/*
 * My Cart (WooCommerce Cart page)
 *
 * All colors/spacing reuse existing tokens (base/variables.css) — no
 * new design system. Uses .qehs-container (base/typography.css), the
 * same container the rest of the site uses.
 */

.qehs-cart-page {
	padding-block: var(--qehs-space-xl);
	background-color: var(--qehs-background-alt);
}

/* --- Heading --- */

.qehs-cart-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--qehs-space-lg);
	margin-bottom: var(--qehs-space-xl);
	flex-wrap: wrap;
}

.qehs-cart-heading__breadcrumb {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-xs);
	margin-bottom: var(--qehs-space-sm);
	font-size: 0.9rem;
	color: var(--qehs-text-muted);
}

.qehs-cart-heading__breadcrumb a {
	color: var(--qehs-secondary);
	font-weight: 600;
}

.qehs-cart-heading__title {
	margin: 0 0 var(--qehs-space-xs);
	font-size: 2rem;
	font-weight: 700;
	color: var(--qehs-text);
}

.qehs-cart-heading__count {
	font-size: 1.25rem;
	font-weight: 400;
	color: var(--qehs-text-muted);
}

.qehs-cart-heading__subtitle {
	margin: 0;
	color: var(--qehs-text-muted);
}

.qehs-cart-heading__continue {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: var(--qehs-space-sm);
	padding: var(--qehs-space-sm) var(--qehs-space-lg);
	border: 1px solid var(--qehs-border);
	border-radius: 999px;
	background-color: var(--qehs-background);
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--qehs-text);
}

.qehs-cart-heading__continue:hover,
.qehs-cart-heading__continue:focus-visible {
	border-color: var(--qehs-secondary);
	color: var(--qehs-secondary);
}

/* --- Two-column layout --- */

.qehs-cart-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 420px;
	gap: var(--qehs-space-lg);
	align-items: start;
}

.qehs-cart-items {
	min-width: 0;
}

/* --- Cart items table --- */

.qehs-cart-table-wrap {
	background-color: var(--qehs-background);
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-lg);
	padding: var(--qehs-space-lg);
}

.qehs-cart-table {
	width: 100%;
	border-collapse: collapse;
}

.qehs-cart-table thead th {
	padding-bottom: var(--qehs-space-md);
	border-bottom: 1px solid var(--qehs-border);
	text-align: left;
	font-size: 1rem;
	font-weight: 700;
	color: var(--qehs-text);
}

.qehs-cart-table__col-remove {
	width: 40px;
}

.qehs-cart-table__row td {
	padding-block: var(--qehs-space-lg);
	border-bottom: 1px solid var(--qehs-border);
	vertical-align: middle;
}

.qehs-cart-table__row:last-child td {
	border-bottom: none;
}

.qehs-cart-table__product-inner {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-md);
}

.qehs-cart-table__thumb {
	flex-shrink: 0;
	display: block;
	width: 80px;
	height: 100px;
	border-radius: var(--qehs-radius-md);
	overflow: hidden;
	background-color: var(--qehs-background-alt);
}

.qehs-cart-table__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.qehs-cart-table__product-info {
	display: flex;
	flex-direction: column;
	gap: var(--qehs-space-xs);
	min-width: 0;
}

.qehs-cart-table__product-name a {
	font-weight: 700;
	font-size: 1rem;
	color: var(--qehs-text);
}

.qehs-cart-table__badge {
	display: inline-flex;
	align-self: flex-start;
	padding: 2px 10px;
	border-radius: var(--qehs-radius-sm);
	background-color: var(--qehs-accent-blue-tint);
	color: var(--qehs-accent-blue);
	font-size: 0.75rem;
	font-weight: 700;
}

.qehs-cart-table__price,
.qehs-cart-table__total {
	font-weight: 700;
	color: var(--qehs-text);
	white-space: nowrap;
}

/* --- Quantity stepper (wraps WooCommerce's own <input class="qty">) --- */

.qehs-cart-table__stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-md);
	overflow: hidden;
}

/* Briefly shown after a failed AJAX quantity update (assets/js/cart.js)
   - only the border color changes, so this can never shift layout. */
.qehs-cart-table__stepper.is-error {
	border-color: var(--qehs-error);
}

.qehs-cart-table__qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 36px;
	border: none;
	background-color: var(--qehs-background-alt);
	color: var(--qehs-text-muted);
	font-size: 1rem;
	cursor: pointer;
}

.qehs-cart-table__qty-btn:hover,
.qehs-cart-table__qty-btn:focus-visible {
	background-color: var(--qehs-border);
	color: var(--qehs-text);
}

