/* =========================================================
   OH MAMI — Cabecera editorial
   Barra de servicio · fila de marca (buscador, logo, acciones)
   · fila de navegación con menús a todo el ancho.
   ========================================================= */
:root {
  --hd-line: color-mix(in srgb, var(--forest) 9%, transparent);
  --hd-main: 96px;
  --hd-main-full: 96px;   /* altura sin compactar: la que ocupa siempre la cabecera en la página */
  --hd-nav: 48px;
  /* altura de referencia para anclas y elementos pegajosos (cabecera ya compacta) */
  --header-h: calc(64px + var(--hd-nav));
}

/* ---------- Barra de servicio ---------- */
.utb { position: relative; z-index: 81; background: var(--forest); color: color-mix(in srgb, #fff 82%, var(--sage-300)); font-size: .8rem; letter-spacing: .01em; }
.utb__in { max-width: 1400px; height: 38px; margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; }
.utb svg { width: 15px; height: 15px; flex: none; }
.utb a { display: inline-flex; align-items: center; gap: 8px; color: inherit; transition: color .25s; }
.utb a:hover { color: #fff; }
.utb__side { justify-self: start; }
.utb__side--r { justify-self: end; display: flex; gap: 22px; }
.utb__msgs { position: relative; height: 38px; width: min(480px, 46vw); overflow: hidden; }
.utb__msgs p {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap;
  font-weight: 600; color: #fff; opacity: 0; translate: 0 70%;
  transition: opacity .5s var(--ease), translate .6s var(--ease);
}
.utb__msgs p svg { color: var(--accent); }
.utb__msgs p.on { opacity: 1; translate: 0 0; }
.utb__msgs p.out { opacity: 0; translate: 0 -70%; }

/* ---------- Cabecera ---------- */
.hd {
  position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--cream) 94%, transparent);
  backdrop-filter: saturate(1.3) blur(16px); -webkit-backdrop-filter: saturate(1.3) blur(16px);
  border-bottom: 1px solid var(--hd-line);
  /* Al compactarse, el hueco que deja se compensa con margen (misma duración y curva que la altura):
     la página no cambia de tamaño, el navegador no recoloca el scroll y la cabecera no entra en bucle */
  margin-bottom: calc(var(--hd-main-full) - var(--hd-main));
  transition: translate .5s var(--ease), box-shadow .4s, background .4s, margin-bottom .45s var(--ease);
}
.hd.scrolled { --hd-main: 64px; background: color-mix(in srgb, var(--cream) 97%, transparent); box-shadow: 0 10px 30px -24px rgba(31, 58, 51, .45); }
.hd.hide { translate: 0 -100%; }
.hd.mega-open { background: #FFFDF9; }

.hd__main {
  max-width: 1400px; height: var(--hd-main); margin-inline: auto; padding-inline: var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px;
  transition: height .45s var(--ease);
}
.hd__left { display: flex; align-items: center; gap: 6px; }
.hd__right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

/* Logo */
.hd__logo { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-width: 0; transition: opacity .3s; }
.hd__logo img {
  /* proporción fija del logotipo: Safari en móvil lo estiraba al calcular el ancho */
  display: block; flex: none; aspect-ratio: 600 / 387; width: auto; max-width: none; object-fit: contain;
  height: calc(var(--hd-main) - 8px); margin-block: -10px -14px;
  /* el logotipo original es verde muy claro: lo llevamos al verde bosque de la marca */
  /* logotipo recoloreado en verde bosque (img/logo-oh-mami.png), sin filtros */
  transition: height .45s var(--ease), margin .45s var(--ease);
}
.hd__logo small {
  font-size: .56rem; font-weight: 700; letter-spacing: .34em; text-transform: uppercase; color: var(--sage-600); white-space: nowrap;
  transition: opacity .3s, translate .4s var(--ease);
}
.hd.scrolled .hd__logo img { height: calc(var(--hd-main) + 12px); margin-block: -12px; }
.hd.scrolled .hd__logo small { opacity: 0; translate: 0 -6px; position: absolute; }
.hd__logo:hover { opacity: .75; }

/* Buscador tipo campo */
.hd__search {
  display: inline-flex; align-items: center; gap: 10px; width: min(300px, 100%); height: 40px; padding: 0 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--forest) 22%, transparent);
  color: var(--muted); font-size: .9rem; text-align: left; transition: border-color .3s, color .3s;
}
.hd__search svg { width: 18px; height: 18px; color: var(--forest); flex: none; }
.hd__search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd__search kbd { display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--sage-200); color: var(--sage-600); font: 600 .72rem var(--ff-body); }
.hd__search:hover { border-color: var(--forest); color: var(--ink); }

