/* מתחם הריהוט — commerce primitives: section head, product card, grid, buttons,
 * badges. Shared across home best-sellers, shop grid, search, wishlist. */

/* ---- Section head ---- */
.mr-secthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.mr-secthead__titles { display: flex; flex-direction: column; gap: 6px; }
.mr-secthead__eyebrow { font-size: 14px; font-weight: var(--fw-bold); letter-spacing: .12em; line-height: 18px; color: var(--mr-muted); }
.mr-secthead__eyebrow.is-orange { color: var(--mr-orange); }
.mr-secthead__eyebrow.is-red { color: var(--mr-red); }
.mr-secthead__title { margin: 0; font-size: 34px; font-weight: var(--fw-black); letter-spacing: -.02em; line-height: 42px; color: var(--mr-nav-ink); }
.mr-secthead__link { font-size: 15px; font-weight: 600; color: var(--mr-navy); white-space: nowrap; }
.mr-secthead__link:hover { color: var(--mr-orange); }

/* ---- Grid ---- */
.mr-grid { display: grid; gap: 24px; }
.mr-grid--4 { grid-template-columns: repeat(4, 1fr); }
.mr-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .mr-grid--4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .mr-grid--4, .mr-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .mr-grid--4, .mr-grid--3 { grid-template-columns: 1fr; } }

/* ---- Product card (equal-height: fixed-line title + min-height price, button
 *      pinned to the bottom, card fills its grid cell) ---- */
.mr-card {
	display: flex; flex-direction: column; height: 100%; background: var(--mr-white);
	border: 1px solid var(--mr-line); border-radius: var(--r-md); overflow: hidden;
	box-shadow: var(--sh-sm); transition: box-shadow .25s ease, transform .25s ease;
}
.mr-card:hover { box-shadow: var(--sh-md); transform: translateY(-3px); }
.mr-card__media { position: relative; display: block; aspect-ratio: 314 / 240; background: var(--mr-cream); overflow: hidden; }
/* !important beats WC core's `.woocommerce img { height: auto }`, which
 * otherwise lets each image keep its natural ratio inside the fixed box. */
.mr-card__img { width: 100% !important; height: 100% !important; object-fit: cover; display: block; transition: transform .3s ease; }
.mr-card:hover .mr-card__img { transform: scale(1.04); }
.mr-card__badge {
	position: absolute; top: 12px; inset-inline-end: 12px;
	background: var(--mr-red); color: var(--mr-white);
	font-size: 13px; font-weight: var(--fw-black); line-height: 1;
	padding: 6px 9px; border-radius: var(--r-sm);
}
.mr-card__body { display: flex; flex-direction: column; gap: 7px; padding: 14px 14px 14px; flex: 1 1 auto; }
.mr-card__title {
	font-size: 15px; font-weight: var(--fw-medium); line-height: 22px; color: var(--mr-ink);
	min-height: 44px; /* 2 lines — keeps card tops aligned */
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mr-card__title:hover { color: var(--mr-navy); }
.mr-card__prices { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-height: 28px; }
/* Price is the hero: the amount runs big + black; prefix text ("החל מ-") and
 * any surrounding words stay small + muted. */
.mr-card__price { font-size: 13px; font-weight: var(--fw-medium); line-height: 28px; color: var(--mr-muted); }
.mr-card__price .woocommerce-Price-amount { font-size: 22px; font-weight: var(--fw-black); color: var(--mr-ink); }
.mr-card__price--old, .mr-card__price--old .woocommerce-Price-amount { font-size: 14px; font-weight: var(--fw-medium); color: #9A9A9A; }
.mr-card__price--old { text-decoration: line-through; text-decoration-color: #9A9A9A; }
/* price_html sale markup (variable "החל מ-" strike): ins = the price, del small gray */
.mr-card__price ins { text-decoration: none; }
.mr-card__price del, .mr-card__price del .woocommerce-Price-amount { font-size: 14px; font-weight: var(--fw-medium); color: #9A9A9A; }
.mr-card__price del { text-decoration: line-through; text-decoration-color: #9A9A9A; }
.mr-card__vat { margin: 0; font-size: 12px; font-weight: var(--fw-medium); line-height: 16px; color: var(--mr-muted); }
/* !important so the card button beats Woo's generic .woocommerce a.button (navy,
 * loaded later). The --select outline variant re-asserts after, so it stays. */
.mr-card__cart {
	margin-top: auto; display: inline-flex; align-items: center; justify-content: center;
	/* text-align too — WC core's `.woocommerce a.button` can win the display war
	 * (inline-block), and then only text-align centers the label. */
	text-align: center;
	height: 46px; border-radius: 10px; background: var(--mr-ink) !important; color: var(--mr-white) !important;
	font-size: 15px; font-weight: var(--fw-bold); border: 0; cursor: pointer; transition: background var(--mr-transition);
}
.mr-card__cart:hover, .mr-card__cart.added { background: var(--mr-orange) !important; color: var(--mr-white) !important; }
.mr-card__cart--select { background: var(--mr-white) !important; color: var(--mr-navy) !important; border: 1.5px solid var(--mr-navy) !important; }
.mr-card__cart--select:hover { background: var(--mr-navy) !important; color: var(--mr-white) !important; }

/* ---- Buttons ---- */
.mr-btn--onlight { background: var(--mr-white); color: var(--mr-navy); }
.mr-btn--onlight:hover { background: var(--mr-cream); color: var(--mr-navy); }
.mr-btn--onred { color: var(--mr-red); }
.mr-btn--onred:hover { color: var(--mr-red); }

/* ---- Badges ---- */
.mr-badge { display: inline-block; align-self: flex-start; padding: 5px 15px; border-radius: 20px; font-size: 13px; font-weight: var(--fw-black); line-height: 16px; }
.mr-badge--orange { background: var(--mr-orange); color: var(--mr-white); }

/* ================================================= Mini-cart drawer ======= */
/* Slide-in cart preview (deezen reference, 21.7 batch). Anchored inline-start
 * (right in RTL), above the mobile drawer (z 98/99). */
.mr-cartdrawer-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(20, 20, 22, .5); }
.mr-cartdrawer {
	position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 121;
	width: min(430px, 94vw); background: var(--mr-white); box-shadow: 0 0 40px rgba(30, 30, 30, .25);
	display: flex; flex-direction: column; visibility: hidden;
	transform: translateX(100%); transition: transform .28s ease, visibility .28s;
}
.mr-cartdrawer.is-open { visibility: visible; transform: none; }
/* Busy = dim the content only (the panel stays opaque) + a centered spinner. */
.mr-cartdrawer.is-busy { pointer-events: none; }
.mr-cartdrawer.is-busy .mr-cartdrawer__inner,
.mr-cartdrawer.is-busy .mr-cartdrawer__subwrap { opacity: .5; }
.mr-cartdrawer.is-busy::after {
	content: ""; position: absolute; top: 50%; inset-inline-start: 50%;
	width: 30px; height: 30px; margin: -15px;
	border: 3px solid var(--mr-line); border-top-color: var(--mr-navy); border-radius: 50%;
	animation: mr-spin .7s linear infinite;
}
@keyframes mr-spin { to { transform: rotate(360deg); } }
html.mr-cartdrawer-open { overflow: hidden; }

.mr-cartdrawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--mr-line); }
.mr-cartdrawer__title { margin: 0; font-size: 20px; font-weight: var(--fw-black); color: var(--mr-nav-ink); }
.mr-cartdrawer__close { border: 0; background: none; padding: 6px; cursor: pointer; color: var(--mr-ink); }
.mr-cartdrawer__close:hover { color: var(--mr-red); }

.mr-cartdrawer__inner { flex: 1 1 auto; overflow-y: auto; padding: 6px 22px; }
.mr-dlist { list-style: none; margin: 0; padding: 0; }
.mr-ditem { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--mr-line); }
.mr-ditem:last-child { border-bottom: 0; }
.mr-ditem__media { flex-shrink: 0; }
.mr-ditem__media img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--r-sm); background: var(--mr-cream); }
.mr-ditem__body { flex: 1 1 auto; min-width: 0; }
.mr-ditem__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mr-ditem__name { font-size: 15px; font-weight: var(--fw-bold); color: var(--mr-nav-ink); line-height: 1.35; }
.mr-ditem__name:hover { color: var(--mr-navy); }
.mr-ditem__remove { flex-shrink: 0; font-size: 20px; line-height: 1; color: var(--mr-muted) !important; }
.mr-ditem__remove:hover { color: var(--mr-red) !important; }
.mr-ditem__meta { margin-top: 4px; font-size: 13px; color: var(--mr-muted); }
.mr-ditem__meta dl, .mr-ditem__meta p { margin: 0; }
.mr-ditem__specs { margin-top: 4px; font-size: 12px; color: var(--mr-muted); }
.mr-ditem__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

