/**
 * Checkout page — Multi-step layout & step styles.
 *
 * Shopify-inspired: full-page takeover, two-column layout,
 * floating-label fields, numbered step indicator.
 *
 * @package Woo_Specialist
 */

/* =========================================================================
   Hidden WC order review — must stay in DOM for fragment replacement
   ========================================================================= */

.wsp-checkout__wc-review {
	position: fixed !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
}

/* =========================================================================
   Page shell
   ========================================================================= */

.wsp-checkout-page {
	margin: 0;
	padding: 0;
	background: var(--wsp-color-white);
	font-family: var(--wsp-font-family);
	color: var(--wsp-color-text);
	-webkit-font-smoothing: antialiased;
}

.wsp-checkout {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.wsp-checkout__header {
	padding: var(--wsp-space-lg) var(--wsp-space-xl);
	border-bottom: 1px solid var(--wsp-color-border-light);
}

.wsp-checkout__header-inner {
	max-width: 1200px;
	margin: 0 auto;
}

.wsp-checkout__logo {
	text-decoration: none;
	display: inline-block;
}

.wsp-checkout__logo--text {
	font-size: var(--wsp-font-size-xl);
	font-weight: var(--wsp-font-weight-semibold);
	color: var(--wsp-color-text);
}

.wsp-checkout__logo-img {
	max-height: 40px;
	width: auto;
}

.wsp-checkout__content {
	flex: 1;
}

.wsp-checkout__footer {
	border-top: 1px solid var(--wsp-color-border-light);
	padding: var(--wsp-space-lg) var(--wsp-space-xl);
}

.wsp-checkout__footer-inner {
	max-width: 1200px;
	margin: 0 auto;
}

.wsp-checkout__footer p {
	font-size: 12px;
	color: var(--wsp-color-text-muted);
	margin: 0;
}

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

.wsp-checkout__layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: calc(100vh - 160px);
	position: relative;
}

/* Extend dark background to cover the full right half + edge of viewport */
.wsp-checkout__layout::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	width: 50%;
	background: #1a1a1a;
	z-index: -1;
}

.wsp-checkout__main {
	padding: var(--wsp-space-xl) var(--wsp-space-2xl) var(--wsp-space-2xl);
	max-width: 600px;
	width: 100%;
	box-sizing: border-box;
	margin-left: auto;
	margin-right: var(--wsp-space-2xl);
}

.wsp-checkout__sidebar {
	background: #1a1a1a;
	padding: var(--wsp-space-2xl) var(--wsp-space-2xl);
	border-left: 1px solid var(--wsp-color-border-light);
	max-width: 450px;
}

/* =========================================================================
   Step indicator
   ========================================================================= */

.wsp-steps {
	margin-bottom: var(--wsp-space-2xl);
}

.wsp-steps__list {
	display: flex;
	align-items: center;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.wsp-steps__item {
	display: flex;
	align-items: center;
	gap: var(--wsp-space-xs);
	cursor: pointer;
}

.wsp-steps__number {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--wsp-color-border);
	color: var(--wsp-color-white);
	font-size: 12px;
	font-weight: var(--wsp-font-weight-semibold);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background var(--wsp-transition-fast);
}

.wsp-steps__label {
	font-size: var(--wsp-font-size-sm);
	color: var(--wsp-color-text-muted);
	white-space: nowrap;
	transition: color var(--wsp-transition-fast);
}

/* Active step: blue circle, bold label */
.wsp-steps__item.is-active .wsp-steps__number {
	background: var(--wsp-color-accent);
}

.wsp-steps__item.is-active .wsp-steps__label {
	color: var(--wsp-color-text);
	font-weight: var(--wsp-font-weight-semibold);
}

/* Completed step: dark circle (done) */
.wsp-steps__item.is-completed .wsp-steps__number {
	background: var(--wsp-color-text);
}

.wsp-steps__separator {
	width: var(--wsp-space-lg);
	height: 1px;
	background: var(--wsp-color-border);
	margin: 0 var(--wsp-space-sm);
	list-style: none;
}

/* =========================================================================
   Step containers
   ========================================================================= */

