/*
 * Mashin Irani — Cart cross-sell block («پیشنهاد برای شما / محصولات مرتبط و مکمل»).
 *
 * Rendered by mirani-cart-crosssell.php on woocommerce_after_cart. Verified against WC 10.9.3:
 * that hook is the last statement in cart/cart.php and [woocommerce_cart] wraps the whole template in
 * <div class="woocommerce"> (WC_Shortcodes::shortcode_wrapper), so the section is a DIRECT child of
 * div.woocommerce. mirani-cart-skin.css makes that element a 2-col named grid
 * ("notices notices" / "items summary"), so this section claims grid-column 1 / -1 and auto-places onto
 * an implicit third row — full width, under the items table and the sticky summary. At <=900px the cart
 * grid collapses to a single column and 1 / -1 still spans it. If the cart skin is ever switched off,
 * grid-column is simply inert and the section is a plain block.
 *
 * Tokens: every var() carries a hex/px fallback verified against mi.css :root. The design system has NO
 * --space-7 and it is never referenced. RTL-native: margin-inline / inset-inline / start-end only.
 *
 * NOTE: the unprefixed tokens (--border, --radius-lg, …) live in mi.css / home.css / product.css, NOT in
 * tokens.css. On /cart/ mi.css is present (handle mi-frozen), so they resolve; the fallbacks cover every
 * other case.
 */

.mi-xsell {
	grid-column: 1 / -1;
	margin-block-start: var(--space-10, 40px);
	padding-block-start: var(--space-8, 32px);
	border-top: 1px solid var(--border, #d9cbc2);
}

.mi-xsell__head { margin: 0 0 var(--space-5, 20px); }
.mi-xsell__eyebrow {
	font-size: .8125rem;
	font-weight: 600;
	color: var(--gold-text, #7f6220);
	margin: 0 0 var(--space-2, 8px);
}
.mi-xsell__title {
	font-size: clamp(1.15rem, 2.4vw, 1.5rem);
	line-height: 1.3;
	font-weight: 700;
	color: var(--navy-900, #102134);
	margin: 0 0 var(--space-2, 8px);
}
.mi-xsell__lede {
	margin: 0;
	max-width: 62ch;
	font-size: .9rem;
	line-height: 1.85;
	color: var(--text-secondary, #404751);
}

/* ---------- Card grid ---------- */
.mi-xsell__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--space-4, 16px);
	list-style: none;
	margin: 0;
	padding: 0;
}
.mi-xsell__card {
	display: flex;
	flex-direction: column;
	background: var(--bg-elevated, #fff);
	border: 1px solid var(--border, #d9cbc2);
	border-radius: var(--radius-lg, 12px);
	box-shadow: var(--shadow-e1, 0 1px 2px rgba(16, 33, 52, .06));
	padding: var(--space-4, 16px);
	transition: transform var(--duration-base, 200ms) var(--ease-standard, cubic-bezier(.2, 0, 0, 1)),
		box-shadow var(--duration-base, 200ms), border-color var(--duration-base, 200ms);
}
.mi-xsell__card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-e3, 0 8px 24px rgba(16, 33, 52, .10));
	border-color: var(--gold-300, #e0c58f);
}
@media (prefers-reduced-motion: reduce) {
	.mi-xsell__card { transition: none; }
	.mi-xsell__card:hover { transform: none; }
}

.mi-xsell__media {
	display: block;
	margin: 0 0 var(--space-3, 12px);
	border-radius: var(--radius-md, 8px);
	background: var(--bg-sunken, #ece4da);
	overflow: hidden;
}
.mi-xsell__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	padding: 10px;
	box-sizing: border-box;
}

.mi-xsell__body { display: flex; flex-direction: column; flex: 1 1 auto; }

.mi-xsell__brand {
	display: block;
	font-size: .75rem;
	font-weight: 600;
	color: var(--text-tertiary, #6e6a66);
	margin: 0 0 4px;
}
.mi-xsell__name {
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.5;
	margin: 0 0 var(--space-2, 8px);
}
.mi-xsell__name a { color: var(--navy-900, #102134); text-decoration: none; }
.mi-xsell__name a:hover { color: var(--link, #3c507d); }

/* ---------- Octane chips ---------- */
.mi-xsell__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 var(--space-3, 12px);
}
.mi-xsell__chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 9px;
	border-radius: var(--radius-pill, 999px);
	background: var(--bg-sunken, #ece4da);
	color: var(--text-secondary, #404751);
	font-size: .72rem;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}
/* flex:none — an SVG inside a flex parent otherwise collapses to ~2px (project gotcha). */
.mi-xsell__chip svg { width: 13px; height: 13px; flex: none; display: block; }
.mi-xsell__chip--grade { background: #f6efdf; color: var(--gold-text, #7f6220); }

/* ---------- Price ---------- */
.mi-xsell__price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 var(--space-3, 12px);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--navy-900, #102134);
}
.mi-xsell__price small { font-size: .75rem; font-weight: 600; color: var(--text-tertiary, #6e6a66); }
.mi-xsell__price del {
	font-size: .8rem;
	font-weight: 400;
	color: var(--text-tertiary, #6e6a66);
	text-decoration: line-through;
}

/* ---------- Add to cart ---------- */
/*
 * An <a>, never a <button>/[type], so hello-elementor reset.css's
 * [type="submit"],button{background-color:transparent} at (0,1,0) cannot strip the fill — no (0,2,0)
 * counter-rule needed. Scoped class (not .btn) keeps it clear of the site-wide .btn.btn-cta/.btn-buy
 * fixes in mirani-home-fixes.css.
 */
.mi-xsell__add {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	box-sizing: border-box;
	min-height: 44px;
	padding: 10px 14px;
	border: 0;
	border-radius: var(--radius-md, 8px);
	background: var(--action-buy, #112250);
	color: var(--ivory-50, #f5f0e9);
	font-family: inherit;
	font-weight: 700;
	font-size: .9rem;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--duration-fast, 120ms);
}
.mi-xsell__add:hover,
.mi-xsell__add:focus { background: var(--navy-900, #102134); color: var(--ivory-50, #f5f0e9); }
.mi-xsell__add:focus-visible { outline: 2px solid var(--link, #3c507d); outline-offset: 2px; }
.mi-xsell__add svg { width: 16px; height: 16px; flex: none; display: block; }

/* Non-simple products link to the product page instead of a GET add-to-cart (no variation picker). */
.mi-xsell__add--view {
	background: transparent;
	color: var(--navy-800, #112250);
	border: 1.5px solid var(--navy-800, #112250);
}
.mi-xsell__add--view:hover,
.mi-xsell__add--view:focus { background: rgba(17, 34, 80, .08); color: var(--navy-800, #112250); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.mi-xsell {
		margin-block-start: var(--space-6, 24px);
		padding-block-start: var(--space-6, 24px);
	}
}
@media (max-width: 768px) {
	.mi-xsell__grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3, 12px); }
	.mi-xsell__card { padding: var(--space-3, 12px); }
}
@media (max-width: 420px) {
	.mi-xsell__name { font-size: .875rem; }
	.mi-xsell__price { font-size: .95rem; }
	.mi-xsell__add { font-size: .82rem; padding: 10px 8px; }
}
