/* Three Step Quick Checkout — cart page ([tsqc_cart_step]).
   Design: Claude Design handoff "مسیر خرید موبایل تیبوکا", frames 1a–1c.
   Tokens match assets/css/checkout-steps.css. */

.tsqc-page {
	--tk-primary: #1f6fa9;
	--tk-primary-700: #17578a;
	--tk-accent: #b4185f;
	--tk-accent-2: #6b2a8c;
	--tk-success: #0f9d76;
	--tk-success-ink: #0f7a5c;
	--tk-success-bg: #e8f6f1;
	--tk-error: #d92d20;
	--tk-text: #101828;
	--tk-text-2: #344054;
	--tk-text-3: #475467;
	--tk-muted: #667085;
	--tk-faint: #98a2b3;
	--tk-border: #e6ebf1;
	--tk-border-2: #eef1f5;
	--tk-border-ctl: #dbe3ec;
	--tk-bg-2: #f7f9fc;
	--tk-blue-50: #eef5fb;
	--tk-ink: #0e2233;
	--tk-sh-bar: 0 -8px 20px -14px rgba(16, 24, 40, .35);

	max-width: 560px;
	margin: 0 auto;
	display: grid;
	gap: 12px;
	color: var(--tk-text);
	/* @font-face lives in checkout-steps.css, loaded on the cart page too. */
	font-family: "TSQC Vazirmatn", Vazirmatn, system-ui, sans-serif;
	font-size: 14px;
	line-height: 1.9;
	direction: rtl;
	text-align: right;
}

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

.tsqc-page input,
.tsqc-page button,
.tsqc-page .tsqc-toast {
	font-family: inherit !important;
}

/* Our own rules set display on several of these elements, which would
   otherwise beat the browser's default [hidden] { display: none }. */
.tsqc-page [hidden] {
	display: none !important;
}

.tsqc-page a {
	color: inherit;
	text-decoration: none;
}

#tsqc-cart-content {
	display: grid;
	gap: 12px;
}

.tsqc-card {
	background: #fff;
	border: 1px solid var(--tk-border);
	border-radius: 16px;
	padding: 14px;
	margin: 0;
}

.tsqc-ph {
	display: block;
	background: repeating-linear-gradient(135deg, #f4f7fa 0 8px, #e8ecf2 8px 16px);
}

.tsqc-chev {
	flex: 0 0 auto;
	color: var(--tk-faint);
	transition: transform .15s;
}

details[open] > summary .tsqc-chev {
	transform: rotate(180deg);
}

/* Busy: totals dim while a request is in flight. */
.tsqc-page.tsqc-busy .tsqc-cart-totals,
.tsqc-page.tsqc-busy .tsqc-sticky-total strong {
	opacity: .45;
	transition: opacity .15s;
}

/* ---------- Free-shipping progress ---------- */

.tsqc-freeship {
	padding: 14px 16px;
}

.tsqc-freeship-text {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--tk-text-2);
}

.tsqc-freeship-text strong {
	color: var(--tk-text);
}

.tsqc-freeship-track {
	height: 8px;
	margin-top: 10px;
	border-radius: 99px;
	background: var(--tk-border-2);
	overflow: hidden;
}

.tsqc-freeship-track span {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--tk-accent), var(--tk-accent-2));
	transition: width .3s ease;
}

.tsqc-freeship.is-reached {
	background: var(--tk-success-bg);
	border-color: #c5e6d9;
}

.tsqc-freeship.is-reached .tsqc-freeship-text {
	font-weight: 700;
	color: var(--tk-success-ink);
}

.tsqc-freeship.is-reached .tsqc-freeship-track {
	background: #c5e6d9;
}

.tsqc-freeship.is-reached .tsqc-freeship-track span {
	background: var(--tk-success);
}

/* ---------- Cart item card ---------- */

.tsqc-cart-item {
	transition: opacity .2s;
}

