/* Las Marquesitas Zap — estilos base */

:root {
  --mantequilla: #EFDD9D;
  --mantequilla-claro: #F7EBC4;
  --tinta: #1A1410;
  --kraft: #B98E5E;
  --kraft-claro: #D9BD94;
  --cacao: #4B2A1A;
  --fresa: #C8102E;
  --fresa-oscura: #A00D24;
  --malteada: #F4C9D2;
  --blanco: #FFFDF7;

  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --texto: 'Figtree', system-ui, sans-serif;
  --mano: 'Caveat', cursive;

  --radio-s: 10px;
  --radio-m: 18px;
  --radio-l: 28px;
  --borde: 2px solid var(--tinta);
  --sombra-sello: 4px 4px 0 var(--tinta);

  --gutter: 16px;
  --max: 1160px;
  --nav-h: 64px;
  --bottom-h: 72px;

  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-rebote: cubic-bezier(.34,1.56,.64,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--mantequilla);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--fresa); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.contenedor { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 700px) { :root { --gutter: 32px; } }

/* Tipografía */
.titular {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: -.005em;
  margin: 0;
  overflow-wrap: break-word;
}
.t-xl { font-size: clamp(3.2rem, 15vw, 8.5rem); }
.t-l  { font-size: clamp(2.6rem, 10vw, 5.5rem); }
.t-m  { font-size: clamp(2rem, 7vw, 3.4rem); }
.t-s  { font-size: clamp(1.5rem, 5vw, 2rem); }
.mano { font-family: var(--mano); font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--fresa); }
.bajada { font-size: 1.1rem; max-width: 34ch; margin: 14px 0 0; }
.texto-suave { color: #4a3d30; }
p { max-width: 62ch; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border-radius: 999px; border: var(--borde);
  font-weight: 700; font-size: 1rem; text-decoration: none;
  background: var(--blanco); color: var(--tinta);
  box-shadow: var(--sombra-sello);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--tinta); }
