/*!
 * SayWOW Cart — stylesheet
 * Phase 2 (1.0.0-phase2) — server-side render + visual treatment
 *
 * Brand DS v2.2 compliant. Tokens come from the theme's sw-utilities.css.
 * Fallback values inside var() are public Brand DS values, included only for
 * resilience if the theme's tokens fail to load — they do not redefine
 * anything (per SPEC §17).
 *
 * Layout per SPEC §8 (desktop) + §9 (mobile bottom-sheet).
 */

/* ============================================================
   ROOT WRAPPER + RESET
   ============================================================ */

.sw-cart-root,
.sw-cart-root *,
.sw-cart-root *::before,
.sw-cart-root *::after {
	box-sizing: border-box;
}

.sw-cart-root {
	font-family: var(--sw-font, 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif);
	color: var(--sw-grey-900, #212529);
	font-size: 16px;
	line-height: 1.5;
}

/* ============================================================
   VISIBILITY STATE
   Cart hidden by default — Phase 3 JS toggles --closed → --open.
   ============================================================ */

.sw-cart-root--closed .sw-cart-backdrop,
.sw-cart-root--closed .sw-cart-panel {
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
}

.sw-cart-root--closed .sw-cart-panel {
	transform: translateX(100%);
}

@media (max-width: 768px) {
	.sw-cart-root--closed .sw-cart-panel {
		transform: translateY(100%);
	}
}

.sw-cart-root--open .sw-cart-backdrop,
.sw-cart-root--open .sw-cart-panel {
	pointer-events: auto;
	opacity: 1;
	visibility: visible;
}

.sw-cart-root--open .sw-cart-panel {
	transform: translateX(0) translateY(0);
}

/* ============================================================
   BACKDROP
   SPEC §8.2 — rgba(0,0,0,0.45), z-index 9998, fade 200ms.
   ============================================================ */

.sw-cart-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 9998;
	transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0s linear 200ms;
}

.sw-cart-root--open .sw-cart-backdrop {
	transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0s linear 0s;
}

/* ============================================================
   PANEL — DESKTOP (≥769px)
   SPEC §8.1 — 420px, 100vh, white bg, left-edge soft shadow,
   z-index 10000, slide-in 280ms.
   ============================================================ */

.sw-cart-panel {
	position: fixed;
	top: 0;
	right: 0;
	width: 420px;
	height: 100vh;
	height: 100dvh;
	background: var(--sw-white, #FFFFFF);
	z-index: 10000;
	display: flex;
	flex-direction: column;
	box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18);
	transform: translateX(100%);
	transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0s linear 280ms;
	overflow: hidden;
}

.sw-cart-root--open .sw-cart-panel {
	transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0s linear 0s;
}

/* ============================================================
   PANEL — MOBILE BOTTOM SHEET (≤768px)
   SPEC §9.1 — 100vw, 85vh default, top corners 16px radius,
   top-edge shadow, slide-up 320ms.
   ============================================================ */

@media (max-width: 768px) {
	.sw-cart-panel {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		height: var(--sw-cart-mobile-height, 85vh);
		max-height: 85dvh;
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.16);
		transform: translateY(100%);
		transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
		            opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
		            visibility 0s linear 320ms;
	}

	.sw-cart-root--open .sw-cart-panel {
		transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
		            opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
		            visibility 0s linear 0s;
	}
}

/* ============================================================
   MOBILE DRAG HANDLE
   SPEC §9.2 — 36×4px pill, 4px below top edge, --sw-grey-300.
   ============================================================ */

.sw-cart-mobile-handle {
	display: none;
}

