/*
 * ESTRUCTURA VISUAL — igual para todos los negocios. No se edita por cliente.
 * Medidas tomadas de mcdonalds.com.ar en 375 px (ver ANALISIS-MCDONALDS.md).
 * Los colores de marca llegan como variables desde negocio.js (--acento, etc.).
 */
:root {
  --blanco: #fff;
  --texto: #292929;
  --texto-2: #6f6f6f;
  --marfil: #f9f9f9;
  --linea: #ececec;
  --acento: #e8a33d;
  --sobre-acento: #292929;
  --refuerzo: #7a4a2a;
  --fuente: system-ui, sans-serif;
  --barra: 64px;
  --sombra-tarjeta: 0 8px 16px rgba(41, 41, 41, .16);
  --sombra-barra: 6px -1px 27px 13px rgba(0, 0, 0, .14);
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: calc(var(--barra) + 24px); }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 24px;
  color: var(--texto);
  background: var(--blanco);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--barra) + var(--seguro-abajo));
}
body.con-accion { padding-bottom: calc(var(--barra) + 56px + var(--seguro-abajo)); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
main:focus { outline: none; }
/* Solo para lectores de pantalla */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; }

/* ---------- Hueco de imagen (cuando el negocio todavía no tiene foto) ---------- */
.hueco {
  display: grid; place-items: center;
  background: var(--marfil); color: #d4d4d4;
  width: 100%; height: 100%;
}
.hueco svg { width: 36%; max-width: 72px; height: auto; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; border-radius: 4px;
  background: var(--acento); color: var(--sobre-acento);
  font-size: 14px; font-weight: 700;
}
.boton svg { width: 20px; height: 20px; flex: none; }
.boton-blanco {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; border-radius: 8px; background: var(--blanco); color: var(--texto);
  font-size: 14px; font-weight: 700; line-height: 1;
}
.boton-blanco svg { width: 20px; height: 20px; color: var(--refuerzo); flex: none; }