/* Botones de icono y acciones con etiqueta */
.hd__icon { display: none; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--forest); transition: background .25s; }
.hd__icon svg { width: 22px; height: 22px; }
.hd__icon:hover { background: var(--sage-100); }
.hd__act {
  position: relative; display: inline-grid; justify-items: center; gap: 4px; min-width: 64px; padding: 6px 8px;
  color: var(--forest); font-size: .72rem; font-weight: 600; letter-spacing: .02em; line-height: 1;
}
.hd__act svg { width: 22px; height: 22px; transition: translate .35s var(--ease); }
.hd__act span { position: relative; }
.hd__act span::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform .35s var(--ease); }
.hd__act:hover svg { translate: 0 -2px; }
.hd__act:hover span::after { transform: scaleX(1); }
.hd__act .badge { top: 0; right: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; font-size: .64rem; box-shadow: 0 0 0 2px var(--cream); }
.hd__act--visit { color: var(--muted); }
.hd__act--visit:hover { color: var(--forest); }

/* ---------- Navegación ---------- */
.hd__nav { border-top: 1px solid var(--hd-line); }
.hd__menu { max-width: 1400px; height: var(--hd-nav); margin-inline: auto; padding-inline: var(--gutter); display: flex; justify-content: center; align-items: stretch; gap: clamp(18px, 2.7vw, 44px); }
.hd__menu > li { display: flex; }
.hd__link {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); white-space: nowrap;
  transition: color .25s;
}
.hd__link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--forest);
  transform: scaleX(0); transition: transform .4s var(--ease);
}
.hd__link:hover, .hd__has.open > .hd__link, .hd__link[aria-current="page"] { color: var(--forest); }
.hd__link:hover::after, .hd__has.open > .hd__link::after, .hd__link[aria-current="page"]::after { transform: scaleX(1); }
.hd__link[data-nav="nuevo"] { color: var(--accent-deep); }
.hd__link[data-nav="nuevo"]::after { background: var(--accent-deep); }
.hd__chev { width: 11px; height: 11px; opacity: .6; transition: transform .35s var(--ease), opacity .25s; }
.hd__has.open .hd__chev { transform: rotate(180deg); opacity: 1; }

/* ---------- Menús desplegables ---------- */
.hd__mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #FFFDF9; border-top: 1px solid var(--hd-line);
  box-shadow: 0 40px 60px -40px rgba(31, 58, 51, .45);
  opacity: 0; visibility: hidden; clip-path: inset(0 0 100% 0);
  transition: opacity .3s var(--ease), clip-path .45s var(--ease), visibility 0s .45s;
}
.hd__has.open > .hd__mega { opacity: 1; visibility: visible; clip-path: inset(0 0 -60px 0); transition-delay: 0s; }
.mg {
  max-width: 1320px; margin-inline: auto; padding: 34px var(--gutter) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 290px; column-gap: clamp(28px, 4vw, 64px);
}
.mg > * { opacity: 0; translate: 0 8px; transition: opacity .4s var(--ease), translate .5s var(--ease); }
.hd__has.open .mg > * { opacity: 1; translate: 0 0; }
.hd__has.open .mg > :nth-child(2) { transition-delay: .06s; }
.hd__has.open .mg > :nth-child(3) { transition-delay: .1s; }
.mg__cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; padding-bottom: 26px; }
.mg__h { display: block; margin-bottom: 12px; font-family: var(--ff-display); font-size: 1.12rem; color: var(--forest); transition: color .2s; }
a.mg__h:hover { color: var(--accent-deep); }
.mg__col ul + .mg__h { margin-top: 24px; }
.mg__h--muted { font-family: var(--ff-body); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--sage-600); padding-top: 6px; }
.mg__col ul { display: grid; gap: 2px; }
.mg__col li a { display: inline-block; padding: 5px 0; font-size: .92rem; color: var(--muted); transition: color .2s, translate .3s var(--ease); }
.mg__col li a:hover { color: var(--forest); translate: 4px 0; }
.mg__col--quick { padding-left: 28px; border-left: 1px solid var(--hd-line); }
.mg__col--quick li a { color: var(--ink); font-weight: 600; }

