/* ==========================
   Components + navigation
   ========================== */

/* =======================
   HEADER
   ======================= */
.p-header{
  position: sticky;
  top:0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  height: 64px;
  min-height:64px;
  display:flex;
  align-items:center;
}

/* CONTENIDO INTERIOR */
.p-header__inner{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  height:64px;
  min-height:64px;
  padding:0 20px;
  width:100%;
  max-width:var(--shell);
  margin:0 auto;
}

/* SECCIONES */
.p-header__left{
  display:flex;
  align-items:center;
  gap:16px;
}
.p-header__right{
  display:flex;
  align-items:center;
  gap:12px;
}

/* LOGO */
.p-logo img{
  height:55px;
  width:auto;
  display:block;
}

/* =======================
   BURGER — solo móvil
   ======================= */
.p-burger{
  display:none;
  width:28px;
  height:28px;
  background:none;
  border:0;
  padding:0;
  cursor:pointer;
  flex-direction:column;
  justify-content:center;
  gap:6px;
}
.p-burger span{
  width:24px;
  height:2px;
  background:var(--text);
  transition:transform .22s ease, opacity .18s ease;
}

/* Animación hamburguesa → X */
body.p-nav-open .p-burger span:nth-child(1){
  transform: translateY(6px) rotate(45deg);
}
body.p-nav-open .p-burger span:nth-child(2){
  opacity: 0;
}
body.p-nav-open .p-burger span:nth-child(3){
  transform: translateY(-6px) rotate(-45deg);
}

/* =======================
   THEME TOGGLE
   ======================= */
.p-theme-toggle{
  width:38px;
  height:38px;
  border-radius:999px;
  border:1px solid var(--hairline);
  background:transparent;
  cursor:pointer;
  display:grid;
  place-items:center;
}
.p-theme-toggle__dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background:var(--text);
}

/* =======================
   NAV — BASE
   ======================= */
.p-nav{
  display:none;
}

.p-nav__menu{
  list-style:none;
  margin:0;
  padding:0;
}

.p-nav__menu a{
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:13px;
  opacity:.86;
  text-decoration:none;
  transition:opacity .18s ease, font-weight .18s ease;
}

/* Estado activo */
.p-nav__menu .current-menu-item > a,
.p-nav__menu .current-menu-parent > a,
.p-nav__menu .current-menu-ancestor > a{
  font-weight:600;
  opacity:1;
}

/* =======================
   DESKTOP — MENÚ HORIZONTAL
   ======================= */
@media(min-width:981px){

  .p-burger{ display:none; }

  .p-nav{
    display:flex;
    align-items:center;
    height:64px;
  }

  /* ✅ ÚNICO CAMBIO: separación logo ↔ menú */
  .p-nav--desktop{
    margin-left:15px;
  }

  .p-nav__menu{
    display:flex;
    align-items:center;
    gap:20px;
    height:64px;
  }

  .p-nav__menu a{
    line-height:64px;
  }

  /* evita menú duplicado */
  .p-nav--mobile{
    display:none !important;
  }
}

/* =======================
   MOBILE MENU — VOGUE FULLSCREEN
   ======================= */
@media(max-width:980px){

  .p-burger{
    display:flex;
  }

  /* evita menú duplicado */
  .p-nav--desktop{
    display:none !important;
  }

  /* Empuja el bloque derecho */
  .p-header__right{
    justify-self: end;
  }

  /* Fullscreen nav */
  .p-nav--mobile{
    position:fixed;
    inset:0;
    z-index:50;
    background:var(--bg);
    transform:translateX(-100%);
    transition:transform .45s cubic-bezier(.22,.61,.36,1);
    padding:28px 24px;
    display:flex;
    flex-direction:column;
  }

  body.p-nav-open .p-nav--mobile{
    transform:translateX(0);
  }

  /* Overlay invisible para cerrar */
  .p-nav__overlay{
    position:fixed;
    inset:0;
    z-index:49;
    background:transparent;
    display:none;
  }

  body.p-nav-open .p-nav__overlay{
    display:block;
  }

  /* Burger flotante como X */
  body.p-nav-open .p-burger{
    position:fixed;
    top:18px;
    left:20px;
    z-index:60;
  }

  /* Header se desmonta visualmente */
  body.p-nav-open .p-header{
    background:transparent;
    border-bottom:none;
    backdrop-filter:none;
  }

  body.p-nav-open .p-logo,
  body.p-nav-open .p-header__right{
    opacity:0;
    pointer-events:none;
  }

  /* Contenedor editorial */
  .p-nav__editorial{
    margin-top:72px;
    position:relative;
    z-index:51;
  }

  /* Menú editorial */
  .p-nav__menu{
    display:flex;
    flex-direction:column;
    gap:22px;
  }

  .p-nav__menu a{
    font-size:20px;
    letter-spacing:.14em;
    font-weight:500;
    opacity:.92;
  }

  .p-nav__menu a:hover{
    opacity:1;
  }

  body.p-lock{
    overflow:hidden;
  }
}

/* =======================
   SEARCH
   ======================= */
.p-searchform{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--hairline);
  border-radius:999px;
  padding:6px 10px;
  background:color-mix(in srgb, var(--surface) 80%, transparent);
}
.p-searchform__input{
  border:0;
  outline:none;
  background:transparent;
  color:var(--text);
  width:140px;
  font-size:13px;
}

/* XS FIXES */
@media(max-width:560px){
  .p-searchform{ padding:6px 8px; }
  .p-searchform__input{ width:86px; }
  .p-header__right{ gap:6px; }
}

/* =======================
   FOOTER
   ======================= */
.p-footer{
  border-top:1px solid var(--hairline);
  padding:26px 0;
}
.p-footer__inner{
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:18px;
}

/* ===============================
   FIX: HERO NO INVADE EL HEADER
   =============================== */
.p-shell.p-hero,
.p-hero{
  margin-top:64px !important;
}
