:root {
  --brand: #5f7d33;
  --brand-dark: #46601f;
  --brand-soft: #edf1e1;
  --gold: #d9a52a;
  --ink: #2a2a20;
  --muted: #7c7a6c;
  --line: #e9e5d8;
  --bg: #f7f3e9;
  --card: #fffdf7;
  --green: #16794c;
  --danger: #b11e1e;
  --shadow: 0 2px 12px rgba(70,96,31,.10);
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 96px;
  line-height: 1.45;
}
img { max-width: 100%; }

/* Header */
.header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 22px 18px 20px;
  border-radius: 0 0 22px 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.header::after {
  content: "";
  position: absolute; right: -30px; top: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand .logo {
  width: 56px; height: 56px; border-radius: 50%;
  background: #fff; overflow: hidden; flex: 0 0 auto;
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand h1 { font-size: 21px; margin: 0; font-weight: 800; letter-spacing: .3px; }
.brand p { margin: 2px 0 0; font-size: 12.5px; opacity: .92; font-style: italic; }
.header .meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.24);
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.closed-banner {
  margin: 12px 18px 0; background: #fff3cd; border: 1px solid #ffe08a;
  color: #6b5200; padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 600;
}

/* Category chips */
.cats {
  display: flex; gap: 8px; overflow-x: auto; padding: 16px 18px 6px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.cats::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Ofertas */
.chip.chip-oferta { border-color: var(--gold); color: var(--brand-dark); }
.chip.chip-oferta.active { background: var(--gold); border-color: var(--gold); color: #3a2c00; }
.oferta-title { color: var(--gold) !important; }
.card-oferta { border: 1.5px solid var(--gold); background: #fffdf3; }
.oferta-list { margin: 4px 0 2px; padding-left: 18px; }
.oferta-list li { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* Product list */
.list { padding: 8px 14px 20px; }
.cat-title {
  font-size: 13px; font-weight: 700; color: var(--brand-dark);
  text-transform: uppercase; letter-spacing: .6px; margin: 18px 6px 8px;
}
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  border: 1px solid var(--line);
}
.card .info { flex: 1; min-width: 0; }
.card .name { font-weight: 700; font-size: 15px; }
.card .desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card .price { font-weight: 800; color: var(--brand-dark); margin-top: 4px; font-size: 15px; }
.card .price small { color: var(--muted); font-weight: 600; }

/* Stepper */
.stepper { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.stepper button {
  width: 34px; height: 34px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 20px; font-weight: 700; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark);
}
.stepper button:active { transform: scale(.92); }
.stepper .qty { min-width: 46px; text-align: center; font-weight: 700; font-size: 14px; }
.add-btn {
  border: none; background: var(--brand); color: #fff; border-radius: 10px;
  padding: 9px 14px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.add-btn:active { transform: scale(.96); }

/* Bottom cart bar */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.cartbar button {
  pointer-events: auto; width: 100%; border: none; cursor: pointer;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 15px 18px;
  font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
.cartbar button:active { transform: translateY(1px); }
.cartbar .count {
  background: var(--gold); color: #3a2c00; border-radius: 999px; padding: 2px 10px; font-size: 13px; margin-right: 8px;
}
.cartbar.hidden { display: none; }

/* Sheet / modal */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: none; align-items: flex-end; justify-content: center;
}
.overlay.open { display: flex; }
.sheet {
  background: var(--bg); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0;
  max-height: 92vh; overflow-y: auto; padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 42px; height: 5px; border-radius: 3px; background: #d8d3c2; margin: 8px auto 4px; }
.sheet h2 { font-size: 18px; margin: 8px 4px 12px; }
.line-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.line-item .li-qty { color: var(--muted); font-size: 12.5px; }
.line-item .li-remove { color: var(--danger); font-size: 12px; cursor: pointer; font-weight: 600; }
.total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; padding: 14px 4px; }

label.fld { display: block; margin: 12px 2px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
input.f, textarea.f, select.f {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; background: #fff; font-family: inherit;
}
textarea.f { min-height: 64px; resize: vertical; }
.fld-hint { font-size: 12px; color: var(--muted); margin: 3px 2px 0; }
.install-pill { cursor: pointer; background: rgba(255,255,255,.92); color: var(--brand-dark); border: 1px solid #fff; font-weight: 700; font-family: inherit; }
.install-pill:active { transform: scale(.97); }

.turnos { display: flex; gap: 10px; }
.turno-btn { flex: 1; padding: 13px; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--muted); cursor: pointer; }
.turno-btn.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.turno-btn:active { transform: scale(.97); }

.confirm {
  width: 100%; margin-top: 16px; border: none; background: var(--brand); color: #fff;
  border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 800; cursor: pointer;
}
.confirm:disabled { opacity: .5; }
.mini { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }
.close-x { position: sticky; top: 0; float: right; background: none; border: none; font-size: 26px; color: var(--muted); cursor: pointer; }

/* Success */
.success { text-align: center; padding: 30px 10px; }
.success .check {
  width: 74px; height: 74px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-size: 40px; margin: 0 auto 16px;
}
.success h2 { font-size: 22px; margin: 0 0 6px; }
.success .code { font-size: 30px; font-weight: 900; color: var(--brand-dark); letter-spacing: 1px; margin: 10px 0; }
.success p { color: var(--muted); font-size: 14px; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.wa-warn { background: #fff3cd; border: 1px solid #ffe08a; color: #6b5200; padding: 10px; border-radius: 10px; font-size: 12.5px; margin-top: 12px; }
.foot { text-align: center; color: #b9b3a4; font-size: 11px; padding: 16px; }
.foot a { color: #b9b3a4; }
