/* Pedidos web de SCROLLS: papel, cacao y burdeos; Bodoni para nombres y cifras. Pensada para el celular. */
:root {
  --papel: #F3ECE2; --papel-2: #FAF6F0; --lino: #E6DBCB; --piedra: #CFC4B5; --cacao: #3A2419; --negro: #1C1310;
  --burdeos: #6B2830; --matcha: #5F6B45; --suave: #7A6A5E; --alerta: #A2402F;
  --serif: "Bodoni Moda", Georgia, serif; --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papel); color: var(--negro); font: 16px/1.5 var(--sans); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cacao); outline-offset: 2px; }
.oculto { display: none !important; }
.cargando { text-align: center; padding: 80px 16px; color: var(--suave); }
#app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(110px + env(safe-area-inset-bottom)); }

/* Encabezado */
.cab { position: relative; text-align: center; padding: 28px 0 18px; overflow: hidden; }
.cab .espiral { position: absolute; width: 420px; left: 50%; top: -150px; transform: translateX(-30%); opacity: .22; pointer-events: none; }
.cab img.logo { position: relative; height: 54px; width: auto; margin: 0 auto; }
.cab .marca { position: relative; font: 400 40px/1 var(--serif); letter-spacing: .08em; color: var(--cacao); }
.cab h1 { position: relative; font: 400 26px/1.2 var(--serif); margin: 14px 0 6px; }
.estado-local { position: relative; display: block; max-width: 34ch; margin: 0 auto; font-size: 14px; color: var(--suave); }
.estado-local::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--matcha); vertical-align: 1px; }
.estado-local.cerrado::before { background: var(--piedra); }

/* Categorías */
.chips { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; margin: 0 -16px; padding-inline: 16px; background: var(--papel); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--piedra); background: transparent; border-radius: 999px; padding: 8px 16px; min-height: 40px; }
.chip.on { background: var(--cacao); border-color: var(--cacao); color: var(--papel-2); }

/* Productos */
.seccion { margin-top: 22px; scroll-margin-top: 64px; }
.seccion > h2 { font: 400 24px/1.2 var(--serif); margin: 0 0 4px; }
.seccion > p { margin: 0 0 12px; color: var(--suave); font-size: 14px; }
.prod { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; padding: 14px 0; border-top: 1px solid var(--lino); }
.prod:first-of-type { border-top: 0; }
.prod .foto { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; background: var(--lino); }
.prod .sin-foto { width: 96px; height: 96px; border-radius: 12px; background: var(--lino); }
.prod h3 { margin: 0; font: 500 17px/1.3 var(--sans); }
.prod p { margin: 4px 0 0; font-size: 14px; color: var(--suave); }
.prod .pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.precio { font: 400 19px/1 var(--serif); }
.agregar { border: 0; background: var(--burdeos); color: #fff; border-radius: 999px; padding: 9px 18px; min-height: 40px; font-weight: 600; }
.agregar:disabled { background: var(--piedra); color: var(--papel-2); cursor: default; }
.en-carrito { font-size: 13px; color: var(--matcha); font-weight: 600; }

/* Barra del pedido */
.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--papel) 30%); }
.barra button { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 688px; margin: 0 auto; border: 0; border-radius: 16px; padding: 16px 20px; background: var(--cacao); color: var(--papel-2); font-weight: 600; font-size: 17px; }
.barra .total { font: 400 22px/1 var(--serif); }

