:root {
  --cream: #f7f2ee;
  --beige: #e8e1dc;
  --sand: #d9cdc4;
  --brown: #4a3426;
  --mocha: #7f5a50;
  --rose: #d4a39a;
  --rose-soft: #f3e3de;
  --white: #fffdfb;
  --ok: #4f7a4f;
  --warn: #b5762a;
  --danger: #a8443b;
  --shadow: 0 6px 24px rgba(74, 52, 38, .12);
  --radius: 18px;
  --font: "Josefin Sans", system-ui, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--brown);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
img[src$="logo.png"] { mix-blend-mode: multiply; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--mocha); opacity: .8; font-weight: 400; }

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(247, 242, 238, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--beige);
}
.brand img { height: 40px; width: auto; }
.status-pill {
  font-size: 13px; font-weight: 600; padding: 5px 10px 3px; border-radius: 99px;
  background: #e3eee0; color: var(--ok);
}
.status-pill.closed { background: #f4dfdc; color: var(--danger); }
.cart-btn {
  margin-left: auto; position: relative;
  width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: var(--brown); color: var(--cream);
  display: grid; place-items: center;
}
.cart-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-count {
  position: absolute; top: -3px; right: -3px;
  min-width: 20px; height: 20px; padding: 3px 5px 0; border-radius: 99px;
  background: var(--rose); color: var(--brown); font-size: 12px; font-weight: 700;
}
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.15); } }

/* Hero */
.hero {
  text-align: center;
  padding: 40px 16px 34px;
  background:
    radial-gradient(circle at 15% 20%, rgba(212, 163, 154, .35), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(127, 90, 80, .18), transparent 45%),
    var(--beige);
}
.hero-logo { width: min(260px, 70vw); height: auto; margin: 0 auto 18px; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 5vw, 40px); margin: 0 0 8px; }
.hero p { margin: 0 auto; max-width: 460px; color: var(--mocha); font-size: 17px; }
.hero-links { margin-top: 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero-links button {
  border: 1px solid var(--mocha); background: transparent; border-radius: 99px;
  padding: 8px 14px 6px; font-weight: 600; color: var(--brown);
}

.closed-banner {
  background: var(--brown); color: var(--cream); text-align: center;
  padding: 12px 16px 10px; font-weight: 600;
}

/* Navegación por categorías */
.cat-nav {
  position: sticky; top: 67px; z-index: 20;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 12px 16px; background: var(--cream);
  border-bottom: 1px solid var(--beige);
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: 0 0 auto; text-decoration: none; color: var(--brown);
  padding: 8px 14px 6px; border-radius: 99px; background: var(--white);
  border: 1px solid var(--sand); font-weight: 600; font-size: 15px; white-space: nowrap;
}
.cat-nav a.active { background: var(--brown); border-color: var(--brown); color: var(--cream); }

/* Menú */
.menu { max-width: 1100px; margin: 0 auto; padding: 8px 16px 120px; }
.loading { text-align: center; padding: 60px 0; color: var(--mocha); }
.cat-section { padding-top: 28px; }
.cat-section h2 {
  font-family: var(--serif); font-weight: 600; font-size: 28px; margin: 0;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.cat-section h2 small { font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--rose); }
.cat-section .rule { height: 1px; background: var(--sand); margin: 10px 0 16px; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--white); border: 1px solid var(--beige); border-radius: var(--radius);
  padding: 14px; transition: transform .15s, box-shadow .15s;
}
.card:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow); }
.card .icon {
  flex: 0 0 52px; height: 52px; border-radius: 50%;
  background: var(--rose-soft); display: grid; place-items: center; font-size: 24px;
}
.card .info { flex: 1; min-width: 0; }
.card .info > span { display: block; }
.card .name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.card .desc { font-size: 14px; color: var(--mocha); margin-top: 3px; }
.card .price { font-weight: 700; font-size: 17px; margin-top: 6px; }
.card .add {
  flex: 0 0 36px; height: 36px; border-radius: 50%;
  background: var(--brown); color: var(--cream); display: grid; place-items: center;
  font-size: 22px; line-height: 1; padding-top: 3px;
}
.card:disabled { opacity: .55; cursor: not-allowed; }
.card:disabled .add { background: var(--sand); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 7px 1px; border-radius: 6px; background: var(--beige); color: var(--mocha); }

/* Footer */
.footer { background: var(--beige); text-align: center; padding: 36px 16px 110px; }
.footer img { width: 180px; height: auto; margin: 0 auto; }
.footer p { color: var(--mocha); margin: 8px 0 14px; }
.socials { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.socials a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--brown); background: var(--white); border-radius: 99px; padding: 8px 14px 6px; font-weight: 600;
}
.socials svg { width: 18px; height: 18px; fill: currentColor; }

/* Carrito flotante */
.floating-cart {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 25; width: min(520px, calc(100% - 32px));
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 20px 13px; border: 0; border-radius: 99px;
  background: var(--brown); color: var(--cream); font-size: 16px; box-shadow: var(--shadow);
}
.floating-cart strong { font-size: 18px; }

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(46, 31, 22, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.close, .back {
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: var(--beige); font-size: 22px; line-height: 1; flex: 0 0 auto;
}
.sheet {
  position: relative; width: 100%; max-width: 520px; max-height: 92vh;
  background: var(--white); border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column; animation: up .25s ease;
}
.sheet > .close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.sheet-body { overflow-y: auto; padding: 24px 20px 8px; }
.sheet-body h3 { font-family: var(--serif); font-size: 26px; margin: 0 44px 4px 0; font-weight: 600; }
.sheet-body .desc { color: var(--mocha); margin: 0 0 8px; }
.sheet-foot { display: flex; gap: 12px; padding: 14px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--beige); }