.mr-ditem__qty { display: inline-flex; align-items: stretch; border: 1px solid var(--mr-line); border-radius: var(--r-sm); overflow: hidden; }
.mr-dqty__btn { width: 34px; height: 40px; border: 0; background: var(--mr-white); color: var(--mr-ink); font-size: 18px; cursor: pointer; }
.mr-dqty__btn:hover { background: var(--mr-cream); }
.mr-dqty__input { width: 40px; height: 40px; border: 0; text-align: center; font-weight: var(--fw-bold); font-family: var(--mr-font); -moz-appearance: textfield; }
.mr-dqty__input::-webkit-outer-spin-button, .mr-dqty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.mr-ditem__prices { display: flex; align-items: flex-end; }
.mr-ditem__line { display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: var(--fw-bold); color: var(--mr-ink); }
.mr-ditem__perunit { font-size: 12px; font-weight: var(--fw-regular); color: var(--mr-muted); }
.mr-ditem__perunit .amount { font-size: 12px; font-weight: inherit; color: inherit; }
.mr-ditem__prices .mr-line-price del, .mr-ditem__prices .mr-line-price del .amount { font-size: 12px; }

.mr-cartdrawer__empty { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 56px 20px; text-align: center; color: var(--mr-muted); font-size: 16px; }
.mr-cartdrawer__empty p { margin: 0; }

.mr-cartdrawer__subwrap { border-top: 1px solid var(--mr-line); padding: 14px 22px 0; }
.mr-cartdrawer__subtotal { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: var(--fw-black); color: var(--mr-ink); }
.mr-cartdrawer__note { margin: 4px 0 0; font-size: 12px; color: var(--mr-muted); }
.mr-cartdrawer__foot { display: flex; flex-direction: column; gap: 10px; padding: 14px 22px 20px; }
.mr-cartdrawer__btn { display: block; width: 100%; text-align: center; padding: 15px; border-radius: var(--r-md); font-size: 16px; font-weight: var(--fw-bold); cursor: pointer; transition: background var(--mr-transition), border-color var(--mr-transition), color var(--mr-transition); }
.mr-cartdrawer__btn--dark { background: var(--mr-ink); color: var(--mr-white); border: 0; }
.mr-cartdrawer__btn--dark:hover { background: var(--mr-orange); color: var(--mr-white); }
.mr-cartdrawer__btn--ghost { background: var(--mr-white); color: var(--mr-ink); border: 1px solid var(--mr-line); }
.mr-cartdrawer__btn--ghost:hover { border-color: var(--mr-navy); color: var(--mr-navy); }
