/* =========================================================
   SOMOS TORTA — HEADER.CSS (CUTE + LIMPIO)
   - Top strips
   - Header sticky
   - Menú horizontal (desktop)
   - Botones header
   - Search bar
   - Drawer menú dark (tipo referencia) ✅ sin recortes iOS
========================================================= */

/* =========================
   TOP STRIPS
========================= */

.topbar__free{
  width:100%;
  background:#fff;
  color:var(--st-orange);
  text-align:center;
  font-size:14px;
  letter-spacing:.18em;
  text-transform:uppercase;
  font-weight:600;
  padding:6px 0;
}

.topbar__wa{
  width:100%;
  background:var(--st-orange);
  text-align:center;
  padding:8px 0;
}
.topbar__wa a{
  color:#fff;
  text-decoration:none;
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-weight:600;
}
.topbar__wa a:hover{ opacity:.9; }

/* =========================
   HEADER LAYOUT
========================= */

.site-header{
  position:sticky;
  top:0;
  z-index: 9000; /* ✅ debajo del drawer */
  background:#fff;
  transition:box-shadow .3s ease;
}
.site-header.is-scrolled{
  box-shadow:0 6px 18px rgba(0,0,0,0.08);
}

.navwrap{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  padding:28px 0;
  gap:16px;
}
.navwrap > :first-child{ justify-self:start; }

.brand{
  justify-self:center;
  text-align:center;
  transform:translateX(-8px);
}

.navright{
  justify-self:end;
  display:flex;
  align-items:center;
  gap:10px;
}

.logo img{
  max-height:60px;
  width:auto;
  display:inline-block;
  transition:max-height .3s ease;
}

.site-header.is-scrolled .navwrap{ padding:16px 0; }
.site-header.is-scrolled .logo img{ max-height:48px; }

/* =========================
   MENÚ HORIZONTAL (DESKTOP)
========================= */

.primary-nav{
  border-top:1.5px solid var(--st-orange);
  color:var(--st-orange);
}
.primary-nav ul{
  display:flex;
  gap:24px;
  justify-content:center;
  list-style:none;
  padding:14px 0;
  margin:0;
  flex-wrap:wrap;
}
.primary-nav a{
  text-decoration:none;
  font-weight:500;
  font-size:14px;
  letter-spacing:.14em;
  opacity:.85;
  padding:10px 6px;
}
.primary-nav a:hover{ opacity:1; }

@media (max-width:768px){
  .primary-nav ul{ display:none; }
}

/* =========================
   BOTONES HEADER
========================= */

.st-burger,
.st-searchbtn,
.cartlink{
  width:42px;
  height:42px;
  border:1px solid #f0f0f0;
  background:#fff;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--st-orange);
  cursor:pointer;
  position:relative;
  transition:all .2s ease;
  padding:0;
  text-decoration:none;
}

.st-burger:hover,
.st-searchbtn:hover,
.cartlink:hover{
  border-color:#e8e8e8;
  transform:translateY(-1px);
}

.st-icon{
  width:25px;
  height:25px;
  display:block;
}

.cartbadge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:var(--st-orange);
  color:#fff;
  font-size:11px;
  line-height:18px;
  text-align:center;
  font-weight:600;
}

/* =========================
   SEARCH BAR
========================= */

.st-searchbar{
  width:100%;
  background:#fff;
  border-top:1px solid #f1f1f1;
  border-bottom:1px solid #f1f1f1;
}
.st-searchbar .container{ padding:18px 0; }

.st-searchbar__form{
  max-width:900px;
  margin:0 auto;
  display:flex;
  align-items:center;
  gap:12px;
}

.st-searchbar__input{
  flex:1;
  height:50px;
  border:1.5px solid var(--st-orange);
  border-radius:14px;
  padding:0 18px;
  font-size:15px;
  font-family:inherit;
  outline:none;
}
.st-searchbar__input:focus{
  box-shadow:0 0 0 3px rgba(255,106,0,.15);
}