.mg__feat { align-self: start; display: grid; gap: 4px; padding: 12px 12px 16px; margin-bottom: 30px; border-radius: 18px; background: var(--cream-2); transition: opacity .3s, translate .3s; }
.mg__feat.swapping { opacity: .3; }
.mg__img { display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 8px; border-radius: 12px; background: #fff; overflow: hidden; }
.mg__img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; mix-blend-mode: multiply; transition: scale .6s var(--ease); }
.mg__feat:hover .mg__img img { scale: 1.05; }
.mg__feat small { padding-inline: 4px; font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-deep); }
.mg__feat strong { padding-inline: 4px; font-family: var(--ff-display); font-weight: 400; font-size: 1.05rem; line-height: 1.25; color: var(--forest); }
.mg__price { padding-inline: 4px; font-size: .9rem; font-weight: 700; color: var(--sage-700); }

.mg__foot {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 0 20px; border-top: 1px solid var(--hd-line); font-size: .85rem; color: var(--muted);
}
.mg__foot p { display: inline-flex; align-items: center; gap: 8px; }
.mg__foot p svg { width: 16px; height: 16px; color: var(--sage-600); }
.mg__all { display: inline-flex; align-items: center; gap: 10px; font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--forest); }
.mg__all b { padding: 2px 8px; border-radius: 99px; background: var(--sage-100); font-size: .7rem; letter-spacing: .04em; }
.mg__all svg { width: 16px; height: 16px; transition: translate .3s var(--ease); }
.mg__all:hover svg { translate: 4px 0; }