.tsqc-cart-item.is-removing {
	opacity: .55;
	pointer-events: none;
}

.tsqc-ci-top {
	display: flex;
	gap: 12px;
}

.tsqc-cart-item-thumb {
	flex: 0 0 auto;
}

.tsqc-cart-item-thumb img,
.tsqc-cart-item-thumb .tsqc-ph {
	display: block;
	width: 76px !important;
	height: 76px !important;
	border-radius: 12px;
	object-fit: cover;
}

.tsqc-cart-item-info {
	flex: 1 1 auto;
	min-width: 0;
}

.tsqc-cart-item-name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.7;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tsqc-cart-item-meta {
	margin-top: 3px;
	font-size: 12px;
	color: var(--tk-muted);
}

.tsqc-cart-item-price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 6px;
}

.tsqc-cart-item-price del {
	font-size: 12px;
	color: var(--tk-faint);
}

.tsqc-ci-now {
	font-size: 14.5px;
	font-weight: 800;
}

.tsqc-page .woocommerce-Price-currencySymbol {
	font-size: 11px;
	font-weight: 500;
	color: var(--tk-muted);
}

.tsqc-ci-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 12px;
}

.tsqc-qty-control {
	display: flex;
	align-items: center;
	height: 44px;
	border: 1px solid var(--tk-border-ctl);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
}

/* Theme button resets otherwise paint these solid / hide the glyph. */
.tsqc-page .tsqc-qty-control button {
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--tk-primary) !important;
	font-family: inherit;
	font-size: 19px !important;
	line-height: 1 !important;
	box-shadow: none !important;
	cursor: pointer;
	touch-action: manipulation;
}

.tsqc-page .tsqc-qty-control button:active {
	background: var(--tk-blue-50) !important;
}

/* 16px stops iOS zooming on focus. */
.tsqc-page .tsqc-qty-input {
	width: 40px;
	min-width: 40px;
	height: 44px;
	margin: 0;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: #fff !important;
	color: var(--tk-text) !important;
	font-family: inherit;
	font-size: 16px !important;
	font-weight: 700;
	line-height: normal !important;
	text-align: center;
	box-shadow: none !important;
	-moz-appearance: textfield;
	appearance: textfield;
}

.tsqc-page .tsqc-qty-input::-webkit-outer-spin-button,
.tsqc-page .tsqc-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tsqc-cart-item-subtotal {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--tk-text-2);
	white-space: nowrap;
}

.tsqc-cart-item-subtotal .woocommerce-Price-amount {
	font-weight: 700;
}

.tsqc-page .tsqc-remove-item {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0 !important;
	border: 1px solid var(--tk-border-2) !important;
	border-radius: 12px !important;
	background: #fff !important;
	color: var(--tk-faint) !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px !important;
	box-shadow: none !important;
	cursor: pointer;
	touch-action: manipulation;
}

.tsqc-page .tsqc-remove-item:hover,
.tsqc-page .tsqc-remove-item:active {
	color: var(--tk-error) !important;
	border-color: #fbd5d1 !important;
}

/* ---------- Coupon ---------- */

.tsqc-coupon {
	padding: 14px 16px;
}

.tsqc-coupon > summary,
.tsqc-coupon-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 24px;
	font-size: 14px;
	font-weight: 700;
	color: var(--tk-primary);
	list-style: none;
	cursor: pointer;
}

.tsqc-coupon[open] > summary {
	color: var(--tk-text);
}

.tsqc-coupon > summary::-webkit-details-marker {
	display: none;
}

.tsqc-coupon-box {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.tsqc-page .tsqc-coupon-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	padding: 0 14px !important;
	border: 1px solid #d0d8e2 !important;
	border-radius: 12px !important;
	background: #fff !important;
	color: var(--tk-text) !important;
	font-family: inherit;
	font-size: 16px !important;
	direction: ltr;
	text-align: right;
	box-shadow: none !important;
	outline: none;
}

