/* صفحه سبد خرید — طراحی جدید مطابق Figma (Tamland.com) */

@font-face {
	font-family: 'Yekan Bakh FaNum';
	src: url('../../assets/fonts/YekanBakhFaNum-Regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Yekan Bakh FaNum';
	src: url('../../assets/fonts/YekanBakhFaNum-SemiBold.woff2') format('woff2');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Yekan Bakh FaNum';
	src: url('../../assets/fonts/YekanBakhFaNum-Bold.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

.tamland-cart-page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 15px;
	box-sizing: border-box;
	font-family: 'Yekan Bakh FaNum', 'YekanBakhFaNum', Tahoma, sans-serif;
	direction: rtl;
}

/* این صفحه با ویجت «سبد خرید» المنتور ساخته شده که کل خروجی cart.php ما را
   داخل یک گرید دوستونه‌ی خودش (708px + 462px، برای چیدمان native خودِ
   المنتور) می‌گذارد. چون خروجی ما همیشه یک بلوک واحد است (چیدمان دو ستونه
   خودمان را خودِ .tamland-cart-layout به‌صورت داخلی انجام می‌دهد)، همه‌چیز
   داخل همان ستون اول گیر می‌افتد، ستون دوم گرید خالی می‌ماند، و items+summary
   به‌خاطر تنگی جا زیر هم می‌افتند. با تک‌ستونه‌کردن گرید المنتور، عرض کامل
   ۱۲۰۰px به .tamland-cart-page می‌رسد و .tamland-cart-layout می‌تواند
   items/summary را واقعاً کنار هم (و درست‌جهت، راست/چپ طبق RTL) بچیند. */
.e-cart__container {
	grid-template-columns: 1fr !important;
}
.e-cart__column-start {
	width: 100% !important;
	max-width: 100% !important;
}

.tamland-cart-page *,
.tamland-cart-page *::before,
.tamland-cart-page *::after {
	box-sizing: border-box;
}

/* استپر ۳ مرحله — عیناً هم‌شکل با استپر صفحه پرداخت (woocommerce/global/order-flow-stepper.php) */
.tamland-co-stepper {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	margin-bottom: 40px;
}
.tamland-co-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	min-width: 60px;
	text-decoration: none;
}
.tamland-co-step-icon {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	background: #fcfcfc;
	border: 1px solid #d5d5d6;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.3s, border-color 0.3s;
}
.tamland-co-step.is-active .tamland-co-step-icon {
	background: #c5161c;
	border-color: #c5161c;
}
.tamland-co-step-icon img {
	width: 24px;
	height: 24px;
	/* آیکون‌های SVG این استپر ذاتاً سفید/تقریباً سفید هستند (stroke="white" یا
	   fill="#FEF7FF") — روی پس‌زمینه‌ی روشن غیرفعال نامرئی می‌شوند مگر این‌که
	   به‌صورت پیش‌فرض مشکی نمایش داده شوند؛ در حالت active/done به سفید برمی‌گردند
	   تا روی پس‌زمینه‌ی قرمز دیده شوند. */
	filter: brightness(0);
}
.tamland-co-step.is-active .tamland-co-step-icon img {
	filter: brightness(0) invert(1);
}
.tamland-co-step-label {
	font-size: 14px;
	line-height: 20px;
	font-weight: 600;
	color: #202021;
	text-align: center;
	white-space: nowrap;
}
.tamland-co-step.is-active .tamland-co-step-label {
	color: #c5161c;
}
.tamland-co-connector {
	flex-shrink: 0;
	width: 150px;
	max-width: 150px;
	height: 2px;
	background: #d5d5d6;
	border-radius: 24px;
	margin: 22px 4px 0;
	transition: background 0.3s;
}

/* چیدمان اصلی: کارت‌های محصول (راست) + خلاصه پرداخت (چپ) */
.tamland-cart-layout {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.tamland-cart-items {
	flex: 1 1 460px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* کارت محصول */
.tamland-cart-item-card {
	background: #fff;
	border: 1px solid #d7d7d7;
	border-radius: 16px;
	padding: 12px;
}
.tamland-cart-item-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}
.tamland-cart-item-actions {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	gap: 16px;
	order: 3;
}
.tamland-cart-item-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	flex-shrink: 0;
	border: 1px solid #e7e8e8;
	border-radius: 12px;
	color: #57595b;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tamland-cart-item-remove:hover {
	background: #fef2f2;
	border-color: #f87171;
	color: #b91c1c;
}
.tamland-cart-item-remove svg {
	width: 24px;
	height: 24px;
}
.tamland-cart-item-price-block {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.tamland-cart-item-price {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	gap: 4px;
	font-size: 20px;
	font-weight: 700;
	color: #202021;
	white-space: nowrap;
}
.tamland-cart-toman-icon {
	width: 16px;
	height: 22px;
}
.tamland-cart-item-discount {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	gap: 8px;
}
.tamland-cart-discount-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 4px;
	background: #c5161c;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
}
.tamland-cart-item-old-price {
	font-size: 14px;
	color: #7e7f83;
	text-decoration: line-through;
}
.tamland-cart-item-info {
	flex: 1 1 220px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	order: 2;
}
.tamland-cart-item-title {
	font-size: 16px;
	font-weight: 700;
	color: #231f20;
	text-align: right;
	line-height: 24px;
}
.tamland-cart-item-chip {
	display: inline-flex;
	align-items: center;
	background: #ffe6a2;
	border-radius: 24px;
	padding: 6px 8px;
	font-size: 10px;
	font-weight: 600;
	color: #202021;
	white-space: nowrap;
}
.tamland-cart-item-image {
	order: 1;
	flex-shrink: 0;
	width: 100px;
	height: 100px;
	border: 1px solid #d7d7d7;
	border-radius: 8px;
	overflow: hidden;
}
.tamland-cart-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* اعلان امکان اقساط */
.tamland-cart-installment-notice {
	justify-content: flex-end;
	margin-top: 12px;
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	background: #fff;
	border: 1px solid #d5d5d6;
	border-radius: 12px;
	padding: 12px;
	font-size: 14px;
	color: #231f20;
}
.tamland-cart-installment-notice svg {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	color: #7e7f83;
}

/* خلاصه پرداخت */
.tamland-cart-summary {
	flex: 0 0 420px;
	max-width: 420px;
	width: 100%;
}
.tamland-cart-summary-card {
	background: #fff;
	border: 1px solid #d5d5d6;
	border-radius: 16px;
	padding: 25px;
}
.tamland-cart-summary-header {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	width: 100%;
	border: none;
	border-bottom: 1px solid #d5d5d6;
	background: none;
	padding: 0 0 11px;
	margin-bottom: 16px;
	font-family: inherit;
	cursor: default;
}
.tamland-cart-summary-header p {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: #202021;
}
.tamland-cart-summary-header svg {
	width: 24px;
	height: 24px;
	color: #202021;
	flex-shrink: 0;
}
.tamland-cart-summary-chevron {
	display: none;
	transition: transform 0.2s;
}
.tamland-cart-summary-header[aria-expanded="true"] .tamland-cart-summary-chevron {
	transform: rotate(180deg);
}
.tamland-cart-summary-rows {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.tamland-cart-summary-row {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 0;
}
.tamland-cart-summary-row--total {
	border-top: 1px solid #e5e7eb;
	padding-top: 16px;
	margin-top: 4px;
}
.tamland-cart-summary-amount {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	gap: 4px;
	font-size: 20px;
	font-weight: 700;
	color: #202021;
	white-space: nowrap;
}
.tamland-cart-summary-amount--positive {
	color: #158e29;
}
.tamland-cart-toman-icon--positive {
	filter: hue-rotate(80deg) saturate(4);
}
.tamland-cart-summary-label {
	font-size: 16px;
	font-weight: 700;
	color: #57595b;
	text-align: right;
}

.tamland-cart-summary-actions {
	margin-top: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.tamland-cart-submit-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 56px;
	background: #c5161c;
	color: #fcfcfc;
	border: none;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s;
}
.tamland-cart-submit-btn:hover {
	background: #a91218;
	color: #fcfcfc;
}
.tamland-cart-disclaimer {
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	color: #57595b;
	text-align: right;
	line-height: 20px;
}

/* سبد خرید خالی */

/* واکنش‌گرا */
@media (max-width: 1024px) {
	.tamland-cart-layout {
		flex-direction: column;
	}
	.tamland-cart-summary {
		flex: 1 1 auto;
		max-width: 100%;
		order: -1;
	}
	.tamland-co-connector {
		width: 60px;
	}
}
@media (max-width: 640px) {
	/* ارتفاع نوار پیمایش چسبان پایین سایت (.sticky-navbar در
	   template-parts/footer/footer-mobile.php — روی همه صفحات غیرمحصول موبایل،
	   از جمله سبد خرید، فعال است: position:fixed; bottom:0; z-index:111).
	   کارت «جزئیات پرداخت» باید دقیقاً روی همین نوار بنشیند، نه زیر آن. */
	:root {
		--tamland-sticky-navbar-height: 62px;
	}

	.tamland-cart-page {
		padding: 12px;
		/* فضای کافی برای نوار چسبان «جزئیات پرداخت» در پایین صفحه (این نوار دقیقاً
		   روی نوار ناوبری سایت می‌نشیند و آن را می‌پوشاند، پس دیگر ارتفاع
		   navbar را جدا اضافه نمی‌کنیم) */
		padding-bottom: 200px;
	}

	/* استپر فشرده‌تر، مطابق مشخصات Figma برای موبایل */
	.tamland-co-step-icon {
		width: 35px;
		height: 35px;
	}
	.tamland-co-step-icon img {
		width: 20px;
		height: 20px;
	}
	.tamland-co-step-label {
		font-size: 10px;
	}
	.tamland-co-connector {
		width: 30px;
		margin-top: 18px;
		/* طبق مانیفست فیگما برای این فریم موبایل، رنگ اتصال‌دهنده تیره‌تر است
		   (Border/Darker) نه رنگ روشن نسخه دسکتاپ (Border/Light) */
		background: #57595b;
	}

	/* ردیف ۱: عنوان+چیپ کنار تصویر — ردیف ۲: سطل زباله+قیمت، تمام‌عرض زیر آن */
	.tamland-cart-item-row {
		flex-wrap: wrap;
	}
	.tamland-cart-item-info {
		flex: 1 1 180px;
		order: 1;
	}
	.tamland-cart-item-image {
		order: 2;
	}
	.tamland-cart-item-actions {
		order: 3;
		flex: 1 0 100%;
		width: 100%;
		padding-top: 12px;
		margin-top: 4px;
		border-top: 1px solid #f0f0f0;
	}
	/* در موبایل متن اعلان اقساط Body/Small (12/18) است، نه Body/Medium (14/20) دسکتاپ */
	.tamland-cart-installment-notice {
		font-size: 12px;
		line-height: 18px;
	}

	/* خلاصه پرداخت به‌صورت نوار چسبان پایین صفحه، جمع‌شونده */
	.tamland-cart-summary {
		flex-basis: auto;
		max-width: none;
	}
	.tamland-cart-summary-card {
		/* !important چون قالب/صفحه‌ساز اطراف این المان ممکن است position یا
		   transform روی والدها ست کند و fixed معمولی را خنثی کند — همان الگوی
		   دفاعی که در سراسر form-checkout.css استفاده شده است.
		   طبق درخواست: این نوار دقیقاً روی نوار ناوبری چسبان سایت (class="sticky-navbar
		   border-light") و بالای مطلقاً هر عنصر دیگری در صفحه می‌نشیند —
		   bottom:0 و بالاترین z-index ممکن، بدون فاصله. */
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		z-index: 999999 !important;
		border-radius: 24px 24px 0 0;
		border-bottom: none;
		padding: 12px;
		box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
	}
	.tamland-cart-summary-header {
		cursor: pointer;
		border-bottom-color: #d5d5d6;
		padding-bottom: 11px;
		margin-bottom: 0;
	}
	.tamland-cart-summary-header p {
		font-size: 16px;
	}
	.tamland-cart-summary-chevron {
		display: block;
	}
	.tamland-cart-summary-rows {
		display: none;
		padding-top: 16px;
	}
	.tamland-cart-summary-rows.is-open {
		display: flex;
	}
	.tamland-cart-summary-actions {
		margin-top: 12px;
		gap: 8px;
	}
	.tamland-cart-submit-btn {
		height: 40px;
		font-size: 12px;
	}
	.tamland-cart-disclaimer {
		font-size: 12px;
		line-height: 18px;
	}
}

/* ===== Empty cart - minimal centered state ===== */
.tamland-cart-empty-wrap{
    min-height: 65vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:48px 20px 64px;
}

.tamland-cart-empty{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:24px;
    text-align:center;
}

.tamland-cart-empty__title{
    margin:0;
    color:#2a2a2e;
    font-size:32px;
    font-weight:700;
    line-height:1.6;
}

.tamland-cart-empty__button{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-width:160px !important;
    min-height:54px !important;
    padding:0 28px !important;
    background:#f7f1df !important;
    color:#000000 !important;
    border:1px solid #000000 !important;
    border-radius:14px !important;
    text-decoration:none !important;
    font-size:18px !important;
    font-weight:600 !important;
    line-height:1 !important;
    transition:all .2s ease !important;
    box-shadow:none !important;
}

.tamland-cart-empty__button:hover,
.tamland-cart-empty__button:focus{
    background:#ffffff !important;
    color:#000000 !important;
    border-color:#000000 !important;
    text-decoration:none !important;
    transform:translateY(-1px) !important;
    box-shadow:0 6px 16px rgba(0,0,0,.08) !important;
}

.tamland-cart-empty__button:active{
    transform:translateY(0) !important;
    box-shadow:none !important;
}

@media (max-width: 767px){
    .tamland-cart-empty-wrap{
        min-height:55vh;
        padding:32px 16px 48px;
    }
    .tamland-cart-empty{
        gap:18px;
    }
    .tamland-cart-empty__title{
        font-size:24px;
        line-height:1.7;
    }
    .tamland-cart-empty__button{
        min-width:150px;
        min-height:48px;
        padding:0 22px;
        font-size:16px;
        border-radius:12px;
    }
}