/* ---------- Portada ---------- */
.portada { position: relative; height: 320px; color: var(--blanco); overflow: hidden; background: #3a3a3a; }
.portada > .portada-fotos, .portada > .hueco { position: absolute; inset: 0; width: 100%; height: 100%; }
.portada-fotos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.portada-fotos img.activa { opacity: 1; }
.portada > .hueco { background: #4a4a4a; }
.portada > .hueco svg { display: none; }
.portada::after { content: ''; position: absolute; inset: 0; background: rgba(41, 41, 41, .7); }
.portada-contenido { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.encabezado { display: flex; align-items: center; justify-content: space-between; height: 66px; padding: 0 16px 0 20px; }
.marca { font-size: 18px; font-weight: 700; letter-spacing: -.15px; }
.marca img { height: 32px; width: auto; }
.portada .boton { font-size: 12px; font-weight: 400; min-width: 112px; }
.portada h1 { margin-top: 34px; text-align: center; font-size: 24px; line-height: 32px; font-weight: 700; padding: 0 20px; }
.portada-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; padding: 0 20px; }

/* ---------- Fila de categorías ---------- */
.categorias {
  display: flex; overflow-x: auto; scrollbar-width: none;
  padding: 16px 8px 0; scroll-snap-type: x proximity;
}
.categorias::-webkit-scrollbar { display: none; }
.categoria-chip {
  flex: 0 0 96px; display: flex; flex-direction: column; align-items: center;
  position: relative; padding-bottom: 12px; scroll-snap-align: start;
}
/* Raya de la categoría activa (es un elemento propio para poder deslizarla entre categorías) */
.raya { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--acento); }
.categoria-chip .foto { width: 42px; height: 42px; margin: 8px 0; border-radius: 8px; overflow: hidden; }
.categoria-chip .foto img { width: 100%; height: 100%; object-fit: contain; }
.categoria-chip span { font-size: 12px; line-height: 16px; min-height: 32px; text-align: center; padding: 0 4px; }

/* ---------- Destacado ---------- */
.destacado { margin-top: 80px; }
.destacado .foto { aspect-ratio: 3 / 2; }
.destacado .foto img { width: 100%; height: 100%; object-fit: cover; }
.destacado-texto { padding: 32px 32px 0; }
.destacado h2 { font-size: 32px; line-height: 36px; font-weight: 700; letter-spacing: -.15px; }
.destacado p { margin-top: 16px; font-size: 14px; line-height: 16px; letter-spacing: -.15px; }

/* ---------- Novedades (carrusel) ---------- */
.novedades {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 48px 8px 0; scroll-snap-type: x mandatory;
}
.novedades::-webkit-scrollbar { display: none; }
.novedad { flex: 0 0 calc(100% - 32px); scroll-snap-align: center; }
.novedad .foto { aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; }
.novedad .foto img { width: 100%; height: 100%; object-fit: cover; }
.novedad h3 { margin-top: 12px; font-size: 16px; line-height: 24px; font-weight: 700; }
.novedad p { font-size: 14px; line-height: 20px; color: var(--texto-2); }

/* ---------- Historias (tarjetas grandes) ---------- */
.historias { display: grid; gap: 24px; padding: 48px 8px 0; }
.historia .foto { aspect-ratio: 5 / 6; border-radius: 8px; overflow: hidden; }
.historia .foto img { width: 100%; height: 100%; object-fit: cover; }
.historia h2 { padding: 16px 16px 0; font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -.15px; }

/* Galería: una historia con varias fotos se vuelve un carrusel (el giro en perspectiva está en movimiento.css) */
.galeria {
  display: flex; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; padding: 8px 12%; /* cada foto ocupa el 76 % del ancho y queda centrada */
}
.galeria::-webkit-scrollbar { display: none; }
/* La caja (.galeria-foto) no gira, así el carrusel frena siempre con una foto en el centro; gira lo de adentro */
.galeria-foto { flex: 0 0 100%; aspect-ratio: 4 / 5; scroll-snap-align: center; }
.galeria-foto > * { width: 100%; height: 100%; border-radius: 8px; background: var(--marfil); }
.galeria-foto img { object-fit: cover; }
.galeria-flechas { display: none; }
@media (hover: hover) {
  .galeria-flechas { display: flex; justify-content: center; gap: 12px; margin-top: 12px; }
  .galeria-flechas button {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--linea); background: var(--blanco); color: var(--texto); cursor: pointer;
  }
  .galeria-flechas svg { width: 20px; height: 20px; }
  .galeria-flechas button:first-child svg { transform: scaleX(-1); }
}

/* ---------- Preguntas ---------- */
.preguntas { padding: 64px 0 40px; }
.titulo-bloque { padding: 0 16px; font-size: 24px; line-height: 32px; font-weight: 700; max-width: 75%; }
.preguntas ul { list-style: none; margin: 24px 0 0; padding: 0; }
.pregunta button {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; min-height: 64px; padding: 0 16px; text-align: left;
  font-size: 14px; line-height: 20px;
}
.pregunta svg { width: 24px; height: 24px; flex: none; }
.pregunta.abierta svg { transform: rotate(90deg); }
.pregunta .respuesta { padding: 0 16px 20px; font-size: 14px; line-height: 20px; color: var(--texto-2); }

/* ---------- Pie ---------- */
.pie { display: grid; gap: 40px; padding: 40px 16px; background: var(--marfil); }
.pie h2 { font-size: 18px; line-height: 28px; font-weight: 700; margin-bottom: 8px; }
.pie p, .pie a { display: block; font-size: 14px; line-height: 28px; }
.pie p + p { margin-top: 8px; }
.pie p span { color: var(--texto-2); }
.pie .legal { font-size: 12px; line-height: 16px; color: var(--texto-2); }

/* ---------- Carta (todas las categorías) ---------- */
.titulo-pagina { padding: 24px 20px 0; font-size: 24px; line-height: 32px; font-weight: 700; }
.carta-grilla { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 4px; padding: 24px 16px 40px; }
.carta-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.carta-item .foto { width: 96px; height: 96px; border-radius: 8px; overflow: hidden; }
.carta-item .foto img { width: 100%; height: 100%; object-fit: contain; }
.carta-item span { font-size: 20px; line-height: 28px; text-align: center; min-height: 56px; }

