*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --verde-oscuro: #2d5e1a;
  --verde: #52b020;
  --crema: #fdf6ec;
  --gris-claro: #ddeacf;
  --texto: #1a2a10;
  --texto-suave: #547840;
  --borde: #c5d4b0;
  --sombra: rgba(45,94,26,0.12);
}

html { scroll-behavior: smooth; scroll-padding-top: 3.5rem; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--crema);
  color: var(--texto);
  min-height: 100vh;
}

/* ── Cabecera ── */
header {
  background: #e6f0d8;
  padding: 1.5rem 1.5rem 1.2rem;
  border-bottom: 1px solid var(--borde);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.logo {
  display: block;
  margin: 0 auto;
  max-width: 240px;
  height: auto;
}

.header-bloque {
  display: none;
}

.tel-label {
  font-family: system-ui, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--texto-suave);
}

.tel-numero {
  font-family: system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

@media (min-width: 640px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .header-logo { text-align: center; }

  .header-bloque {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.75rem;
  }

  a.tel-numero {
    color: var(--verde-oscuro);
    text-decoration: none;
    transition: color 0.15s;
  }

  a.tel-numero:hover { color: var(--verde); }

  .dir-ciudad {
    /* color: var(--texto-suave); */
    /* font-weight: 400; */
    font-size: 0.85rem;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
header p {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--texto-suave);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: system-ui, sans-serif;
}

/* ── Navegación ── */
#nav-carta {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ccddb2;
  box-shadow: 0 2px 6px var(--sombra);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#nav-carta::-webkit-scrollbar { display: none; }
#nav-carta .nav-inner { min-width: max-content; }
.nav-inner {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0 0.5rem;
}
#nav-carta a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--verde-oscuro);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
#nav-carta a:hover {
  background: rgba(45,94,26,0.12);
  border-bottom-color: var(--verde-oscuro);
}

/* ── Contenido principal ── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ── Sección / categoría ── */
.seccion {
  margin-bottom: 2.5rem;
}
.seccion h2 {
  font-size: 1.5rem;
  font-weight: normal;
  color: var(--verde-oscuro);
  border-bottom: 2px solid var(--verde);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
}

.seccion:target {
  animation: destacar-seccion 2s ease-out;
}
.seccion:target .producto:nth-child(even) {
  animation: destacar-fila-par 2s ease-out;
}

@keyframes destacar-seccion {
  from { background-color: rgba(82, 176, 32, 0.22); }
  to   { background-color: transparent; }
}
@keyframes destacar-fila-par {
  from { background-color: rgba(82, 176, 32, 0.22); }
  to   { background-color: var(--gris-claro); }
}

/* ── Lista de productos ── */
.productos {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.producto {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px dotted var(--borde);
}
.producto:last-child { border-bottom: none; }
.producto:nth-child(even) { background: var(--gris-claro); }
.producto-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.nombre {
  font-size: 1rem;
  font-weight: bold;
  font-family: system-ui, sans-serif;
  color: var(--texto);
}
.desc {
  font-size: 0.82rem;
  color: var(--texto-suave);
  font-style: italic;
  line-height: 1.35;
}
.precio {
  font-size: 1rem;
  font-weight: bold;
  font-family: system-ui, sans-serif;
  color: var(--verde-oscuro);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Pie de página ── */
footer {
  border-top: 1px solid var(--borde);
  font-family: system-ui, sans-serif;
}

.footer-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1.5rem 2rem;
  max-width: 860px;
  margin: 0 auto;
}

.footer-titulo {
  font-weight: 700;
  color: var(--verde-oscuro);
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-contacto,
.footer-horario {
  font-size: 0.88rem;
  color: var(--texto);
  line-height: 1.8;
}

.footer-contacto p,
.footer-horario p {
  margin: 0;
}

.footer-contacto a {
  color: var(--verde-oscuro);
  text-decoration: none;
}

.footer-contacto a:hover { color: var(--verde); }

.footer-redes {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
  align-items: center;
}

.footer-redes a {
  display: flex;
  line-height: 0;
  color: var(--verde-oscuro);
  transition: color 0.15s, transform 0.15s;
}

.footer-redes a:hover {
  color: var(--verde);
  transform: scale(1.1);
}

.footer-legal {
  text-align: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--texto-suave);
  border-top: 1px solid var(--borde);
}

@media (min-width: 1181px) {
  .btn-arriba {
    left: auto;
    right: calc(50vw - 500px - 1.2rem);
    bottom: 1.5rem;
  }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .logo { max-width: 200px; }
  .producto { padding: 0.55rem 0.5rem; }
  .nombre { font-size: 0.95rem; }
  .precio { font-size: 0.95rem; }
  .footer-info { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.2rem 1rem; }
}

/* ── Nav superior Carta / Menús ── */
.nav-top {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.nav-top a {
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--verde-oscuro);
  padding: 0.3rem 1rem;
  border: 2px solid transparent;
  border-radius: 2px;
  transition: border-color 0.15s, background 0.15s;
}
.nav-top a:hover { border-color: var(--verde-oscuro); }
.nav-top a.activo {
  background: var(--verde);
  color: #fff;
  border-color: var(--verde);
}

/* ── Tabs de menú ── */
#nav-menus {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ccddb2;
  box-shadow: 0 2px 6px var(--sombra);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#nav-menus::-webkit-scrollbar { display: none; }
#nav-menus .nav-inner { display: flex; justify-content: center; min-width: max-content; padding: 0 0.5rem; }
#nav-menus button {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: block;
  padding: 0.75rem 1.2rem;
  color: var(--verde-oscuro);
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
#nav-menus button:hover { background: rgba(45,94,26,0.12); border-bottom-color: var(--verde-oscuro); }
#nav-menus button.activo { border-bottom-color: var(--verde-oscuro); background: rgba(45,94,26,0.12); }

/* ── Panel de menú ── */
.menu-panel {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
.menu-panel[hidden] { display: none; }

/* ── Cabecera Comebueno-style ── */
.menu-cabecera {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--borde);
}
.menu-precio-global {
  font-family: system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--verde-oscuro);
  letter-spacing: 0.02em;
}
.menu-subtitulo {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--texto-suave);
  font-style: italic;
}