.wsp-checkout__step {
	display: none;
}

.wsp-checkout__step.is-active {
	display: block;
}

@keyframes wspSlideFromRight {
	from { opacity: 0; transform: translateX(30px); }
	to { opacity: 1; transform: translateX(0); }
}

@keyframes wspSlideFromLeft {
	from { opacity: 0; transform: translateX(-30px); }
	to { opacity: 1; transform: translateX(0); }
}

/* =========================================================================
   Contact section (guest email + login prompt)
   ========================================================================= */

.wsp-checkout__login-prompt {
	font-size: var(--wsp-font-size-sm);
	color: var(--wsp-color-text-muted);
	margin: var(--wsp-space-xs) 0 0;
}

.wsp-checkout__login-prompt a {
	color: var(--wsp-color-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* =========================================================================
   Account creation checkbox
   ========================================================================= */

.wsp-checkout__create-account {
	margin-top: var(--wsp-space-md);
}

.wsp-checkout__create-account-label {
	display: flex;
	align-items: flex-start;
	gap: var(--wsp-space-sm);
	font-size: var(--wsp-font-size-sm);
	cursor: pointer;
}

.wsp-checkout__create-account-label input[type="checkbox"] {
	margin-top: 2px;
	accent-color: var(--wsp-color-accent);
}

/* =========================================================================
   Headings
   ========================================================================= */

.wsp-checkout__heading {
	font-size: var(--wsp-font-size-lg);
	font-weight: var(--wsp-font-weight-semibold);
	margin: 0 0 var(--wsp-space-sm);
	line-height: var(--wsp-line-height-tight);
}

.wsp-checkout__subheading {
	font-size: var(--wsp-font-size-base);
	font-weight: var(--wsp-font-weight-semibold);
	margin: var(--wsp-space-lg) 0 var(--wsp-space-md);
}

.wsp-checkout__welcome {
	font-size: var(--wsp-font-size-sm);
	color: var(--wsp-color-text-muted);
	margin-bottom: var(--wsp-space-lg);
}

.wsp-checkout__secure-note {
	font-size: var(--wsp-font-size-sm);
	color: var(--wsp-color-text-muted);
	margin-bottom: var(--wsp-space-lg);
}

.wsp-checkout__billing-note {
	font-size: var(--wsp-font-size-sm);
	color: var(--wsp-color-text-muted);
	margin-bottom: var(--wsp-space-md);
}

/* =========================================================================
   Field grid
   ========================================================================= */

.wsp-checkout__field-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wsp-space-md);
}

.wsp-checkout__field--full {
	grid-column: 1 / -1;
}

.wsp-checkout__field--half {
	/* Default: spans 1 column in the 2-col grid */
}

/* 3-column sub-row for Country/ZIP/State */
.wsp-checkout__field-row--3col {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: var(--wsp-space-md);
}

/* =========================================================================
   Floating-label fields
   ========================================================================= */

.wsp-float-field {
	position: relative;
}

.wsp-float-field__input {
	width: 100%;
	padding: 20px 12px 8px;
	border: 1px solid var(--wsp-color-border);
	border-radius: var(--wsp-radius-sm);
	font-size: var(--wsp-font-size-sm);
	font-family: inherit;
	color: var(--wsp-color-text);
	background: var(--wsp-color-white);
	outline: none;
	transition: border-color var(--wsp-transition-fast);
	box-sizing: border-box;
	appearance: none;
}

.wsp-float-field__input:focus {
	border-color: var(--wsp-color-accent);
	box-shadow: 0 0 0 1px var(--wsp-color-accent);
}

.wsp-float-field__label {
	position: absolute;
	top: 50%;
	left: 13px;
	transform: translateY(-50%);
	font-size: var(--wsp-font-size-sm);
	color: var(--wsp-color-text-muted);
	pointer-events: none;
	transition: all var(--wsp-transition-fast);
	transform-origin: left top;
	background: var(--wsp-color-white);
	padding: 0 2px;
}

