/* ==========================================================
   Farmacia Atenea · app.css  (v1.0.0 · etapa 1 diseño)
   Estilo mixto: mostrador azul marino arriba, góndola clara abajo.
   ========================================================== */

:root {
  color-scheme: light;
  /* Marca */
  --navy: #0A1E3F;
  --navy-2: #122D59;
  --navy-3: #1B3B70;
  --blue: #1766D6;
  --blue-600: #0F55B8;
  --blue-50: #EAF2FD;
  --yellow: #FFD23F;
  --yellow-600: #F2BE12;
  --yellow-50: #FFF7D6;
  /* Neutros con sesgo azul */
  --surface: #F3F6FA;
  --card: #FFFFFF;
  --media: #F6F8FB;
  --ink: #0E1B2E;
  --ink-2: #33445C;
  --muted: #5E6E84;
  --line: #E0E7F0;
  --line-2: #CCD6E3;
  --on-navy: #E6EDF7;
  --on-navy-muted: #9DB0CB;
  /* Semánticos (estados de pedido) */
  --st-received: #2B6FD6;
  --st-preparing: #C98F00;
  --st-transit: #0E8DA6;
  --st-ready: #7453C9;
  --st-delivered: #1B8A57;
  --st-cancelled: #CC3B4A;
  --st-failed: #D2612C;
  --danger: #CC3B4A;
  --success: #1B8A57;

  --f-display: "Bricolage Grotesque", "Figtree", ui-sans-serif, system-ui, sans-serif;
  --f-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(10, 30, 63, .06), 0 2px 8px rgba(10, 30, 63, .05);
  --shadow-2: 0 10px 30px rgba(10, 30, 63, .14);
  --shadow-3: 0 24px 60px rgba(6, 18, 40, .28);
  --gutter: 16px;
  --maxw: 1280px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 150px; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -.02em; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--yellow); color: var(--navy); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 700; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.ic { width: 22px; height: 22px; flex: none; }
.ic--sm { width: 16px; height: 16px; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.eyebrow--light { color: var(--yellow); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-600); }
.btn--primary:disabled { background: var(--line-2); color: var(--muted); cursor: not-allowed; }
.btn--yellow { background: var(--yellow); color: var(--navy); }
.btn--yellow:hover { background: var(--yellow-600); }
.btn--ghost-light { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.btn--ghost-light:hover { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7); }
.btn--soft { background: var(--blue-50); color: var(--blue-600); }
.btn--soft:hover { background: #dbe8fb; }
.btn--danger-soft { background: #FBEAEC; color: var(--danger); }
.link { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.round-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.round-btn:hover { box-shadow: inset 0 0 0 1px var(--line-2); background: var(--media); }
.round-btn:disabled { opacity: .35; cursor: default; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--on-navy); }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.icon-btn--dark { color: var(--ink); }
.icon-btn--dark:hover { background: var(--surface); }
.text-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: var(--r-pill); color: var(--on-navy); font-weight: 600; }
.text-btn:hover { background: rgba(255,255,255,.08); }
.dot-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--yellow); color: var(--navy); font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1; }

/* ---------- Franja promo ---------- */
.promo-strip { background: var(--yellow); color: var(--navy); font-size: 13px; }
.promo-strip__in { display: flex; justify-content: space-between; gap: 16px; padding-block: 7px; }
.promo-strip__in p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promo-strip__aside { font-weight: 700; }