.qehs-cart-table__stepper .quantity {
	display: contents;
}

.qehs-cart-table__stepper input.qty {
	width: 40px;
	height: 36px;
	border: none;
	border-inline: 1px solid var(--qehs-border);
	text-align: center;
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--qehs-text);
	-moz-appearance: textfield;
}

.qehs-cart-table__stepper input.qty::-webkit-inner-spin-button,
.qehs-cart-table__stepper input.qty::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.qehs-cart-table__remove-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: var(--qehs-radius-sm);
	background-color: var(--qehs-background-alt);
	color: var(--qehs-text-muted);
}

.qehs-cart-table__remove-btn:hover,
.qehs-cart-table__remove-btn:focus-visible {
	background-color: var(--qehs-error-tint);
	color: var(--qehs-error);
}

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

.qehs-cart-coupon {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-md);
	margin-top: var(--qehs-space-lg);
	padding: var(--qehs-space-lg);
	border-radius: var(--qehs-radius-lg);
	background-color: var(--qehs-accent-blue-tint);
	flex-wrap: wrap;
}

.qehs-cart-coupon__icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background-color: var(--qehs-background);
	color: var(--qehs-secondary);
}

.qehs-cart-coupon__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex-shrink: 0;
}

.qehs-cart-coupon__text strong {
	color: var(--qehs-text);
}

.qehs-cart-coupon__text span {
	font-size: 0.85rem;
	color: var(--qehs-text-muted);
}

.qehs-cart-coupon__form {
	flex: 1 1 320px;
	display: flex;
	gap: var(--qehs-space-sm);
	min-width: 0;
}

.qehs-cart-coupon__form input {
	flex: 1 1 auto;
	min-width: 0;
	padding: var(--qehs-space-sm) var(--qehs-space-md);
	border: none;
	border-radius: var(--qehs-radius-md);
	font-family: inherit;
	font-size: 0.95rem;
}

.qehs-cart-coupon__apply {
	flex-shrink: 0;
	padding: var(--qehs-space-sm) var(--qehs-space-lg);
	border: none;
	border-radius: var(--qehs-radius-md);
	background-color: var(--qehs-secondary);
	color: #ffffff;
	font-weight: 700;
	cursor: pointer;
}

.qehs-cart-coupon__apply:hover {
	filter: brightness(1.08);
}

/* --- Order Summary --- */

.qehs-cart-summary {
	background-color: var(--qehs-background);
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-lg);
	padding: var(--qehs-space-lg);
}

.qehs-cart-summary__title {
	margin: 0 0 var(--qehs-space-lg);
	font-size: 1.4rem;
	font-weight: 700;
}

.qehs-cart-summary__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--qehs-space-md);
	font-size: 0.95rem;
	color: var(--qehs-text);
}

.qehs-cart-summary__row--discount span:last-child {
	color: var(--qehs-secondary);
}

.qehs-cart-summary__remove-coupon {
	margin-left: var(--qehs-space-xs);
	color: var(--qehs-text-muted);
}

.qehs-cart-summary__total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: var(--qehs-space-md);
	margin-bottom: var(--qehs-space-lg);
	border-top: 1px solid var(--qehs-border);
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--qehs-text);
}

.qehs-cart-summary__total small {
	display: block;
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--qehs-text-muted);
}

.qehs-cart-summary__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--qehs-space-sm);
	width: 100%;
	padding: var(--qehs-space-md);
	border: none;
	border-radius: var(--qehs-radius-md);
	background-color: var(--qehs-secondary);
	color: #ffffff;
	font-weight: 700;
	font-size: 1rem;
}

.qehs-cart-summary__checkout:hover {
	filter: brightness(1.08);
}

.qehs-cart-summary__divider {
	position: relative;
	text-align: center;
	margin-block: var(--qehs-space-lg);
}

.qehs-cart-summary__divider::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	border-top: 1px solid var(--qehs-border);
}

.qehs-cart-summary__divider span {
	position: relative;
	padding-inline: var(--qehs-space-sm);
	background-color: var(--qehs-background);
	font-size: 0.8rem;
	color: var(--qehs-text-muted);
}

.qehs-cart-summary__express {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--qehs-space-sm);
	margin-bottom: var(--qehs-space-lg);
}

.qehs-cart-summary__express-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 44px;
	padding: var(--qehs-space-sm);
	border: 1px solid var(--qehs-border);
	border-radius: var(--qehs-radius-md);
}

