/* ============================================================
   ESCENA — shared site header (redesign)
   Layout, top → bottom:
     1. .brand-strip  — thin, subtle moving strip of brand logos
     2. .world-tabs   — BMX / MTB / Skate (kept as-is)
     3. .header-main  — desktop: nav with the wordmark CENTERED between
                        the category links (Bicicletas · Partes · Arma tu
                        BMX · [LOGO] · Protecciones · Ropa · Promo).
                        mobile: burger (left) · centered wordmark · cart
                        (right), links collapse into a slide-down menu.
   Scoped under .site-header so it cleanly overrides each page's older
   inline nav CSS. --gold falls back to its hex in case a page's :root
   doesn't define it (index.html does).
   ============================================================ */

/* ---- 1. Brand strip (subtle moving marquee, very top) ----
   Small white chips on a dark band — thin/subtle, but each logo stays in its
   natural colours (the logos are a mix of transparent PNGs and white-background
   JPEGs, so a single tint/invert can't work for both). */
/* No backdrop-filter here: combined with overflow:hidden and the child's
   infinite transform animation, iOS Safari's compositor can freeze the
   marquee after the first paint. Not needed anyway at .94 opacity — the
   blur added nothing visible over the already near-solid background. */
.brand-strip { background: rgba(10, 10, 10, .48); overflow: hidden; padding: 9px 0; }
.brand-strip-track { display: flex; width: max-content; animation: bsScroll 60s linear infinite; will-change: transform; -webkit-transform: translateZ(0); transform: translateZ(0); }
@media (hover: hover) and (pointer: fine) { .brand-strip:hover .brand-strip-track { animation-play-state: paused; } }
.brand-strip-group { display: flex; align-items: center; flex-shrink: 0; }
.brand-strip .bs-chip { display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin: 0 .4rem; }
.brand-strip .bs-chip img { display: block; height: 44px; width: auto; max-width: 152px; object-fit: contain; background: #fff; border-radius: 6px; padding: 5px 14px; opacity: .9; transition: opacity .2s; }
@media (hover: hover) and (pointer: fine) { .brand-strip .bs-chip:hover img { opacity: 1; } }
@keyframes bsScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 640px) { .brand-strip { padding: 7px 0; } .brand-strip .bs-chip img { height: 32px; max-width: 112px; padding: 4px 10px; } }
@media (prefers-reduced-motion: reduce) { .brand-strip-track { animation: none; } }

/* ---- Header shell ----
   Always a translucent black (frosted) bar, matching the dark brand strip
   above it — not just on scroll. Scrolling just deepens it slightly for
   contrast/depth. The wordmark (black fill, white outline) and all nav
   text/icons are light so they stay legible against the dark background. */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 10, .48);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  transition: box-shadow .3s, background-color .4s;
}
.site-header.scrolled {
  background: rgba(10, 10, 10, .6);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
}
/* ---- 3. Main row (now renders first — world tabs sit under the logo) ---- */
.site-header .header-main { position: relative; display: flex; align-items: center; justify-content: center; padding: .18rem 1.5rem; transition: padding .3s; }
.site-header.scrolled .header-main { padding-top: .05rem; padding-bottom: .05rem; }