/* ---------- Categoría (grilla de productos) ---------- */
.grilla { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px 20px 40px; }
.tarjeta { display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; box-shadow: var(--sombra-tarjeta); background: var(--blanco); }
.tarjeta .foto { height: 144px; background: var(--marfil); display: flex; align-items: flex-end; justify-content: center; }
.tarjeta .foto img { height: 70%; width: auto; margin-bottom: 16px; object-fit: contain; }
.tarjeta .foto img.llena { height: 100%; width: 100%; margin: 0; object-fit: cover; }
.tarjeta-texto { padding: 12px; }
.tarjeta h2 { font-size: 16px; line-height: 20px; font-weight: 400; }
.tarjeta .precio { margin-top: 4px; font-size: 14px; line-height: 20px; font-weight: 700; }

/* ---------- Producto ---------- */
.cabecera {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px;
  height: 57px; background: var(--blanco); padding-right: 16px;
}
.cabecera a { display: grid; place-items: center; width: 52px; height: 57px; }
.cabecera svg { width: 24px; height: 24px; }
.cabecera span { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.producto-foto { width: 75%; aspect-ratio: 4 / 3; margin: 20px auto 0; border-radius: 8px; overflow: hidden; }
.producto-foto img { width: 100%; height: 100%; object-fit: contain; }
.producto { padding: 32px 20px 40px; }
.producto > h1 { font-size: 24px; line-height: 32px; font-weight: 700; }
.producto > .precio { margin-top: 4px; font-size: 20px; line-height: 28px; font-weight: 700; }
.producto .descripcion { margin-top: 16px; font-size: 14px; line-height: 20px; color: var(--texto-2); }
.producto > h2 { margin-top: 40px; font-size: 18px; line-height: 28px; font-weight: 700; }
.relacionados { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 16px -20px 0; padding: 0 20px 16px; }
.relacionados::-webkit-scrollbar { display: none; }
.relacionados .tarjeta { flex: 0 0 140px; }
.relacionados .tarjeta .foto { height: 112px; }

/* Botón de acción fijo (encima de la barra) */
#accion { position: fixed; left: 0; right: 0; bottom: calc(var(--barra) + var(--seguro-abajo)); z-index: 9; }
#accion:empty { display: none; }
#accion a {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px;
  background: var(--acento); color: var(--sobre-acento); font-size: 16px; font-weight: 700;
}
#accion svg { width: 22px; height: 22px; }

/* ---------- Local ---------- */
.local { padding: 0 20px 40px; }
.local h2 { margin-top: 32px; font-size: 18px; line-height: 28px; font-weight: 700; }
.local p { font-size: 14px; line-height: 20px; color: var(--texto-2); }
.horarios { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; font-size: 14px; line-height: 20px; }
.horarios dt { color: var(--texto-2); }
.horarios dd { margin: 0; text-align: right; }
.estado { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; font-weight: 700; }
.estado::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #9e9e9e; }
.estado.abierto::before { background: #2e9e4f; }
.mapa { margin-top: 16px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--marfil); }
.mapa iframe { width: 100%; height: 100%; border: 0; }
.local .boton { margin-top: 16px; width: 100%; height: 48px; font-size: 16px; }
.enlaces { list-style: none; margin: 8px 0 0; padding: 0; }
.enlaces a { display: flex; align-items: center; justify-content: space-between; min-height: 56px; font-size: 14px; border-bottom: 1px solid var(--linea); }
.enlaces svg { width: 24px; height: 24px; }

/* ---------- Barra inferior (fija en toda la web) ---------- */
#barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  height: calc(var(--barra) + var(--seguro-abajo)); padding: 8px 0 var(--seguro-abajo);
  background: var(--blanco); border-radius: 8px 8px 0 0; box-shadow: var(--sombra-barra);
}
#barra a {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  min-width: 64px; height: 48px; color: var(--texto-2);
}
#barra svg { width: 28px; height: 28px; }
#barra span { font-size: 11px; line-height: 14px; }
#barra a[aria-current="page"] { color: var(--texto); }
#barra a[aria-current="page"] svg { color: var(--acento); }
#barra a[data-seccion="pedir"] svg { color: #25d366; } /* verde de WhatsApp: el botón de pedir se destaca */