.tsqc-page .tsqc-coupon-input:focus {
	border: 1.5px solid var(--tk-primary) !important;
	box-shadow: 0 0 0 3px rgba(31, 111, 169, .14) !important;
}

.tsqc-coupon:has(.tsqc-coupon-msg:not([hidden])) .tsqc-coupon-input {
	border: 1.5px solid var(--tk-error) !important;
	box-shadow: none !important;
}

.tsqc-page .tsqc-apply-coupon {
	flex: 0 0 auto;
	height: 48px;
	padding: 0 18px !important;
	border: none !important;
	border-radius: 12px !important;
	background: var(--tk-ink) !important;
	color: #fff !important;
	font-family: inherit;
	font-size: 14px !important;
	font-weight: 700;
	box-shadow: none !important;
	cursor: pointer;
	touch-action: manipulation;
}

.tsqc-page .tsqc-apply-coupon:disabled {
	opacity: .6;
}

.tsqc-coupon-msg {
	margin: 7px 0 0;
	font-size: 12.5px;
	color: var(--tk-error);
}

.tsqc-applied-coupons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.tsqc-coupon-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 12px 0 6px;
	padding-inline: 12px 6px;
	border-radius: 99px;
	background: var(--tk-success-bg);
	color: var(--tk-success-ink);
	font-size: 13px;
	font-weight: 700;
}

.tsqc-coupon-pill a {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #fff;
	color: var(--tk-success-ink) !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
}

/* ---------- Totals ---------- */

.tsqc-cart-totals {
	padding: 16px;
}

.tsqc-rows {
	display: grid;
	gap: 10px;
	font-size: 14px;
}

.tsqc-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.tsqc-row > span:first-child {
	color: var(--tk-muted);
}

.tsqc-row.is-discount > span:last-child {
	color: var(--tk-accent);
}

.tsqc-divider {
	height: 1px;
	background: var(--tk-border-2);
}

.tsqc-row-final {
	font-size: 15.5px;
	font-weight: 800;
}

.tsqc-row-final > span:first-child {
	color: var(--tk-text);
}

.tsqc-savings {
	margin-top: 12px;
	padding: 11px 14px;
	border-radius: 12px;
	background: var(--tk-success-bg);
	color: var(--tk-success-ink);
	font-size: 13.5px;
	font-weight: 700;
}

.tsqc-savings .woocommerce-Price-currencySymbol {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
}

.tsqc-shipping-note {
	margin: 9px 0 0;
	font-size: 12px;
	color: var(--tk-faint);
}

/* ---------- Delivery-time line ---------- */

.tsqc-delivery-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	border-radius: 14px;
	background: var(--tk-blue-50);
	border: 1px solid #d6e6f4;
	font-size: 13px;
	line-height: 1.9;
	color: #1d2939;
}

.tsqc-delivery-note.is-later {
	background: var(--tk-bg-2);
	border-color: var(--tk-border);
}

.tsqc-dn-icon {
	flex: 0 0 auto;
	font-size: 15px;
	line-height: 1.7;
}

/* ---------- Continue button + trust ---------- */

.tsqc-page-footer {
	display: grid;
	gap: 12px;
}

.tsqc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 54px;
	padding: 0 16px;
	border: 0;
	border-radius: 14px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-decoration: none !important;
	cursor: pointer;
	touch-action: manipulation;
}

.tsqc-btn-primary {
	background: var(--tk-primary) !important;
	color: #fff !important;
}

.tsqc-btn-primary:hover {
	background: var(--tk-primary-700) !important;
}

.tsqc-trust {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 2px 4px 6px;
	list-style: none;
}

.tsqc-trust li {
	display: flex;
	gap: 8px;
	margin: 0;
	font-size: 12.5px;
	color: var(--tk-text-3);
}

.tsqc-trust li::before {
	content: "✓";
	color: var(--tk-success);
}

/* ---------- Empty cart (1c) ---------- */

.tsqc-empty {
	padding: 70px 28px 80px;
	text-align: center;
}