/* ---- 2. World tabs (BMX / MTB / Skate) — directly under the centered wordmark ---- */
.site-header .world-tabs { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .1rem 1rem .35rem; transition: padding .3s; }
.site-header.scrolled .world-tabs { padding-top: .05rem; padding-bottom: .18rem; }
.site-header .world-tab { font-family: 'Bebas Neue', sans-serif; font-size: .95rem; letter-spacing: .12em; color: rgba(255, 255, 255, .55); text-decoration: none; padding: .05rem .1rem .15rem; border-bottom: 2.5px solid transparent; transition: color .2s, border-color .2s; }
.site-header .world-tab:hover { color: #fff; }
.site-header .world-tab.is-active { color: #fff; border-bottom-color: var(--gold, #C79A3A); }
.site-header .world-sep { width: 1px; height: 12px; background: rgba(255, 255, 255, .25); }

/* wordmark (shared img rule — resets the legacy circular-avatar styling that
   some pages still carry on ".brand img") */
.site-header .brand { display: inline-flex; align-items: center; text-decoration: none; }
.site-header .brand-logo { width: clamp(130px, 18vw, 260px); height: auto; display: block; border-radius: 0; background: none; border: none; transition: width .3s; }
.site-header.scrolled .brand-logo { width: clamp(105px, 13vw, 190px); }
/* the centered wordmark inside the nav (desktop); a separate .brand-mobile is
   shown in the bar on small screens */
.site-header .nav-brand { margin: 0 1.2rem; }
.site-header .brand-mobile { display: none; }

/* social icons pinned left (desktop only — burger owns that corner on mobile) */
.site-header .header-social { position: absolute; left: 1.5rem; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: .55rem; }
.site-header .header-social a { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: rgba(255, 255, 255, .75); transition: color .2s; }
.site-header .header-social a:hover { color: #fff; }
.site-header .header-social svg { width: 17px; height: 17px; fill: currentColor; }

/* actions pinned right */
.site-header .header-actions { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: .6rem; }
.site-header .search-btn { width: 38px; height: 38px; background: none; border: 0; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.site-header .search-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.site-header .cart-btn { position: relative; width: 38px; height: 38px; background: none; border: 0; color: #fff; cursor: pointer; }
.site-header .cart-btn svg { width: 23px; height: 23px; }
.site-header .cart-badge { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--gold, #C79A3A); color: #fff; font-size: .6rem; font-weight: 800; line-height: 16px; text-align: center; }
.site-header .burger { display: none; position: absolute; left: 1.5rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; line-height: 1; }

/* search panel — slides down from the header-actions corner */
.site-header .header-search-panel {
  display: none; position: absolute; top: 100%; right: 1.5rem; margin-top: .6rem;
  background: #fff; border-radius: 10px; box-shadow: 0 20px 45px rgba(0,0,0,.22);
  padding: .5rem; gap: .4rem; z-index: 70; width: min(320px, calc(100vw - 3rem));
}
.site-header .header-search-panel.open { display: flex; }
.site-header .header-search-panel input {
  flex: 1; border: 1.5px solid var(--line, #ececeb); border-radius: 7px; padding: .6rem .75rem;
  font-family: inherit; font-size: .85rem; color: var(--ink, #0A0A0A); background: #fff;
}
.site-header .header-search-panel input:focus { outline: none; border-color: var(--ink, #0A0A0A); }
.site-header .header-search-panel button {
  flex-shrink: 0; width: 40px; border-radius: 7px; border: none; background: var(--ink, #0A0A0A);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.site-header .header-search-panel button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* category links */
.site-header .nav-links { display: flex; align-items: center; justify-content: center; gap: .1rem; }
.site-header .nav-links > a, .site-header .nav-drop > a { color: #fff; font-family: 'Bebas Neue', sans-serif; font-size: 1rem; font-weight: 400; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; padding: .5rem .7rem; border-radius: 0; border-bottom: 2.5px solid transparent; transition: color .2s, background .2s, border-color .2s; white-space: nowrap; }
.site-header .nav-links > a:hover, .site-header .nav-drop > a:hover { background: rgba(255, 255, 255, .12); }
.site-header .nav-links > a.active, .site-header .nav-drop.active > a { color: #fff; border-bottom-color: var(--gold, #C79A3A); }
.site-header .nav-promo { color: var(--gold, #C79A3A) !important; }

/* dropdowns (Partes / Protecciones / Ropa) */
.site-header .nav-drop { position: relative; }
.site-header .nav-drop > a { display: inline-flex; align-items: center; gap: .35rem; }
.site-header .nav-drop .caret { display: inline-block; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); position: relative; top: -2px; }
.site-header .nav-drop-menu { display: none; }
.site-header .nav-drop-toggle { display: none; }
@media (min-width: 981px) {
  .site-header .nav-drop-menu { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 45px rgba(0,0,0,.18); padding: .5rem; min-width: 220px; z-index: 60; max-height: min(74vh, 560px); overflow-y: auto; }
  .site-header .nav-drop:hover .nav-drop-menu, .site-header .nav-drop:focus-within .nav-drop-menu { display: block; }
  .site-header .nav-drop-menu a { display: block; color: var(--ink) !important; font-weight: 600 !important; font-size: .78rem !important; letter-spacing: 0 !important; text-transform: none !important; padding: .55rem .75rem !important; border-radius: 7px; background: none !important; border-bottom: none !important; }
  .site-header .nav-drop-menu a:hover { background: var(--panel) !important; color: var(--ink) !important; }
  /* Partes menu: 3 zone columns so it stays short. Scoped to #navDropMenu so
     Protecciones / Ropa (few items) keep their single column. */
  .site-header #navDropMenu { left: 50%; transform: translateX(-50%); min-width: 480px; grid-template-columns: repeat(3, minmax(150px, 1fr)); column-gap: .4rem; }
  .site-header .nav-drop:hover #navDropMenu, .site-header .nav-drop:focus-within #navDropMenu { display: grid; }
  .site-header .nav-drop-col { display: flex; flex-direction: column; }
}

@media (max-width: 980px) {
  .site-header .world-tabs { gap: .8rem; }
  .site-header .header-main { justify-content: center; padding: .4rem 1.5rem; }
  .site-header .burger { display: block; }
  .site-header .header-social { display: none; }
  /* on mobile the centered wordmark lives in the bar, not inside the nav */
  .site-header .nav-brand { display: none; }
  .site-header .brand-mobile { display: inline-flex; }
  .site-header .brand-mobile .brand-logo { width: clamp(130px, 44vw, 260px); max-width: calc(100vw - 140px); }
  .site-header.scrolled .brand-mobile .brand-logo { width: clamp(105px, 34vw, 200px); }
  /* category bar collapses into a slide-down under the header.
     bottom:auto is explicit so a leftover inline `inset:… 0 …` (bottom:0) on
     the category pages can't pin both edges and crush the menu to ~36px. */
  .site-header .nav-links {
    position: absolute; top: 100%; bottom: auto; left: 0; right: 0; z-index: 90;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0;
    background: #fff; padding: .4rem 1.5rem 1.8rem;
    transform: translateY(-135%); transition: transform .3s, visibility 0s .3s;
    box-shadow: 0 14px 26px rgba(0,0,0,.28);
    max-height: calc(100vh - 100px); overflow-y: auto; -webkit-overflow-scrolling: touch;
    visibility: hidden;
  }
  .site-header .nav-links.open { transform: translateY(0); visibility: visible; transition: transform .3s; }
  .site-header .nav-links > a, .site-header .nav-drop > a { width: 100%; padding: 1.05rem .2rem !important; border-bottom: 1px solid var(--line); font-size: .9rem !important; }
  /* the slide-down panel keeps a solid white background regardless of the
     (now always-dark) header, so its links must stay dark to stay legible. */
  .site-header .nav-links > a, .site-header .nav-drop > a { color: var(--ink) !important; }
  .site-header .nav-links > a:hover, .site-header .nav-drop > a:hover { background: var(--panel); }
  .site-header .nav-drop { width: 100%; }
  .site-header .nav-drop > a { padding-right: 3rem !important; }
  .site-header .nav-drop > a .caret { display: none; }
  .site-header .nav-drop-toggle {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 0; right: 0; width: 52px; height: 3.4rem;
    background: none; border: none; padding: 0; margin: 0; cursor: pointer; color: var(--ink);
  }
  .site-header .nav-drop-toggle .caret { display: inline-block; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .25s ease; }
  .site-header .nav-drop-toggle[aria-expanded="true"] .caret { transform: rotate(-135deg); }
  .site-header .nav-drop-menu {
    display: block !important; position: static; background: none; border: none; box-shadow: none; transform: none;
    max-height: 0; overflow: hidden; padding: 0 0 0 .3rem; margin: 0;
    transition: max-height .35s ease;
  }
  .site-header .nav-drop-menu.open { max-height: 1100px; padding: .3rem 0 .7rem .3rem; }
  .site-header .nav-drop-menu a {
    display: block; border-bottom: none !important; background: none !important;
    padding: .6rem .2rem !important; font-size: .8rem !important; letter-spacing: .04em !important;
    text-transform: uppercase !important; font-weight: 700 !important; color: var(--ink) !important;
  }
  .site-header .nav-drop-menu a:hover, .site-header .nav-drop-menu a:active { color: var(--muted) !important; }
}
@media (max-width: 480px) {
  .site-header .header-main { padding-left: 3.6rem; padding-right: 3.6rem; }
  .site-header .header-actions { right: 1rem; }
  .site-header .burger { left: 1rem; }
}
