/* ── Burddo a domicilio · rediseño 27 oct 2026 ─────────────────────── */
:root {
  --navy: #0A1628;
  --navy-2: #13233A;
  --cream: #F6EDE0;
  --cream-2: #EADBC6;
  --paper: #FFFCF7;
  --gold: #C9993F;
  --gold-text: #8A5E17;
  --ink: #1E1710;
  --muted: #6F6356;
  --line: rgba(10, 22, 40, .10);
  --ok: #2E7656;
  --warn: #A8641B;
  --wa: #1F8A4C;
  --bg: var(--cream);
  --surface: var(--paper);
  --text: var(--ink);
  --text-muted: var(--muted);
  --accent: var(--navy);
  --accent-text: #FFFCF7;
  --chip: rgba(10, 22, 40, .06);
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, .06), 0 4px 14px rgba(10, 22, 40, .06);
  --shadow-lg: 0 18px 50px rgba(10, 22, 40, .22);
  --radius: 18px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --top-h: 60px;
  --cats-h: 52px;
}

body.night-mode {
  --bg: #07090C;
  --surface: #11161D;
  --text: #F1E2CE;
  --text-muted: #B3A694;
  --line: rgba(241, 226, 206, .10);
  --accent: #D4A84B;
  --accent-text: #0A0D12;
  --gold-text: #D4A84B;
  --chip: rgba(241, 226, 206, .07);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + var(--cats-h) + 12px); scroll-padding-bottom: 96px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color .3s ease, color .3s ease;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.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; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ── Barra superior ── */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--top-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1080px; height: 100%; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.brand-logo { width: 116px; height: auto; }
body.night-mode .brand-logo { filter: brightness(0) invert(.9) sepia(.3); }
.brand-delivery { padding: 4px 8px; border-radius: 999px; background: var(--chip); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.back-menu, .header-cart {
  height: 40px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; text-decoration: none; font-size: 13px; font-weight: 600;
  transition: transform .16s var(--ease-out), background-color .2s ease;
}
.back-menu { padding: 0 12px 0 8px; color: var(--text); border: 1px solid var(--line); }
.back-menu svg, .header-cart svg { width: 18px; height: 18px; }
.header-cart { position: relative; padding: 0 14px; border: 0; background: var(--accent); color: var(--accent-text); }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--accent-text); color: var(--accent); font-size: 11px; font-weight: 700;
}
.cart-count.bump { animation: bump .3s var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.3); } }
.back-menu:active, .header-cart:active { transform: scale(.97); }

/* ── Encabezado ── */
.page-shell { max-width: 1080px; margin: 0 auto; padding: 0 16px 140px; }
.hero { padding: 22px 0 4px; }
.eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text); }
.hero h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(2.3rem, 9vw, 3.6rem); line-height: .98; letter-spacing: -.01em; color: var(--text); }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--gold-text); }
.hero-copy { margin: 12px 0 0; max-width: 46ch; color: var(--text-muted); font-size: 14px; }

