/* Diseño: tienda de barrio digital. Verde de la marca, amarillo del sol, fondo claro con un toque verde. */
:root {
  --brand: #2f8a3a;
  --brand-deep: #17431f;
  --brand-soft: #e6f2e4;
  --sun: #f2c230;
  --sun-soft: #fff5d1;
  --bg: #f5f7f2;
  --card: #ffffff;
  --ink: #1b221c;
  --muted: #5f6b61;
  --line: #e1e6dd;
  --danger: #c0392b;
  --offer: #d6336c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23,67,31,.06), 0 4px 14px rgba(23,67,31,.06);
  --font-display: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.2; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; text-decoration: none; transition: transform .08s ease, background .15s ease; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-wa { background: #1fa855; color: #fff; }
.btn-wa:hover { background: #178a45; }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--brand-deep); color: #fff; border-color: var(--brand-deep); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Badges */
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.b-oferta { background: var(--offer); color: #fff; }
.b-nuevo { background: var(--sun); color: #3a2c00; }
.b-top { background: var(--brand-deep); color: #fff; }

/* Formularios */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: none; }
.form { display: grid; gap: 14px; }

/* Stepper */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--brand); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { border: 0; background: transparent; width: 38px; height: 38px; font-size: 20px; font-weight: 700; color: var(--brand-deep); }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Hoja inferior (carrito, detalle) */
.sheet-bg { position: fixed; inset: 0; background: rgba(15,25,17,.45); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--card); border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto; padding: 18px max(16px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); box-shadow: 0 -10px 30px rgba(0,0,0,.15); }
@media (min-width: 760px) { .sheet { left: auto; right: 24px; bottom: 24px; width: 440px; border-radius: 20px; max-height: 86vh; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.x { border: 0; background: var(--bg); width: 36px; height: 36px; border-radius: 50%; font-size: 18px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); }

/* Placeholder de foto */
.ph { display: grid; place-items: center; text-align: center; color: #fff; font-family: var(--font-display); font-weight: 700; padding: 12px; font-size: 15px; line-height: 1.2; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