/* Menú de colecciones */
.mg--coll { grid-template-columns: repeat(5, minmax(0, 1fr)) 190px; column-gap: 16px; padding-bottom: 30px; }
.mgc { display: grid; gap: 12px; color: var(--ink); }
.mgc__art {
  position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden;
  background: var(--c-bg);
}
.mgc__art span { position: absolute; width: 62%; aspect-ratio: 1; border-radius: 14px; background: rgba(255, 255, 255, .7); overflow: hidden; box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .35); transition: translate .6s var(--ease), rotate .6s var(--ease); }
.mgc__art span:nth-child(1) { left: 8%; top: 9%; rotate: -5deg; }
.mgc__art span:nth-child(2) { right: 8%; bottom: 9%; rotate: 6deg; }
.mgc__art img { width: 100%; height: 100%; object-fit: contain; padding: 8%; mix-blend-mode: multiply; }
.mgc:hover .mgc__art span:nth-child(1) { translate: -3px -3px; rotate: -8deg; }
.mgc:hover .mgc__art span:nth-child(2) { translate: 3px 3px; rotate: 9deg; }
.mgc small { display: block; font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--c-ink); }
.mgc b { display: block; margin-top: 2px; font-family: var(--ff-display); font-weight: 400; font-size: 1.1rem; line-height: 1.15; color: var(--forest); transition: color .2s; }
.mgc b em { font-weight: 300; }
.mgc i { font-style: normal; font-size: .8rem; color: var(--muted); }
.mgc:hover b { color: var(--c-ink); }
.mgc--all { align-content: end; gap: 10px; padding: 18px; border-radius: 16px; background: var(--forest); color: #fff; }
.mgc--all small { color: var(--sage-300); }
.mgc--all b { color: #fff; font-size: 1.25rem; }
.mgc--all svg { width: 22px; height: 22px; transition: translate .3s var(--ease); }
.mgc--all:hover b { color: #fff; }
.mgc--all:hover svg { translate: 5px 0; }

/* Velo bajo los menús */
.hd-scrim {
  position: fixed; inset: 0; z-index: 79; background: rgba(31, 58, 51, .22);
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease);
}
.hd.mega-open + .hd-scrim { opacity: 1; }

/* ---------- Pantallas medianas ---------- */
@media (max-width: 1240px) {
  .hd__search kbd { display: none; }
  .hd__act--visit { display: none; }
  .hd__menu { gap: 22px; }
  .hd__link { letter-spacing: .1em; }
  .mg { grid-template-columns: minmax(0, 1fr) 240px; }
  .mg--coll { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mgc--all { display: none; }
}
@media (max-width: 1080px) {
  .hd__menu > li:last-child { display: none; }
  .mg__col--quick { display: none; }
  .mg__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Móvil / tablet ---------- */
@media (max-width: 960px) {
  :root { --hd-main: 62px; --hd-main-full: 62px; --header-h: 62px; }
  .hd.scrolled { --hd-main: 58px; }
  .utb__in { grid-template-columns: minmax(0, 1fr); height: 34px; }
  .utb .utb__side { display: none; }
  .utb__msgs { width: 100%; height: 34px; }
  .utb__msgs p { font-size: .76rem; }
  .hd__main { padding-inline: 10px; gap: 8px; }
  .hd__nav, .hd__search, .hd__act--visit { display: none; }
  .hd__icon { display: inline-grid; }
  .hd__logo small { display: none; }
  .hd__logo img, .hd.scrolled .hd__logo img { height: calc(var(--hd-main) - 2px); margin-block: 0; }
  .hd__act { min-width: 48px; padding: 6px; }
  .hd__act span { display: none; }
  .hd__act .badge { right: 2px; }
  .hd-scrim { display: none; }
}
@media (max-width: 760px) {
  .hd__right .hd__act { display: none; }
  .fab, .to-top { display: none !important; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

/* ---------- Menú lateral (móvil) ---------- */
.drawer__head .logo-sm { width: 92px; height: auto; aspect-ratio: 600 / 387; object-fit: contain; filter: none; }

@media (prefers-reduced-motion: reduce) {
  .utb__msgs p, .hd__mega, .mg > *, .hd__main, .hd__logo { transition: none; }
}

/* Menú de la tienda: 9 secciones en columnas bajas, con scroll si la pantalla es corta */
.hd__mega { max-height: calc(100dvh - var(--header-h, 120px)); overflow-y: auto; overscroll-behavior: contain; }
.mg__col ul + .mg__h { margin-top: 20px; }
.mg__h { font-size: 1.04rem; margin-bottom: 8px; }
.mg__col li a { padding: 4px 0; font-size: .88rem; line-height: 1.3; }
.mg__more { font-weight: 700; color: var(--forest); margin-right: 18px; }
.mg__more:hover { color: var(--accent-deep); }

/* ---------- Menú del móvil ---------- */
.mdrawer { width: min(420px, calc(100vw - 36px)); background: var(--cream); }
.mdrawer .drawer__in { overflow: hidden; }
.mnav__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--sage-100); }
.mnav__head .logo-sm { width: 76px; height: auto; aspect-ratio: 600 / 387; object-fit: contain; filter: none; }
.mnav__x { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--white); border: 1px solid var(--sage-100); color: var(--forest); transition: background .25s; }
.mnav__x svg { width: 20px; height: 20px; }
.mnav__x:hover { background: var(--sage-50); }
.mnav__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 28px; }
.mnav__search { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; border-radius: 99px; background: var(--white); border: 1px solid var(--sage-200); color: var(--muted); font: 500 .95rem var(--ff-body); text-align: left; }
.mnav__search svg { width: 19px; height: 19px; color: var(--sage-600); flex: none; }
.mnav__quick { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.mnav__quick a { display: grid; justify-items: center; gap: 6px; padding: 12px 6px 11px; border-radius: var(--r-sm); background: var(--sage-50); font-size: .82rem; font-weight: 700; color: var(--forest); transition: background .25s; }
.mnav__quick a:hover { background: var(--sage-100); }
.mnav__quick svg { width: 22px; height: 22px; color: var(--sage-700); }
.mnav__quick .is-outlet { background: var(--blush-soft); color: var(--accent-deep); }
.mnav__quick .is-outlet svg { color: var(--accent-deep); }
.mnav { display: block; }
.mnav__label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 4px 10px; }
.mnav__label h2 { font-family: var(--ff-display); font-weight: 500; font-size: 1.4rem; line-height: 1.1; color: var(--forest); }
.mnav__label a { font-size: .8rem; font-weight: 700; color: var(--sage-700); text-decoration: underline; text-underline-offset: 3px; }
.mnav__sec { margin-bottom: 6px; border: 1px solid var(--sage-100); border-radius: var(--r-sm); background: var(--white); overflow: hidden; }
.mnav__sec summary { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px 10px 10px; list-style: none; cursor: pointer; font-size: .98rem; font-weight: 700; color: var(--forest); -webkit-tap-highlight-color: transparent; }
.mnav__sec summary::-webkit-details-marker { display: none; }
.mnav__sec summary > span { flex: 1; min-width: 0; }
.mnav__sec summary > small { font-size: .74rem; font-weight: 600; color: var(--muted); }
.mnav__sec[open] summary { border-bottom: 1px solid var(--sage-100); }
.mnav__chev { width: 14px; height: 14px; flex: none; color: var(--sage-500); transition: rotate .3s var(--ease); }
.mnav__sec[open] .mnav__chev { rotate: 180deg; }
.mnav__ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--sage-50); color: var(--sage-700); }
.mnav__ic svg { width: 21px; height: 21px; }
.mnav__ic--viaje, .mnav__ic--bano { background: var(--sky); }
.mnav__ic--dormir { background: var(--lilac); }
.mnav__ic--comer, .mnav__ic--juguetes { background: var(--peach); }
.mnav__ic--canastilla, .mnav__ic--embarazo { background: var(--blush-soft); }
.mnav__ic--ropita { background: var(--butter); }
.mnav__sec ul { padding: 4px 12px 8px 60px; }
.mnav__sec li a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--sage-50); font-size: .93rem; color: var(--ink); }
.mnav__sec li:last-child a { border-bottom: 0; }
.mnav__sec li small { font-size: .74rem; font-weight: 600; color: var(--sage-500); }
.mnav__sec li a:hover { color: var(--sage-700); }
.mnav__sec .mnav__all { font-weight: 700; color: var(--sage-700); }
.mnav__colls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mnav__colls a { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--sw) 45%, var(--white)); font-size: .86rem; font-weight: 700; line-height: 1.2; color: var(--forest); }
.mnav__colls i { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 2px var(--white), 0 0 0 1.5px var(--si); }
.mnav__links { margin-top: 26px; border: 1px solid var(--sage-100); border-radius: var(--r-sm); background: var(--white); overflow: hidden; }
.mnav__links a { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 12px 14px; border-bottom: 1px solid var(--sage-50); font-size: .95rem; font-weight: 600; color: var(--forest); }
.mnav__links a:last-child { border-bottom: 0; }
.mnav__links a > svg:first-child { width: 20px; height: 20px; flex: none; color: var(--sage-600); }
.mnav__links span { flex: 1; }
.mnav__links a:hover { background: var(--sage-50); }
.mnav__go { width: 16px; height: 16px; flex: none; color: var(--sage-400); }
.mnav__foot { display: grid; grid-template-columns: 3fr 2fr; gap: 8px; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sage-100); background: var(--cream); }
.mnav__foot .btn { width: 100%; padding: 14px 12px; font-size: .92rem; }
@media (prefers-reduced-motion: no-preference) {
  #menu-dialog[open] .mnav__scroll > * { animation: swap .5s var(--ease) both; }
  #menu-dialog[open] .mnav__scroll > :nth-child(2) { animation-delay: .05s; }
  #menu-dialog[open] .mnav__scroll > :nth-child(3) { animation-delay: .1s; }
  .mnav__sec[open] ul { animation: swap .35s var(--ease) both; }
}