.status {
  margin: 14px 0 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(46, 118, 86, .12); color: var(--ok);
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(46, 118, 86, .18); }
.status.closed { background: rgba(168, 100, 27, .12); color: var(--warn); }
.status.closed::before { box-shadow: 0 0 0 4px rgba(168, 100, 27, .16); }
body.night-mode .status { background: rgba(92, 196, 145, .14); color: #7FD1A6; }
body.night-mode .status.closed { background: rgba(230, 160, 80, .14); color: #E8B26E; }

.facts { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.facts li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 12px; color: var(--text-muted); }
.facts strong { color: var(--text); font-weight: 600; }
.facts svg { width: 15px; height: 15px; color: var(--gold-text); flex: none; }

/* ── Cómo pedir ── */
.steps { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; counter-reset: paso; font-size: 12px; color: var(--text-muted); }
.steps li { counter-increment: paso; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.steps li::after { order: -1; content: counter(paso); display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 10px; font-weight: 700; }
.steps strong { color: var(--text); font-weight: 600; }

.hero-side { margin-top: 18px; }

/* ── Aviso fuera de horario ── */
.availability-notice { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.availability-notice p { margin: 0; flex: 1 1 220px; font-size: 13px; line-height: 1.4; color: var(--text-muted); }
.availability-notice strong { color: var(--text); }
.availability-whatsapp {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px;
  border-radius: 999px; background: var(--wa); color: #fff; text-decoration: none; font-size: 12.5px; font-weight: 600;
  transition: transform .16s var(--ease-out);
}
.availability-whatsapp svg { width: 15px; height: 15px; }
.availability-whatsapp:active { transform: scale(.97); }

/* ── Categorías fijas ── */
.cats {
  position: sticky; top: var(--top-h); z-index: 50;
  margin: 18px -16px 0; padding: 8px 16px;
  height: var(--cats-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.cats-track { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.cats-track::-webkit-scrollbar { display: none; }
.cat {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .16s var(--ease-out);
}
.cat.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.cat:active { transform: scale(.97); }

/* ── Secciones y productos ── */
.menu-group { padding-top: 6px; }
.section { padding-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.section-head h2 { margin: 0; font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1; color: var(--text); }
.section-head span { font-size: 12px; color: var(--text-muted); }
.list { display: grid; gap: 10px; }

.item {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 14px;
  padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
}
.item-info { min-width: 0; display: flex; flex-direction: column; min-height: 100%; }
.tag { align-self: flex-start; margin-bottom: 6px; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold-text); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.item h3 { margin: 0; font-family: var(--serif); font-size: 1.32rem; font-weight: 600; line-height: 1.08; color: var(--text); }
.item p { margin: 5px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.item-price { margin-top: auto; padding-top: 10px; font-size: 15px; font-weight: 700; color: var(--text); }

.item-media { position: relative; width: 112px; }
.item-media img { width: 112px; height: 112px; border-radius: 14px; object-fit: cover; background: var(--cream-2); }
.item-media.contain img { object-fit: contain; background: #F3E9DA; }

/* control agregar / cantidad */
.add {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; min-width: 40px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-text);
  box-shadow: 0 4px 12px rgba(10, 22, 40, .18);
  transition: transform .16s var(--ease-out), background-color .2s ease;
}
.add svg { width: 18px; height: 18px; }
.add:active { transform: scale(.94); }
.item-media .add, .item-media .stepper { position: absolute; right: -6px; bottom: -8px; }
.item-noimg .item-ctrl { align-self: end; }

.stepper {
  display: inline-flex; align-items: center; height: 40px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); box-shadow: 0 4px 12px rgba(10, 22, 40, .18);
  animation: grow .22s var(--ease-out);
}
.stepper button { width: 38px; height: 40px; border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; transition: transform .16s var(--ease-out); }
.stepper button:active { transform: scale(.85); }
.stepper output { min-width: 18px; text-align: center; font-size: 14px; font-weight: 700; }
@keyframes grow { from { opacity: .4; transform: scale(.9); } }
.item.in-cart { box-shadow: 0 0 0 1.5px var(--gold), var(--shadow-sm); }

/* ── Pie ── */
.store-footer { margin-top: 40px; padding: 20px; border-radius: var(--radius); background: var(--navy); color: #F1E2CE; display: flex; gap: 14px; align-items: center; }
.footer-mark { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(212, 168, 75, .5); font-family: var(--serif); font-size: 1.7rem; color: #D4A84B; }
.store-footer strong { display: block; font-family: var(--serif); font-size: 1.25rem; }
.store-footer address { font-style: normal; font-size: 12.5px; color: rgba(241, 226, 206, .75); }
body.night-mode .store-footer { background: var(--surface); }

/* ── Barra flotante del pedido ── */
.floating-cart {
  position: fixed; left: 0; right: 0; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 70;
  width: calc(100% - 24px); max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 8px 8px 18px; border: 0; border-radius: 18px;
  background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-lg); text-align: left;
  transform: translateY(140%); opacity: 0; pointer-events: none;
  transition: transform .35s var(--ease-out), opacity .2s ease;
}
.floating-cart.visible { transform: none; opacity: 1; pointer-events: auto; }
.floating-cart:active { transform: scale(.98); }
.floating-cart-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.floating-cart-copy strong { font-size: 14px; }
.floating-cart-copy span { font-size: 12px; opacity: .75; }
.floating-total { padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .12); font-weight: 700; font-size: 15px; white-space: nowrap; }
body.night-mode .floating-total { background: rgba(0, 0, 0, .12); }

/* ── Panel del pedido (hoja inferior en celular) ── */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 9, 15, .5);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.overlay.open { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.cart-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform .25s var(--ease-out);
}
.overlay.open .cart-panel { transform: none; transition: transform .42s var(--ease-drawer); }
.cart-panel::before { content: ""; align-self: center; width: 40px; height: 4px; margin-top: 8px; border-radius: 4px; background: var(--line); flex: none; }
.cart-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 18px 12px; border-bottom: 1px solid var(--line); }
.cart-panel-head h2 { margin: 0; font-family: var(--serif); font-size: 1.8rem; font-weight: 600; line-height: 1.05; }
.cart-panel-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }
.close-cart { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--chip); color: var(--text); transition: transform .16s var(--ease-out); }
.close-cart svg { width: 18px; height: 18px; }
.close-cart:active { transform: scale(.92); }
.cart-panel-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px calc(24px + env(safe-area-inset-bottom)); }

.empty-cart { padding: 36px 8px; text-align: center; }
.empty-cart-icon { width: 56px; height: 56px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--chip); color: var(--gold-text); }
.empty-cart-icon svg { width: 24px; height: 24px; }
.empty-cart h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 1.5rem; }
.empty-cart p { margin: 0 0 16px; font-size: 13px; color: var(--text-muted); }

.cart-step { margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-text); }
#cartContent > .cart-step:first-child { margin-top: 0; }
.cart-step b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 11px; letter-spacing: 0; }

