/* ===== Cocina sin Frontera · tienda de pedidos =====
   Colores y tipografías base: brand.css (generado desde _BrandKit/marca.md). */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Kaushan+Script&display=swap");

:root {
  --green: var(--primario, #149b79);
  --green-dark: var(--primario-2, #0d6b54);
  --green-deep: var(--fondo-2, #0a4f3e);
  --yellow: var(--secundario, #f2b90f);
  --yellow-dark: var(--secundario-2, #c9960a);
  --yellow-soft: color-mix(in srgb, var(--yellow) 30%, #fff);
  --coral: var(--acento, #e8603c);
  --cream: var(--base, #fff8ec);
  --sand: var(--base-2, #f6ead3);
  --ink: var(--oscuro, #1c2a25);
  --muted: color-mix(in srgb, var(--ink) 66%, #fff);
  --line: color-mix(in srgb, var(--ink) 11%, transparent);
  --white: #fff;
  --radius: 16px;
  --shadow: 0 8px 24px color-mix(in srgb, var(--ink) 10%, transparent);
  --font-head: var(--font-display, "Bricolage Grotesque", system-ui, sans-serif);
  --font-body: var(--font-cuerpo, "DM Sans", system-ui, sans-serif);
  --font-script: "Kaushan Script", cursive;
  --cats-alto: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--cats-alto) + 12px); }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--cream); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--green-dark); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0; }
p { margin: 0 0 .8em; }
small { font-weight: 400; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .85em 1.4em; border-radius: 999px; border: 0; font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer; transition: background .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn--primario { background: var(--green); color: var(--white); }
.btn--primario:hover { background: var(--green-dark); }
.btn--bloque { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn--claro { background: var(--sand); color: var(--ink); }
.btn--wa { background: #25d366; color: var(--white); }
.icon-btn { background: var(--white); border: 1px solid var(--line); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1rem; color: var(--ink); }

/* Franja (solo si se cargan mensajes en el panel) */
.franja { background: var(--green-deep); color: var(--yellow-soft); font-size: .85rem; overflow: hidden; white-space: nowrap; }
.franja:not(:has(.franja__pista)) { display: none; }
.franja__pista { display: flex; width: max-content; animation: franja 40s linear infinite; }
.franja__tramo { display: flex; gap: 22px; padding: .45em 11px; }
.franja__punto { color: var(--yellow); }
@keyframes franja { to { transform: translateX(-50%); } }

/* Ficha del local */
.local { background: var(--white); border-bottom: 1px solid var(--line); }
.local__portada {
  height: clamp(90px, 14vw, 150px);
  background:
    radial-gradient(circle at 85% 30%, color-mix(in srgb, var(--yellow) 45%, transparent), transparent 35%),
    radial-gradient(circle at 15% 110%, color-mix(in srgb, var(--coral) 40%, transparent), transparent 40%),
    var(--green);
}
.local__ficha { display: flex; gap: 20px; align-items: flex-end; padding-bottom: 18px; }
.local__logo { width: 96px; height: 96px; border-radius: 50%; margin-top: -48px; background: var(--white); box-shadow: 0 0 0 4px var(--white), var(--shadow); flex: none; }
.local__datos { padding-top: 12px; min-width: 0; }
.local__nombre { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; }
.local__frase { font-family: var(--font-script); color: var(--green-dark); font-size: 1.15rem; margin: 2px 0 10px; }
.local__info { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.chip { font-size: .85rem; padding: .3em .8em; border-radius: 999px; background: var(--sand); white-space: nowrap; }
.chip--abierto { background: color-mix(in srgb, var(--green) 14%, #fff); color: var(--green-dark); font-weight: 700; }
.chip--cerrado { background: color-mix(in srgb, var(--coral) 16%, #fff); color: #a3391c; font-weight: 700; }

/* Banners (solo si hay vigentes) */
.portada { position: relative; margin-top: 16px; }
.portada:not(:has(.portada__slide)) { display: none; }
.portada__pista { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); }
.portada__pista::-webkit-scrollbar { display: none; }
.portada__slide { flex: 0 0 100%; scroll-snap-align: start; }
.banner__imagen { width: 100%; height: clamp(140px, 26vw, 320px); object-fit: cover; }
.portada__puntos { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.portada__puntos button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.6); cursor: pointer; }
.portada__puntos button[aria-current] { background: var(--white); width: 22px; border-radius: 999px; }
.aviso { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--coral) 12%, #fff); border: 1px solid var(--coral); }

/* Categorías fijas + buscador */
.cats { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--cream) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.cats__fila { display: flex; align-items: center; gap: 12px; height: var(--cats-alto); }
.cats__lista { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.cats__lista::-webkit-scrollbar { display: none; }
.cat { flex: none; white-space: nowrap; padding: .45em 1em; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.cat:hover { background: var(--sand); }
.cat.is-active { background: var(--ink); color: var(--white); }
.buscar { display: flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; color: var(--muted); width: 200px; flex: none; }
.buscar input { border: 0; outline: 0; background: none; font: inherit; padding: .55em 0; width: 100%; color: var(--ink); }
.buscar:focus-within { border-color: var(--green); }

/* Página: menú + pedido */
.pagina { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; padding-top: 8px; }
.menu { min-width: 0; padding-bottom: 40px; }
.cerrado { margin: 20px 0 0; padding: 14px 18px; border-radius: 12px; background: var(--ink); color: var(--white); font-weight: 700; }
.filtro-veg { margin: 20px 0 0; border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: .4em .9em; font: 500 .85rem var(--font-body); color: var(--muted); cursor: pointer; }
.filtro-veg.is-active { background: var(--green); border-color: var(--green); color: var(--white); }

.menu-cat { padding-top: 26px; }
.menu-cat__titulo { font-size: 1.5rem; font-weight: 800; margin-bottom: 12px; }
.menu-grupo + .menu-grupo { margin-top: 18px; }
.menu-grupo__titulo { font: 700 .8rem var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--coral); margin-bottom: 8px; }
.menu-grupo__nota { color: var(--muted); font-size: .9rem; margin: -4px 0 10px; }

.items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.item__abrir {
  display: flex; gap: 14px; justify-content: space-between; width: 100%; height: 100%; text-align: left;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; font: inherit; color: inherit;
}
button.item__abrir { cursor: pointer; transition: box-shadow .15s, border-color .15s; }
button.item__abrir:hover { border-color: color-mix(in srgb, var(--green) 45%, transparent); box-shadow: var(--shadow); }
.item--agotado { opacity: .6; }
.item__texto { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.item__nombre { font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.item__desc { color: var(--muted); font-size: .88rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item__pie { margin-top: auto; padding-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.item__precio { font-weight: 800; font-size: 1rem; }
.item__antes { color: var(--muted); font-size: .85rem; }
.item__opciones { font-size: .78rem; color: var(--muted); }
.item__media { position: relative; flex: none; width: 96px; height: 96px; border-radius: 12px; background: color-mix(in srgb, var(--bg, var(--green)) 22%, #fff); display: grid; place-items: center; }
.item__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.item__emoji { font-size: 2.6rem; }
.item__mas { position: absolute; right: -6px; bottom: -6px; width: 34px; height: 34px; border-radius: 50%; background: var(--white); color: var(--green-dark); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; line-height: 1; }
button.item__abrir:hover .item__mas { background: var(--green); color: var(--white); }
.tag { font-size: .72rem; font-weight: 700; padding: .15em .6em; border-radius: 999px; background: var(--sand); }
.tag--marca { background: var(--yellow-soft); }
.tag--oferta { background: var(--coral); color: var(--white); }
.tag--oscuro { background: var(--ink); color: var(--white); }
.vacio { text-align: center; color: var(--muted); padding: 40px 0; }

/* Información */
.info { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.info h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 14px; }
.info__grilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.info__bloque { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: .92rem; }
.info__bloque h3 { font: 700 .95rem var(--font-body); margin-bottom: 8px; }
.info__bloque ul { margin: 0; padding-left: 1.1em; }
.info__bloque p:last-child { margin: 0; }
.faq { margin-top: 24px; }
.faq h3 { font: 700 1rem var(--font-body); margin-bottom: 10px; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 0 16px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 600; padding: 14px 0; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--green); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); padding-bottom: 14px; margin: 0; }

/* Pedido en la compu */
.lateral { position: sticky; top: calc(var(--cats-alto) + 16px); padding-top: 26px; }
.lateral__caja { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.lateral__caja h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.lateral .lineas { max-height: 46vh; overflow-y: auto; }
.lateral__vacio { color: var(--muted); font-size: .92rem; margin: 6px 0 0; }
.lateral__pie { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.fila-total { display: flex; justify-content: space-between; margin-bottom: 8px; }

.lineas { list-style: none; margin: 0; padding: 0; }
.linea { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.linea:last-child { border-bottom: 0; }
.linea__emoji { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.3rem; background: color-mix(in srgb, var(--bg, var(--green)) 22%, #fff); }
.linea__texto { display: flex; flex-direction: column; min-width: 0; font-size: .9rem; line-height: 1.3; }
.linea__nombre { font-weight: 600; }
.linea__precio { font-weight: 700; margin-top: 2px; }
.qty { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--white); }
.qty button { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--sand); cursor: pointer; font-weight: 700; color: var(--ink); font-size: .9rem; }
.qty span { min-width: 20px; text-align: center; font-weight: 700; font-size: .9rem; }
.qty--grande button { width: 40px; height: 40px; font-size: 1.1rem; }
.qty--grande span { min-width: 30px; font-size: 1.05rem; }
.envio-gratis { font-size: .82rem; color: var(--green-dark); background: color-mix(in srgb, var(--green) 10%, transparent); border-radius: 10px; padding: 6px 10px; margin: 0 0 10px; }
.envio-gratis:empty { display: none; }

/* Barra del pedido (celular) */
.barra-pedido {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; display: none; align-items: center; gap: 12px;
  background: var(--green); color: var(--white); border: 0; border-radius: 999px; padding: 14px 20px; font: 700 1rem var(--font-body);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 30%, transparent); cursor: pointer;
}
.barra-pedido strong { margin-left: auto; }
.barra-pedido__cantidad { background: var(--white); color: var(--green-dark); min-width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-size: .85rem; padding: 0 6px; }
.barra-pedido.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.04); } }

/* Ventana del plato */
.plato { padding: 0; border: 0; border-radius: 20px; width: min(480px, 100% - 24px); max-height: calc(100% - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
.plato::backdrop { background: rgba(10, 30, 24, .55); }
.plato__form { display: flex; flex-direction: column; max-height: inherit; }
.plato__cerrar { position: absolute; top: 12px; right: 12px; z-index: 1; }
.plato__media { height: 200px; background: color-mix(in srgb, var(--bg, var(--green)) 25%, #fff); display: grid; place-items: center; font-size: 5rem; flex: none; }
.plato__media img { width: 100%; height: 100%; object-fit: cover; }
.plato__cuerpo { padding: 18px 20px 8px; overflow-y: auto; }
.plato__cuerpo h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 6px; }
.plato__desc { color: var(--muted); }
.plato__precio { font-weight: 800; font-size: 1.1rem; }
.plato__opciones { border: 0; padding: 0; margin: 8px 0 0; }
.plato__opciones legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.opcion { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.opcion:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); }
.opcion input { accent-color: var(--green); }
.plato__pie { display: flex; gap: 12px; align-items: center; padding: 14px 20px 20px; border-top: 1px solid var(--line); flex: none; }
.plato__agregar { flex: 1; }

/* WhatsApp */
.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 35; width: 52px; height: 52px; border-radius: 50%; background: #25d366; color: var(--white); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0,0,0,.2); }

/* Pie */
.pie { border-top: 1px solid var(--line); padding: 20px 0 90px; font-size: .85rem; color: var(--muted); }
.pie__fila { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.pie a { color: inherit; }

/* Carrito y datos (panel lateral) */
.overlay { position: fixed; inset: 0; background: rgba(10, 30, 24, .5); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(460px, 100%); z-index: 60; background: var(--cream); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; box-shadow: -10px 0 40px rgba(0,0,0,.2); }
.drawer.is-open { transform: none; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h3 { font-size: 1.3rem; }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer__foot { padding: 14px 20px 20px; border-top: 1px solid var(--line); background: var(--white); }
.cart-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.totals div { display: flex; justify-content: space-between; margin-bottom: 4px; }
.totals__total { font-weight: 800; font-size: 1.2rem; padding-top: 8px; border-top: 1px solid var(--line); margin: 8px 0 14px !important; }

.checkout label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 14px; }
.checkout input:not([type=radio]):not([type=checkbox]), .checkout select, .checkout textarea {
  display: block; width: 100%; margin-top: 6px; padding: .7em .85em; border-radius: 12px; border: 1px solid var(--line); background: var(--white); font: 400 1rem var(--font-body); color: var(--ink);
}
.checkout input:focus, .checkout select:focus, .checkout textarea:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 15%, transparent); }
.checkout .invalid { border-color: var(--coral) !important; }
.checkout .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.checkout .nota, .nota { font-size: .85rem; color: var(--muted); margin: -6px 0 14px; }
.seg, .metodos { border: 0; padding: 0; margin: 0 0 14px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg legend, .metodos legend { font-weight: 700; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.seg label, .metodo { margin: 0 !important; font-weight: 500 !important; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: .7em; cursor: pointer; display: flex !important; gap: 10px; align-items: center; }
.metodo + .metodo { margin-top: 8px !important; }
.metodo span { display: flex; flex-direction: column; line-height: 1.3; }
.seg label:has(input:checked), .metodo:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); }
.seg input, .metodo input, .casilla input { accent-color: var(--green); }
.casilla { display: flex !important; gap: 10px; align-items: center; font-weight: 500 !important; }
.link-btn { background: none; border: 0; color: var(--green-dark); font: 700 .9rem var(--font-body); cursor: pointer; padding: 0; margin-bottom: 16px; }
.form-error { color: #b4232a; font-weight: 700; font-size: .9rem; }

.toast { position: fixed; left: 50%; top: 16px; transform: translate(-50%, -120px); z-index: 70; background: var(--ink); color: var(--white); padding: .7em 1.3em; border-radius: 999px; font-weight: 500; transition: transform .25s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }

/* Página de gracias y legales */
.header { background: var(--white); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand__name { font-family: var(--font-script); font-size: 1.4rem; color: var(--green); }
.section { padding: 48px 0; }
.container--narrow { width: min(760px, 100% - 32px); }
.gracias { min-height: 70vh; display: grid; place-items: center; padding: 40px 16px; }
.tarjeta-gracias { background: var(--white); border-radius: 22px; padding: clamp(22px, 5vw, 40px); width: min(560px, 100%); box-shadow: var(--shadow); border: 1px solid var(--line); }
.tarjeta-gracias h1 { font-size: clamp(1.7rem, 5vw, 2.2rem); font-weight: 800; margin-bottom: 10px; }
.tarjeta-gracias .estado { display: inline-block; font-size: .8rem; font-weight: 700; padding: .3em .9em; border-radius: 999px; background: var(--sand); color: var(--green-dark); margin-bottom: 12px; }
.tarjeta-gracias .estado--ok { background: var(--green); color: var(--white); }
.tarjeta-gracias .estado--alerta { background: var(--coral); color: var(--white); }
.tarjeta-gracias .resumen { width: 100%; border-collapse: collapse; margin: 16px 0; }
.tarjeta-gracias .resumen td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tarjeta-gracias .resumen td:last-child { text-align: right; white-space: nowrap; }
.tarjeta-gracias .resumen tr:last-child td { border: 0; font-weight: 800; font-size: 1.1rem; }
.tarjeta-gracias .acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tarjeta-gracias .alias { padding: 12px 14px; border-radius: 12px; background: var(--yellow-soft); }
.legal h1 { font-size: clamp(1.9rem, 5vw, 2.4rem); font-weight: 800; margin-bottom: 8px; }
.legal h2 { font-size: 1.25rem; margin-top: 1.6em; margin-bottom: .5em; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .5em; }

/* Responsive */
@media (max-width: 1023px) {
  .pagina { grid-template-columns: 1fr; }
  .lateral { display: none; }
  .barra-pedido:not([hidden]) { display: flex; }
  /* Con la barra del pedido a la vista, el WhatsApp queda en Información y en el pie (no tapa los "+") */
  body:has(.barra-pedido:not([hidden])) .wa-float { display: none; }
}
@media (max-width: 700px) {
  :root { --cats-alto: 104px; }
  .cats__fila { flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; }
  .buscar { width: 100%; }
  .items { grid-template-columns: 1fr; gap: 10px; }
  .local__ficha { flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 14px; }
  .local__logo { width: 72px; height: 72px; margin-top: -36px; }
  .local__datos { padding-top: 0; width: 100%; }
  .local__frase { font-size: 1rem; }
  .chip { white-space: normal; }
  .item__media { width: 88px; height: 88px; }
  .checkout .dos { grid-template-columns: 1fr; }
  .plato { width: 100%; max-width: none; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