.qehs-cart-summary__express-btn:hover,
.qehs-cart-summary__express-btn:focus-visible {
	border-color: var(--qehs-secondary);
}

.qehs-cart-summary__express-brand {
	font-weight: 800;
	font-size: 1rem;
	font-style: normal;
	letter-spacing: -0.01em;
}

/* Brand-characteristic two-tone wordmark (styled text, not an
   embedded trademarked logo file) — approximates PayPal's dark-navy
   + lighter-blue two-tone treatment. */
.qehs-cart-summary__express-btn--paypal .qehs-cart-summary__express-brand {
	color: #003087;
}

.qehs-cart-summary__express-btn--paypal .qehs-cart-summary__express-brand em {
	font-style: normal;
	color: #009cde;
}

/* Brand-characteristic blue (styled text + simple triangular glyph,
   not an embedded trademarked logo file) — approximates Razorpay's
   blue wordmark treatment. */
.qehs-cart-summary__express-btn--razorpay {
	color: #3395ff;
}

.qehs-cart-summary__express-btn--razorpay .qehs-cart-summary__express-brand {
	color: #3395ff;
}

/* A gateway that isn't currently configured/enabled in WooCommerce —
   visually present (so the section always matches the approved
   design) but clearly non-interactive: greyed out, not clickable,
   never presented as a real working payment option. */
.qehs-cart-summary__express-btn--disabled {
	cursor: not-allowed;
	opacity: 0.45;
	filter: grayscale(1);
}

.qehs-cart-summary__express-btn--disabled:hover,
.qehs-cart-summary__express-btn--disabled:focus-visible {
	border-color: var(--qehs-border);
}

.qehs-cart-summary__trust {
	display: flex;
	align-items: center;
	gap: var(--qehs-space-md);
	margin-top: var(--qehs-space-md);
}

.qehs-cart-summary__trust-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	background-color: var(--qehs-success-tint);
	color: var(--qehs-secondary);
}

.qehs-cart-summary__trust strong {
	display: block;
	font-size: 0.9rem;
	color: var(--qehs-text);
}

.qehs-cart-summary__trust span:not(.qehs-cart-summary__trust-icon) {
	display: block;
}

.qehs-cart-summary__trust span span {
	font-size: 0.8rem;
	color: var(--qehs-text-muted);
}

/* --- Tablet --- */
@media (max-width: 1024px) {
	.qehs-cart-layout {
		grid-template-columns: 1fr;
	}
}

/* --- Mobile --- */
@media (max-width: 768px) {
	.qehs-cart-heading {
		flex-direction: column;
		align-items: flex-start;
	}

	.qehs-cart-table thead {
		display: none;
	}

	.qehs-cart-table,
	.qehs-cart-table tbody,
	.qehs-cart-table__row {
		display: block;
		width: 100%;
	}

	.qehs-cart-table__row {
		padding-block: var(--qehs-space-md);
	}

	.qehs-cart-table__row td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: var(--qehs-space-xs) 0;
		border-bottom: none;
	}

	.qehs-cart-table__product {
		flex-direction: column;
		align-items: flex-start;
	}

	.qehs-cart-table__price::before,
	.qehs-cart-table__qty::before,
	.qehs-cart-table__total::before {
		content: attr(data-label);
		font-weight: 600;
		color: var(--qehs-text-muted);
	}

	.qehs-cart-table__remove {
		justify-content: flex-end;
	}

	.qehs-cart-coupon {
		flex-direction: column;
		align-items: flex-start;
	}

	.qehs-cart-coupon__form {
		width: 100%;
	}
}

/* ==========================================================
   Empty cart state
   ========================================================== */

.qehs-cart-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 50vh;
	padding: var(--qehs-space-2xl) var(--qehs-space-md);
	text-align: center;
}

.qehs-cart-empty__illustration {
	display: block;
	width: 180px;
	height: auto;
	margin-bottom: var(--qehs-space-lg);
	object-fit: contain;
}

.qehs-cart-empty__title {
	margin: 0 0 var(--qehs-space-sm);
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--qehs-text);
}

.qehs-cart-empty__text {
	margin: 0;
	max-width: 380px;
	color: var(--qehs-text-muted);
	font-size: 1rem;
	line-height: 1.5;
}

/* --- Mobile --- */
@media (max-width: 480px) {
	.qehs-cart-empty {
		min-height: 40vh;
		padding: var(--qehs-space-xl) var(--qehs-space-md);
	}

	.qehs-cart-empty__illustration {
		width: 140px;
	}

	.qehs-cart-empty__title {
		font-size: 1.4rem;
	}
}