.btn:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--tinta); }
.btn-pedir { background: var(--fresa); color: #fff; }
.btn-pedir:hover { background: var(--fresa-oscura); }
.btn-tinta { background: var(--tinta); color: var(--mantequilla); box-shadow: 4px 4px 0 var(--fresa); }
.btn-tinta:hover { box-shadow: 5px 5px 0 var(--fresa); }
.btn-bloque { width: 100%; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-chico { min-height: 40px; padding: 0 14px; font-size: .92rem; box-shadow: 3px 3px 0 var(--tinta); }

/* Encabezado */
.encabezado {
  position: sticky; top: 0; z-index: 50;
  background: var(--mantequilla);
  border-bottom: var(--borde);
}
.encabezado .contenedor { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 12px; }
.marca { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.marca img { height: 54px; width: auto; }
.nav-escritorio { display: none; gap: 4px; }
.nav-escritorio a {
  font-family: var(--display); font-weight: 800; font-size: 1.15rem; text-transform: uppercase;
  text-decoration: none; padding: 8px 12px; border-radius: 999px;
}
.nav-escritorio a:hover { background: var(--mantequilla-claro); }
.nav-escritorio a[aria-current="page"] { background: var(--tinta); color: var(--mantequilla); }
.acciones-enc { display: flex; align-items: center; gap: 8px; }
.icono-btn {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  border: var(--borde); background: var(--blanco);
  display: inline-flex; align-items: center; justify-content: center;
}
.icono-btn svg { width: 22px; height: 22px; }
.contador {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--fresa); color: #fff; font-size: .75rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--mantequilla);
}
.contador[data-vacio="true"] { display: none; }
.contador.pulso { animation: pulso .45s var(--ease-rebote); }
@keyframes pulso { 0% { transform: scale(.6); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (min-width: 900px) {
  .nav-escritorio { display: flex; }
  .btn-menu { display: none; }
}

/* Estado de horario */
.estado { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.estado::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #8a7a5c; }
.estado[data-abierto="true"]::before { background: #1f9d55; box-shadow: 0 0 0 4px rgba(31,157,85,.18); }

/* Menú pantalla completa (móvil) */
.menu-movil {
  position: fixed; inset: 0; z-index: 80; background: var(--tinta); color: var(--mantequilla);
  display: flex; flex-direction: column; padding: 18px var(--gutter) 32px;
  transform: translateY(-100%); transition: transform .45s var(--ease);
  visibility: hidden;
}
.menu-movil.abierto { transform: none; visibility: visible; }
.menu-movil .cerrar { align-self: flex-end; background: var(--mantequilla); color: var(--tinta); border-color: var(--mantequilla); }
.menu-movil nav { display: flex; flex-direction: column; margin-top: 12px; }
.menu-movil nav a {
  font-family: var(--display); font-weight: 900; font-size: 2.9rem; text-transform: uppercase;
  text-decoration: none; line-height: 1.05; padding: 4px 0;
}
.menu-movil nav a[aria-current="page"] { color: var(--malteada); }
.menu-movil .pie-menu { margin-top: auto; font-size: .95rem; opacity: .9; }

/* Barra inferior (móvil) */
.barra-inferior {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--tinta); color: var(--mantequilla);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
.barra-inferior a, .barra-inferior button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; font-size: .72rem; font-weight: 600; background: none; border: 0;
  padding: 6px 0; min-height: 56px; justify-content: center;
}
.barra-inferior svg { width: 24px; height: 24px; }
.barra-inferior a[aria-current="page"] { color: var(--malteada); }
.barra-inferior .pedir-central {
  margin-top: -26px; width: 66px; height: 66px; border-radius: 50%; justify-self: center;
  background: var(--fresa); color: #fff; border: 3px solid var(--mantequilla); position: relative;
  font-size: .72rem; gap: 0;
}
.barra-inferior .pedir-central .contador { top: -2px; right: -2px; border-color: var(--tinta); }
@media (min-width: 900px) { .barra-inferior { display: none; } }

/* Secciones */
.seccion { padding: 72px 0; }
.seccion-tinta { background: var(--tinta); color: var(--mantequilla); }
.seccion-cacao { background: var(--cacao); color: var(--mantequilla); }
.seccion-malteada { background: var(--malteada); }
.seccion-blanca { background: var(--blanco); }
.borde-arriba { border-top: var(--borde); }
.encabezado-seccion { margin-bottom: 32px; }
.encabezado-seccion .mano { display: block; margin-bottom: 6px; }
.seccion-tinta .mano, .seccion-cacao .mano { color: var(--malteada); }

/* Textura waffle */
.waffle {
  background-color: var(--kraft-claro);
  background-image:
    repeating-linear-gradient(45deg, rgba(75,42,26,.18) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(-45deg, rgba(75,42,26,.18) 0 2px, transparent 2px 26px);
}

/* Cabecera de página interna */
.cabecera-pagina { padding: 40px 0 28px; border-bottom: var(--borde); }
.cabecera-pagina .bajada { margin-top: 12px; }

/* Cinta de horario */
.cinta {
  background: var(--fresa); color: #fff; border-block: var(--borde);
  overflow: hidden; white-space: nowrap;
}
.cinta-pista { display: inline-flex; gap: 40px; padding: 12px 0; animation: cinta 26s linear infinite; }
.cinta-pista span { font-family: var(--display); font-weight: 800; font-size: 1.35rem; text-transform: uppercase; }
@keyframes cinta { to { transform: translateX(-50%); } }

/* Pie */
.pie { background: var(--tinta); color: var(--mantequilla); padding: 56px 0 40px; }
.pie-grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .pie-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.pie h3 { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 1.5rem; margin: 0 0 10px; }
.pie a { text-decoration: none; }
.pie a:hover { text-decoration: underline; }
.pie ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pie .logo-pie { width: 200px; background: var(--mantequilla); border-radius: var(--radio-m); padding: 12px 16px; }
.pie-legal { margin-top: 40px; font-size: .85rem; opacity: .75; }

/* Hoja del pedido (carrito) */
.velo { position: fixed; inset: 0; background: rgba(26,20,16,.55); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .3s; }
.velo.visible { opacity: 1; pointer-events: auto; }
.hoja {
  position: fixed; z-index: 95; left: 0; right: 0; bottom: 0;
  max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--blanco); border-top: var(--borde); border-radius: var(--radio-l) var(--radio-l) 0 0;
  transform: translateY(105%); transition: transform .42s var(--ease);
  visibility: hidden;
}
.hoja.abierta { transform: none; visibility: visible; }
@media (min-width: 900px) {
  .hoja { left: auto; top: 0; width: 460px; max-height: none; border-radius: 0; border-top: 0; border-left: var(--borde); transform: translateX(105%); }
}
.hoja-cabeza { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: var(--borde); }
.hoja-cabeza h2 { margin: 0; }
.hoja-cuerpo { overflow-y: auto; padding: 16px 20px 24px; flex: 1; overscroll-behavior: contain; }
.hoja-pie { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: var(--borde); background: var(--mantequilla-claro); }
.agarradera { width: 44px; height: 5px; border-radius: 9px; background: #cbbd9c; margin: 8px auto 0; }
@media (min-width: 900px) { .agarradera { display: none; } }

.linea-pedido { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px dashed #cdbb94; }
.linea-pedido .nombre { font-weight: 700; }
.linea-pedido .detalle { font-size: .88rem; color: #5c4b38; grid-column: 1; }
.linea-pedido .precio { font-weight: 700; text-align: right; }
.cantidad { display: inline-flex; align-items: center; border: var(--borde); border-radius: 999px; overflow: hidden; grid-column: 2; justify-self: end; }
.cantidad button { width: 38px; height: 34px; border: 0; background: var(--blanco); font-weight: 700; font-size: 1.1rem; }
.cantidad span { min-width: 26px; text-align: center; font-weight: 700; }
.vacio { text-align: center; padding: 28px 8px; }
.vacio .titular { margin-bottom: 8px; }

.segmentado { display: grid; grid-template-columns: repeat(3, 1fr); border: var(--borde); border-radius: 14px; overflow: hidden; margin: 18px 0 14px; }
.segmentado label { position: relative; text-align: center; padding: 10px 4px; font-weight: 700; font-size: .9rem; cursor: pointer; border-right: var(--borde); background: var(--blanco); }
.segmentado label:last-child { border-right: 0; }
.segmentado input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmentado label:has(input:checked) { background: var(--tinta); color: var(--mantequilla); }
.segmentado label:has(input:focus-visible) { outline: 3px solid var(--fresa); outline-offset: -5px; }
.segmentado small { display: block; font-weight: 500; font-size: .75rem; opacity: .8; }

.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo label { font-weight: 600; font-size: .92rem; }
.campo .ayuda { font-size: .82rem; color: #5c4b38; }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border: var(--borde); border-radius: 12px; background: #fff;
  font-size: 16px;
}
.campo textarea { min-height: 88px; resize: vertical; }
.campo .error { color: var(--fresa-oscura); font-size: .85rem; font-weight: 600; display: none; }
.campo.con-error .error { display: block; }
.campo.con-error input, .campo.con-error select, .campo.con-error textarea { border-color: var(--fresa); }
.gps-ok { display: none; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: #1f7a45; }
.gps-ok.visible { display: flex; }

.totales { display: grid; gap: 4px; margin-bottom: 12px; font-size: .95rem; }
.totales div { display: flex; justify-content: space-between; }
.totales .total { font-family: var(--display); font-weight: 900; font-size: 1.7rem; text-transform: uppercase; }
.aviso {
  border: var(--borde); border-radius: 14px; padding: 12px 14px; background: var(--malteada); font-size: .92rem; margin: 6px 0 14px;
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-h) + 20px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--tinta); color: var(--mantequilla); padding: 12px 18px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; transition: all .3s var(--ease); white-space: nowrap;
}
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
@media (min-width: 900px) { .toast { bottom: 32px; } }
.hoja.abierta ~ .toast { bottom: auto; top: calc(16px + env(safe-area-inset-top)); }

/* Revelado al hacer scroll (sutil, una sola vez) */
.revelar { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.revelar.visto { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .revelar { opacity: 1; transform: none; }
}
