/* Shared theme-aware header styles — all header layouts use these tokens */

.hdr-shell {
    background-color: var(--card-light, #fff);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    overflow: visible;
}

.hdr-nav-strip {
    overflow: visible;
}

/* Set by the auto-fit script in _HeaderNavDesktop: whatever does not fit on the strip is hidden
   here and shown as a plain link inside the "more" panel instead. !important because the strip
   itself is a flex row whose children carry display utilities. */
.hdr-nav-item--hidden {
    display: none !important;
}

/* Push "more" to the right so the categories read as one run from the left edge. */
.hdr-nav-more {
    margin-left: auto;
}

.hdr-nav-dropdown {
    z-index: 1100;
}

/* Boutique — centered logo with fluid left/right wings */
.hdr-boutique-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.5rem;
    height: 4rem;
}

@media (min-width: 1024px) {
    .hdr-boutique-top {
        column-gap: 1rem;
    }
}

.hdr-boutique-wing {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
    flex-wrap: nowrap;
}

.hdr-boutique-wing--left {
    gap: 0.5rem;
}

.hdr-boutique-wing--right {
    justify-content: flex-end;
    gap: 0.125rem;
}

.hdr-boutique-search-slot {
    display: none;
    flex: 1 1 0%;
    min-width: 0;
}

@media (min-width: 1024px) {
    .hdr-boutique-search-slot {
        display: flex;
    }
}

.hdr-boutique-logo {
    flex-shrink: 0;
    padding-inline: 0.5rem;
    z-index: 1;
}

@media (min-width: 1024px) {
    .hdr-boutique-logo {
        padding-inline: 1rem;
    }
}

.hdr-shell-blur {
    background-color: color-mix(in srgb, var(--card-light, #fff) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.hdr-promo {
    background-color: var(--primary-color);
    color: #fff;
}

.hdr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    transition: background-color 150ms, color 150ms;
}

.hdr-icon-btn:hover {
    background-color: color-mix(in srgb, var(--primary-color) 10%, var(--background-color, #f9fafb));
    color: var(--text-main);
}

.hdr-nav-link {
    display: block;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    transition: color 150ms, background-color 150ms;
    white-space: nowrap;
}

button.hdr-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    line-height: 1.25;
}

button.hdr-nav-link .material-symbols-outlined {
    font-size: 1rem;
    line-height: 1;
}

.hdr-nav-link:hover,
.hdr-nav-link.is-active {
    color: var(--primary-color);
    background-color: color-mix(in srgb, var(--primary-color) 8%, transparent);
}

.hdr-nav-link-sm {
    font-size: 0.8125rem;
    padding: 0.375rem 0.625rem;
}

.hdr-dropdown {
    background: var(--card-light);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.hdr-dropdown-overflow {
    min-width: 18rem;
    width: max-content;
}

.hdr-dropdown-link {
    display: block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    transition: background-color 150ms, color 150ms;
    white-space: nowrap;
}

.hdr-dropdown-link:hover {
    background-color: color-mix(in srgb, var(--primary-color) 8%, var(--background-color));
    color: var(--text-main);
}

.hdr-dropdown-link-strong {
    font-weight: 600;
    color: var(--text-main);
}

.hdr-search {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    font-size: 0.875rem;
    color: var(--text-main);
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    transition: box-shadow 150ms, border-color 150ms;
}

.hdr-search:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.hdr-search-square {
    border-radius: 0.75rem;
}

.hdr-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary-color);
    border-radius: 9999px;
    transition: background-color 150ms, transform 150ms, opacity 150ms;
}

.hdr-btn-primary:hover {
    background-color: var(--primary-hover, var(--primary-color));
    opacity: 0.95;
}

.hdr-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    transition: border-color 150ms, background-color 150ms;
}

.hdr-btn-outline:hover {
    border-color: var(--primary-color);
    background-color: color-mix(in srgb, var(--primary-color) 6%, transparent);
}

.hdr-divider {
    width: 1px;
    height: 1rem;
    background-color: var(--border-color);
}

.hdr-mobile-panel {
    background: var(--card-light);
    border-left: 1px solid var(--border-color);
}

.hdr-mega-panel {
    min-width: 28rem;
    padding: 1rem;
}

.hdr-mega-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem;
}

/* ── Automotive Clean header (3-tier: promo / main / category strip) ── */

.hdr-auto-shell {
    position: sticky;
    top: 0;
    z-index: 1000;
    isolation: isolate;
}

/* Full-bleed instead of the 1280px page container: with eleven top categories the nav strip
   had nowhere to go, and on a wide monitor the header was a narrow island in the middle. */
.hdr-auto-container {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .hdr-auto-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .hdr-auto-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.hdr-auto {
    background: var(--background-dark, #1a1d24);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow: visible;
}

.hdr-auto .hdr-nav-dropdown {
    z-index: 1100;
}

.hdr-auto-main {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hdr-auto-main__inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 4.25rem;
}

@media (min-width: 1024px) {
    .hdr-auto-main__inner {
        gap: 1.25rem;
        min-height: 4.5rem;
    }
}

.hdr-auto-logo {
    flex-shrink: 0;
}

.hdr-auto-search {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 42rem;
}

.hdr-auto-search__input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.75rem;
    font-size: 0.9375rem;
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    transition: border-color 150ms, background-color 150ms, box-shadow 150ms;
}

.hdr-auto-search__input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.hdr-auto-search__input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #f39c12) 35%, transparent);
}