/* ---------- Header ---------- */
.topbar { position: sticky; top: var(--safe-t); z-index: 40; background: var(--navy); color: var(--on-navy); box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.topbar__row { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 16px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand__mark { width: 40px; height: 40px; border-radius: 12px; background: var(--yellow); color: var(--navy); display: grid; place-items: center; }
.brand__mark svg { width: 22px; height: 22px; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__text b { font-family: var(--f-display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.brand__text small { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--on-navy-muted); margin-top: 3px; font-weight: 600; }

.branch-pill { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px 0 12px; border-radius: var(--r-md); background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); text-align: left; max-width: 250px; }
.branch-pill:hover { background: rgba(255,255,255,.1); }
.branch-pill .ic { color: var(--yellow); }
.branch-pill__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.branch-pill__txt small { font-size: 11px; color: var(--on-navy-muted); }
.branch-pill__txt b { font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search { position: relative; }
.search input {
  width: 100%; height: 48px; border-radius: var(--r-pill); border: 0;
  padding: 0 44px 0 46px; background: #fff; color: var(--ink); font-size: 15px;
  box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .15s;
}
.search input::placeholder { color: #7F8DA1; }
.search input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--yellow); }
.search input::-webkit-search-cancel-button { display: none; }
.search__ic { position: absolute; left: 16px; top: 13px; color: var(--muted); pointer-events: none; }
.search__clear { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.search__clear:hover { background: var(--surface); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: #fff; color: var(--ink); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 6px; z-index: 50; max-height: 70vh; overflow: auto; }
.suggest__item { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: var(--r-sm); text-align: left; }
.suggest__item:hover, .suggest__item.is-active { background: var(--surface); }
.suggest__item img { width: 44px; height: 44px; object-fit: contain; background: var(--media); border-radius: 8px; padding: 4px; }
.suggest__item b { display: block; font-size: 14px; font-weight: 600; }
.suggest__item small { color: var(--muted); font-size: 12px; }
.suggest__price { font-weight: 800; font-variant-numeric: tabular-nums; }
.suggest__all { display: block; width: 100%; padding: 10px; text-align: center; color: var(--blue); font-weight: 700; border-top: 1px solid var(--line); margin-top: 4px; }
.suggest__none { padding: 14px; color: var(--muted); font-size: 14px; }

.top-actions { display: flex; align-items: center; gap: 4px; }
.cart-btn { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 16px; border-radius: var(--r-pill); background: var(--yellow); color: var(--navy); font-weight: 800; margin-left: 6px; }
.cart-btn:hover { background: var(--yellow-600); }
.cart-btn__total { font-variant-numeric: tabular-nums; }
.cart-btn__count { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px; background: var(--navy); color: var(--yellow); display: grid; place-items: center; font-size: 14px; }
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.07); } }

.catbar { border-top: 1px solid rgba(255,255,255,.08); }
.catbar__row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 6px; }
.catbar__row::-webkit-scrollbar { display: none; }
.catbar a, .catbar button {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-pill);
  color: var(--on-navy); font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none;
}
.catbar button:hover { background: rgba(255,255,255,.08); }
.catbar button.is-on { background: var(--yellow); color: var(--navy); }
.catbar .ic { width: 18px; height: 18px; opacity: .9; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: var(--on-navy); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 48px; background: var(--surface); border-radius: 28px 28px 0 0; }
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-block: 44px 72px; }
.hero h1 { font-size: clamp(34px, 4.4vw, 56px); font-weight: 800; color: #fff; max-width: 14ch; }
.hero__lead { margin-top: 16px; font-size: 18px; color: var(--on-navy); max-width: 46ch; line-height: 1.55; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 32px; font-size: 14px; color: var(--on-navy-muted); }
.hero__facts li { display: flex; align-items: center; gap: 10px; }
.hero__facts b { color: #fff; font-weight: 700; }
.hero__facts .ic { color: var(--yellow); }
.hero__media { margin: 0; justify-self: end; width: 100%; max-width: 400px; position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-3), 0 0 0 1px rgba(255,255,255,.08); background: var(--navy-3); aspect-ratio: 4 / 5; }
.hero__media video { width: 100%; height: 100%; object-fit: cover; }
.hero__media figcaption { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hero__media figcaption span { background: rgba(10,30,63,.72); backdrop-filter: blur(6px); padding: 6px 10px; border-radius: var(--r-pill); color: #fff; }
.video-toggle { width: 36px; height: 36px; border-radius: 50%; background: rgba(10,30,63,.72); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }

/* ---------- Secciones home ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.sec-head h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; }
.rail-nav { display: flex; gap: 8px; }

.cat-tiles { padding-top: 8px; }
.cat-tiles__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.cat-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; min-height: 132px;
  background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-1); text-align: left;
  transition: transform .15s, box-shadow .15s;
}
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.cat-tile__ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); }
.cat-tile:nth-child(3n+2) .cat-tile__ic { background: var(--yellow-50); color: #9A7400; }
.cat-tile b { font-size: 15px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.cat-tile small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.cat-tile__n { margin-top: auto; font-size: 12px; color: var(--blue); font-weight: 700; }

.rail-sec { margin-top: 44px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 16px) / 5); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 12px; margin-inline: -2px; scroll-behavior: smooth; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

.band { margin-top: 36px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.band__item { display: flex; gap: 14px; align-items: flex-start; padding: 20px; background: var(--card); }
.band__item b { display: block; font-size: 15px; margin-bottom: 2px; }
.band__item p { color: var(--muted); font-size: 14px; line-height: 1.45; }
.band__ic { width: 44px; height: 44px; border-radius: 12px; background: var(--navy); color: var(--yellow); display: grid; place-items: center; flex: none; }
.band__ic--rx { font-family: var(--f-display); font-weight: 800; font-size: 15px; font-style: italic; }

.brands { margin-top: 44px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brands__title { font-size: 15px; font-family: var(--f-body); font-weight: 700; color: var(--muted); letter-spacing: 0; }
.brands__row { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-chip { height: 40px; padding: 0 16px; border-radius: var(--r-pill); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-family: var(--f-display); font-weight: 700; font-size: 15px; color: var(--ink-2); }
.brand-chip:hover { box-shadow: inset 0 0 0 1.5px var(--blue); color: var(--blue); }

/* ---------- Tarjeta de producto ---------- */
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-1); overflow: hidden; transition: box-shadow .15s, transform .15s; min-width: 0; }
.card:hover { box-shadow: var(--shadow-2); }
.card__media { display: block; width: 100%; aspect-ratio: 1 / 1; background: var(--media); position: relative; overflow: hidden; }
.card__media img { position: absolute; inset: 13%; width: 74%; height: 74%; object-fit: contain; object-position: center; mix-blend-mode: multiply; transition: transform .25s; }
.card:hover .card__media img { transform: scale(1.04); }
.card__fav { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; color: var(--muted); box-shadow: var(--shadow-1); z-index: 2; }
.card__fav:hover { color: var(--danger); }
.card__fav[aria-pressed="true"] { color: var(--danger); }
.card__fav .ic { width: 19px; height: 19px; }
.badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; z-index: 2; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 4px 8px; border-radius: 6px; line-height: 1.1; }
.badge--rx { background: var(--navy); color: var(--yellow); }
.badge--out { background: #fff; color: var(--danger); box-shadow: inset 0 0 0 1px #F2C4C9; }
.badge--feat { background: var(--yellow); color: var(--navy); }
.card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.card__brand { font-size: 12px; color: var(--muted); font-weight: 600; }
.card__title { font-family: var(--f-body); font-size: 15px; font-weight: 700; line-height: 1.3; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card__title button { text-align: left; }
.card__title button:hover { color: var(--blue); }
.card__var { font-size: 12px; color: var(--blue-600); font-weight: 600; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.price small { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 3px; }
.add { height: 40px; min-width: 40px; padding: 0 14px; border-radius: var(--r-pill); background: var(--blue); color: #fff; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.add:hover { background: var(--blue-600); }
.add:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.add .ic { width: 18px; height: 18px; }
.stepper { display: inline-flex; align-items: center; height: 40px; border-radius: var(--r-pill); background: var(--blue-50); color: var(--blue-600); }
.stepper button { width: 38px; height: 40px; display: grid; place-items: center; border-radius: var(--r-pill); }
.stepper button:hover { background: #d6e5fb; }
.stepper button .ic { width: 16px; height: 16px; }
.stepper output { min-width: 24px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---------- Catálogo ---------- */
.catalog { margin-top: 52px; display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.catalog__side { position: sticky; top: 150px; background: var(--card); border-radius: var(--r-md); padding: 16px 10px 10px; box-shadow: var(--shadow-1); }
.catalog__side .eyebrow { padding-inline: 8px; }
.side-cat { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 8px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; color: var(--ink-2); text-align: left; }
.side-cat:hover { background: var(--surface); }
.side-cat.is-on { background: var(--navy); color: #fff; }
.side-cat.is-on .ic { color: var(--yellow); }
.side-cat .ic { width: 20px; height: 20px; color: var(--blue); }
.side-cat span:last-child { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-cat.is-on span:last-child { color: var(--on-navy-muted); }
.catalog__main { min-width: 0; }
.catalog__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.catalog__head h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; }
.catalog__count { color: var(--muted); font-size: 14px; margin-top: 4px; }
.select { position: relative; display: inline-flex; align-items: center; }
.select select { appearance: none; height: 42px; padding: 0 38px 0 14px; border-radius: var(--r-pill); border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; font-size: 14px; }
.select .ic { position: absolute; right: 14px; pointer-events: none; color: var(--muted); }
.chips { display: none; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.empty { text-align: center; padding: 40px 16px; display: grid; justify-items: center; gap: 8px; color: var(--muted); }
.empty b { color: var(--ink); }
.empty .btn { margin-top: 8px; }

/* ---------- Footer ---------- */
.footer { margin-top: 72px; background: var(--navy); color: var(--on-navy-muted); padding-top: 44px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer h3 { font-family: var(--f-body); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; margin-bottom: 12px; }
.footer li { margin-bottom: 8px; font-size: 14px; }
.footer li button { color: var(--on-navy-muted); text-align: left; }
.footer li button:hover { color: #fff; }
.footer li b { color: var(--on-navy); font-weight: 600; display: block; }
.footer__blurb { margin-top: 14px; font-size: 14px; max-width: 34ch; }
.footer__legal { border-top: 1px solid rgba(255,255,255,.08); margin-top: 32px; padding-block: 18px 24px; font-size: 12px; }

/* ---------- Tabbar (celular) ---------- */
.tabbar { display: none; }

/* ---------- Capas ---------- */
.scrim { position: fixed; inset: 0; background: rgba(6, 16, 34, .5); z-index: 60; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--card); z-index: 70; display: flex; flex-direction: column; box-shadow: var(--shadow-3); animation: slideIn .25s ease; padding-top: var(--safe-t); }
@keyframes slideIn { from { transform: translateX(100%); } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 22px; font-weight: 800; }
.drawer__branch { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--surface); font-size: 13px; color: var(--ink-2); }
.drawer__branch .ic { color: var(--blue); width: 18px; height: 18px; }
.drawer__branch button { margin-left: auto; color: var(--blue); font-weight: 700; }
.cart-items { flex: 1; overflow-y: auto; padding: 8px 20px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item__img { width: 72px; height: 72px; border-radius: var(--r-sm); background: var(--media); padding: 8px; }
.cart-item__img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.cart-item__top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cart-item__name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.cart-item__var { font-size: 12px; color: var(--blue-600); font-weight: 600; margin-top: 2px; }
.cart-item__unit { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.cart-item__del { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
.cart-item__del:hover { background: #FBEAEC; color: var(--danger); }
.cart-item__del .ic { width: 18px; height: 18px; }
.cart-item__bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cart-item__bottom .stepper { height: 36px; }
.cart-item__bottom .stepper button { height: 36px; width: 34px; }
.cart-item__sub { font-weight: 800; font-variant-numeric: tabular-nums; }
.drawer__foot { padding: 16px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--card); }
.drawer__foot .totals { margin-bottom: 14px; }
.empty--cart { flex: 1; align-content: center; }
.empty__ic { width: 64px; height: 64px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--muted); margin-bottom: 4px; }

.totals { margin: 0; display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.totals dt, .totals dd { margin: 0; }
.totals dd { font-weight: 700; color: var(--ink); }
.totals__note dd { font-weight: 500; color: var(--muted); }
.totals__grand { padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line-2); }
.totals__grand dt { font-weight: 800; color: var(--ink); font-size: 16px; }
.totals__grand dd { font-size: 22px; font-weight: 800; }

.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal__card { position: relative; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 20px; animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal__head h2 { font-size: 22px; font-weight: 800; }
.modal__lead { color: var(--muted); margin: 6px 0 16px; font-size: 14px; }
.branch-list { display: grid; gap: 10px; }
.branch-opt { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; width: 100%; }
.branch-opt:hover { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.branch-opt.is-on { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-50); }
.branch-opt__n { width: 44px; height: 44px; border-radius: 12px; background: var(--navy); color: var(--yellow); display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 18px; }
.branch-opt b { display: block; }
.branch-opt small { color: var(--muted); }
.branch-opt__check { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); display: grid; place-items: center; color: #fff; }
.branch-opt.is-on .branch-opt__check { background: var(--blue); box-shadow: none; }
.branch-opt__check .ic { width: 16px; height: 16px; }

/* Detalle producto */
.modal__card--product { width: min(880px, 100%); padding: 0; display: grid; grid-template-columns: 1fr 1fr; }
.pm__media { background: var(--media); padding: 40px; display: grid; place-items: center; position: relative; min-height: 360px; }
.pm__media img { width: 100%; max-height: 380px; object-fit: contain; mix-blend-mode: multiply; }
.pm__body { padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.pm__close { position: absolute; top: 10px; right: 10px; z-index: 3; background: #fff; box-shadow: var(--shadow-1); }
.pm__brand { font-size: 13px; color: var(--muted); font-weight: 600; }
.pm__title { font-size: 28px; font-weight: 800; }
.pm__desc { color: var(--ink-2); }
.pm__price { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pm__label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 4px; }
.variants { display: flex; flex-wrap: wrap; gap: 8px; }
.variant { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 14px; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1.5px var(--line-2); min-width: 92px; text-align: left; }
.variant b { font-size: 14px; }
.variant small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.variant.is-on { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-50); }
.variant.is-on small { color: var(--blue-600); }
.pm__buy { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.pm__buy .stepper { height: 52px; }
.pm__buy .stepper button { height: 52px; width: 44px; }
.pm__buy .btn { flex: 1; }
.pm__meta { display: grid; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pm__meta li { display: flex; gap: 10px; align-items: center; }
.pm__meta .ic { width: 18px; height: 18px; color: var(--blue); }
.rx-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; padding: 10px 12px; border-radius: var(--r-sm); background: var(--yellow-50); color: #5E4A00; }
.rx { font-family: var(--f-display); font-style: italic; font-weight: 800; background: var(--navy); color: var(--yellow); border-radius: 6px; padding: 1px 6px; flex: none; }

.cats-sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.cats-sheet .cat-tile { min-height: 116px; box-shadow: inset 0 0 0 1px var(--line); }

.toast { position: fixed; left: 16px; right: 16px; margin-inline: auto; width: fit-content; bottom: 24px; z-index: 90; background: var(--navy); color: #fff; border-radius: var(--r-pill); padding: 10px 10px 10px 18px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-3); font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); animation: toastIn .25s ease; }
.toast button { background: var(--yellow); color: var(--navy); border-radius: var(--r-pill); padding: 6px 12px; font-weight: 800; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
.toast span { min-width: 0; }

/* ---------- Páginas ---------- */
.page { padding-block: 24px 16px; }
.page--narrow { max-width: 520px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 700; margin-bottom: 12px; height: 36px; }
.page__title { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; }
.page__lead { color: var(--muted); margin-top: 6px; }

/* Checkout */
.checkout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; margin-top: 20px; }
.checkout__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.track__status { display: grid; justify-items: end; gap: 8px; }
.step { margin: 0; border: 0; background: var(--card); border-radius: var(--r-md); padding: 18px 18px 20px; box-shadow: var(--shadow-1); min-width: 0; }
.step legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.step legend small { font-family: var(--f-body); font-size: 13px; color: var(--muted); font-weight: 500; }
.step legend + * { clear: both; }
.step__n { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--yellow); display: grid; place-items: center; font-size: 14px; font-family: var(--f-body); font-weight: 800; flex: none; }
.opts { display: grid; gap: 10px; }
.opts--2 { grid-template-columns: 1fr 1fr; }
.opt { position: relative; display: block; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__box { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1.5px var(--line-2); cursor: pointer; height: 100%; transition: box-shadow .15s, background .15s; }
.opt__box .ic { grid-row: span 2; color: var(--blue); width: 26px; height: 26px; }
.opt__box b { font-size: 15px; }
.opt__box small { color: var(--muted); font-size: 13px; }
.opt__box .branch-opt__n { grid-row: span 2; width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
.opt input:checked + .opt__box { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-50); }
.opt input:focus-visible + .opt__box { outline: 3px solid var(--blue); outline-offset: 2px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field label small { font-weight: 500; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-sm); border: 0; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line); font-size: 16px; transition: box-shadow .15s, background .15s;
}
.field textarea { resize: vertical; min-height: 72px; }
.field input:focus, .field textarea:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--blue); }
.field.has-err input { box-shadow: inset 0 0 0 2px var(--danger); background: #FFF7F8; }
.field__err { color: var(--danger); font-size: 13px; font-weight: 600; }
.step > .field__err { margin-top: 8px; }

.cash { margin-top: 14px; padding: 16px; border-radius: var(--r-md); background: var(--yellow-50); box-shadow: inset 0 0 0 1px #F4E3A0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.cash__row { display: flex; justify-content: space-between; align-items: baseline; font-variant-numeric: tabular-nums; }
.cash__row b { font-size: 18px; }
.cash__row--change { padding-top: 10px; border-top: 1px dashed #E3CD7A; }
.cash__row--change b { font-size: 22px; color: var(--success); }
.cash__row--change b.is-bad { color: var(--danger); font-size: 15px; }
.cash__label { font-weight: 700; font-size: 14px; }
.cash__input { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1.5px #E6D38E; padding: 0 14px; }
.cash__input span { font-weight: 800; font-size: 20px; color: var(--muted); }
.cash__input input { flex: 1; min-width: 0; width: 100%; height: 52px; border: 0; background: none; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cash__input input:focus { outline: none; }
.cash__input:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.cash__quick { display: flex; flex-wrap: wrap; gap: 8px; }
.cash__quick button { height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px #E6D38E; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.cash__quick button:hover, .cash__quick button.is-on { background: var(--navy); color: var(--yellow); box-shadow: none; }

.summary { position: sticky; top: 150px; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 20px; display: grid; gap: 14px; }
.summary h2 { font-size: 20px; font-weight: 800; }
.summary__items { display: grid; gap: 12px; max-height: 340px; overflow-y: auto; padding: 8px 4px 2px 8px; margin: -8px -4px 0 -8px; }
.sum-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; }
.sum-item__img { width: 52px; height: 52px; border-radius: 10px; background: var(--media); padding: 6px; position: relative; }
.sum-item__img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.sum-item__qty { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.sum-item b { display: block; font-size: 13px; font-weight: 700; line-height: 1.3; }
.sum-item small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sum-item__sub { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.summary__fine { font-size: 12px; color: var(--muted); text-align: center; }

/* Seguimiento */
.track { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; margin-top: 16px; }
.track__card { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 20px; }
.track__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.track__code { font-family: var(--f-display); font-size: 28px; font-weight: 800; letter-spacing: -.01em; }
.track__when { color: var(--muted); font-size: 14px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(27,138,87,.5); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(27,138,87,0); } 100% { box-shadow: 0 0 0 0 rgba(27,138,87,0); } }
.status { --c: var(--st-received); display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, #fff); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.st-recibido { --c: var(--st-received); }
.st-preparando { --c: var(--st-preparing); }
.st-en-camino { --c: var(--st-transit); }
.st-listo-para-retirar { --c: var(--st-ready); }
.st-entregado { --c: var(--st-delivered); }
.st-cancelado { --c: var(--st-cancelled); }
.st-no-entregado { --c: var(--st-failed); }
.timeline { margin-top: 24px; display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 36px 1fr; gap: 14px; position: relative; padding-bottom: 22px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl__dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); position: relative; z-index: 1; }
.tl__dot .ic { width: 18px; height: 18px; }
.tl b { display: block; margin-top: 6px; font-size: 15px; }
.tl small { color: var(--muted); font-size: 13px; }
.tl.is-done .tl__dot { background: var(--c); color: #fff; box-shadow: none; }
.tl.is-done::before { background: var(--c); }
.tl.is-now .tl__dot { background: var(--c); color: #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 20%, transparent); }
.tl.is-now b { color: var(--c); }
.cancel-box { margin-top: 18px; padding: 14px; border-radius: var(--r-sm); background: #FBEAEC; color: #7A1E28; font-size: 14px; }
.track__info { display: grid; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.track__info div { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14px; }
.track__info .ic { width: 20px; height: 20px; color: var(--blue); }
.track__info small { display: block; color: var(--muted); font-size: 12px; }
.demo-bar { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1px dashed var(--line-2); font-size: 13px; color: var(--muted); }
.demo-bar b { color: var(--ink-2); margin-right: auto; }
.demo-bar .btn { min-height: 36px; font-size: 13px; padding: 0 12px; }
.success-banner { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r-md); background: #E7F5EE; color: #0F5535; margin-top: 12px; }
.success-banner .ic { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--success); color: #fff; flex: none; }

.orders { display: grid; gap: 12px; margin-top: 16px; }
.order-row { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-1); text-align: left; width: 100%; }
.order-row:hover { box-shadow: var(--shadow-2); }
.order-row__imgs { display: flex; }
.order-row__imgs span { width: 44px; height: 44px; border-radius: 10px; background: var(--media); padding: 5px; box-shadow: 0 0 0 2px #fff; margin-left: -10px; }
.order-row__imgs span:first-child { margin-left: 0; }
.order-row__imgs img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.order-row b { font-family: var(--f-display); font-size: 17px; }
.order-row small { display: block; color: var(--muted); font-size: 13px; }
.order-row__right { display: grid; justify-items: end; gap: 6px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Cuenta */
.auth { margin-top: 12px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 20px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: var(--r-pill); padding: 4px; margin-bottom: 18px; }
.tab { height: 42px; border-radius: var(--r-pill); font-weight: 700; color: var(--muted); }
.tab.is-on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.auth__form { display: grid; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.fine { font-size: 12px; color: var(--muted); text-align: center; }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--blue-50); color: var(--blue-600); font-size: 14px; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1180px) {
  .rail { grid-auto-columns: calc((100% - 3 * 16px) / 4); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cat-tiles__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .branch-pill { max-width: 200px; }
}

@media (max-width: 960px) {
  html { scroll-padding-top: 12px; }
  .topbar { position: relative; top: auto; }
  .text-btn.hide-sm { display: inline-flex; width: 44px; padding: 0; justify-content: center; }
  .text-btn.hide-sm span { display: none; }
  body { padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }
  .topbar__row { grid-template-columns: auto 1fr auto; gap: 10px 12px; padding-block: 10px; }
  .branch-pill { grid-column: 1 / -1; grid-row: 3; max-width: none; height: 40px; background: none; box-shadow: none; padding: 0; }
  .branch-pill__txt { flex-direction: row; gap: 6px; align-items: baseline; min-width: 0; }
  .branch-pill__txt small { flex: none; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .hide-sm { display: none; }
  .catbar { display: none; }
  .hero__grid { grid-template-columns: 1fr; gap: 24px; padding-block: 24px 64px; }
  .hero__media { justify-self: center; max-width: 440px; }
  .catalog { grid-template-columns: 1fr; margin-top: 40px; }
  .catalog__side { display: none; }
  .chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--safe-t); z-index: 20; background: var(--surface); padding: 10px var(--gutter); margin: 0 calc(-1 * var(--gutter)) 12px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--r-pill); background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 700; font-size: 14px; color: var(--ink-2); }
  .chip .ic { width: 17px; height: 17px; color: var(--blue); }
  .chip.is-on { background: var(--navy); color: #fff; box-shadow: none; }
  .chip.is-on .ic { color: var(--yellow); }
  .checkout, .track { grid-template-columns: 1fr; }
  .summary { position: static; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding-bottom: var(--safe-b); height: calc(var(--tabbar-h) + var(--safe-b));
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
  .tabbar button.is-on { color: var(--navy); }
  .tabbar button.is-on .ic { color: var(--blue); }
  .tabbar__cart-ic { position: relative; display: grid; place-items: center; }
  .tabbar__cart-ic .dot-count { top: -7px; right: -12px; background: var(--blue); color: #fff; }
  .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); }
  .cart-btn__total { display: none; }
  .cart-btn { padding: 0 6px 0 12px; height: 44px; gap: 8px; }
  .cart-btn__count { min-width: 30px; height: 30px; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .promo-strip__aside { display: none; }
  .promo-strip__in { justify-content: center; }
  .brand__mark { width: 36px; height: 36px; border-radius: 10px; }
  .brand__text b { font-size: 20px; }
  .search input { height: 46px; }
  .search__ic { top: 12px; }
  .hero h1 { font-size: 30px; }
  .hero__lead { font-size: 15px; margin-top: 10px; }
  .hero__cta { margin-top: 18px; }
  .hero__cta .btn { flex: 1; min-height: 48px; padding: 0 12px; font-size: 15px; }
  .hero__facts { display: none; }
  .hero__media { max-width: none; aspect-ratio: 4 / 4.2; }
  .hero::after { height: 32px; border-radius: 20px 20px 0 0; }
  .hero__grid { padding-block: 20px 48px; }
  .sec-head { margin-bottom: 12px; }
  .rail-nav { display: none; }
  .cat-tiles__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cat-tile { min-height: 0; padding: 12px 8px; align-items: center; text-align: center; gap: 8px; }
  .cat-tile b { font-size: 13px; }
  .cat-tile small, .cat-tile__n { display: none; }
  .rail { grid-auto-columns: 46%; gap: 12px; }
  .rail-sec { margin-top: 32px; }
  .band { grid-template-columns: 1fr; }
  .band__item { padding: 16px; }
  .brands { margin-top: 32px; gap: 10px; }
  .brands__row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); width: calc(100% + 2 * var(--gutter)); }
  .brands__row::-webkit-scrollbar { display: none; }
  .brand-chip { flex: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card__body { padding: 10px 12px 12px; }
  .card__title { font-size: 14px; }
  .price { font-size: 16px; }
  .add { width: 40px; padding: 0; justify-content: center; }
  .add span { display: none; }
  .stepper button { width: 32px; }
  .catalog__head { flex-direction: column; align-items: stretch; gap: 10px; }
  .catalog__tools .select, .catalog__tools select { width: 100%; }
  .opts--2 { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .step { padding: 16px 14px 18px; }
  .modal { padding: 0; align-items: end; }
  .modal__card { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding-bottom: calc(20px + var(--safe-b)); animation: sheetUp .25s ease; }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  .modal__card--product { grid-template-columns: 1fr; }
  .pm__media { min-height: 0; padding: 28px 40px; }
  .pm__media img { max-height: 240px; }
  .pm__body { padding: 20px 16px calc(20px + var(--safe-b)); }
  .pm__title { font-size: 23px; }
  .pm__price { font-size: 26px; }
  .footer { margin-top: 48px; }
  .footer__grid { grid-template-columns: 1fr; gap: 24px; }
  .order-row { grid-template-columns: 1fr auto; }
  .track__status { justify-items: start; }
  .order-row__imgs { display: none; }
}

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

/* ==========================================================
   v2 · estados de carga, cuenta y avisos
   ========================================================== */
.card--skel { pointer-events: none; }
.card--skel .card__media { background: linear-gradient(90deg, var(--media) 0%, #EDF1F6 50%, var(--media) 100%); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
.card--skel .card__body span { display: block; height: 12px; border-radius: 6px; background: var(--surface); }
.card--skel .card__body span:nth-child(1) { width: 40%; }
.card--skel .card__body span:nth-child(2) { width: 85%; height: 16px; }
.card--skel .card__body span:nth-child(3) { width: 55%; height: 20px; margin-top: 18px; }
@keyframes skel { to { background-position: -200% 0; } }
.loading-line { color: var(--muted); padding: 24px 0; }
.form-error { color: var(--danger); background: #FBEAEC; border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; font-weight: 600; }
.closed-banner { background: #FBEAEC; color: #7A1E28; font-weight: 700; font-size: 14px; padding-block: 10px; text-align: center; }

.account .auth { display: grid; gap: 16px; }
.account .page__title { font-size: 30px; }
.auth__h { font-size: 18px; font-weight: 800; }
.auth .auth__form { padding-top: 16px; border-top: 1px solid var(--line); }
.auth .tabs + .auth__form { padding-top: 0; border-top: 0; }
.staff-link { text-decoration: none; }
.staff-link .ic { width: 20px; height: 20px; }
.account-links { display: grid; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.account-links button { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-weight: 700; text-align: left; }
.account-links button + button { border-top: 1px solid var(--line); }
.account-links button:hover { background: var(--surface); }
.account-links button .ic:first-child { color: var(--blue); }
.account-links button span { flex: 1; }
.account-links .ic--sm { color: var(--muted); }
.fine b { color: var(--ink-2); }

/* ==========================================================
   v2.1 · Tienda en azul oscuro (como /farmacia)
   Solo afecta a la tienda (body.store). El panel queda igual.
   ========================================================== */
body.store {
  color-scheme: dark;
  --surface: #081424;
  --card: #0E1D33;
  --media: #F4F7FB;
  --ink: #E9EFF8;
  --ink-2: #C4D0E0;
  --muted: #8FA3BD;
  --line: #1C2F4C;
  --line-2: #2B4468;
  --blue-50: #132F58;
  --blue-600: #8DB8FF;
  --yellow-50: #2B2712;
  --on-navy-muted: #A3B5CE;
  --link: #8DB8FF;
  --shadow-1: 0 0 0 1px rgba(255,255,255,.06), 0 6px 18px rgba(0,0,0,.28);
  --shadow-2: 0 0 0 1px rgba(255,255,255,.1), 0 12px 30px rgba(0,0,0,.4);
  --shadow-3: 0 0 0 1px rgba(255,255,255,.08), 0 24px 60px rgba(0,0,0,.55);
  background:
    radial-gradient(circle at 10% 0%, rgba(23,102,214,.22), transparent 32%),
    radial-gradient(circle at 95% 18%, rgba(255,210,63,.07), transparent 24%),
    linear-gradient(180deg, #07111F 0%, #081424 50%, #07111D 100%);
  background-attachment: fixed;
}
body.store .hero { background: transparent; }
body.store .hero::after { display: none; }
body.store .topbar { background: rgba(8, 20, 36, .94); backdrop-filter: blur(10px); }

/* textos y enlaces legibles sobre oscuro */
body.store .eyebrow, body.store .link, body.store .back, body.store .cat-tile__n,
body.store .suggest__all, body.store .drawer__branch button { color: var(--link); }
body.store .drawer__branch .ic, body.store .pm__meta .ic, body.store .track__info .ic,
body.store .opt__box .ic, body.store .side-cat .ic, body.store .chip .ic,
body.store .account-links button .ic:first-child { color: var(--link); }
body.store .cat-tile__ic { background: var(--blue-50); color: var(--link); }
body.store .cat-tile:nth-child(3n+2) .cat-tile__ic { background: var(--yellow-50); color: var(--yellow); }

/* tarjetas de producto: foto sobre fondo claro para que se vea limpia */
body.store .card__media { margin: 8px 8px 0; width: auto; border-radius: 10px; }
body.store .card__body { padding-top: 10px; }

/* estados activos */
body.store .side-cat.is-on { background: var(--blue); }
body.store .side-cat.is-on .ic { color: #fff; }
body.store .chip.is-on { background: var(--yellow); color: var(--navy); }
body.store .chip.is-on .ic { color: var(--navy); }
body.store .step__n { background: var(--yellow); color: var(--navy); }
body.store .branch-opt__n { background: var(--navy-3); }
body.store .band__ic { background: var(--navy-3); }

/* buscador y sugerencias */
body.store .search input { background: #fff; color: #0E1B2E; }
body.store .suggest { background: var(--card); color: var(--ink); }
body.store .suggest__item:hover, body.store .suggest__item.is-active { background: var(--blue-50); }

/* formularios */
body.store .field input, body.store .field textarea, body.store .field select { background: #0A172B; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
body.store .field input::placeholder, body.store .field textarea::placeholder { color: #6F84A0; }
body.store .field input:focus, body.store .field textarea:focus { background: #0A172B; box-shadow: inset 0 0 0 2px var(--link); }
body.store .field.has-err input { background: #2A1119; }
body.store .select select { background: var(--card); color: var(--ink); }

/* efectivo */
body.store .cash { background: #16233A; box-shadow: inset 0 0 0 1px #3A4A2A; }
body.store .cash__row--change { border-top-color: #3D4F6D; }
body.store .cash__input { background: #0A172B; box-shadow: inset 0 0 0 1.5px var(--line-2); }
body.store .cash__input input { color: var(--ink); }
body.store .cash__quick button { background: #0A172B; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); }
body.store .cash__quick button:hover, body.store .cash__quick button.is-on { background: var(--yellow); color: var(--navy); }
body.store .cash__row--change b { color: #4ED19A; }

/* avisos */
body.store .rx-note { background: var(--yellow-50); color: #FFE39A; }
body.store .notice { color: var(--link); }
body.store .pm__close { background: var(--card); color: var(--ink); }
body.store .order-row__imgs span { box-shadow: 0 0 0 2px var(--card); }
body.store .toast { background: #13284A; box-shadow: var(--shadow-3); }
body.store .footer { background: #050D18; border-top: 1px solid var(--line); }
body.store .tl__dot { background: #0A172B; }
body.store .icon-btn--dark { color: var(--ink); }
body.store .card--skel .card__media { background: linear-gradient(90deg, #13233B 0%, #1A2E4B 50%, #13233B 100%); background-size: 200% 100%; }

/* ---------- buscador fijo al hacer scroll (celular) ---------- */
@media (max-width: 960px) {
  html { scroll-padding-top: calc(var(--hdr-h, 64px) + 12px); }
  .topbar { position: sticky; top: var(--safe-t); }
  .chips { top: calc(var(--safe-t) + var(--hdr-h, 64px)); }
  body.store .tabbar { background: rgba(8, 20, 36, .97); border-top-color: var(--line); }
  body.store .tabbar button.is-on { color: #fff; }
  body.store .tabbar button.is-on .ic { color: var(--yellow); }
  .topbar.is-compact .brand, .topbar.is-compact .branch-pill,
  .topbar.is-compact .top-actions .icon-btn, .topbar.is-compact .top-actions .text-btn { display: none; }
  .topbar.is-compact .topbar__row { grid-template-columns: 1fr auto; padding-block: 8px; }
  .topbar.is-compact .search { grid-row: 1; grid-column: 1; }
  .topbar.is-compact .top-actions { grid-row: 1; grid-column: 2; }
  .topbar.is-compact .search input { height: 44px; }
  .topbar.is-compact .search__ic { top: 11px; }
}

/* ---------- celular: hero = video, después categorías ---------- */
@media (max-width: 640px) {
  .hero__copy > :not(h1) { display: none; }
  .hero__copy h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero__grid { padding-block: 14px 8px; }
  .hero__media { aspect-ratio: 4 / 5; }
  .cat-tiles { padding-top: 20px; }
}
/* estados hover sobre oscuro (en celular el "hover" queda pegado al tocar) */
body.store .btn--primary:hover, body.store .add:hover { background: #1F72E6; }
body.store .btn--soft:hover { background: #1A3C6E; }
body.store .stepper button:hover { background: #1A3C6E; }
body.store .round-btn:hover { background: var(--blue-50); }
body.store .brand-chip:hover { color: var(--link); box-shadow: inset 0 0 0 1.5px var(--link); }
body.store .side-cat:hover, body.store .account-links button:hover { background: #13243D; }
body.store .icon-btn--dark:hover { background: #13243D; }
body.store .cart-item__del:hover { background: #3A1520; }
@media (hover: none) {
  body.store .btn--primary:hover, body.store .add:hover { background: var(--blue); }
}
.cancel-box--warn { background: #FDEEE4; color: #7A3310; }

/* v2.3 · aviso bajo un campo */
.field .hint { display: block; margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