/* Float label up when input has focus or value */
.wsp-float-field__input:focus ~ .wsp-float-field__label,
.wsp-float-field__input:not(:placeholder-shown) ~ .wsp-float-field__label,
.wsp-float-field.has-value .wsp-float-field__label {
	top: 8px;
	transform: translateY(0);
	font-size: 11px;
	color: var(--wsp-color-text-muted);
}

/* Select fields — always show label floated */
.wsp-float-field__select ~ .wsp-float-field__label {
	top: 8px;
	transform: translateY(0);
	font-size: 11px;
}

.wsp-float-field__select {
	padding-right: 32px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6e73' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

/* Validation error state */
.wsp-float-field--error .wsp-float-field__input {
	border-color: var(--wsp-color-error);
}

.wsp-float-field--error .wsp-float-field__input:focus {
	box-shadow: 0 0 0 1px var(--wsp-color-error);
}

textarea.wsp-float-field__input {
	resize: vertical;
	min-height: 80px;
}

/* =========================================================================
   Address line 2 toggle
   ========================================================================= */

.wsp-checkout__add-line2 {
	background: none;
	border: none;
	color: var(--wsp-color-accent);
	font-size: var(--wsp-font-size-sm);
	cursor: pointer;
	padding: 0;
}

.wsp-checkout__add-line2:hover {
	text-decoration: underline;
}

/* =========================================================================
   Summary bar (between steps)
   ========================================================================= */

.wsp-checkout__summary-bar {
	border: 1px solid var(--wsp-color-border);
	border-radius: var(--wsp-radius-sm);
	margin-bottom: var(--wsp-space-xl);
}

.wsp-checkout__summary-table {
	width: 100%;
	border-collapse: collapse;
}

.wsp-checkout__summary-table td {
	padding: var(--wsp-space-sm) var(--wsp-space-md);
	font-size: var(--wsp-font-size-sm);
	border-bottom: 1px solid var(--wsp-color-border-light);
	vertical-align: top;
}

.wsp-checkout__summary-table tr:last-child td {
	border-bottom: none;
}

.wsp-checkout__summary-label {
	color: var(--wsp-color-text-muted);
	white-space: nowrap;
	width: 70px;
}

.wsp-checkout__summary-value {
	color: var(--wsp-color-text);
}

.wsp-checkout__summary-action {
	text-align: right;
	width: 60px;
}

.wsp-checkout__change-link {
	background: none;
	border: none;
	color: var(--wsp-color-accent);
	font-size: var(--wsp-font-size-sm);
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wsp-checkout__change-link:focus-visible {
	outline: 2px solid var(--wsp-color-accent);
	outline-offset: 2px;
	border-radius: 2px;
}

/* =========================================================================
   Shipping method list
   ========================================================================= */

.wsp-checkout__shipping-list {
	position: relative; /* anchors the .is-updating spinner overlay */
	border: 1px solid var(--wsp-color-border);
	border-radius: var(--wsp-radius-sm);
	overflow: hidden;
	margin-bottom: var(--wsp-space-xl);
	transition: opacity 150ms ease;
}

/* Visual feedback while WC's update_checkout AJAX is in flight after a radio
   change. Dim the list + show a centred spinner so the customer knows we
   heard them and the new rate is propagating. */
.wsp-checkout__shipping-list.is-updating {
	opacity: 0.55;
	pointer-events: none;
	cursor: progress;
}

.wsp-checkout__shipping-list.is-updating::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border: 2px solid var(--wsp-color-border, #d2d2d7);
	border-top-color: var(--wsp-color-primary, #0071e3);
	border-radius: 50%;
	animation: wsp-shipping-spin 0.8s linear infinite;
	z-index: 2;
	pointer-events: none;
}

.wsp-checkout__shipping-list.is-updating::after {
	content: 'Updating shipping rates…';
	position: absolute;
	top: 50%;
	left: 50%;
	margin: 24px 0 0 0;
	transform: translateX(-50%);
	font-size: 13px;
	font-weight: 500;
	color: var(--wsp-color-text-secondary, #6e6e73);
	white-space: nowrap;
	z-index: 2;
	pointer-events: none;
}

@keyframes wsp-shipping-spin {
	to { transform: rotate(360deg); }
}

/* Respect users who prefer reduced motion — show spinner statically. */
@media (prefers-reduced-motion: reduce) {
	.wsp-checkout__shipping-list.is-updating::before {
		animation: none;
	}
}

.wsp-checkout__shipping-list .woocommerce-shipping-methods {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wsp-checkout__shipping-list .woocommerce-shipping-methods li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--wsp-space-sm) var(--wsp-space-md);
	border-bottom: 1px solid var(--wsp-color-border-light);
	cursor: pointer;
	transition: background var(--wsp-transition-fast);
}

.wsp-checkout__shipping-list .woocommerce-shipping-methods li:last-child {
	border-bottom: none;
}

.wsp-checkout__shipping-list .woocommerce-shipping-methods li:hover {
	background: var(--wsp-color-bg);
}

.wsp-checkout__shipping-list .shipping_method {
	margin-right: var(--wsp-space-sm);
	accent-color: var(--wsp-color-accent);
}

.wsp-checkout__shipping-loading {
	padding: var(--wsp-space-xl);
	text-align: center;
	color: var(--wsp-color-text-muted);
	font-size: var(--wsp-font-size-sm);
}

/* =========================================================================
   Billing address toggle
   ========================================================================= */

.wsp-checkout__billing-toggle {
	border: 1px solid var(--wsp-color-border);
	border-radius: var(--wsp-radius-sm);
	overflow: hidden;
	margin-bottom: var(--wsp-space-lg);
}

.wsp-checkout__billing-option {
	display: flex;
	align-items: center;
	gap: var(--wsp-space-sm);
	padding: var(--wsp-space-md);
	border-bottom: 1px solid var(--wsp-color-border-light);
	cursor: pointer;
	font-size: var(--wsp-font-size-sm);
	transition: background var(--wsp-transition-fast);
}

.wsp-checkout__billing-option:last-child {
	border-bottom: none;
}

.wsp-checkout__billing-option:hover {
	background: var(--wsp-color-bg);
}

.wsp-checkout__billing-option input[type="radio"] {
	accent-color: var(--wsp-color-accent);
}

.wsp-checkout__billing-fields {
	margin-bottom: var(--wsp-space-lg);
}

/* =========================================================================
   Payment section (WC-rendered, moved to Step 3 via JS)
   ========================================================================= */

.wsp-checkout__payment-wrap .woocommerce-checkout-payment {
	margin-bottom: var(--wsp-space-xl);
}

.wsp-checkout__payment-wrap .wc_payment_methods {
	list-style: none;
	padding: 0;
	margin: 0;
}

.wsp-checkout__payment-wrap .wc_payment_method {
	border: 1px solid var(--wsp-color-border);
	border-bottom: none;
	padding: var(--wsp-space-md);
}

.wsp-checkout__payment-wrap .wc_payment_method:first-child {
	border-radius: var(--wsp-radius-sm) var(--wsp-radius-sm) 0 0;
}

.wsp-checkout__payment-wrap .wc_payment_method:last-child {
	border-bottom: 1px solid var(--wsp-color-border);
	border-radius: 0 0 var(--wsp-radius-sm) var(--wsp-radius-sm);
}

.wsp-checkout__payment-wrap .wc_payment_method label {
	font-weight: var(--wsp-font-weight-medium);
	cursor: pointer;
}

.wsp-checkout__payment-wrap .payment_box {
	padding: var(--wsp-space-md) 0 0;
	font-size: var(--wsp-font-size-sm);
	color: var(--wsp-color-text-muted);
}

/* Hide WC's place-order div inside the payment section — we render
   our own #place_order button in the step actions area. The div must
   stay in the DOM so gateways can find their hooks. */
.wsp-checkout__payment-wrap .place-order {
	position: absolute !important;
	left: -9999px !important;
	height: 1px !important;
	width: 1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
}

.wsp-checkout__payment-loading {
	padding: var(--wsp-space-xl);
	text-align: center;
	color: var(--wsp-color-text-muted);
	font-size: var(--wsp-font-size-sm);
}

/* =========================================================================
   Order notes (collapsible)
   ========================================================================= */

.wsp-checkout__order-notes {
	margin-bottom: var(--wsp-space-lg);
}

.wsp-checkout__notes-toggle {
	background: none;
	border: none;
	color: var(--wsp-color-accent);
	font-size: var(--wsp-font-size-sm);
	cursor: pointer;
	padding: 0;
}

.wsp-checkout__notes-toggle:hover {
	text-decoration: underline;
}

.wsp-checkout__notes-field {
	margin-top: var(--wsp-space-sm);
}

.wsp-checkout__notes-field textarea.wsp-float-field__input {
	min-height: 100px;
}

/* =========================================================================
   Terms
   ========================================================================= */

.wsp-checkout__terms {
	font-size: var(--wsp-font-size-sm);
	color: var(--wsp-color-text-muted);
	margin-bottom: var(--wsp-space-lg);
	line-height: var(--wsp-line-height);
}

.wsp-checkout__terms a {
	color: var(--wsp-color-accent);
}

/* =========================================================================
   Action buttons
   ========================================================================= */

.wsp-checkout__actions {
	margin-top: var(--wsp-space-xl);
}

.wsp-checkout__actions--split {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.wsp-checkout__continue,
.wsp-checkout__submit {
	padding: var(--wsp-space-md) var(--wsp-space-2xl);
	font-size: var(--wsp-font-size-base);
	border-radius: var(--wsp-radius-sm);
	min-width: 200px;
	background: var(--wsp-color-text);
	color: var(--wsp-color-white);
	border: none;
	cursor: pointer;
	font-weight: var(--wsp-font-weight-medium);
	transition: opacity var(--wsp-transition-fast);
}

.wsp-checkout__continue:hover,
.wsp-checkout__submit:hover {
	opacity: 0.85;
}

.wsp-checkout__continue:focus-visible,
.wsp-checkout__submit:focus-visible {
	outline: 2px solid var(--wsp-color-accent);
	outline-offset: 2px;
}

.wsp-checkout__continue.is-loading,
.wsp-checkout__submit.is-loading {
	opacity: 0.6;
	pointer-events: none;
	cursor: wait;
}

.wsp-checkout__back-link {
	background: none;
	border: none;
	color: var(--wsp-color-accent);
	font-size: var(--wsp-font-size-sm);
	cursor: pointer;
	padding: 0;
}

.wsp-checkout__back-link:hover {
	text-decoration: underline;
}

.wsp-checkout__back-link:focus-visible {
	outline: 2px solid var(--wsp-color-accent);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Empty cart */
.wsp-checkout__empty {
	text-align: center;
	padding: var(--wsp-space-3xl);
}

/* =========================================================================
   Mobile: Collapsible order summary
   ========================================================================= */

.wsp-checkout__mobile-toggle {
	display: none;
}

/* =========================================================================
   Notices (WC error messages)
   ========================================================================= */

.wsp-checkout .woocommerce-error,
.wsp-checkout .woocommerce-message,
.wsp-checkout .woocommerce-info {
	list-style: none;
	padding: var(--wsp-space-md);
	margin: 0 0 var(--wsp-space-lg);
	border-radius: var(--wsp-radius-sm);
	font-size: var(--wsp-font-size-sm);
}

.wsp-checkout .woocommerce-error {
	background: var(--wsp-color-error-bg);
	border: 1px solid var(--wsp-color-error-border);
	color: var(--wsp-color-error-text);
}

/* =========================================================================
   Responsive: Tablet & Mobile
   ========================================================================= */

/* =========================================================================
   Tablet (≤ 1024px) — single column, collapsible sidebar
   ========================================================================= */

@media (max-width: 1024px) {
	.wsp-checkout__layout {
		grid-template-columns: 1fr;
	}

	/* Kill the dark background pseudo-element */
	.wsp-checkout__layout::after {
		display: none;
	}

	.wsp-checkout__sidebar {
		display: none;
	}

	/* Mobile order summary toggle */
	.wsp-checkout__mobile-toggle {
		display: block;
		background: #1a1a1a;
	}

	.wsp-checkout__mobile-toggle-btn {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: var(--wsp-space-md) var(--wsp-space-lg);
		background: none;
		border: none;
		color: var(--wsp-color-white);
		font-size: var(--wsp-font-size-sm);
		cursor: pointer;
	}

	.wsp-checkout__mobile-toggle-text {
		display: flex;
		align-items: center;
		gap: var(--wsp-space-xs);
	}

	.wsp-checkout__mobile-toggle-text svg {
		transition: transform var(--wsp-transition-fast);
	}

	.wsp-checkout__mobile-toggle-btn[aria-expanded="true"] .wsp-checkout__mobile-toggle-text svg {
		transform: rotate(180deg);
	}

	.wsp-checkout__mobile-toggle-total {
		color: var(--wsp-color-white);
		font-size: var(--wsp-font-size-base);
		font-weight: var(--wsp-font-weight-semibold);
	}

	.wsp-checkout__mobile-sidebar {
		background: #1a1a1a;
		padding: 0 var(--wsp-space-lg) var(--wsp-space-lg);
	}

	.wsp-checkout__layout {
		min-height: auto;
	}

	/* Form content — centered with comfortable padding */
	.wsp-checkout__main {
		padding: var(--wsp-space-xl) var(--wsp-space-xl);
		max-width: 600px;
		margin: 0 auto;
	}

	/* Header and footer tighten */
	.wsp-checkout__header {
		padding: var(--wsp-space-md) var(--wsp-space-lg);
	}

	.wsp-checkout__footer {
		padding: var(--wsp-space-md) var(--wsp-space-lg);
	}
}

/* =========================================================================
   Phone (≤ 640px) — stacked fields, full-width buttons
   ========================================================================= */

@media (max-width: 640px) {
	.wsp-checkout__main {
		padding: var(--wsp-space-lg) var(--wsp-space-md);
	}

	/* Stack all fields single column */
	.wsp-checkout__field-grid {
		grid-template-columns: 1fr;
	}

	.wsp-checkout__field-row--3col {
		grid-template-columns: 1fr;
	}

	/* Step indicator: numbers only, no labels */
	.wsp-steps__label {
		display: none;
	}

	.wsp-steps__separator {
		width: var(--wsp-space-md);
	}

	/* Full-width buttons, back link above */
	.wsp-checkout__actions--split {
		flex-direction: column-reverse;
		gap: var(--wsp-space-md);
		align-items: stretch;
		text-align: center;
	}

	.wsp-checkout__continue,
	.wsp-checkout__submit {
		width: 100%;
		min-width: unset;
	}

	/* Smaller headings */
	.wsp-checkout__heading {
		font-size: 20px;
	}

	/* Summary bar tighter */
	.wsp-checkout__summary-table td {
		padding: var(--wsp-space-xs) var(--wsp-space-sm);
		font-size: 13px;
	}

	/* Billing toggle labels */
	.wsp-checkout__billing-option {
		padding: var(--wsp-space-sm) var(--wsp-space-md);
		font-size: 13px;
	}
}

/* =========================================================================
   Empty-cart modal
   ========================================================================= */

.wsp-empty-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--wsp-space-lg);
}

.wsp-empty-modal.is-closed {
	display: none;
}

.wsp-empty-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	animation: wspFadeIn 200ms ease both;
}

.wsp-empty-modal__dialog {
	position: relative;
	background: var(--wsp-color-white);
	border-radius: var(--wsp-radius-lg);
	padding: var(--wsp-space-2xl);
	max-width: 720px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	animation: wspModalIn 250ms cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.wsp-empty-modal__close {
	position: absolute;
	top: var(--wsp-space-md);
	right: var(--wsp-space-md);
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: var(--wsp-color-text-muted);
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--wsp-transition-fast), color var(--wsp-transition-fast);
}

.wsp-empty-modal__close:hover {
	background: var(--wsp-color-bg-muted);
	color: var(--wsp-color-text);
}

.wsp-empty-modal__close:focus-visible {
	outline: 2px solid var(--wsp-color-accent);
	outline-offset: 2px;
}

.wsp-empty-modal__title {
	font-size: var(--wsp-font-size-2xl);
	font-weight: var(--wsp-font-weight-semibold);
	color: var(--wsp-color-text);
	margin: 0 0 var(--wsp-space-xs);
	line-height: 1.2;
	padding-right: var(--wsp-space-xl);
}

.wsp-empty-modal__subtitle {
	font-size: var(--wsp-font-size-md);
	color: var(--wsp-color-text-muted);
	margin: 0 0 var(--wsp-space-xl);
}

.wsp-empty-modal__products {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wsp-space-lg);
	margin-bottom: var(--wsp-space-xl);
}

.wsp-empty-modal__product {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	text-align: center;
	gap: var(--wsp-space-sm);
	padding: var(--wsp-space-md);
	border: 1px solid var(--wsp-color-border-light);
	border-radius: var(--wsp-radius-md);
	transition: border-color var(--wsp-transition-fast), transform var(--wsp-transition-fast);
}

.wsp-empty-modal__product:hover {
	border-color: var(--wsp-color-border);
	transform: translateY(-2px);
}

.wsp-empty-modal__product-thumb {
	display: block;
	aspect-ratio: 1 / 1;
	background: var(--wsp-color-bg-muted);
	border-radius: var(--wsp-radius-sm);
	overflow: hidden;
}

.wsp-empty-modal__product-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wsp-empty-modal__product-name {
	font-size: var(--wsp-font-size-sm);
	font-weight: var(--wsp-font-weight-semibold);
	color: var(--wsp-color-text);
	text-decoration: none;
	line-height: 1.3;
	min-height: 2.6em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wsp-empty-modal__product-name:hover {
	color: var(--wsp-color-accent);
}

.wsp-empty-modal__product-price {
	font-size: var(--wsp-font-size-sm);
	color: var(--wsp-color-text);
	font-weight: var(--wsp-font-weight-medium);
}

.wsp-empty-modal__add-btn {
	margin-top: auto;
	padding: var(--wsp-space-sm) var(--wsp-space-md);
	font-size: var(--wsp-font-size-sm);
}

.wsp-empty-modal__error {
	margin: 0 0 var(--wsp-space-md);
	padding: var(--wsp-space-sm) var(--wsp-space-md);
	background: rgba(220, 38, 38, 0.08);
	border: 1px solid rgba(220, 38, 38, 0.3);
	border-radius: var(--wsp-radius-sm);
	color: var(--wsp-color-error);
	font-size: var(--wsp-font-size-sm);
	text-align: center;
}

.wsp-empty-modal__footer {
	text-align: center;
	padding-top: var(--wsp-space-md);
	border-top: 1px solid var(--wsp-color-border-light);
}

.wsp-empty-modal__shop-link {
	color: var(--wsp-color-accent);
	text-decoration: none;
	font-size: var(--wsp-font-size-sm);
	font-weight: var(--wsp-font-weight-medium);
}

.wsp-empty-modal__shop-link:hover {
	text-decoration: underline;
}

@keyframes wspFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes wspModalIn {
	from { opacity: 0; transform: scale(0.95) translateY(10px); }
	to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 640px) {
	.wsp-empty-modal__dialog {
		padding: var(--wsp-space-xl) var(--wsp-space-lg);
	}

	.wsp-empty-modal__title {
		font-size: var(--wsp-font-size-xl);
	}

	.wsp-empty-modal__products {
		grid-template-columns: 1fr;
		gap: var(--wsp-space-md);
	}

	.wsp-empty-modal__product {
		flex-direction: row;
		text-align: left;
		align-items: center;
	}

	.wsp-empty-modal__product-thumb {
		width: 80px;
		aspect-ratio: 1 / 1;
		flex-shrink: 0;
	}

	.wsp-empty-modal__product-name {
		min-height: 0;
	}

	.wsp-empty-modal__add-btn {
		align-self: center;
		flex-shrink: 0;
	}
}

/* =========================================================================
   Reduced motion
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
	.wsp-checkout__step {
		animation: none;
	}

	.wsp-checkout__mobile-toggle-text svg {
		transition: none;
	}

	.wsp-empty-modal__overlay,
	.wsp-empty-modal__dialog {
		animation: none;
	}
}