.tsqc-empty-icon {
	width: 88px;
	height: 88px;
	margin: 0 auto;
	border-radius: 50%;
	background: var(--tk-blue-50);
	color: var(--tk-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 34px;
}

.tsqc-empty-title {
	margin-top: 20px;
	font-size: 18px;
	font-weight: 800;
}

.tsqc-empty p {
	margin: 9px 0 0;
	font-size: 14px;
	line-height: 1.95;
	color: var(--tk-muted);
}

.tsqc-empty .tsqc-btn {
	margin-top: 22px;
}

/* ---------- Undo toast ---------- */

.tsqc-toast {
	position: fixed;
	z-index: 10000;
	right: 14px;
	left: 14px;
	bottom: calc(var(--tsqc-sticky-offset, 0px) + 16px + env(safe-area-inset-bottom, 0px));
	max-width: 532px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 14px;
	border-radius: 14px;
	background: var(--tk-ink);
	color: #fff;
	font-size: 13px;
	line-height: 1.7;
	box-shadow: 0 12px 28px -12px rgba(16, 24, 40, .6);
	direction: rtl;
}

.tsqc-page .tsqc-toast-undo {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 0 !important;
	border: none !important;
	background: transparent !important;
	color: #9cc8ec !important;
	font-family: inherit;
	font-size: 13px !important;
	font-weight: 700;
	box-shadow: none !important;
	cursor: pointer;
}

/* ---------- Mobile sticky bar ---------- */

.tsqc-sticky-bar {
	display: none;
}

@media (max-width: 767px) {
	.tsqc-page.tsqc-has-sticky:not(.is-empty) {
		padding-bottom: 84px;
	}

	.tsqc-sticky-bar {
		position: fixed;
		z-index: 9999;
		left: 0;
		right: 0;
		bottom: calc(var(--tsqc-sticky-offset, 0px) + env(safe-area-inset-bottom, 0px));
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 12px 14px;
		background: #fff;
		border-top: 1px solid var(--tk-border);
		box-shadow: var(--tk-sh-bar);
		direction: rtl;
		transition: transform .2s ease;
	}

	.tsqc-page.tsqc-footer-visible .tsqc-sticky-bar,
	.tsqc-page.tsqc-typing .tsqc-sticky-bar {
		transform: translateY(calc(100% + var(--tsqc-sticky-offset, 0px) + 40px));
	}

	.tsqc-sticky-total {
		flex: 0 0 auto;
		display: flex;
		flex-direction: column;
		line-height: 1.5;
	}

	.tsqc-sticky-total span {
		font-size: 11.5px;
		color: var(--tk-muted);
	}

	.tsqc-sticky-total strong {
		font-size: 16px;
		font-weight: 800;
		white-space: nowrap;
	}

	.tsqc-sticky-bar .tsqc-btn {
		flex: 1 1 auto;
		width: auto;
		height: 50px;
		border-radius: 13px;
		font-size: 15px;
	}

	.tsqc-has-sticky .tsqc-toast {
		bottom: calc(var(--tsqc-sticky-offset, 0px) + 86px + env(safe-area-inset-bottom, 0px));
	}
}

/* ---------- Legacy 3-dot indicator (step checkout off) ---------- */

.tsqc-steps-indicator {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.tsqc-step-dot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	opacity: .45;
}

.tsqc-step-dot.active {
	opacity: 1;
}

.tsqc-dot-num {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--tk-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
}

.tsqc-step-dot.active .tsqc-dot-num {
	background: var(--tk-primary);
	color: #fff;
}

.tsqc-dot-label {
	font-size: 11px;
}

.tsqc-step-line {
	flex: 1 1 auto;
	min-width: 16px;
	height: 2px;
	background: var(--tk-border);
}

@media (prefers-reduced-motion: reduce) {
	.tsqc-page *,
	.tsqc-sticky-bar {
		transition: none !important;
	}
}
