/* =========================
   HEADER + NAV (desktop/móvil)
   ========================= */

/* ===== Base ===== */
.site-header{
  background: var(--ink-blue);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: none;                   /* ← quitamos el borde */
  box-shadow: 0 1px 0 rgba(255,255,255,.10); /* hairline sutil */
}
.header-inner{
  display: flex;
  align-items: center;
  height: 64px;
  width: 100%;
  padding-inline: clamp(12px, 4vw, 24px);
  gap: 16px;
}
.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  margin-right: auto;
  text-decoration: none;
}
.brand-text{ display: flex; flex-direction: column; line-height: 1.1; }
.brand-title{
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 22px);
  color: #fff;
  margin: 0;
}
.subtitle{
  font-family: var(--font-sans,"Montserrat",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: .2px;
  margin: 2px 0 0;
  font-size: clamp(12px, 1.3vw, 14px);
  color: #fff;
}

/* ===== Chips (desktop) ===== */
.main-nav{ display: flex; gap: 10px; margin-left: auto; }
.main-nav .chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.12);
  text-decoration: none;
  line-height: 1;
  transition: background .2s ease, transform .1s ease, color .2s ease, border-color .2s ease;
  margin-inline: 2px;
}
.main-nav .chip:hover{ background: rgba(255,255,255,.12); }
.main-nav .chip:active{ transform: translateY(1px); }
.main-nav .chip:focus-visible{
  outline: 2px solid #F4D35E; /* dorado */
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(0,0,0,.35);
}

/* Ícono redondito dentro del chip */
.material-symbols-outlined{
  font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
}
.main-nav .chip .material-symbols-outlined{
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0,0,0,.32);
  font-size: 18px;
  color: #fff;
}

/* Estado activo por ruta */
.main-nav .chip[aria-current="page"],
.main-nav .chip.is-active{
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.18);
}

/* ===== Botón hamburguesa: oculto por defecto (desktop) ===== */
.menu-btn{
  display: none; /* se muestra en móvil */
  width: 40px; height: 40px; border-radius: 8px;
  background: transparent; border: 1px solid rgba(255,255,255,.24);
  place-items: center; cursor: pointer; margin-left: auto;
}
.menu-icon{
  width: 20px; height: 2px; background: #fff; position: relative; border-radius: 2px; display: block;
}
.menu-icon::before, .menu-icon::after{
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: #fff; border-radius: 2px;
}
.menu-icon::before{ transform: translateY(-6px); }
.menu-icon::after{ transform: translateY(6px); }

/* =========================
   MÓVIL (<=920px): Drawer lateral
   ========================= */
@media (max-width: 920px){
  /* Mostrar botón en móvil */
  .menu-btn{ display: inline-grid; }

  /* Reusar .main-nav como panel lateral */
  .site-header .main-nav{
    position: fixed; inset: 0 0 0 auto; /* sale de la derecha */
    width: min(82vw, 320px); height: 100dvh;
    background: #ffffff; color: #0d1b2a;
    padding: 16px 16px 24px; /* espacio + header propio */
    box-shadow: -24px 0 48px rgba(0,0,0,.24);
    transform: translateX(100%);
    transition: transform 220ms ease;
    display: flex; flex-direction: column; gap: 12px;
    z-index: 22;
    margin-left: 0; /* evita centrado accidental */
    will-change: transform;
  }

  /* Chips en móvil (look claro) */
  .site-header .main-nav .chip{
    background: #f5f5f7; color: #0d1b2a;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 12px; padding: 14px 12px; font-weight: 700;
  }
  .site-header .main-nav .chip .material-symbols-outlined{
    background: rgba(0,0,0,.06);
    color: #0d1b2a;
  }

  /* Estado abierto */
  .site-header[data-drawer="open"] .main-nav{ transform: translateX(0); }

  /* Fondo oscurecido */
  .backdrop{
    position: fixed; inset: 0; background: #000;
    opacity: 0; transition: opacity 200ms ease;
    z-index: 21; pointer-events: none;
  }
  .site-header[data-drawer="open"] .backdrop{ opacity: .5; pointer-events: auto; }

  /* En móvil la nav no va en la topbar */
  .header-inner .main-nav{ margin-left: 0; }

  /* ===== Drawer: encabezado con logo ===== */
  .drawer-head{
    display: flex; align-items: center; gap: 12px;
    padding: 8px 4px 12px;
  }
  .drawer-logo{
    width: 40px; height: 40px; object-fit: contain;
    border-radius: 8px; /* opcional */
    padding: 4px;       /* opcional */
  }
  .drawer-brand{ display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
  .drawer-title{
    font-weight: 800; font-size: 18px; color: #0d1b2a; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--font-display,"Playfair Display",Georgia,serif);
  }
  .drawer-subtitle{
    font-size: 12px; color: #4a5568; margin-top: 2px;
    font-family: var(--font-sans,"Montserrat",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .drawer-sep{
    border: 0; height: 1px; background: rgba(0,0,0,.08);
    margin: 8px 0 12px;
  }
}

/* ===== DESKTOP (>=921px): reset duro del drawer ===== */
@media (min-width: 921px){
  .site-header .main-nav{
    position: static !important;
    transform: none !important;
    width: auto !important; height: auto !important;
    background: transparent !important;
    padding: 0 !important; box-shadow: none !important;
    display: flex !important; flex-direction: row !important; gap: 10px !important;
    margin-left: auto !important;  /* chips a la derecha */
  }
  .menu-btn{ display: none !important; }
  .backdrop{ display: none !important; }
  .drawer-head, .drawer-sep{ display: none !important; }
}

/* ===== Accesibilidad: reduce motion ===== */
@media (prefers-reduced-motion: reduce){
  .main-nav, .backdrop{ transition: none !important; }
}

/* ===== Utilidad: forzar tokens por si faltan ===== */
:root{
  --ink-blue: #0D1B2A;
  --sand-beige: #F4D35E;
  --font-display: "Playfair Display";
  --font-sans: "Montserrat";
}

/* Normaliza los íconos Material Symbols usados con .mi */
.mi,
.material-symbols-outlined{
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  display: inline-block;
  /* Activa variaciones para que renderice como ícono */
  font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 24;
}

/* Ícono dentro del chip: look redondito */
.main-nav .chip .mi{
  display: grid;
  place-items: center;
  width: 24px; height: 24px; border-radius: 999px;
}

/* Tema claro del drawer (móvil) */
@media (max-width:920px){
  .site-header .main-nav .chip .mi{
    background: rgba(0,0,0,.06);
    color: #0d1b2a;
    margin-right: 8px;
  }
}

/* Tema oscuro de la topbar (desktop) */
@media (min-width:921px){
  .main-nav .chip .mi{
    background: rgba(0,0,0,.32);
    color: #fff;
    margin-right: 8px;
  }
}
