/* ============================================================
   XSHIELD Shop Styles
   Shared design tokens with page-custom-checkout.php so the shop →
   cart → checkout flow feels like one continuous experience.
   Mobile-first: base styles are the small-screen layout, desktop
   rules live inside the min-width media query near the bottom.
   ============================================================ */

.xs-motorsports-shop {
	--primary-color: var(--xs-color-text);
	--accent-color: var(--xs-color-brand);
	--accent-color-dark: var(--xs-color-brand-hover);
	--text-color: var(--xs-color-text);
	--text-muted: var(--xs-color-text-muted);
	--border-color: var(--xs-color-border);
	--bg-light: var(--xs-color-surface);
	--success-color: var(--xs-success);
	--error-color: var(--xs-danger);
	--focus-ring: rgba(205, 24, 29, 0.2);
	--radius: var(--xs-radius-lg);
	--radius-sm: var(--xs-radius-md);
	--transition: all var(--xs-duration-fast) var(--xs-ease-standard);

	max-width: 1000px;
	margin: 0 auto;
	padding: 24px 16px 60px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	color: var(--text-color);
	box-sizing: border-box;
}

.xs-motorsports-shop *,
.xs-motorsports-shop *::before,
.xs-motorsports-shop *::after {
	box-sizing: border-box;
}

/* ---- Selector card ---- */
.xs-shop-selector {
	background: var(--xs-white);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	padding: 24px 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.xs-shop-title {
	font-size: 22px;
	font-weight: 700;
	text-align: center;
	color: var(--primary-color);
	margin: 0 0 8px;
	letter-spacing: -0.01em;
}

.xs-shop-subtitle {
	font-size: 14px;
	color: var(--text-muted);
	text-align: center;
	margin: 0 0 24px;
	line-height: 1.5;
}

/* ---- Dropdowns ---- */
.xs-dropdown-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.xs-dropdown-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.xs-dropdown-field label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--primary-color);
}

.xs-dropdown-field select {
	width: 100%;
	min-height: 48px;
	padding: 10px 40px 10px 14px;
	font-size: 16px; /* prevents iOS auto-zoom on focus */
	font-family: inherit;
	color: var(--text-color);
	background-color: var(--xs-white);
	border: 1px solid var(--border-color);
	border-radius: var(--radius-sm);
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23666' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 12px center;
	transition: var(--transition);
	cursor: pointer;
}

.xs-dropdown-field select:focus {
	outline: none;
	border-color: var(--accent-color);
	box-shadow: 0 0 0 3px var(--focus-ring);
}

.xs-dropdown-field select:disabled {
	background-color: var(--bg-light);
	color: var(--xs-gray-400);
	cursor: not-allowed;
}

/* ---- Request vehicle ---- */
.xs-request-vehicle {
	text-align: center;
	font-size: 13px;
	color: var(--text-muted);
	margin: 16px 0 0;
}

.xs-request-vehicle a {
	color: var(--accent-color);
	font-weight: 600;
	text-decoration: underline;
}

/* ---- Material description ---- */
.xs-material-description {
	margin-top: 20px;
	padding: 16px 18px;
	background: var(--bg-light);
	border-left: 4px solid var(--accent-color);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.xs-material-description-title {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--accent-color);
	text-transform: uppercase;
	margin-bottom: 8px;
}

.xs-material-description-text {
	font-size: 13px;
	line-height: 1.6;
	color: var(--text-color);
}

.xs-material-description-text .xs-highlight {
	color: var(--accent-color);
	font-weight: 700;
}

/* ---- Vehicle result panel ---- */
.xs-vehicle-result {
	margin-top: 20px;
	background: var(--xs-white);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	padding: 20px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.xs-vehicle-photo {
	width: 100%;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, var(--xs-black), var(--xs-gray-800));
	border-radius: var(--radius-sm);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.xs-vehicle-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.xs-vehicle-photo-placeholder {
	color: var(--xs-gray-500);
	font-size: 13px;
	text-align: center;
	padding: 0 20px;
}

.xs-vehicle-name {
	font-size: 18px;
	font-weight: 700;
	color: var(--primary-color);
	margin-bottom: 6px;
}

.xs-stock-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--success-color);
	margin-bottom: 12px;
}

.xs-stock-status.is-out-of-stock {
	color: var(--error-color);
}

.xs-price {
	font-size: 28px;
	font-weight: 700;
	color: var(--primary-color);
	margin-bottom: 16px;
}

/* ---- Quantity stepper ---- */
.xs-qty-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
}

.xs-qty-row label {
	font-size: 13px;
	font-weight: 600;
	color: var(--primary-color);
}

.xs-qty-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--border-color);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.xs-qty-btn {
	width: 44px;
	height: 44px;
	border: none;
	background: var(--bg-light);
	font-size: 18px;
	font-weight: 600;
	color: var(--primary-color);
	cursor: pointer;
	transition: var(--transition);
}

.xs-qty-btn:hover {
	background: var(--xs-gray-100);
}

.xs-qty-stepper input {
	width: 48px;
	height: 44px;
	border: none;
	border-left: 1px solid var(--border-color);
	border-right: 1px solid var(--border-color);
	text-align: center;
	font-size: 16px;
	font-weight: 600;
	color: var(--text-color);
	-moz-appearance: textfield;
}

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

/* ---- CTA buttons ---- */
.xs-cta-row {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 14px;
}

/* Base button styling (.xs-btn / .xs-btn--primary / .xs-btn--outline) now
   lives globally in base.css. Shop-specific additions only: */
.xs-btn {
	min-height: 50px;
}

.xs-btn--primary:disabled {
	background: var(--xs-gray-300);
	border-color: var(--xs-gray-300);
	cursor: not-allowed;
}

.xs-btn--outline:disabled {
	border-color: var(--xs-gray-300);
	color: var(--xs-gray-300);
	cursor: not-allowed;
}

.xs-shipping-note {
	font-size: 12px;
	color: var(--text-muted);
	text-align: center;
	margin: 0;
}

/* ---- Loading state ---- */
.xs-is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* ============================================================
   Desktop / tablet enhancements
   ============================================================ */
@media (min-width: 640px) {
	.xs-dropdown-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.xs-cta-row {
		flex-direction: row;
	}

	.xs-btn {
		flex: 1;
	}
}

@media (min-width: 900px) {
	.xs-motorsports-shop {
		padding-top: 40px;
	}

	.xs-shop-title {
		font-size: 28px;
	}

	.xs-shop-subtitle {
		font-size: 15px;
	}

	.xs-dropdown-grid {
		grid-template-columns: repeat(4, 1fr);
	}

	.xs-vehicle-result {
		grid-template-columns: 340px 1fr;
		align-items: start;
	}

	.xs-vehicle-photo {
		aspect-ratio: 4 / 3;
	}
}