.opt-group { margin: 18px 0; }
.opt-group h4 { margin: 0 0 8px; font-size: 15px; display: flex; justify-content: space-between; }
.opt-group h4 span { font-weight: 400; color: var(--mocha); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label, .seg label { position: relative; }
.chips input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.chips span, .seg span {
  display: inline-block; padding: 9px 14px 7px; border-radius: 99px;
  border: 1.5px solid var(--sand); background: var(--white); cursor: pointer; font-weight: 600; font-size: 15px;
}
.chips input:checked + span, .seg input:checked + span { background: var(--brown); border-color: var(--brown); color: var(--cream); }
.chips input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--rose); outline-offset: 2px; }
.chips input:disabled + span { opacity: .4; cursor: not-allowed; }
.price-table { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--mocha); margin-top: 6px; }
.price-table b { color: var(--brown); }
.price-table .on { background: var(--rose-soft); border-radius: 8px; padding: 2px 8px 0; }
textarea, input[type=text], input[type=tel], input[type=time], input:not([type]) {
  width: 100%; border: 1.5px solid var(--sand); border-radius: 12px; padding: 11px 12px 9px; background: var(--white);
}
textarea:focus, input:focus { outline: none; border-color: var(--mocha); }

.stepper { display: flex; align-items: center; gap: 4px; background: var(--cream); border-radius: 99px; padding: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--white); font-size: 20px; line-height: 1; }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; padding-top: 3px; }
.stepper.sm button { width: 30px; height: 30px; font-size: 17px; }

.btn { border: 0; border-radius: 99px; padding: 14px 20px 12px; font-weight: 700; font-size: 16px; }
.btn.primary { background: var(--brown); color: var(--cream); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--beige); color: var(--brown); }
.btn.wa { background: #2f8f56; color: #fff; text-decoration: none; display: inline-block; text-align: center; }
.btn.grow { flex: 1; }
.btn.block { width: 100%; }

/* Drawer carrito */
.drawer {
  width: 100%; max-width: 520px; height: 92vh;
  background: var(--white); border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column; animation: up .25s ease;
}
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--beige); }
.drawer-head h2 { font-family: var(--serif); font-weight: 600; margin: 0; flex: 1; font-size: 24px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-foot { padding: 14px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--beige); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 18px; }
.total-row strong { font-size: 24px; }

.line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--sand); }
.line:last-child { border-bottom: 0; }
.line .info { flex: 1; min-width: 0; }
.line .name { font-weight: 700; }
.line .meta { font-size: 14px; color: var(--mocha); margin-top: 2px; }
.line .right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.empty { text-align: center; padding: 50px 10px; color: var(--mocha); }
.empty .big { font-size: 46px; }

#checkoutView label { display: block; font-weight: 600; margin-bottom: 14px; }
#checkoutView label > input, #checkoutView label > textarea { margin-top: 6px; }
#checkoutView .seg label { display: inline-block; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.seg { display: flex; gap: 8px; }
.seg.wrap { flex-wrap: wrap; }
#timeInput { margin-top: 10px; max-width: 180px; }
.form-error { color: var(--danger); font-weight: 600; min-height: 1em; margin: 0; }

/* Seguimiento */
.track { padding: 28px 20px max(22px, env(safe-area-inset-bottom)); overflow-y: auto; }
.track .hello { text-align: center; }
.track .hello .big { font-size: 44px; }
.track h3 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 6px 0; }
.code-box {
  margin: 14px auto; text-align: center; background: var(--rose-soft); border-radius: 16px; padding: 14px;
}
.code-box small { display: block; color: var(--mocha); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.code-box strong { font-size: 34px; letter-spacing: .18em; }
.steps { display: flex; justify-content: space-between; margin: 22px 0; position: relative; }
.steps::before { content: ""; position: absolute; top: 15px; left: 12%; right: 12%; height: 3px; background: var(--beige); }
.step { position: relative; flex: 1; text-align: center; font-size: 13px; font-weight: 600; color: var(--mocha); }
.step i { display: grid; place-items: center; margin: 0 auto 6px; width: 32px; height: 32px; border-radius: 50%; background: var(--beige); font-style: normal; font-size: 15px; }
.step.done i { background: var(--brown); color: var(--cream); }
.step.current i { background: var(--rose); color: var(--brown); box-shadow: 0 0 0 5px var(--rose-soft); }
.step.current { color: var(--brown); }
.status-msg { text-align: center; font-size: 17px; margin: 0 0 16px; }
.status-msg.cancel { color: var(--danger); font-weight: 700; }
.summary { background: var(--cream); border-radius: 16px; padding: 4px 16px; margin-top: 10px; }
.summary .line { padding: 10px 0; }
.track .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); z-index: 80;
  background: var(--brown); color: var(--cream); padding: 12px 18px 10px; border-radius: 99px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 24px; max-height: 86vh; }
  #cartPanel { justify-content: flex-end; align-items: stretch; }
  .drawer { height: 100%; max-width: 440px; border-radius: 0; animation-name: slide; }
  @keyframes slide { from { transform: translateX(40px); opacity: 0; } }
  .floating-cart { display: none !important; }
  .footer { padding-bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
