/* Página de pedidos · colores desde config.js (--marca / --crema) */
:root {
  --marca: #1D4AA0;
  --crema: #F4E8CF;
  --bg: color-mix(in srgb, var(--crema) 70%, white);
  --paper: color-mix(in srgb, var(--crema) 18%, white);
  --ink: color-mix(in srgb, var(--marca) 45%, #0b0f1c);
  --ink-2: color-mix(in srgb, var(--marca) 30%, #4b5262);
  --muted: color-mix(in srgb, var(--marca) 15%, #868b98);
  --line: color-mix(in srgb, var(--marca) 16%, transparent);
  --line-strong: color-mix(in srgb, var(--marca) 38%, transparent);
  --accent: var(--marca);
  --accent-soft: color-mix(in srgb, var(--marca) 9%, transparent);
  --wa: #1F8A55;
  --shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 16px 34px -22px rgba(20, 30, 60, .45);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  --bubble: "Arial Rounded MT Bold", var(--display);
  --script: "Snell Roundhand", cursive;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: color-mix(in srgb, var(--marca) 22%, #070a12); --paper: color-mix(in srgb, var(--marca) 30%, #0d111c);
    --ink: var(--crema); --ink-2: color-mix(in srgb, var(--crema) 75%, #8a90a0); --muted: color-mix(in srgb, var(--crema) 50%, #6b7182);
    --line: color-mix(in srgb, var(--crema) 12%, transparent); --line-strong: color-mix(in srgb, var(--crema) 30%, transparent);
    --accent: color-mix(in srgb, var(--marca) 45%, white); --accent-soft: color-mix(in srgb, var(--marca) 30%, transparent);
    --shadow: 0 16px 34px -20px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 var(--sans); letter-spacing: -.01em; -webkit-font-smoothing: antialiased; overflow-x: hidden; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.85) rotate(-12deg); } }

/* ── encabezado ── */
.top { background: var(--marca); color: var(--crema); text-align: center; padding: calc(env(safe-area-inset-top) + 24px) 20px 70px; border-radius: 0 0 38px 38px; position: relative; overflow: hidden; }
.top::before { content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none; background-image: radial-gradient(var(--crema) 1.2px, transparent 1.4px); background-size: 22px 22px; }
.top-inner { position: relative; }
.sello { width: 92px; height: 92px; display: block; margin: 0 auto 6px; animation: pop .9s var(--spring) both; }
.sello .s-fondo { fill: var(--crema); } .sello .s-aro { fill: none; stroke: var(--marca); stroke-width: 2.5; stroke-dasharray: 3 5; } .sello .s-letra { font: 400 58px var(--bubble); fill: var(--marca); }
.wordmark { margin: 0; font: 400 clamp(50px, 16vw, 78px)/.88 var(--bubble); text-transform: uppercase; display: flex; flex-direction: column; align-items: center; }
.wordmark span { animation: rise .8s var(--spring) both; } .wordmark span:first-child { font-size: .62em; animation-delay: .1s; } .wordmark span:nth-child(2) { animation-delay: .2s; }
.script { margin: 6px 0 0; font: 400 23px/1.3 var(--script); transform: rotate(-3deg); animation: rise .8s var(--ease) .35s both; }

/* ── contenido ── */
.wrap { max-width: 560px; margin: -46px auto 0; padding: 0 16px; position: relative; z-index: 2; }
.card { background: var(--paper); border: 1.5px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.producto { overflow: hidden; animation: rise .8s var(--ease) .3s both; }
.ilus-wrap { background: var(--accent-soft); padding: 22px 20px 6px; }
.ilus { width: 100%; max-width: 320px; display: block; margin: 0 auto; }
.ilus .i-sombra { fill: var(--accent); opacity: .1; }
.ilus .i-bandeja { fill: color-mix(in srgb, var(--paper) 70%, #c9ccd4); stroke: var(--line-strong); stroke-width: 2; }
.ilus .i-borde { fill: color-mix(in srgb, var(--paper) 50%, #b6bac4); }
.ilus .i-pieza { fill: #F2D59B; stroke: #D9B26A; stroke-width: 1.5; animation: rise .5s var(--spring) both; animation-delay: calc(400ms + var(--d)); }
.ilus .i-raya { stroke: #D9B26A; stroke-width: 1.4; stroke-linecap: round; fill: none; }
.fotos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.fotos img { width: 100%; flex: none; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; }
.prod-body { padding: 20px 20px 22px; }
.titular { font: 750 25px/1.15 var(--display); letter-spacing: -.03em; margin: 0; text-wrap: balance; }
.bajada { color: var(--ink-2); margin: 8px 0 0; font-size: 16px; }
.precio-row { display: flex; align-items: baseline; gap: 8px; margin-top: 16px; }
.precio { font: 800 40px/1 var(--display); letter-spacing: -.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.precio-row span { color: var(--muted); font-weight: 600; }
.promos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.promo { background: var(--marca); color: var(--crema); border-radius: 99px; padding: 6px 13px; font-size: 14px; font-weight: 750; }
.cantidad { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1.5px dashed var(--line); }
.cantidad > span { font-weight: 650; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--accent-soft); border-radius: 99px; padding: 4px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--paper); color: var(--accent); font: 600 26px/1 var(--display); box-shadow: 0 2px 8px -4px rgba(0,0,0,.3); transition: transform .25s var(--spring), opacity .2s; }
.stepper button:active { transform: scale(.88); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 44px; text-align: center; font: 800 26px var(--display); font-variant-numeric: tabular-nums; }
.ahorro { min-height: 22px; margin: 10px 0 0; font-size: 14.5px; color: var(--muted); text-align: right; }
.ahorro.on { color: var(--wa); font-weight: 700; }

.beneficios { list-style: none; padding: 0; margin: 18px 4px; display: grid; gap: 10px; }
.beneficios li { display: flex; align-items: center; gap: 10px; font-weight: 600; animation: rise .6s var(--ease) both; }
.beneficios li:nth-child(2) { animation-delay: .08s; } .beneficios li:nth-child(3) { animation-delay: .16s; }
.beneficios svg { width: 26px; height: 26px; flex: none; padding: 4px; border-radius: 50%; background: var(--accent-soft); fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.bloque { padding: 18px 20px; margin-top: 14px; }
.bloque h3 { font: 400 23px/1.2 var(--script); color: var(--accent); margin: 0 0 8px; }
dl { margin: 0; }
dl div { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 10px 0; border-top: 1.5px dashed var(--line); }
dl div:first-child { border-top: 0; }
dt { color: var(--muted); font-weight: 650; font-size: 15px; } dd { margin: 0; font-size: 15.5px; }
details { border-top: 1.5px dashed var(--line); padding: 12px 0; } details:first-of-type { border-top: 0; }
summary { font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; transition: transform .3s var(--spring); }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 8px 0 0; color: var(--ink-2); font-size: 15.5px; }
.pie { text-align: center; color: var(--muted); font-size: 13px; margin: 26px 0 0; line-height: 1.7; }
.pie a { color: var(--muted); }

/* ── barra fija de pedido ── */
.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); animation: subir .7s var(--spring) .6s both; }
@keyframes subir { from { transform: translateY(110%); } }
.barra-inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.total { display: flex; flex-direction: column; min-width: 0; }
.total small { color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
.total b { font: 800 24px/1.1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pedir { flex: 1; min-height: 56px; border: 0; border-radius: 99px; background: var(--wa); color: #fff; font: 750 17px var(--display); display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 14px 24px -12px var(--wa); transition: transform .3s var(--spring); }
.pedir:active { transform: scale(.96); }
.pedir svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 360px) { .pedir { font-size: 15px; } .total b { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; } }

/* ── cupos por tanda ── */
.tanda { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--line); }
.tanda-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tanda-top b { font-size: 15.5px; }
.tanda-top span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tanda-barra { height: 6px; margin: 9px 0 0; border-radius: 99px; background: var(--line); overflow: hidden; }
.tanda-barra i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .8s var(--ease); }
.tanda small { display: block; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.tanda.pocos { background: color-mix(in srgb, #D9533B 10%, transparent); border-color: color-mix(in srgb, #D9533B 30%, transparent); }
.tanda.pocos .tanda-barra i { background: #D9533B; }
.tanda.fin { background: var(--paper); border-style: dashed; border-color: var(--line-strong); }
.cantidad.off { opacity: .45; }

/* ── logo propio (config.js → marca.logo) ── */
.logo { width: 132px; height: auto; display: block; margin: 0 auto 4px; animation: pop .9s var(--spring) both; }

/* ── fecha única (config.js → pedidos.fecha) ── */
.aviso-fecha { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; padding: 16px 18px; border-radius: 24px; background: var(--paper); color: var(--ink); border: 2.5px solid var(--accent); box-shadow: var(--shadow); animation: rise .8s var(--ease) .2s both; position: relative; overflow: hidden; }
.aviso-fecha::after { content: ""; position: absolute; inset: 6px; border: 1.5px dashed var(--line-strong); border-radius: 17px; pointer-events: none; }
.cal { flex: none; width: 74px; border-radius: 14px; background: var(--marca); color: var(--crema); text-align: center; overflow: hidden; transform: rotate(-4deg); box-shadow: 0 8px 18px -10px rgba(0,0,0,.5); }
.cal small { display: block; background: #C8452E; color: #fff; font: 800 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; padding: 6px 0 5px; }
.cal b { display: block; font: 400 42px/1.15 var(--bubble); padding: 2px 0 4px; }
.aviso-txt { position: relative; min-width: 0; }
.aviso-txt > b { display: block; color: var(--accent); font: 800 20px/1.15 var(--display); letter-spacing: -.02em; text-transform: uppercase; }
.aviso-txt p { margin: 5px 0 0; font-size: 15px; line-height: 1.35; opacity: .95; }
.aviso-txt small { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 750; background: #C8452E; color: #fff; padding: 4px 10px; border-radius: 99px; }

/* ── envío (config.js → pedidos.envio) ── */
.recibir .modos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.recibir button[role="radio"] { border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); border-radius: 18px; transition: transform .25s var(--spring), border-color .2s, background .2s; }
.recibir button[role="radio"]:active { transform: scale(.97); }
.recibir button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1.5px var(--accent) inset; }
.modos button { display: flex; align-items: center; gap: 10px; padding: 14px; text-align: left; }
.modos svg { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modos span { display: flex; flex-direction: column; } .modos b { font-size: 16.5px; } .modos small { color: var(--muted); font-size: 13px; font-weight: 600; }
.panel { margin-top: 14px; }
.lbl { margin: 0 0 8px; font-weight: 650; font-size: 15px; }
.zonas { display: grid; gap: 8px; }
.zonas button { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 15px; text-align: left; font-size: 15.5px; font-weight: 600; }
.zonas b { font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; } .zonas b.gratis { color: var(--wa); }
.nota { margin: 10px 0 0; font-size: 14.5px; color: var(--ink-2); }
.campo { display: block; margin-top: 14px; }
.campo span { display: block; font-weight: 650; font-size: 15px; margin-bottom: 6px; } .campo i { color: var(--muted); font-style: normal; font-weight: 500; }
.campo input { width: 100%; font: 16.5px var(--sans); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 13px 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.campo input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.falta { margin: 10px 0 0; min-height: 0; color: #C8452E; font-weight: 700; font-size: 15px; } .falta:empty { display: none; }

/* ── rendimiento (config.js → producto.rindePersonas) ── */
.rinde { margin: 12px 0 0; text-align: right; font-size: 15px; color: var(--ink-2); } .rinde b { color: var(--accent); }

.nota.cotiza { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); }
