/* PideYa · hoja de estilos base
   Móvil primero. Sin dependencias. */

:root {
  --brand: #e63946;
  --brand2: #1d3557;
  --tinta: #1a1a1a;
  --gris: #6b7280;
  --linea: #e5e7eb;
  --fondo: #f7f7f8;
  --blanco: #fff;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* El atributo hidden debe ganarle a cualquier display de autor.
   Sin esto, un panel con display:grid queda visible y bloquea los clics. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--tinta);
  background: var(--fondo);
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}

img { max-width: 100%; display: block; }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }

.muted { color: var(--gris); font-size: 0.95rem; }

/* ---------- Portada ---------- */

.hero {
  background: linear-gradient(160deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 62%, #000) 100%);
  color: #fff;
  padding: 34px 20px 28px;
  text-align: center;
}

.hero-in { max-width: 640px; margin: 0 auto; display: grid; gap: 8px; justify-items: center; }

.logo { height: 72px; width: auto; border-radius: 12px; object-fit: contain; background: rgba(255,255,255,.08); padding: 8px; }

.logo-emoji { font-size: 3rem; line-height: 1; }

.hero h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin-top: 4px; }

.hero .sub { margin: 0; font-size: 0.95rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.08em; }

.hero .tag { margin: 2px 0 0; font-size: 1rem; opacity: 0.95; max-width: 34ch; }

.estado {
  margin: 6px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.estado.abierto { background: #16a34a; }
.estado.cerrado { background: rgba(0, 0, 0, 0.35); }

.cta {
  margin-top: 12px;
  display: inline-block;
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.aviso-top {
  margin: 0;
  padding: 10px 16px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.85rem;
  text-align: center;
  border-bottom: 1px solid #fed7aa;
}

/* ---------- Navegación de categorías ---------- */

.catnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}

.catnav-in {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.catnav-in::-webkit-scrollbar { display: none; }

.catnav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--tinta);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f2f4;
  white-space: nowrap;
}

.catnav a:active { background: var(--brand); color: #fff; }

/* ---------- Menú ---------- */

main { max-width: 720px; margin: 0 auto; padding: 8px 14px 120px; }

.cat { padding-top: 22px; scroll-margin-top: 62px; }

.cat-head h2 { font-size: 1.3rem; }

.cat-head p { margin: 4px 0 0; color: var(--gris); font-size: 0.9rem; }

.prods { display: grid; gap: 10px; margin-top: 12px; }

.prod {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 10px;
  box-shadow: var(--sombra);
}

.prod.agotado { opacity: 0.55; }

.prod-media {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f2f4;
  display: grid;
  place-items: center;
}

.prod-media img { width: 100%; height: 100%; object-fit: cover; }

.prod-media .emoji { font-size: 2rem; }

.prod-info { display: grid; gap: 4px; align-content: start; }

.prod-info h3 { font-size: 1rem; }

.prod-info .desc { margin: 0; font-size: 0.88rem; color: #4b5563; }

.prod-info .incluye { margin: 0; font-size: 0.8rem; color: var(--gris); font-style: italic; }

.prod-pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.precio { font-weight: 800; color: var(--brand); font-size: 1.02rem; }

.add {
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 44px;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
}

.add:active { transform: scale(0.96); }

.tag-agotado { font-size: 0.8rem; font-weight: 700; color: var(--gris); }

.vacio { text-align: center; color: var(--gris); padding: 40px 0; }

/* ---------- Info ---------- */

.info {
  max-width: 720px;
  margin: 8px auto 0;
  padding: 22px 20px 30px;
  background: var(--blanco);
  border-top: 1px solid var(--linea);
}

.info h2 { font-size: 1.1rem; margin-bottom: 10px; }

.info .dir { margin: 0 0 6px; }

.info .link { color: var(--brand); font-weight: 600; text-decoration: none; font-size: 0.92rem; }

.horas { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 0.9rem; }

.horas li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--linea); padding-bottom: 6px; }

.pagos { margin: 14px 0 0; font-size: 0.88rem; color: var(--gris); }

.aviso { margin: 14px 0 0; font-size: 0.85rem; color: #9a3412; background: #fff7ed; padding: 10px 12px; border-radius: 10px; }

.pie { text-align: center; padding: 26px 16px 40px; color: var(--gris); font-size: 0.82rem; }

.pie-prueba {
  margin-top: 6px;
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------- Menú del día ---------- */

.menudia {
  max-width: 720px;
  margin: 14px auto 0;
  padding: 0 14px;
}

.menudia-in {
  border: 2px solid var(--brand);
  border-radius: var(--radio);
  background: #fff;
  padding: 14px 16px 16px;
  box-shadow: var(--sombra);
}

.menudia-in header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px dashed var(--linea);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.menudia-tag {
  background: var(--brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.menudia-fecha { color: var(--gris); font-size: 0.82rem; text-transform: capitalize; }

.menudia-in ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

.menudia-in li { font-size: 0.98rem; }

.menudia-incluye { margin: 8px 0 0; font-size: 0.84rem; color: var(--gris); }

.menudia-precio { margin: 10px 0 0; font-size: 1.35rem; font-weight: 800; color: var(--brand); }

.menudia-nota {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #9a3412;
  background: #fff7ed;
  padding: 8px 10px;
  border-radius: 8px;
}

/* ---------- Barra del carrito ---------- */

.barra {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(247,247,248,0.98), rgba(247,247,248,0.7));
  z-index: 30;
}

.barra-btn {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--brand);
  color: #fff;
  border: 0;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--brand) 38%, transparent);
  cursor: pointer;
}

.barra-count {
  background: rgba(255, 255, 255, 0.24);
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

/* ---------- Hoja / panel ---------- */

.hoja {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 50;
  display: grid;
  align-items: end;
}

.hoja-in {
  background: var(--blanco);
  border-radius: 18px 18px 0 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.hoja-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--linea);
}

.hoja-head h2 { font-size: 1.1rem; }

.cerrar {
  border: 0;
  background: #f1f2f4;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
}

.hoja-body { padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }

/* ---------- Carrito ---------- */

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--linea);
}