.hdr-auto-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-left: auto;
}

.hdr-auto-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    border-radius: 9999px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background-color 150ms, color 150ms, border-color 150ms;
    white-space: nowrap;
}

.hdr-auto-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.16);
}

.hdr-auto-action--icon {
    padding: 0.5rem;
    border-radius: 9999px;
}

.hdr-auto-action--cart {
    position: relative;
}

/* headers.css is loaded after tailwind.css, so ".hdr-auto-action { display: inline-flex }" beats
   a bare ".hidden" on a specificity tie and the responsive utilities on these buttons silently
   did nothing — every action stayed on screen at 390px and pushed the row past the viewport.
   Matching on both classes puts the utilities back in charge without touching load order. */
.hdr-auto-action.hidden {
    display: none;
}

@media (min-width: 640px) {
    .hdr-auto-action.hidden.sm\:inline-flex {
        display: inline-flex;
    }
}

@media (min-width: 768px) {
    .hdr-auto-action.md\:hidden {
        display: none;
    }
}

.hdr-auto-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.15rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.2rem;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    color: #fff;
    background: var(--primary-color, #f39c12);
    border-radius: 9999px;
}

.hdr-auto-nav {
    background: var(--background-dark, #1a1d24);
    overflow: visible;
    position: relative;
    z-index: 20;
}

.hdr-auto-nav .relative.group:hover,
.hdr-auto-nav .relative.group:focus-within {
    z-index: 100;
}

.hdr-auto-nav__scroll {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    overflow: visible;
    padding: 0.55rem 0;
}

.hdr-auto-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.75rem;
    min-height: 2.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    border-radius: 0.375rem;
    white-space: nowrap;
    font-family: inherit;
}

button.hdr-auto-nav-link {
    border: none;
    background: transparent;
    cursor: pointer;
}

.hdr-auto-nav-link:hover,
.hdr-auto-nav-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.hdr-auto-nav-link .material-symbols-outlined {
    font-size: 1rem;
    line-height: 1;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.hdr-auto-nav .relative.group {
    flex-shrink: 0;
}

.hdr-auto-mobile-search {
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 768px) {
    .hdr-auto-mobile-search {
        display: none;
    }
}

/* Locale / user controls on dark automotive bar */
.hdr-auto-actions .relative > button,
.hdr-auto-actions [x-data] > button {
    color: rgba(255, 255, 255, 0.88) !important;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
}

.hdr-auto-actions .relative > button:hover,
.hdr-auto-actions [x-data] > button:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

/* ── Knight Rider scanner ────────────────────────────────────────────────────
   A thin strip under the header with a red "eye" sweeping side to side.

   The signature of the original is the easing, not the movement: the light
   decelerates at each end and accelerates through the middle, so the sweep is
   driven by ease-in-out with `alternate` rather than a constant slide. The eye
   is a bright core with a long gradient tail on both sides, and it dims as it
   turns around — a fixed-brightness block reads as a loading bar instead.

   Animated with transform + opacity only, so it stays on the compositor and
   costs nothing on scroll. */

.hdr-scanner {
    position: relative;
    height: 2px;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(225, 6, 0, 0.10) 50%,
        rgba(0, 0, 0, 0.55) 100%
    );
}

.hdr-scanner__eye {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    /* Wide enough for a visible tail; the core sits in the middle of it. */
    width: 22%;
    min-width: 120px;
    border-radius: 9999px;
    background: linear-gradient(
        90deg,
        rgba(225, 6, 0, 0) 0%,
        rgba(225, 6, 0, 0.45) 35%,
        #ff2a20 50%,
        rgba(225, 6, 0, 0.45) 65%,
        rgba(225, 6, 0, 0) 100%
    );
    box-shadow:
        0 0 6px rgba(255, 42, 32, 0.85),
        0 0 18px rgba(225, 6, 0, 0.55);
    will-change: transform, opacity;
    animation:
        hdr-scanner-sweep 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate,
        hdr-scanner-pulse 1.3s ease-in-out infinite;
}

@keyframes hdr-scanner-sweep {
    from { transform: translateX(-12%); }
    /* Travels the full strip minus its own width, so the eye never clips off. */
    to   { transform: translateX(calc(100vw - 100% + 12%)); }
}

/* Dips at the turnaround points, where the sweep is slowest. */
@keyframes hdr-scanner-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

/* A sweeping light is exactly the kind of motion that triggers discomfort;
   leave the strip lit but still. */
@media (prefers-reduced-motion: reduce) {
    .hdr-scanner__eye {
        animation: none;
        left: 50%;
        transform: translateX(-50%);
        opacity: 0.8;
    }
}
