/*
 * Garage overlay ("Select your car.") and the header car chip, site-wide.
 * Measured from the Shopify theme (docs/PRODUCT-PAGE.md §9). Markup: hrd-core
 * (class-garage.php, blocks/garage-chip); behaviour: hrd-core/assets/garage.js.
 */

/* ---------- Header chip ---------- */
.hrd-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7.5px 12px;
	background: none;
	border: 0;
	color: inherit;
	font: inherit;
	font-size: var(--hrd-menu-size, 14px); /* the menu's type (hrd.css) */
	font-weight: 700;
	line-height: 0.8;
	letter-spacing: var(--hrd-menu-track, -0.02em);
	white-space: nowrap;
	cursor: pointer;
}
.hrd-chip__icon { position: relative; display: block; width: 28px; height: 28px; }
.hrd-chip__icon svg { display: block; width: 28px; height: 28px; }
.hrd-chip__dot {
	position: absolute;
	top: -2px;
	right: -4px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wp--preset--color--sky);
	opacity: 0;
}
.hrd-chip.has-car .hrd-chip__dot { opacity: 1; }
.hrd-chip:focus-visible { outline: 2px solid var(--wp--preset--color--sky); outline-offset: 2px; }
@media (max-width: 1023px), (max-aspect-ratio: 1/1) { /* the phone header's range (hrd.css) */
	.hrd-chip { padding: 7.5px; }
	.hrd-chip__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Overlay ----------
 * docs/SHOP-PAGE.md §8 (the user's rework, 2026-11-08): a tap-through Make -> Model -> Year, then "Your garage".
 * Desktop: a centred panel on the camo. Phones (<=781): a bottom sheet with a handle. */
.hrd-garage { position: fixed; inset: 0; z-index: 100000; }
.hrd-garage[hidden] { display: none; }
html.hrd-garage-open { overflow: hidden; }
.hrd-garage__backdrop { position: absolute; inset: 0; background: rgba(4, 1, 29, 0.72); }
.hrd-garage__panel {
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(680px, calc(100vw - 32px));
	max-height: calc(100dvh - 48px);
	overflow: auto;
	overscroll-behavior: contain;
	transform: translate(-50%, -50%);
	box-sizing: border-box;
	padding: 64px 40px 40px;
	background: var(--wp--preset--color--ink) url("../images/camo-ink.jpg") center / cover;
	border: 1px solid rgba(145, 210, 255, 0.45);
	color: #fff;
	font-family: var(--wp--preset--font-family--helvetica-now);
	letter-spacing: -0.025em;
}
.hrd-garage__panel *, .hrd-garage__panel *::before { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) {
	.hrd-garage__backdrop { animation: hrd-garage-fade 0.15s var(--wp--custom--ease-out); }
	.hrd-garage__panel { animation: hrd-garage-pop 0.18s var(--wp--custom--ease-out); }
}
@keyframes hrd-garage-fade { from { opacity: 0; } }
@keyframes hrd-garage-pop { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } }
.hrd-garage__arrow { position: absolute; top: 16px; left: 16px; width: 40px; height: 40px; color: #fff; pointer-events: none; }
.hrd-garage__arrow svg { display: block; width: 100%; height: 100%; }
.hrd-garage__grab { display: none; }
.hrd-garage__close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; padding: 0; background: none; border: 0; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.hrd-garage :focus-visible { outline: 2px solid var(--wp--preset--color--sky); outline-offset: 2px; }

/* the steps: 01 MAKE · 02 MODEL · 03 YEAR (a step done shows its pick) */
.hrd-garage__steps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; padding: 0; list-style: none; color: rgba(255, 255, 255, 0.45); font-size: 10px; font-weight: 700; line-height: 1.3; letter-spacing: 0.14em; text-transform: uppercase; }
.hrd-garage__steps li { display: flex; gap: 6px; margin: 0; }
.hrd-garage__steps .is-on { color: #fff; }
.hrd-garage__steps .is-done { color: rgba(255, 255, 255, 0.75); }
.hrd-garage__steps .is-on b, .hrd-garage__steps .is-done b { color: var(--wp--preset--color--sky); }
.hrd-garage__kicker { margin: 0 0 10px; font-size: 10px; font-weight: 700; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.14em; color: var(--wp--preset--color--sky); }
.hrd-garage__title { margin: 0 0 14px; font-size: 44px; font-weight: 700; line-height: 0.95; text-transform: uppercase; letter-spacing: -0.01em; color: #fff !important; }
.hrd-garage__hazard { --hz: 16px; display: block; width: calc(var(--hz) * 5.3); height: var(--hz); margin: 0 0 24px; background: repeating-linear-gradient(55deg, var(--wp--preset--color--sky) 0 calc(var(--hz) * 0.33), transparent calc(var(--hz) * 0.33) calc(var(--hz) * 0.56)); }
.hrd-garage__back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: -6px 0 10px; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.hrd-garage__back span { display: block; width: 10px; height: 10px; transform: rotate(-90deg); }
.hrd-garage__back svg { display: block; width: 100%; height: 100%; }
.hrd-garage__back:hover { color: var(--wp--preset--color--sky); }

/* the tap targets */
.hrd-garage__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.hrd-garage__grid li { margin: 0; }
.hrd-garage__grid--models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hrd-garage__grid--years { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.hrd-garage__opt { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; width: 100%; min-height: 60px; margin: 0; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 0; background: rgba(16, 14, 40, 0.92); color: #fff; font: inherit; font-size: 17px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; text-align: left; cursor: pointer; transition: border-color 0.15s ease; }
.hrd-garage__opt small { color: rgba(255, 255, 255, 0.6); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.hrd-garage__opt:hover { border-color: var(--wp--preset--color--sky); }
.hrd-garage__opt:active { background: var(--wp--preset--color--sky); border-color: var(--wp--preset--color--sky); color: var(--wp--preset--color--ink); }
.hrd-garage__opt:active small { color: var(--wp--preset--color--ink); }
.hrd-garage__grid--years .hrd-garage__opt { align-items: center; min-height: 52px; padding: 0; font-size: 16px; }
.hrd-garage__gen { margin: 0 0 18px; }
.hrd-garage__gen:last-child { margin-bottom: 0; }
.hrd-garage__genh { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; color: rgba(255, 255, 255, 0.6); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.hrd-garage__genh b { color: var(--wp--preset--color--sky); font-size: 12px; }
.hrd-garage__help { margin: 22px 0 0; color: rgba(255, 255, 255, 0.6); font-size: 13px; }
.hrd-garage__help a { color: #fff; text-underline-offset: 3px; }

/* your garage */
.hrd-garage__meta { margin: 0 0 22px; color: rgba(255, 255, 255, 0.75); font-size: 10px; font-weight: 700; line-height: 1.5; letter-spacing: 0.14em; text-transform: uppercase; }
.hrd-garage__cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin: 0; padding: 0 20px; border: 0; border-radius: 0; background: var(--wp--preset--color--sky); color: var(--wp--preset--color--ink) !important; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background-color 0.15s ease; }
.hrd-garage__cta:hover { background: #fff; }
.hrd-garage__cta span { display: block; width: 10px; height: 10px; transform: rotate(90deg); }
.hrd-garage__cta svg { display: block; width: 100%; height: 100%; }
.hrd-garage__acts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; }
.hrd-garage__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.hrd-garage__link.is-quiet { color: rgba(255, 255, 255, 0.6); }
.hrd-garage__note { margin: 18px 0 0; font-size: 14px; line-height: 1.4; color: rgba(255, 255, 255, 0.75); }

/* phones: a bottom sheet */
@media (max-width: 781px) {
	.hrd-garage__panel { top: auto; bottom: 0; left: 0; width: 100%; min-height: min(600px, 78svh); max-height: 88svh; padding: 34px 17px calc(24px + env(safe-area-inset-bottom)); transform: none; border-width: 1px 0 0; }
	@media (prefers-reduced-motion: no-preference) {
		.hrd-garage__panel { animation: hrd-garage-up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
	}
	.hrd-garage__grab { display: block; position: absolute; top: 0; left: 50%; width: 44px; height: 44px; margin-left: -22px; touch-action: none; }
	.hrd-garage__grab::before { content: ""; position: absolute; top: 10px; left: 0; width: 44px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); }
	.hrd-garage__arrow { display: none; }
	.hrd-garage__close { top: 6px; right: 4px; }
	.hrd-garage__title { font-size: 34px; }
	.hrd-garage__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hrd-garage__grid--models { grid-template-columns: 1fr; }
	.hrd-garage__grid--years { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.hrd-garage__opt { min-height: 56px; }
}
@keyframes hrd-garage-up { from { transform: translateY(100%); } }

@media (forced-colors: active) {
	.hrd-garage__opt:active { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

/* The phone help link's transparent touch area preserves the text baseline. */
@media (max-width: 781px) {
	.hrd-garage__help a { position: relative; }
	.hrd-garage__help a::before { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
}