/* Hojas (leche, sabores) */
.velo { position: fixed; inset: 0; z-index: 30; background: rgba(28, 19, 16, .45); display: flex; align-items: flex-end; justify-content: center; }
.hoja { position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--papel-2); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
.hoja h2 { font: 400 24px/1.2 var(--serif); margin: 0 0 4px; }
.hoja .sub { color: var(--suave); margin: 0 0 14px; font-size: 14px; }
.opcion { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 16px; margin-bottom: 8px; border: 1px solid var(--lino); border-radius: 12px; background: #fff; text-align: left; min-height: 52px; }
.opcion.on { border-color: var(--cacao); box-shadow: inset 0 0 0 1px var(--cacao); }
.opcion .extra { color: var(--suave); font-size: 14px; }
.sabores { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sabor { position: relative; border: 1px solid var(--lino); border-radius: 12px; background: #fff; padding: 0 0 10px; text-align: left; overflow: hidden; }
.sabor img, .sabor .sin-foto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--lino); }
.sabor span { display: block; padding: 8px 10px 0; font-size: 14px; font-weight: 500; }
.sabor .n { position: absolute; top: 8px; right: 8px; min-width: 28px; height: 28px; border-radius: 14px; background: var(--burdeos); color: #fff; display: grid; place-items: center; font-weight: 600; }
.acciones-hoja { display: flex; gap: 10px; margin-top: 16px; }

/* Botones */
.btn { border: 0; border-radius: 14px; padding: 14px 18px; min-height: 50px; font-weight: 600; background: var(--burdeos); color: #fff; }
.btn.sec { background: transparent; color: var(--cacao); box-shadow: inset 0 0 0 1px var(--cacao); }
.btn.ancho { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.enlace { background: none; border: 0; padding: 0; color: var(--burdeos); text-decoration: underline; }

/* Pedido (checkout) */
.volver { display: inline-flex; align-items: center; gap: 6px; margin: 18px 0 6px; background: none; border: 0; padding: 6px 0; color: var(--cacao); font-weight: 500; }
.titulo { font: 400 30px/1.15 var(--serif); margin: 4px 0 16px; }
.bloque { background: var(--papel-2); border: 1px solid var(--lino); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.bloque > h2 { font: 600 15px/1.3 var(--sans); margin: 0 0 12px; }
.linea { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px dashed var(--lino); }
.linea:first-of-type { border-top: 0; padding-top: 0; }
.linea .det { font-size: 13px; color: var(--suave); }
.cant { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.cant button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--piedra); background: #fff; font-size: 18px; line-height: 1; }
.cant span { min-width: 26px; text-align: center; font-weight: 600; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: var(--lino); margin-bottom: 12px; }
.seg button { border: 0; border-radius: 10px; padding: 11px 8px; min-height: 44px; background: transparent; font-weight: 500; }
.seg button.on { background: var(--papel-2); box-shadow: 0 1px 2px rgba(58, 36, 25, .15); font-weight: 600; }
.campo { display: block; margin-bottom: 12px; }
.campo > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.campo input, .campo select, .campo textarea { width: 100%; border: 1px solid var(--piedra); border-radius: 12px; padding: 12px 14px; background: #fff; min-height: 48px; font-size: 16px; }
.campo small { display: block; margin-top: 4px; color: var(--suave); font-size: 13px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 10px 0; }
.chk input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--burdeos); flex: 0 0 auto; }
.pago { display: grid; gap: 8px; }
.pago .opcion b { display: block; }
.pago .opcion small { color: var(--suave); }
.nota-ubic { font-size: 13px; color: var(--matcha); margin: -4px 0 10px; }
.totales { display: grid; gap: 6px; font-size: 15px; }
.totales div { display: flex; justify-content: space-between; }
.totales .gran { font: 400 28px/1.1 var(--serif); margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--lino); }
.error { color: var(--alerta); font-size: 14px; margin: 8px 0 0; }
.vacio { text-align: center; padding: 50px 10px; color: var(--suave); }
.vacio b { display: block; font: 400 24px var(--serif); color: var(--cacao); margin-bottom: 6px; }

/* Estado del pedido */
.estado-n { font: 400 54px/1 var(--serif); color: var(--cacao); }
.pasos { list-style: none; padding: 0; margin: 16px 0 6px; }
.pasos li { position: relative; padding: 0 0 18px 30px; color: var(--suave); }
.pasos li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--piedra); }
.pasos li::after { content: ""; position: absolute; left: 11px; top: 20px; bottom: 2px; width: 2px; background: var(--lino); }
.pasos li:last-child::after { display: none; }
.pasos li.hecho { color: var(--negro); }
.pasos li.hecho::before { background: var(--matcha); }
.pasos li.actual { color: var(--negro); font-weight: 600; }
.pasos li.actual::before { background: var(--burdeos); box-shadow: 0 0 0 4px rgba(107, 40, 48, .18); }
.qr { width: 220px; margin: 6px auto 12px; border-radius: 12px; background: #fff; padding: 8px; }
.llave { display: flex; gap: 8px; align-items: center; }
.llave code { flex: 1; font: 600 18px/1.2 var(--sans); background: #fff; border: 1px dashed var(--piedra); border-radius: 10px; padding: 12px; overflow-wrap: anywhere; }
.dato { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--lino); }
.dato:first-of-type { border-top: 0; }
.dato b { font-weight: 600; text-align: right; }

#aviso { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px); }
#aviso div { background: var(--negro); color: var(--papel-2); padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
#aviso div.mal { background: var(--alerta); }

@media (min-width: 640px) {
  .prod { grid-template-columns: 120px 1fr; }
  .prod .foto, .prod .sin-foto { width: 120px; height: 120px; }
}
@media (prefers-reduced-motion: no-preference) {
  .hoja { animation: subir .22s ease-out; }
  @keyframes subir { from { transform: translateY(24px); opacity: .6; } }
}

/* Ayudas, estados y errores por campo */
.ayuda { font-size: 14px; color: var(--suave); margin: 0 0 12px; }
.campo-error { display: block; font-style: normal; color: var(--alerta); font-size: 13px; margin-top: 4px; min-height: 0; }
.campo-error:empty { display: none; }
.domi-estado { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--lino); font-size: 14px; color: var(--cacao); }
.domi-estado:empty { display: none; }
.domi-estado.ok { background: #E4E8DA; color: var(--matcha); }
.domi-estado.ok b { font: 400 18px/1.2 var(--serif); color: var(--negro); }
.domi-estado.mal { background: #F5DED8; color: var(--alerta); }
.domi-estado.calculando { color: var(--suave); }
.btn.resaltar { background: var(--cacao); color: var(--papel-2); box-shadow: none; }

/* Días para programar */
.dias { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.dias::-webkit-scrollbar { display: none; }
.dia { flex: 0 0 auto; min-width: 104px; padding: 10px 14px; border: 1px solid var(--piedra); border-radius: 12px; background: #fff; text-align: left; }
.dia b { display: block; font-weight: 600; text-transform: capitalize; }
.dia small { color: var(--suave); font-size: 12.5px; }
.dia.on { border-color: var(--cacao); box-shadow: inset 0 0 0 1px var(--cacao); background: var(--papel-2); }

/* Barra fija del pedido */
.barra-pedido { display: grid; gap: 6px; }
.barra-pedido .error { max-width: 688px; width: 100%; margin: 0 auto; text-align: center; background: var(--papel-2); border-radius: 10px; padding: 0 10px; }
.barra-pedido .error:empty { display: none; }
.barra-pedido .error:not(:empty) { padding: 8px 10px; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.barra-pedido button { background: var(--burdeos); }
.barra-pedido button:disabled { opacity: .7; }
.pago-rechazado { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #F4E3E2; color: var(--burdeos); font-size: 14px; line-height: 1.45; }
.preventa-dia { margin: 6px 0 10px; color: var(--suave, #7A6A5E); font-size: 15px; }
.seccion.agotada .prod { opacity: .55; }
.agotado-tag { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: #1C1310; color: #F3ECE2; font: 600 12px/1.6 'Instrument Sans', sans-serif; letter-spacing: .02em; }
.domi-estado.fuera { display: grid; gap: 8px; padding: 16px; border: 1.5px solid var(--burdeos, #6B2830); background: #F7E6E1; color: var(--cacao, #3A2419); }
.domi-estado.fuera .fuera-titulo { font: 500 20px/1.2 var(--serif); color: var(--burdeos, #6B2830); }
.domi-estado.fuera .btn { margin-top: 4px; }
.verificando { text-align: center; }
.verificando .giro { width: 34px; height: 34px; margin: 4px auto 10px; border-radius: 50%; border: 3px solid var(--lino, #E6DBCB); border-top-color: var(--matcha, #5F6B45); animation: giro 0.9s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .verificando .giro { animation-duration: 3s; } }

/* Portada: tarjetas por categoría (idea de la carta de Menüpp) */
.cats { display: grid; gap: 12px; margin-top: 8px; }
.cat { position: relative; display: flex; align-items: center; min-height: 148px; padding: 22px 132px 22px 22px; border-radius: 18px; overflow: hidden;
  background: var(--cacao); color: var(--papel); text-decoration: none; }
.cat:active { transform: scale(.99); }
.cat .cat-txt { position: relative; z-index: 1; display: grid; gap: 2px; }
.cat b { font: 400 30px/1.05 var(--serif); }
.cat .cat-txt > span { font: 400 15px/1.3 var(--serif); font-style: italic; opacity: .85; }
.cat small { margin-top: 10px; font-size: 13px; letter-spacing: .01em; color: var(--lino); }
.cat .cat-icono { position: absolute; right: 8px; bottom: -6px; width: auto; height: 132px; max-width: 130px; object-fit: contain; object-position: right bottom; pointer-events: none; }
.cat .cat-icono.rollo, .cat .cat-icono.caliente, .cat .cat-icono.otro { height: auto; width: 165px; max-width: 165px; bottom: -12px; right: -10px; }
.cat .cat-icono.combo { bottom: -18px; }
.cat.agotada .cat-icono { opacity: .6; }
.cat.agotada { background: #6F625A; }
.cat.agotada small { color: var(--papel); font-weight: 600; }
.titulo-cat { font: 400 32px/1.1 var(--serif); margin: 10px 0 2px; }
.titulo-cat + p { margin: 0 0 6px; color: var(--suave); font-family: var(--serif); font-style: italic; }
a.chip { color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
@media (min-width: 640px) {
  .cats { grid-template-columns: 1fr 1fr; }
  .cat { min-height: 170px; }
}
@media (hover: hover) { .cat:hover { background: #4A3022; } }

/* Foto grande del producto */
.foto-btn { display: block; padding: 0; border: 0; background: none; border-radius: 12px; cursor: zoom-in; }
.visor { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(28, 19, 16, .82); }
.visor-caja { position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--papel-2); border-radius: 20px; }
.visor-caja img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 20px 20px 0 0; background: var(--lino); }
.visor-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 4px; }
.visor-pie b { display: block; font: 500 18px/1.3 var(--sans); }
.visor-pie .precio { display: block; margin-top: 4px; }
.visor-caja > p { margin: 0; padding: 6px 16px 16px; font-size: 14px; color: var(--suave); }
.visor-cerrar { position: absolute; top: 10px; right: 10px; z-index: 1; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(243, 236, 226, .92); color: var(--negro); font-size: 26px; line-height: 1; }
@media (prefers-reduced-motion: no-preference) { .visor-caja { animation: subir .2s ease-out; } }

.regla-combo { color: var(--cacao) !important; font-weight: 500; }
.precio small { font: 400 12px var(--sans); color: var(--suave); }

/* Sabores elegidos del combo: × para quitar uno */
.sabor.on { border-color: var(--burdeos); box-shadow: inset 0 0 0 1px var(--burdeos); }
.sabor .quitar-sabor { position: absolute; top: 8px; left: 8px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(250, 246, 240, .95); color: var(--negro); font-size: 22px; line-height: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); cursor: pointer; }
.hoja-cerrar { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--lino); color: var(--negro); font-size: 26px; line-height: 1; }
.hoja h2 { padding-right: 48px; }
.regla-combo.promo { display: inline-block; margin: 8px 0 2px !important; padding: 8px 12px; border-radius: 12px; background: #F4E3E2; color: var(--burdeos) !important; font: 500 15px/1.35 var(--serif); font-style: italic; }
.hoja .regla-combo.promo { margin: 0 0 6px !important; font-size: 17px; }
/* Dónde recoger (página del pedido) */
.recoger-info p { margin: 0 0 8px; }
.recoger-dir { font-size: 16px; line-height: 1.4; }
.recoger-ind, .recoger-hora { font-size: 14px; color: var(--cacao); }
.recoger-mapa { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 6px; text-decoration: none; }

/* ¿Cómo quieres tu pedido? (recoger hoy, domicilio hoy o programado) */
.pregunta { font: 400 24px/1.2 var(--serif); text-align: center; margin: 8px 0 14px; }
.modos { display: grid; gap: 12px; }
.modo { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 1px solid var(--piedra); border-radius: 18px; background: var(--papel-2); padding: 18px 18px; min-height: 84px; }
.modo b { font: 400 22px/1.2 var(--serif); color: var(--cacao); }
.modo span { font-size: 14px; color: var(--suave); }
.modo:hover:not(:disabled) { border-color: var(--cacao); }
.modo.off { opacity: .55; cursor: default; }
.modo-actual { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 0 12px; font-size: 14px; color: var(--cacao); text-align: center; }
.modo-actual .modo-dir { font-weight: 400; color: var(--suave); }
.modo-acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 4px; }
.modo-actual span { font-weight: 600; }
.modo-actual .enlace { background: none; border: 0; padding: 0; font-size: 14px; }
.domi-estado.aviso { background: #F4E8CF; color: var(--cacao); }
.domi-estado span { display: block; margin-top: 4px; }
.dir-elegida { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--papel); line-height: 1.4; }
.dir-elegida span { font-size: 14px; color: var(--matcha); font-weight: 600; }
.dir-elegida .enlace { display: block; margin-top: 6px; font-size: 14px; }

/* Código de descuento */
.codigo-desc { margin-bottom: 14px; }
.fila-codigo { display: flex; gap: 8px; }
.fila-codigo input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .04em; }
.fila-codigo .btn { flex: none; }
.codigo-ok { display: block; color: var(--matcha, #5F6B45); font-weight: 600; margin-top: 4px; }
.codigo-ok:empty { display: none; }
.totales .desc span:last-child { color: var(--matcha, #5F6B45); }