@media (max-width: 768px) {
	.sw-cart-mobile-handle {
		display: block;
		position: absolute;
		/* v1.0.1: 8px → 12px — more breathing room from the panel's
		   top edge. Paired with the header padding-top bump below to also
		   widen the visual gap between the handle and the title row. */
		top: 12px;
		left: 50%;
		transform: translateX(-50%);
		width: 36px;
		height: 4px;
		background: var(--sw-grey-300, #9CA3AF);
		border-radius: 2px;
		z-index: 1;
		/* Per SPEC §9.2 — extend tap area 24px above/below visual element */
		padding: 0;
	}

	.sw-cart-mobile-handle::before {
		content: '';
		position: absolute;
		inset: -24px -16px;
	}
}

/* ============================================================
   HEADER
   SPEC §8.3 (desktop 64px) + §9.6 (mobile 56px, with handle clearance).
   ============================================================ */

.sw-cart-header {
	flex: 0 0 auto;
	height: 64px;
	padding: 0 24px;
	background: var(--sw-white, #FFFFFF);
	border-bottom: 1px solid var(--sw-grey-200, #E5E7EB);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	position: relative;
	z-index: 1;
}

@media (max-width: 768px) {
	.sw-cart-header {
		/* v1.0.1: height 64→72, padding-top 16→24 — increases the
		   gap between the drag-handle pill (now at top:12px) and the
		   title row to ~21px, up from ~13px. Content area (height minus
		   padding-top) stays 48px which keeps the 44×44 close button
		   comfortably inside the bounding box. Other surfaces unchanged —
		   desktop header retains 64px height (handle is `display: none`
		   off-mobile). */
		height: 72px;
		padding: 24px 20px 0;
	}
}

.sw-cart-title {
	margin: 0;
	font-size: 1.5rem;             /* h2 24px per Brand DS */
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.3px;
	color: var(--sw-grey-900, #212529);
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
}

@media (max-width: 768px) {
	.sw-cart-title {
		font-size: 1.25rem;        /* 20px on mobile for header-height fit */
	}
}

.sw-cart-title-count {
	color: var(--sw-grey-500, #6B7280);
	font-weight: 500;
	font-size: 0.875rem;
}

/* Close button — circular blue, 44×44 hit area */
.sw-cart-close {
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--sw-blue, #0052CC);
	border: 0;
	border-radius: 50%;
	color: var(--sw-white, #FFFFFF);
	cursor: pointer;
	padding: 0;
	transition: background 150ms ease;
}

.sw-cart-close:hover {
	background: var(--sw-blue-dark, #003D99);
}

.sw-cart-close:active {
	background: var(--sw-blue-darkest, #002D73);
}

.sw-cart-close svg {
	width: 20px;
	height: 20px;
	display: block;
}

/* ============================================================
   BODY (scroll container between header and totals)
   ============================================================ */

.sw-cart-body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

/* ============================================================
   GUEST LOGIN CTA
   Phase 5.1 — slim banner shown to logged-out users with
   a non-empty cart, nudging toward login for wallet pay /
   QC checkout. Sits at the top of the cart body, above items.
   ============================================================ */

.sw-cart-guest-cta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 16px 24px 0;
	padding: 12px 14px;
	background: rgba(0, 82, 204, 0.06);
	border: 1px solid rgba(0, 82, 204, 0.15);
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.4;
}

.sw-cart-guest-cta-icon {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	color: var(--sw-blue, #0052CC);
}

.sw-cart-guest-cta-text {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.sw-cart-guest-cta-text strong {
	font-weight: 600;
	color: var(--sw-text, #1a1a1a);
}

.sw-cart-guest-cta-text span {
	font-size: 12px;
	color: var(--sw-text-secondary, #666);
}

.sw-cart-guest-cta-link {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	background: var(--sw-blue, #0052CC);
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	border-radius: 6px;
	transition: background 0.15s ease;
}

.sw-cart-guest-cta-link:hover,
.sw-cart-guest-cta-link:focus {
	background: var(--sw-blue-dark, #003D99);
	color: #fff;
}

.sw-cart-guest-cta-link svg {
	width: 14px;
	height: 14px;
}

@media (max-width: 768px) {
	.sw-cart-guest-cta {
		margin: 12px 20px 0;
		padding: 10px 12px;
		font-size: 12px;
	}
	.sw-cart-guest-cta-text span {
		font-size: 11px;
	}
}

/* ============================================================
   ITEMS LIST
   SPEC §8.4 — flex row, gap 16px, vertical padding 16px,
   border-bottom --sw-grey-100.
   ============================================================ */

.sw-cart-items {
	list-style: none;
	margin: 0;
	padding: 0 24px;
}

@media (max-width: 768px) {
	.sw-cart-items {
		padding: 0 20px;
	}
}

.sw-cart-item {
	display: flex;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--sw-grey-100, #F8F9FA);
	align-items: stretch;
}

.sw-cart-item:last-child {
	border-bottom: 0;
}

.sw-cart-item-thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--sw-grey-100, #F8F9FA);
	display: block;
	text-decoration: none;
}

.sw-cart-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sw-cart-item-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	justify-content: space-between;
}

.sw-cart-item-title {
	color: var(--sw-grey-900, #212529);
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-wrap: break-word;
}

a.sw-cart-item-title:hover {
	color: var(--sw-blue, #0052CC);
}

.sw-cart-item-meta {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px;
	min-width: 32px;
}

.sw-cart-item-price {
	font-size: 1rem;
	font-weight: 600;
	color: var(--sw-grey-900, #212529);
	white-space: nowrap;
	line-height: 1.2;
}

/* WC's wc_price() output sometimes wraps in <bdi> — normalise */
.sw-cart-item-price bdi,
.sw-cart-totals-value bdi,
.sw-cart-coupon-applied-amount bdi {
	font-weight: inherit;
	color: inherit;
	font-style: normal;
}

/* Remove × — top-right of item meta column */
.sw-cart-item-remove {
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: var(--sw-grey-500, #6B7280);
	cursor: pointer;
	border-radius: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: color 150ms ease, background 150ms ease;
	text-decoration: none;
}

.sw-cart-item-remove:hover {
	color: var(--sw-red, #E63946);
	background: var(--sw-grey-100, #F8F9FA);
}

.sw-cart-item-remove svg {
	display: block;
}

/* ============================================================
   QUANTITY STEPPER
   SPEC §8.4 (desktop 32×32) + §9.7 (mobile 44×44 WCAG AAA).
   ============================================================ */

.sw-cart-qty {
	display: inline-flex;
	align-items: stretch;
	background: var(--sw-grey-100, #F8F9FA);
	border-radius: 6px;
	overflow: hidden;
	width: max-content;
}

.sw-cart-qty-btn {
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: var(--sw-grey-900, #212529);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1;
	padding: 0;
	transition: background 150ms ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.sw-cart-qty-btn:hover {
	background: var(--sw-grey-200, #E5E7EB);
}

@media (max-width: 768px) {
	.sw-cart-qty-btn {
		width: 44px;
		height: 44px;
	}
}

.sw-cart-qty-value {
	min-width: 32px;
	text-align: center;
	padding: 0 6px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--sw-grey-900, #212529);
	line-height: 1;
	user-select: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ============================================================
   COUPON SECTION
   SPEC §8.5 — collapsed by default, expands to input + Apply.
   ============================================================ */

.sw-cart-coupon {
	padding: 16px 24px;
	border-top: 1px solid var(--sw-grey-200, #E5E7EB);
}

@media (max-width: 768px) {
	.sw-cart-coupon {
		padding: 16px 20px;
	}
}

/* Applied coupons list */
.sw-cart-coupon-applied {
	list-style: none;
	margin: 0 0 12px 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sw-cart-coupon-applied-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	background: var(--sw-grey-100, #F8F9FA);
	border-radius: 6px;
	font-size: 0.875rem;
}

.sw-cart-coupon-applied-code {
	font-weight: 700;
	letter-spacing: 0.3px;
	color: var(--sw-grey-900, #212529);
	flex: 1 1 auto;
}

.sw-cart-coupon-applied-amount {
	font-weight: 600;
	color: var(--sw-green, #28A745);
}

/* Reassurance note when a store credit was applied but
   contributed nothing (still on the customer's account). */
.sw-cart-coupon-applied-note {
	flex: 1 0 100%;
	margin: -8px 0 0;
	font-size: 0.75rem;
	color: var(--sw-grey-500, #6B7280);
}

.sw-cart-coupon-remove {
	color: var(--sw-grey-500, #6B7280);
	text-decoration: none;
	font-size: 1.25rem;
	line-height: 1;
	width: 24px;
	height: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: color 150ms ease, background 150ms ease;
	flex: 0 0 auto;
}

.sw-cart-coupon-remove:hover {
	color: var(--sw-red, #E63946);
	background: var(--sw-white, #FFFFFF);
}

/* "+ Add coupon code" toggle */
.sw-cart-coupon-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: 0;
	padding: 8px 0;
	color: var(--sw-blue, #0052CC);
	cursor: pointer;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
}

.sw-cart-coupon-toggle:hover {
	color: var(--sw-blue-dark, #003D99);
	text-decoration: underline;
}

.sw-cart-coupon-toggle:focus-visible {
	outline: 3px solid rgba(0, 82, 204, 0.3);
	outline-offset: 1px;
	border-radius: 4px;
}

.sw-cart-coupon-toggle-icon {
	display: inline-flex;
	width: 16px;
	height: 16px;
	align-items: center;
	justify-content: center;
	transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
	font-weight: 600;
}

.sw-cart-coupon-toggle[aria-expanded="true"] .sw-cart-coupon-toggle-icon {
	transform: rotate(45deg);
}

/* Coupon form — hidden by default via [hidden] attribute */
.sw-cart-coupon-form {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.sw-cart-coupon-form[hidden] {
	display: none;
}

.sw-cart-coupon-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	padding: 0 16px;
	border: 1px solid var(--sw-grey-200, #E5E7EB);
	border-radius: 6px;
	font-family: inherit;
	font-size: 0.9375rem;
	color: var(--sw-grey-900, #212529);
	background: var(--sw-white, #FFFFFF);
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.sw-cart-coupon-input:focus {
	outline: none;
	border-color: var(--sw-blue, #0052CC);
	box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.15);
}

.sw-cart-coupon-input::placeholder {
	color: var(--sw-grey-300, #9CA3AF);
	text-transform: none;
	letter-spacing: 0;
}

.sw-cart-coupon-apply {
	flex: 0 0 auto;
	min-width: 88px;
	height: 44px;
	min-height: 44px;
	font-size: 0.9375rem;
}

/* ============================================================
   TOTALS
   SPEC §8.6 — light grey contrast bg, border top + bottom,
   total row weight 700 size 1.125rem.
   Note: SPEC references --sw-grey-50 which is not in Brand DS v2.2;
   using --sw-grey-100 (#F8F9FA) which is the lightest defined grey.
   ============================================================ */

.sw-cart-totals {
	flex: 0 0 auto;
	padding: 16px 24px;
	background: var(--sw-grey-100, #F8F9FA);
	border-top: 1px solid var(--sw-grey-200, #E5E7EB);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

@media (max-width: 768px) {
	.sw-cart-totals {
		padding: 16px 20px;
	}
}

.sw-cart-totals-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--sw-grey-900, #212529);
}

.sw-cart-totals-label {
	color: var(--sw-grey-500, #6B7280);
}

.sw-cart-totals-row--savings .sw-cart-totals-label,
.sw-cart-totals-row--savings .sw-cart-totals-value {
	color: var(--sw-green, #28A745);
	font-weight: 600;
}

.sw-cart-totals-row--total {
	font-size: 1.125rem;
	font-weight: 700;
	margin-top: 4px;
	padding-top: 10px;
	border-top: 1px solid var(--sw-grey-200, #E5E7EB);
	color: var(--sw-grey-900, #212529);
}

.sw-cart-totals-row--total .sw-cart-totals-label {
	color: var(--sw-grey-900, #212529);
	font-weight: 700;
}

/* ============================================================
   FOOTER + ACTION BUTTONS
   SPEC §8.7 (desktop) + §9.4 (mobile sticky + safe-area).
   ============================================================ */

.sw-cart-footer {
	flex: 0 0 auto;
	padding: 16px 24px;
	background: var(--sw-white, #FFFFFF);
	border-top: 1px solid var(--sw-grey-200, #E5E7EB);
	padding-bottom: max(16px, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
	.sw-cart-footer {
		padding-left: 20px;
		padding-right: 20px;
	}
}

.sw-cart-actions {
	display: flex;
	gap: 12px;
}

@media (max-width: 379px) {
	.sw-cart-actions {
		flex-direction: column;
	}
}

.sw-cart-btn {
	flex: 1 1 auto;
	min-height: 52px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 16px;
	border-radius: 6px;
	border: 1px solid transparent;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
	white-space: nowrap;
	text-align: center;
}

@media (max-width: 768px) {
	.sw-cart-btn--primary,
	.sw-cart-btn--checkout {
		min-height: 56px;
	}
}

.sw-cart-btn--primary {
	background: var(--sw-red, #E63946);
	color: var(--sw-white, #FFFFFF);
	font-size: 1.3125rem; /* 21px per SPEC §8.7 */
	border-color: var(--sw-red, #E63946);
}

.sw-cart-btn--primary:hover {
	background: var(--sw-red-hover, #CF2F3C);
	border-color: var(--sw-red-hover, #CF2F3C);
	color: var(--sw-white, #FFFFFF);
}

.sw-cart-btn--primary:active {
	background: var(--sw-red-active, #B82633);
	border-color: var(--sw-red-active, #B82633);
}

.sw-cart-btn--secondary {
	background: var(--sw-white, #FFFFFF);
	color: var(--sw-blue, #0052CC);
	border-color: var(--sw-blue, #0052CC);
}

.sw-cart-btn--secondary:hover {
	background: var(--sw-blue, #0052CC);
	color: var(--sw-white, #FFFFFF);
}

.sw-cart-btn:focus-visible {
	outline: 3px solid rgba(0, 82, 204, 0.3);
	outline-offset: 1px;
}

/* Smaller variant for inline contexts (e.g. coupon Apply) */
.sw-cart-coupon-apply.sw-cart-btn--primary {
	font-size: 0.9375rem;
	min-height: 44px;
}

@media (max-width: 768px) {
	.sw-cart-coupon-apply.sw-cart-btn--primary {
		min-height: 44px;
	}
}

/* ============================================================
   EMPTY STATE
   SPEC §10.4 — friendly message + Browse Competitions CTA.
   ============================================================ */

.sw-cart-empty {
	padding: 48px 24px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

@media (max-width: 768px) {
	.sw-cart-empty {
		padding: 40px 20px;
	}
}

.sw-cart-empty-icon {
	width: 96px;
	height: 96px;
	color: var(--sw-grey-300, #9CA3AF);
}

.sw-cart-empty-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.sw-cart-empty-title {
	margin: 0;
	font-size: 1.125rem;          /* h3 18px per Brand DS */
	font-weight: 700;
	color: var(--sw-grey-900, #212529);
	line-height: 1.4;
}

.sw-cart-empty-message {
	margin: 0;
	color: var(--sw-grey-500, #6B7280);
	font-size: 0.9375rem;
	line-height: 1.5;
	max-width: 28ch;
}

.sw-cart-empty-cta {
	margin-top: 12px;
	min-width: 220px;
	flex: 0 0 auto;
	font-size: 1rem;
}

/* ============================================================
   SCREEN-READER + ARIA-LIVE
   ============================================================ */

.sw-cart-aria-live,
.sw-cart-root .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ============================================================
   AVAILABLE COUPONS (Phase 4)
   List of coupons the logged-in user can apply, AJAX-loaded into
   the slot rendered by cart-shell.php. Card layout adapted from
   the original saywow-fast-cart-coupons.php snippet, retokenised
   onto Brand DS values.
   ============================================================ */

.sw-cart-available-coupons-slot {
	min-height: 0;
}

.sw-cart-available-coupons-slot:empty {
	display: none;
}

.sw-cart-coupons-loading {
	margin: 0;
	padding: 12px 24px;
	font-size: 0.8125rem;
	color: var(--sw-grey-500, #6B7280);
}

@media (max-width: 768px) {
	.sw-cart-coupons-loading {
		padding: 12px 20px;
	}
}

.sw-cart-available-coupons {
	padding: 12px 24px;
	border-top: 1px solid var(--sw-grey-200, #E5E7EB);
	background: var(--sw-grey-100, #F8F9FA);
}

@media (max-width: 768px) {
	.sw-cart-available-coupons {
		padding: 12px 20px;
	}
}

.sw-cart-available-coupons-heading {
	margin: 0 0 10px 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--sw-blue, #0052CC);
	line-height: 1.3;
}

.sw-cart-available-coupons-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sw-cart-available-coupon {
	background: var(--sw-white, #FFFFFF);
	border: 2px solid var(--sw-grey-200, #E5E7EB);
	border-radius: 8px;
	padding: 10px 14px;
	cursor: pointer;
	transition: border-color 150ms ease, transform 100ms ease, box-shadow 150ms ease;
}

.sw-cart-available-coupon:hover,
.sw-cart-available-coupon:focus-visible {
	border-color: var(--sw-blue, #0052CC);
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 82, 204, 0.12);
	outline: none;
}

.sw-cart-available-coupon--disabled {
	opacity: 0.45;
	cursor: default;
	pointer-events: none;
}

.sw-cart-available-coupon-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}

.sw-cart-available-coupon-code {
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: var(--sw-blue, #0052CC);
}

.sw-cart-available-coupon-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--sw-white, #FFFFFF);
	background: var(--sw-blue, #0052CC);
	padding: 2px 8px;
	border-radius: 4px;
	white-space: nowrap;
	line-height: 1.4;
}

.sw-cart-available-coupon-label bdi {
	font-weight: inherit;
	color: inherit;
}

.sw-cart-available-coupon-desc {
	display: block;
	font-size: 0.75rem;
	color: var(--sw-grey-500, #6B7280);
	margin-top: 4px;
	line-height: 1.3;
}

.sw-cart-available-coupon-exp {
	display: block;
	font-size: 0.6875rem;
	color: var(--sw-grey-300, #9CA3AF);
	margin-top: 3px;
}

/* ============================================================
   COUPON ERROR (Phase 4)
   Inline error region under the coupon form.
   ============================================================ */

.sw-cart-coupon-error {
	margin-top: 8px;
	padding: 8px 12px;
	background: rgba(230, 57, 70, 0.08);
	border-left: 3px solid var(--sw-red, #E63946);
	border-radius: 4px;
	color: var(--sw-red, #E63946);
	font-size: 0.875rem;
	line-height: 1.4;
}

.sw-cart-coupon-error[hidden] {
	display: none;
}

/* ============================================================
   TOAST / UNDO BANNER
   Phase 3 — appears after item removal with a 5s undo window.
   Positioned absolutely above the footer inside the panel.
   ============================================================ */

.sw-cart-toast {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 96px;
	background: var(--sw-grey-900, #212529);
	color: var(--sw-white, #FFFFFF);
	border-radius: 8px;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	font-size: 0.9375rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
	z-index: 5;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
	            transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.sw-cart-toast--visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.sw-cart-toast[hidden] {
	display: none;
}

.sw-cart-toast-message {
	flex: 1 1 auto;
	min-width: 0;
}

.sw-cart-toast-undo {
	background: transparent;
	border: 0;
	color: var(--sw-white, #FFFFFF);
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	flex: 0 0 auto;
	transition: background 150ms ease;
}

.sw-cart-toast-undo:hover {
	background: rgba(255, 255, 255, 0.1);
}

.sw-cart-toast-undo:focus-visible {
	outline: 2px solid var(--sw-white, #FFFFFF);
	outline-offset: 1px;
}

@media (max-width: 768px) {
	.sw-cart-toast {
		left: 12px;
		right: 12px;
		bottom: 88px;
	}
}

/* ============================================================
   BODY SCROLL LOCK
   Applied while the cart is open so the page underneath can't
   scroll. The inline `top: -<scrollY>px` on body preserves the
   visual scroll position; on close, JS restores window.scrollTo.
   iOS-friendly (position: fixed pattern).
   ============================================================ */

body.sw-cart-locked {
	position: fixed;
	width: 100%;
	overflow: hidden;
}

/* ============================================================
   REDUCED MOTION
   SPEC §18.4 — animations to opacity-only when prefers-reduced-motion.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
	.sw-cart-panel,
	.sw-cart-backdrop,
	.sw-cart-btn,
	.sw-cart-close,
	.sw-cart-qty-btn,
	.sw-cart-item-remove,
	.sw-cart-coupon-toggle,
	.sw-cart-coupon-toggle-icon,
	.sw-cart-toast {
		transition-duration: 0ms !important;
	}

	.sw-cart-root--closed .sw-cart-panel {
		transform: none;
	}
}

/* ============================================================
   PRINT — never render the cart on print
   ============================================================ */

@media print {
	.sw-cart-root {
		display: none !important;
	}
}