/* ---------- Encabezado de PC (en celular no se ve: ahí está la barra inferior) ---------- */
#arriba { display: none; }
.pedir-en-linea { display: none; }

/* ============================================================================
 * TABLET Y PC
 * Medido de mcdonalds.com.ar en 1280 px: contenido al 90 % del ancho (máx. 1152 px),
 * encabezado fijo arriba en vez de la barra inferior, carta en 4 columnas, productos
 * en 5 y ficha de producto en dos columnas (foto + botón a la izquierda, texto a la derecha).
 * ========================================================================== */
@media (min-width: 600px) {
  .grilla { grid-template-columns: repeat(3, 1fr); }
  .carta-grilla { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  :root { --ancho: min(90%, 1152px); --alto-arriba: 72px; }
  body, body.con-accion { padding-bottom: 0; }
  #barra, #accion { display: none; }
  html { scroll-padding-top: calc(var(--alto-arriba) + 16px); scroll-padding-bottom: 0; }

  /* Encabezado fijo: logo · secciones · Pedir */
  /* Siempre fijo; el contenido deja su lugar, salvo la portada, que queda debajo */
  main { padding-top: var(--alto-arriba); }
  main:has(> .portada) { padding-top: 0; }
  #arriba {
    position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: block;
    background: var(--blanco); box-shadow: 0 1px 0 var(--linea);
    transition: background-color 250ms ease, box-shadow 250ms ease, color 250ms ease;
  }
  #arriba .dentro { display: flex; align-items: center; gap: 40px; width: var(--ancho); height: var(--alto-arriba); margin-inline: auto; }
  #arriba .marca { font-size: 20px; }
  #arriba nav { display: flex; gap: 32px; height: 100%; }
  #arriba nav a { position: relative; display: flex; align-items: center; font-size: 18px; line-height: 28px; }
  #arriba nav a[aria-current="page"] { font-weight: 700; }
  #arriba .raya-arriba { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--acento); }
  #arriba .boton { margin-left: auto; height: 44px; padding: 0 24px; }
  #arriba .boton svg { width: 20px; height: 20px; }
  /* En la portada, el encabezado flota transparente sobre la foto */
  #arriba.sobre-portada { background: transparent; box-shadow: none; color: var(--blanco); }

  /* Portada */
  .portada { height: 552px; }
  .portada .encabezado { display: none; }
  .portada-contenido { width: var(--ancho); margin-inline: auto; justify-content: center; padding-top: var(--alto-arriba); }
  .portada h1 { margin-top: 0; padding: 0; text-align: left; font-size: 48px; line-height: 56px; max-width: 14em; }
  .portada-botones { display: flex; gap: 16px; padding: 0; margin-top: 32px; }
  .portada-botones .boton-blanco { width: auto; min-width: 180px; padding: 0 24px; height: 48px; font-size: 16px; }

  /* Fila de categorías: todas a la vista, centradas */
  .categorias { width: min(85%, 1152px); margin-inline: auto; justify-content: center; padding-top: 16px; overflow: visible; }
  .categoria-chip { flex: 0 1 112px; }
  .categoria-chip .foto { width: 48px; height: 48px; }
  .categoria-chip span { font-size: 14px; line-height: 20px; }

  /* Destacado: texto a la izquierda, foto a la derecha */
  .destacado { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; width: var(--ancho); margin: 96px auto 0; }
  .destacado .foto { order: 2; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; }
  .destacado-texto { padding: 0; }
  .destacado h2 { font-size: 48px; line-height: 54px; }
  .destacado p { font-size: 18px; line-height: 28px; }

  /* Novedades: tres en fila (sin carrusel) */
  .novedades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; width: var(--ancho); margin-inline: auto; padding: 64px 0 0; overflow: visible; }
  .novedad { animation: none !important; }
  .novedad h3 { font-size: 18px; line-height: 28px; }
  .novedad p { font-size: 16px; line-height: 24px; }

  /* Historias: foto y texto en zigzag */
  .historias { width: min(var(--ancho), 960px); margin-inline: auto; padding: 96px 0 0; gap: 64px; }
  .historia { display: grid; grid-template-columns: minmax(0, 424px) 1fr; align-items: center; gap: 64px; }
  .historia:nth-child(even) .foto, .historia:nth-child(even) .galeria-caja { order: 2; }
  .historia .foto { aspect-ratio: 424 / 520; }
  .historia h2 { padding: 0; font-size: 32px; line-height: 40px; }

  /* Preguntas: título centrado y lista angosta */
  .preguntas { width: min(var(--ancho), 800px); margin-inline: auto; padding: 120px 0 96px; }
  .titulo-bloque { max-width: none; padding: 0; text-align: center; font-size: 48px; line-height: 56px; }
  .preguntas ul { margin-top: 40px; }
  .pregunta button { padding: 0; min-height: 72px; font-size: 18px; line-height: 28px; }
  .pregunta .respuesta { padding: 0 0 24px; font-size: 16px; line-height: 24px; }
  .pregunta + .pregunta { border-top: 1px solid var(--linea); }

  /* Pie en columnas */
  .pie { grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 56px max(5%, calc((100% - 1152px) / 2)); }
  .pie .legal { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--linea); }

  /* Carta: 4 columnas centradas */
  .titulo-pagina { width: var(--ancho); margin-inline: auto; padding: 40px 0 0; font-size: 32px; line-height: 40px; }
  .carta-grilla { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 40px 24px; width: var(--ancho); margin: 0 auto; padding: 40px 0 96px; }
  .carta-item .foto { width: 112px; height: 112px; }
  .carta-item span { font-size: 24px; line-height: 32px; }

  /* Categoría: grilla de productos */
  .grilla { gap: 32px; width: var(--ancho); margin-inline: auto; padding: 32px 0 96px; }
  .tarjeta .foto { height: 200px; }
  .tarjeta-texto { padding: 16px; }
  .tarjeta h2 { font-size: 16px; line-height: 24px; }
  .tarjeta .precio { font-size: 16px; line-height: 24px; }

  /* Producto: foto y botón a la izquierda (fijos al bajar), texto a la derecha */
  .cabecera { position: static; width: var(--ancho); margin: 24px auto 0; height: 40px; padding: 0; background: none; animation: none !important; }
  .cabecera a { width: auto; height: 40px; padding-right: 8px; }
  .cabecera span { font-weight: 400; color: var(--texto-2); }
  .producto-pc { display: grid; grid-template-columns: 40% 1fr; gap: 5%; align-items: start; width: min(var(--ancho), 1040px); margin: 16px auto 0; padding-bottom: 96px; }
  .producto-media { position: sticky; top: calc(var(--alto-arriba) + 24px); }
  .producto-foto { width: 100%; margin: 0; background: var(--marfil); }
  .pedir-en-linea { display: flex; width: 100%; height: 48px; margin-top: 24px; font-size: 16px; }
  .producto { padding: 24px 0 0; }
  .producto > h1 { font-size: 56px; line-height: 60px; }
  .producto > .precio { margin-top: 12px; font-size: 28px; line-height: 36px; }
  .producto .descripcion { margin-top: 24px; font-size: 18px; line-height: 28px; }
  .producto > h2 { margin-top: 56px; font-size: 24px; line-height: 32px; }
  .relacionados { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; overflow: visible; margin: 20px 0 0; padding: 0; }
  .relacionados .tarjeta .foto { height: 140px; }

  /* Local: datos a la izquierda, mapa grande a la derecha */
  .local { display: grid; grid-template-columns: minmax(0, 380px) 1fr; grid-template-rows: auto; column-gap: 64px; width: var(--ancho); margin-inline: auto; padding: 8px 0 96px; }
  .local > :not(.mapa) { grid-column: 1; }
  .local .mapa { grid-column: 2; grid-row: 1 / span 20; margin-top: 24px; aspect-ratio: auto; min-height: 520px; align-self: stretch; }
  .local p, .horarios { font-size: 16px; line-height: 24px; }
  .local h2 { font-size: 20px; }
  .enlaces a { font-size: 16px; }
}

@media (min-width: 1024px) {
  .grilla { grid-template-columns: repeat(5, 1fr); gap: 40px; }
  .tarjeta .foto { height: 240px; }
  .portada h1 { font-size: 56px; line-height: 64px; }
}

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