/* ── Grupos (Comebueno / Combo / Infantil) ── */
.grupos-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.grupo {
  padding: 0.65rem 1rem 0.65rem 0.9rem;
  border-left: 2px solid var(--verde);
  background: rgba(82, 176, 32, 0.06);
}
.grupo-titulo {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--texto);
  margin-bottom: 0.35rem;
}
.grupo-desc {
  font-size: 0.88rem;
  color: var(--texto-suave);
  font-style: italic;
  line-height: 1.5;
}

/* ── Sub-menús (Pollo) ── */
.submenus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.submenu {
  padding: 0.8rem 1rem 0.8rem 0.9rem;
  border: 1px solid var(--borde);
  border-left: 2px solid var(--verde);
  border-radius: 4px;
  background: rgba(82, 176, 32, 0.06);
}
.submenu-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.submenu-titulo {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--texto);
}
.submenu-precio {
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--verde-oscuro);
  white-space: nowrap;
}
.submenu-desc {
  font-size: 0.85rem;
  color: var(--texto-suave);
  font-style: italic;
  line-height: 1.4;
}

/* ── Responsive menús ── */
@media (max-width: 600px) {
  .submenus-grid { grid-template-columns: 1fr; }
}

/* ── Botón volver al inicio ── */
.btn-arriba {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--verde-oscuro);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 200;
  border: 2px solid rgba(255,255,255,0.2);
}
.btn-arriba.visible { opacity: 0.6; pointer-events: auto; }
.btn-arriba:hover { opacity: 1; }

/* ── Barra de pedidos sticky (mobile) ── */
.barra-pedidos {
  display: none;
}

@media (max-width: 639px) {
  .barra-pedidos {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 199;
    background: var(--verde-oscuro);
  }

  .barra-tel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.6rem 0.5rem;
    text-decoration: none;
    color: #fff;
    transition: background 0.15s;
  }

  .barra-tel:first-child {
    border-right: 1px solid rgba(255,255,255,0.2);
  }

  .barra-tel:active {
    background: rgba(255,255,255,0.12);
  }

  .barra-tel-label {
    font-family: system-ui, sans-serif;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.6);
  }

  .barra-tel-num {
    font-family: system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
  }

  body { padding-bottom: 58px; }

  .btn-arriba { bottom: calc(1.5rem + 58px); }
}