.cart-items { display: grid; gap: 8px; }
.cart-item { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface); }
.cart-item img, .cart-brand-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.cart-brand-thumb { display: grid; place-items: center; background: var(--navy); color: #D4A84B; font-family: var(--serif); font-size: 1.5rem; }
.cart-item h3 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.25; }
.cart-item-price { font-size: 13px; color: var(--text-muted); }
.quantity { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--chip); }
.qty-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); font-size: 18px; line-height: 1; transition: transform .16s var(--ease-out); }
.qty-button:active { transform: scale(.88); }
.qty-value { min-width: 22px; text-align: center; font-weight: 700; font-size: 14px; }
.add-more { margin-top: 10px; width: 100%; height: 42px; border: 1px dashed var(--line); border-radius: 12px; background: transparent; font-size: 13px; font-weight: 600; color: var(--gold-text); transition: transform .16s var(--ease-out); }
.add-more:active { transform: scale(.98); }

.summary { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; color: var(--text-muted); }
.summary-row strong { color: var(--text); font-weight: 600; }
.summary-row.total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 16px; color: var(--text); font-weight: 700; }
.summary-row.total strong { font-weight: 700; font-size: 18px; }
.delivery-note { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }

.field-grid { display: grid; gap: 12px; }
.field label, .payment legend { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 16px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--text-muted) 70%, transparent); }
.opt { font-weight: 400; color: var(--text-muted); }
.field small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }
.payment { margin: 0; padding: 0; border: 0; }
.payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.payment-option { position: relative; }
.payment-option input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.payment-option label {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text-muted);
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .16s var(--ease-out);
}
.payment-option label:active { transform: scale(.97); }
.payment-option input:checked + label { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); color: var(--text); }
.payment-option input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }
.payment-symbol { color: var(--gold-text); font-weight: 700; }

.send-order {
  margin-top: 18px; width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 14px; background: var(--wa); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 22px rgba(31, 138, 76, .3);
  transition: transform .16s var(--ease-out);
}
.send-order svg { width: 22px; height: 22px; }
.send-order:active { transform: scale(.98); }
.send-help { margin: 10px 0 0; font-size: 12.5px; text-align: center; color: var(--text-muted); }
.form-error { margin: 10px 0 0; min-height: 1em; font-size: 13px; font-weight: 600; color: #B4382C; text-align: center; }
body.night-mode .form-error { color: #F08A7E; }

/* toast solo para lectores de pantalla */
.toast { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Pantallas grandes ── */
@media (min-width: 760px) {
  .page-shell { padding: 0 28px 140px; }
  .topbar-inner { padding: 0 28px; }
  .cats { margin: 18px -28px 0; padding: 8px 28px; }
  .hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: end; padding-top: 40px; }
  .hero-side { margin-top: 0; }
  .list { grid-template-columns: 1fr 1fr; gap: 14px; }
  .item-media, .item-media img { width: 128px; }
  .item-media img { height: 128px; }
}
@media (min-width: 900px) {
  .cart-panel { left: auto; top: 0; width: 440px; max-height: none; border-radius: 24px 0 0 24px; transform: translateX(100%); }
  .cart-panel::before { display: none; }
  .cart-panel-head { padding-top: 22px; }
  .floating-cart { left: auto; right: 24px; bottom: 24px; width: 380px; margin: 0; }
}
@media (hover: hover) {
  .item { transition: box-shadow .25s ease; }
  .item:hover { box-shadow: 0 0 0 1px var(--line), 0 10px 28px rgba(10, 22, 40, .10); }
  .cat:hover { color: var(--text); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
