/* header.css — cabecera: barra de estado, barra principal, mega-menú y cajón móvil.
   Mobile-first. Breakpoint de escritorio: 1024px (coincide con header.js). */
:root { --header-h: 64px; }
.ico { flex: 0 0 auto; vertical-align: middle; }

/* ── Barra de estado (arriba del todo) ───────────────────────── */
.gtop { background: var(--c-dark); color: #cfd8dc; font-size: .8rem; }
.gtop__in { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 34px; }
.gtop a { color: inherit; text-decoration: none; }
.gtop__store { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #fff; }
.gtop__dot { width: 8px; height: 8px; border-radius: 50%; background: #e0a458; box-shadow: 0 0 0 3px rgba(224,164,88,.18); }
.gtop__store.is-open .gtop__dot { background: #36d39a; box-shadow: 0 0 0 3px rgba(54,211,154,.2); }
.gtop__addr { font-weight: 400; color: #9fb0b7; }
.gtop__props { display: none; list-style: none; margin: 0 auto; padding: 0; gap: 22px; }
.gtop__props li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.gtop__store, .gtop__wa { white-space: nowrap; }
.gtop__props .ico { color: #7ef0cf; }
.gtop__wa { display: none; align-items: center; gap: 6px; font-weight: 650; color: #fff !important; }
@media (max-width: 559px) { .gtop__addr { display: none; } }
@media (max-width: 1279px) { .gtop__addr, .gtop__props li:nth-child(3) { display: none !important; } }
@media (min-width: 1024px) {
  .gtop__in { justify-content: space-between; }
  .gtop__props { display: flex; }
  .gtop__wa { display: inline-flex; }
}

/* ── Barra principal ───────────────────────────────────────── */
.gh { position: sticky; top: 0; z-index: 90; background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--c-border); transition: box-shadow .2s; }
.gh.is-scrolled { box-shadow: 0 8px 26px rgba(21,27,32,.08); }
.gh__bar { display: flex; align-items: center; gap: 8px; min-height: 60px; }
.gh__burger, .gh__cart, .gh__search, .gh__club, .gh__login { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px;
  border-radius: 12px; border: 0; background: transparent; color: var(--c-dark); font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: none; }
.gh__burger:hover, .gh__cart:hover, .gh__search:hover { background: var(--c-bg); }
.gh__logo { display: inline-flex; align-items: center; margin-right: auto; }
.gh__logo img { height: 42px; width: auto; }
.gh__search { order: 3; padding: 0 10px; }
.gh__search-ph, .gh__kbd { display: none; }
.gh__club { order: 4; padding: 0 10px; }
.gh__club-txt { display: none; }
.gh__login { display: none; }
.gh__cart { order: 5; position: relative; padding: 0 10px; }
.gh__cart-txt { display: none; }
.gh__cart .header-cart__count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--c-primary-d); color: #fff;
  font-size: .7rem; font-weight: 800; display: inline-grid; place-items: center; line-height: 1; }
.gh__cart .header-cart__count[hidden] { display: none; }
.gh__club.is-member { color: var(--c-primary-d); }

@media (min-width: 640px) {
  .gh__club-txt { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
  .gh__club-txt b { font-size: .88rem; }
  .gh__club-txt small { font-size: .72rem; font-weight: 600; color: var(--c-muted); }
}
@media (min-width: 1024px) {
  .gh__bar { min-height: 76px; gap: 14px; }
  .gh__burger { display: none; }
  .gh__logo { margin-right: 8px; }
  .gh__logo img { height: 48px; }
  .gh__search { order: 2; flex: 1; max-width: 560px; justify-content: flex-start; gap: 10px; min-height: 48px; padding: 0 14px; margin-right: auto;
    background: var(--c-bg); border: 1.5px solid var(--c-border); border-radius: 999px; color: var(--c-muted); font-weight: 500; transition: border-color .2s, background .2s; }
  .gh__search:hover { background: #fff; border-color: var(--c-primary); }
  .gh__search-ph { display: inline; flex: 1; text-align: left; }
  .gh__kbd { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--c-border); background: #fff; font: 600 .75rem/1 var(--font-body); color: var(--c-muted); }
  .gh__club { padding: 0 12px; border: 1.5px solid #bfe6d8; background: #f0faf6; border-radius: 999px; min-height: 48px; }
  .gh__club:hover { border-color: var(--c-primary); }
  .gh__login { display: inline-flex; padding: 0 10px; color: var(--c-text); order: 4; }
  .gh__login:hover { color: var(--c-primary-d); }
  .gh__cart { border-radius: 999px; background: var(--c-dark); color: #fff; padding: 0 18px; min-height: 48px; }
  .gh__cart:hover { background: #000; }
  .gh__cart-txt { display: inline; }
  .gh__cart .header-cart__count { position: static; background: var(--c-primary-l); color: var(--c-dark); }
}

/* ── Barra de familias + mega-menú (escritorio) ─────────────── */
.gh__nav { display: none; }
@media (min-width: 1024px) {
  .gh__nav { display: block; border-top: 1px solid var(--c-border); }
  .gh__navin { display: flex; align-items: stretch; gap: 4px; min-height: 46px; }
  .gfam { position: static; display: flex; }
  .gfam__link, .gfam__plain { display: inline-flex; align-items: center; gap: 4px; padding: 0 14px; color: var(--c-dark); font-weight: 700; font-size: .94rem; text-decoration: none;
    border-bottom: 2.5px solid transparent; transition: color .15s, border-color .15s; }
  .gfam__link .ico { transition: transform .2s; color: var(--c-slate); }
  .gfam__link:hover, .gfam__plain:hover, .gfam.is-open .gfam__link { color: var(--c-primary-d); border-bottom-color: var(--c-primary); }
  .gfam.is-open .gfam__link .ico { transform: rotate(90deg); color: var(--c-primary-d); }
  .gfam__plain--club { margin-left: auto; color: var(--c-primary-d); }

  .mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-top: 1px solid var(--c-border); box-shadow: 0 24px 50px rgba(21,27,32,.14);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s, transform .18s, visibility 0s .18s; }
  .gfam.is-open .mega { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .18s; }
  .mega__in { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.15fr) 240px; gap: 36px; padding-top: 26px; padding-bottom: 28px; }
  .mega__eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--c-primary-d); font-weight: 750; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
  .mega__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }
  .mega__list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--c-text); transition: background .15s; }
  .mega__list a:hover, .mega__list a:focus-visible { background: var(--c-bg); }
  .mega__list strong { display: block; font-size: .95rem; color: var(--c-dark); }
  .mega__list small { display: block; font-size: .8rem; color: var(--c-muted); margin-top: 1px; }
  .mega__list em { font-style: normal; font-size: .75rem; font-weight: 750; color: var(--c-muted); background: var(--c-bg); border-radius: 99px; padding: 3px 8px; }
  .mega__list a:hover em { background: #fff; color: var(--c-primary-d); }
  .mega__all { display: inline-flex; align-items: center; gap: 6px; margin: 14px 12px 0; font-weight: 750; color: var(--c-primary-d); text-decoration: none; }
  .mega__all:hover { text-decoration: underline; }
  .mega__all--sm { margin: 10px 0 0; font-size: .88rem; }
  .mega__h { margin: 0 0 12px; font-weight: 750; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }
  .mega__brands ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mega__brands a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid var(--c-border); text-decoration: none; color: var(--c-dark);
    font-weight: 650; font-size: .86rem; transition: border-color .15s, box-shadow .15s; }
  .mega__brands a:hover { border-color: var(--c-primary); box-shadow: 0 6px 14px rgba(1,125,101,.08); }
  .mega__brands img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #fff; }
  .mega__brands span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; }
  .mega__feat { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 18px; background: linear-gradient(180deg, #f3faf7, #fff);
    border: 1px solid #d6efe5; text-decoration: none; color: var(--c-dark); transition: transform .2s, box-shadow .2s; }
  .mega__feat { align-self: start; }
  .mega__feat:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(1,125,101,.12); }
  .mega__feat img { width: 100%; height: 170px; object-fit: contain; border-radius: 12px; background: #fff; margin-bottom: 6px; }
  .mega__feat small { color: var(--c-muted); font-size: .78rem; font-weight: 650; }
  .mega__feat strong { font-size: .95rem; line-height: 1.3; }
  .mega__feat-price { font: 700 1.15rem/1.2 var(--font-display); color: var(--c-primary-d); margin-top: 2px; }
  .mega__feat-tag { position: absolute; top: 12px; left: 12px; z-index: 1; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    background: var(--c-dark); color: #fff; padding: 4px 9px; border-radius: 99px; }
  .mega__in--guides { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .mega__guide { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; border: 1px solid var(--c-border); text-decoration: none; color: var(--c-dark); transition: border-color .15s, background .15s; }
  .mega__guide .ico { color: var(--c-primary-d); }
  .mega__guide small { color: var(--c-muted); font-size: .84rem; }
  .mega__guide:hover { border-color: var(--c-primary); background: #f6fbf9; }
  .gh.mega-open::after { content: ""; position: fixed; inset: 0; top: auto; height: 0; }
}

/* ── Cajón móvil ───────────────────────────────────────────── */
.mnav { position: fixed; inset: 0; z-index: 120; }
.mnav[hidden] { display: none; }
.mnav__backdrop { position: absolute; inset: 0; background: rgba(10,14,17,.55); opacity: 0; transition: opacity .22s; }
.mnav__panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(420px, 92vw); background: #fff; overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-100%); transition: transform .22s ease; padding: 0 0 24px; display: flex; flex-direction: column; }
.mnav.is-open .mnav__backdrop { opacity: 1; }
.mnav.is-open .mnav__panel { transform: none; }
.mnav__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--c-border); position: sticky; top: 0; background: #fff; z-index: 1; }
.mnav__title { font: 700 1.2rem/1 var(--font-display); color: var(--c-dark); }
.mnav__x { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--c-bg); display: grid; place-items: center; cursor: pointer; color: var(--c-dark); }
.mnav__search { display: flex; align-items: center; gap: 10px; margin: 14px 16px 10px; min-height: 48px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--c-border);
  background: var(--c-bg); color: var(--c-muted); font: inherit; font-size: .95rem; text-align: left; cursor: pointer; }
.mnav__club { display: flex; align-items: center; gap: 12px; margin: 0 16px 12px; padding: 14px; border-radius: 16px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #0f5b4b, #0b2f28); }
.mnav__club span { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.mnav__club small { opacity: .85; font-size: .8rem; }
.mnav__club .ico:first-child { color: #e6b98a; }
.mnav__fam { border-bottom: 1px solid var(--c-border); }
.mnav__fam summary { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; list-style: none; cursor: pointer; font-weight: 750; font-size: 1.02rem; color: var(--c-dark); }
.mnav__fam summary::-webkit-details-marker { display: none; }
.mnav__fam summary span { flex: 1; }
.mnav__fam summary .ico:first-child { color: var(--c-primary-d); }
.mnav__fam summary .ico:last-child { transition: transform .2s; color: var(--c-slate); }
.mnav__fam[open] summary .ico:last-child { transform: rotate(90deg); }
.mnav__fam ul { list-style: none; margin: 0; padding: 0 8px 10px 48px; }
.mnav__fam a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 10px; border-radius: 10px; color: var(--c-text); text-decoration: none; font-size: .95rem; }
.mnav__fam a:active { background: var(--c-bg); }
.mnav__fam em { font-style: normal; font-size: .75rem; color: var(--c-muted); }
.mnav__all { font-weight: 750; color: var(--c-primary-d) !important; }
.mnav__links { display: grid; padding: 8px 8px 0; }
.mnav__links a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: 10px; color: var(--c-dark); text-decoration: none; font-weight: 650; }
.mnav__links .ico { color: var(--c-primary-d); }
.mnav__store { margin: auto 16px 0; padding-top: 16px; display: grid; gap: 10px; }
.mnav__store .gtop__store { color: var(--c-dark); font-size: .9rem; }
.mnav__store .btn { justify-content: center; gap: 8px; }
@media (min-width: 1024px) { .mnav { display: none !important; } }
body.nav-open { overflow: hidden; }
body.nav-open .order-fab, body.nav-open .wa-float, body.nav-open .back-to-top { display: none !important; }

/* Buscador: búsquedas populares */
.search-overlay__pop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-size: .85rem; color: #cfd8dc; }
.search-overlay__pop a { padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; font-weight: 600; }
.search-overlay__pop a:hover { background: rgba(255,255,255,.22); }

/* Otros elementos que dependían de la altura antigua de la cabecera */
/* El carrito ya está siempre visible en la cabecera fija: sobra el botón flotante. */
.order-fab { display: none !important; }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

@media (prefers-reduced-motion: reduce) {
  .mega, .mnav__panel, .mnav__backdrop, .gfam__link .ico { transition: none !important; }
}
/* Capas: el carrito y el buscador van por encima de la cabecera fija; con el carrito abierto
   sobran los flotantes. */
.order-drawer { z-index: 130 !important; }
.search-overlay { z-index: 140; }
body.cart-open .wa-float, body.cart-open .pdp-sticky { display: none !important; }