.st-searchbar__close,
.st-searchbar__go{
  width:46px;
  height:46px;
  border:1px solid #ededed;
  background:#fff;
  border-radius:14px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .2s ease;
}
.st-searchbar__close:hover,
.st-searchbar__go:hover{
  border-color:var(--st-orange);
  color:var(--st-orange);
}

/* =========================
   MOBILE TWEAKS
========================= */

@media (max-width:640px){
  .navwrap{ padding:18px 0; }
  .brand{ transform:translateX(-4px); }
}

/* =========================================================
   DRAWER MENÚ (DARK) — ✅ SIN RECORTES + ✅ CAPAS OK
========================================================= */

:root{
  --st-ease: cubic-bezier(.22,1,.36,1);
  --st-drawer-w: 340px;

  --st-drawer-bg1:#2b140f;
  --st-drawer-bg2:#120807;
  --st-drawer-line: rgba(255,255,255,.10);
  --st-drawer-text: rgba(255,255,255,.92);
}

/* Overlay menú (encima del header) */
.st-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--st-ease);
  z-index: 10040 !important;
}
#st-drawer.is-open ~ .st-overlay{
  opacity: 1;
  pointer-events: auto;
}

/* Drawer: top + bottom (evita recortes iOS) */
#st-drawer{
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0; /* ✅ clave */

  width: min(var(--st-drawer-w), 92vw);
  transform: translateX(-102%);
  transition: transform .28s var(--st-ease);
  z-index: 10050 !important;

  display: grid;
  grid-template-rows: auto 1fr auto;

  background: linear-gradient(180deg, var(--st-drawer-bg1), var(--st-drawer-bg2));
  color: var(--st-drawer-text);
  border-right: 1px solid rgba(255,255,255,.08);
  padding-bottom: env(safe-area-inset-bottom);
}

#st-drawer.is-open{ transform: translateX(0); }

/* Head */
.st-drawer__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 18px 18px;
  border-bottom: 1px solid var(--st-drawer-line);
}

.st-drawer__title{
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--st-drawer-text);
}

/* Botón cerrar (tap-friendly) */
.st-drawer__close{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: transparent;
  color: var(--st-drawer-text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.st-drawer__close:hover{ background: rgba(255,255,255,.06); }

/* Body: scroll real */
.st-drawer__body{
  min-height: 0; /* ✅ FIX real */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0;
}

/* Nav */
#st-drawer nav ul{
  list-style:none;
  margin:0;
  padding:0;
}
#st-drawer nav li{
  margin:0;
  border-bottom: 1px solid var(--st-drawer-line);
}
#st-drawer nav a{
  display:block;
  padding:18px 18px;
  text-decoration:none;
  color: var(--st-drawer-text);
  font-weight:800;
  letter-spacing:.18em;
  text-transform:uppercase;
  font-size:12px;
  background: transparent;
}
#st-drawer nav a:hover{
  background: rgba(255,255,255,.07);
}

/* Extras abajo (3ra fila del grid, NO tapa links) */
.st-drawer__extras{
  padding: 14px 18px 18px;
  border-top: 1px solid var(--st-drawer-line);
  background: rgba(18,8,7,.85);
}

.st-drawer__cta{
  display:inline-block;
  text-decoration:none;
  color: var(--st-drawer-text);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 11px;
  opacity: .95;
  border-bottom: 1px solid rgba(255,255,255,.35);
  padding-bottom: 6px;
}
.st-drawer__cta:hover{ opacity: 1; }

/* Móvil */
@media (max-width: 768px){
  #st-drawer{
    width: 86vw;
    max-width: 420px;
  }
}

/* Admin bar (WordPress) */
body.admin-bar #st-drawer{ top: 32px; }
@media (max-width: 782px){
  body.admin-bar #st-drawer{ top: 46px; }
}