:root {
  --brand: #0B7A35;
  --brand-dark: #08602A;
  --brand-bright: #2FAB2E;
  --brand-soft: #E3F3E6;
  --ink: #15261C;
  --muted: #56685C;
  --line: #DCE5DE;
  --bg: #F5F8F5;
  --card: #FFFFFF;
  --rx: #A2441A;
  --rx-soft: #FCEBDF;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 38, 28, .06), 0 8px 24px -12px rgba(21, 38, 28, .18);
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 2px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Aviso de prueba ---------- */
.preview-banner {
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: 14px;
  padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 20px;
  padding-block: 10px;
}
.logo img { height: 48px; width: auto; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  min-height: 48px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--brand); background: #fff; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  color: var(--ink);
  padding-block: 10px;
}
.cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 0 16px 0 14px;
  min-height: 48px;
}
.cart-btn:hover { background: var(--brand-dark); }
.actions { display: flex; gap: 8px; }
.cita-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--brand);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  padding: 0 16px 0 14px;
  min-height: 48px;
}
.cita-btn:hover { background: var(--brand-soft); }
.count {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 14px;
  padding-inline: 6px;
  font-variant-numeric: tabular-nums;
}
.cart-btn.bump .count { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.3); } }

.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 15px;
  white-space: nowrap;
}
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

/* ---------- Store note ---------- */
.note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 24px;
  padding-block: 16px 4px;
  font-size: 15.5px;
}
.note p { margin: 0; }
.note strong { color: var(--brand); }
.store { color: var(--muted); }
.store a { color: var(--brand); font-weight: 700; }

/* ---------- Results ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding-block: 18px 12px;
}
.toolbar h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.8rem); line-height: 1.15; text-wrap: balance; }
.results { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.subs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; }
.subs .chip { font-size: 14px; padding: 5px 12px; }

.promo-cita {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  background: var(--brand-soft);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
}
.promo-cita h2 { margin: 2px 0 4px; font-size: 20px; line-height: 1.2; }
.promo-cita p { margin: 0; color: var(--muted); font-size: 15px; }
.promo-cita .add { padding-inline: 22px; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.cita-intro { margin: 8px 0 0; color: var(--muted); }
.cita-dia { margin: 0; font-size: 14px; color: var(--rx); }
.pickup select { border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 16px; width: 100%; background: #fff; }
.pickup select:focus { border-color: var(--brand); outline: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.ph {
  aspect-ratio: 1;
  background: #fff;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
}
.ph img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.ph.none { background: var(--brand-soft); color: var(--brand); text-align: center; gap: 6px; align-content: center; }
.ph.none svg { width: 40px; height: 40px; stroke-width: 1.6; opacity: .7; margin-inline: auto; }
.ph.none span { font-size: 13px; color: var(--muted); }
.info { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 14px; flex: 1; }
.name {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.3;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lab { font-size: 13px; color: var(--muted); }
.badge {
  align-self: flex-start;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--rx);
  background: var(--rx-soft);
  border-radius: 6px;
  padding: 2px 8px;
}
.buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.add {
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 9px 14px;
  min-height: 42px;
}
.add:hover { background: var(--brand-dark); }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--brand); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; background: #fff; color: var(--brand); width: 38px; min-height: 40px; font-size: 20px; font-weight: 700; }
.stepper button:hover { background: var(--brand-soft); }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.more {
  display: block;
  margin: 24px auto 8px;
  border: 1.5px solid var(--brand);
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 28px;
}
.more:hover { background: var(--brand-soft); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 17px; }
.empty a { color: var(--brand); font-weight: 700; }

/* ---------- Footer ---------- */
.foot { margin-top: 48px; background: #fff; border-top: 1px solid var(--line); padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px)); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 40px; font-size: 14.5px; color: var(--muted); }
.foot h2 { font-size: 15px; color: var(--ink); margin: 0 0 6px; }
.foot p { margin: 8px 0 0; }

/* ---------- Cart drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15, 30, 20, .4); z-index: 40; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(440px, 100%);
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
  box-shadow: -12px 0 40px -20px rgba(0, 0, 0, .35);
  padding-top: env(safe-area-inset-top, 0px);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 20px; }
.icon-btn { border: 0; background: transparent; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; }
.icon-btn:hover { background: var(--bg); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); }
.line img, .line .mini { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: var(--brand-soft); }
.line .mini { display: grid; place-items: center; color: var(--brand); }
.line-name { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.line-price { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.line .stepper button { width: 34px; min-height: 36px; font-size: 18px; }
.cart-empty { color: var(--muted); margin: 24px 0; }
.rx-warn { display: grid; gap: 2px; background: var(--rx-soft); color: var(--rx); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; }
.pickup { display: grid; gap: 6px; }
.pickup label { font-weight: 700; font-size: 15px; margin-top: 6px; }
.pickup .opt { font-weight: 400; color: var(--muted); }
.pickup input, .pickup textarea { border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 16px; width: 100%; resize: vertical; }
.pickup input:focus, .pickup textarea:focus { border-color: var(--brand); outline: none; }
.pickup .bad { border-color: var(--rx); }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; }
.total strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.pay { margin: 0; font-size: 14px; color: var(--muted); }
.send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  min-height: 52px;
  margin-top: 4px;
}
.send:hover { background: var(--brand-dark); }
.send-note { margin: 0; font-size: 14px; color: var(--rx); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  z-index: 60;
  max-width: calc(100% - 32px);
}

@media (max-width: 720px) {
  .bar { grid-template-columns: auto 1fr; }
  .logo img { height: 40px; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .actions { justify-self: end; }
  .cita-btn .cart-label { display: none; }
  .cita-btn { padding: 0 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .info { padding: 10px 10px 12px; }
  .name { font-size: 14.5px; }
  .price { font-size: 18px; }
  .buy { flex-wrap: wrap; }
  .buy .ctl { flex: 1 1 100%; display: flex; }
  .add, .stepper { width: 100%; }
  .stepper { justify-content: space-between; }
}
@media (max-width: 380px) {
  .cart-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
  .cart-btn.bump .count { animation: none; }
}