.item h4 { margin: 0; font-size: 0.98rem; }

.item .opts { margin: 2px 0 0; font-size: 0.82rem; color: var(--gris); }

.item .nota { margin: 2px 0 0; font-size: 0.82rem; color: #9a3412; }

.item-precio { font-weight: 700; white-space: nowrap; }

.stepper { display: inline-flex; align-items: center; gap: 0; margin-top: 6px; border: 1px solid var(--linea); border-radius: 999px; overflow: hidden; }

.stepper button {
  border: 0;
  background: #f7f7f8;
  width: 34px;
  height: 34px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.stepper span { min-width: 30px; text-align: center; font-weight: 700; font-size: 0.92rem; }

.total-linea { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 800; padding: 16px 0 4px; }

/* ---------- Formulario ---------- */

.campo { display: grid; gap: 6px; margin-top: 14px; }

.campo label { font-size: 0.86rem; font-weight: 700; }

.campo input, .campo textarea, .campo select {
  font: inherit;
  font-size: 16px;
  padding: 12px;
  border: 1px solid var(--linea);
  border-radius: 12px;
  background: #fff;
  color: var(--tinta);
  width: 100%;
}

.campo textarea { min-height: 62px; resize: vertical; }

.radios { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.radios label {
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.radios input { position: absolute; opacity: 0; pointer-events: none; }

.radios input:checked + span { color: var(--brand); }

.radios label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, #fff); }

.enviar {
  width: 100%;
  margin-top: 18px;
  border: 0;
  background: #16a34a;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 800;
  padding: 16px;
  border-radius: 14px;
  cursor: pointer;
}

.enviar:disabled { opacity: 0.5; }

.nota-pie { font-size: 0.78rem; color: var(--gris); text-align: center; margin-top: 10px; }

/* ---------- Opciones de producto ---------- */

.grupo { margin-top: 16px; }

.grupo h3 { font-size: 0.95rem; margin-bottom: 8px; }

.grupo h3 small { font-weight: 400; color: var(--gris); }

.opcion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}

.opcion:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, #fff); }

.opcion input { accent-color: var(--brand); width: 20px; height: 20px; }

.opcion .op-precio { color: var(--gris); font-size: 0.9rem; }

/* ---------- Directorio ---------- */

.dir-body { background: var(--fondo); }

.dir-head { padding: 40px 20px 16px; text-align: center; }

.dir-head h1 { font-size: 2rem; color: var(--brand); }

.dir-head p { color: var(--gris); margin: 6px 0 0; }

.dir-grid { max-width: 720px; margin: 0 auto; padding: 12px 16px 40px; display: grid; gap: 10px; }

.dir-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--sombra);
}

.dir-emoji { font-size: 1.8rem; }

.dir-card small { display: block; color: var(--gris); font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
