/* ==========================================================================
   Farmalink — sistema de diseño "Verde salud"
   Blanco limpio + verde farmacia profundo como color de acción + acento coral
   solo para avisos y contadores. Sans pesada para titulares.
   Sin dependencias externas: tipografías del sistema (rápido con conectividad limitada).
   ========================================================================== */

:root {
  /* Color · base */
  --bg: #f7faf9;
  --surface: #ffffff;
  --surface-2: #eef5f2;
  --ink: #0f2a24;
  --muted: #4d625b;
  --line: #dce8e3;
  --line-strong: #7f978f;          /* bordes de controles: ≥3:1 sobre blanco */

  /* Color · marca */
  --primary: #0b7a5c;
  --primary-hover: #086449;
  --primary-ink: #075c44;          /* texto verde sobre fondos suaves */
  --primary-soft: #e3f4ee;
  --primary-deep: #0a3f31;         /* hero y pie */
  --on-primary: #ffffff;
  --accent: #ff6b4a;               /* decorativo: puntos, marcas */
  --accent-strong: #c2391b;        /* texto/contadores sobre blanco */
  --accent-soft: #ffece6;

  /* Color · estados */
  --success: #11704c;  --success-bg: #ddf3e9;
  --warn: #855000;     --warn-bg: #fff1d1;
  --error: #b42318;    --error-bg: #fde8e5;
  --info: #1d5d8a;     --info-bg: #e3eef8;
  --neutral: #4a5d57;  --neutral-bg: #e9f0ed;
  --focus: #1366d6;

  /* Tipografía */
  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "SF Pro Display", -apple-system, "Avenir Next", Montserrat, system-ui, sans-serif;
  --fs-sm: .875rem; --fs-base: 1rem; --fs-lg: 1.125rem;
  --fs-xl: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --fs-2xl: clamp(1.8rem, 1.2rem + 2.2vw, 2.6rem);
  --fs-hero: clamp(2.2rem, 1.3rem + 3.8vw, 3.75rem);

  /* Espaciado (base 4) */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;

  /* Forma */
  --radius-lg: 24px; --radius: 16px; --radius-sm: 10px; --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgb(15 42 36 / .06);
  --shadow: 0 1px 2px rgb(15 42 36 / .05), 0 8px 24px rgb(15 42 36 / .07);
  --shadow-lg: 0 2px 6px rgb(15 42 36 / .06), 0 22px 48px rgb(15 42 36 / .14);
  --container: 1200px;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 64px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-base)/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg { max-width: 100%; display: block; }
a { color: var(--primary-ink); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 var(--s3); text-wrap: balance; }
h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.03em; } h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-lg); letter-spacing: -.01em; }
p { margin: 0 0 var(--s4); text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s3); top: -60px; background: var(--ink); color: #fff; padding: var(--s2) var(--s4); border-radius: var(--radius-sm); z-index: 100; transition: top .15s; }
.skip:focus { top: var(--s3); color: #fff; }

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.stack > * + * { margin-top: var(--s4); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font: 700 .75rem/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--primary-ink); margin-bottom: var(--s3); }
.eyebrow svg { width: 15px; height: 15px; }
.section { padding-block: var(--s7); }
.section--tight { padding-block: var(--s6); }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.section__head h2 { margin: 0; font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.03em; }
.section__head .eyebrow { display: flex; }
.more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--primary-ink); padding: 8px 14px; border-radius: 999px; background: var(--primary-soft); transition: background .15s, gap .2s var(--ease); }
.more svg { width: 18px; height: 18px; }
.more:hover { background: #d2ede3; gap: 10px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 46px; padding: 0 var(--s5); border-radius: 999px;
  border: 1px solid transparent; background: var(--primary); color: var(--on-primary);
  font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgb(11 122 92 / .25);
  transition: background .15s var(--ease), transform .1s var(--ease), border-color .15s, box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: var(--primary-hover); color: var(--on-primary); box-shadow: 0 4px 14px rgb(11 122 92 / .28); }
.btn:active { transform: translateY(1px) scale(.99); }
/* Acción final de un flujo (reservar, confirmar): mismo verde, más presencia */
.btn--accent { min-height: 54px; font-size: 1.0625rem; box-shadow: 0 6px 18px rgb(11 122 92 / .3); }
.btn--accent:hover { color: #fff; }
.btn--ghost { background: var(--surface); color: var(--primary-ink); border-color: var(--line); box-shadow: none; }
.btn--ghost:hover { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary); box-shadow: none; }
.btn--danger { background: var(--surface); color: var(--error); border-color: #efb8b1; box-shadow: none; }
.btn--danger:hover { background: var(--error-bg); color: var(--error); box-shadow: none; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 var(--s4); font-size: var(--fs-sm); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--neutral-bg); color: var(--muted); border-color: transparent; box-shadow: none; cursor: not-allowed; pointer-events: none; }
.btn.is-done { background: var(--success); }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary-ink); text-decoration: underline; cursor: pointer; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 650; line-height: 1.5; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--error { background: var(--error-bg); color: var(--error); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge--rx { background: var(--accent-soft); color: var(--accent-strong); }
.badge--rx::before { content: "Rx"; width: auto; height: auto; background: none; font-size: .6875rem; font-weight: 800; letter-spacing: .02em; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: var(--s2); margin-bottom: var(--s4); }
.field label, .label { font-weight: 650; font-size: var(--fs-sm); }
.field .hint { color: var(--muted); font-size: var(--fs-sm); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 14px; background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 104px; resize: vertical; }
.input:hover { border-color: var(--primary); }
.input:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgb(11 122 92 / .18); }
.input[aria-invalid="true"] { border-color: var(--error); }
.field-error { color: var(--error); font-size: var(--fs-sm); font-weight: 600; }
.check { display: flex; gap: var(--s3); align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.row { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .row--2 { grid-template-columns: 1fr 1fr; } .row--3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Avisos / toasts ---------- */
.alert { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--radius-sm); border: 1px solid; margin-bottom: var(--s4); font-size: var(--fs-sm); }
.alert--success { background: var(--success-bg); color: var(--success); border-color: #b4e2cc; }
.alert--error { background: var(--error-bg); color: var(--error); border-color: #f2bdb6; }
.alert--info { background: var(--info-bg); color: var(--info); border-color: #bcd5ea; }
.alert--warn { background: var(--warn-bg); color: var(--warn); border-color: #f0d590; }
.toasts { position: fixed; z-index: 90; inset: auto var(--s4) calc(var(--s4) + 68px) var(--s4); display: grid; gap: var(--s2); justify-items: end; pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: var(--s5); right: var(--s5); left: auto; } }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: var(--s3) var(--s4); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-width: 380px; animation: toast-in .25s var(--ease); font-size: var(--fs-sm); display: flex; gap: var(--s3); align-items: center; }
.toast--error { background: var(--error); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Cabecera ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header__main { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s5); min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 800 1.25rem/1 var(--font-display); letter-spacing: -.02em; }
.logo:hover { color: var(--ink); }
.logo__mark { width: 38px; height: 38px; flex: none; }
.logo small { display: block; font: 700 .625rem/1 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--primary-ink); margin-top: 4px; }
.header__actions { display: flex; align-items: center; gap: var(--s1); justify-self: end; }
.hbtn { position: relative; display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; min-width: 44px; justify-content: center; padding: 0 var(--s3); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 650; font-size: var(--fs-sm); background: none; border: 0; cursor: pointer; transition: background .15s; }
.hbtn:hover, .hbtn[aria-current] { background: var(--surface-2); color: var(--ink); }
.hbtn svg { width: 22px; height: 22px; }
.hbtn--status > span { display: grid; line-height: 1.15; text-align: left; }
.status { font-size: .6875rem; font-weight: 650; }
.status--success { color: var(--success); } .status--warn { color: var(--warn); } .status--neutral { color: var(--muted); }
.hbtn__count { position: absolute; top: 0; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent-strong); color: #fff; font-size: .75rem; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.hbtn__count[hidden] { display: none; }
.mstatus { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: .8125rem; font-weight: 650; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-dot--success { background: #18a874; box-shadow: 0 0 0 3px rgb(24 168 116 / .2); } .status-dot--warn { background: #e8a200; }
.nav { border-top: 1px solid var(--line); }
.nav .container { position: relative; }
.nav .container::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 48px; background: linear-gradient(to right, rgb(255 255 255 / 0), #fff); pointer-events: none; }
.nav ul { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; padding-block: 8px; padding-right: 48px; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a { display: block; padding: 6px 14px; color: var(--muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; border-radius: 999px; transition: background .15s, color .15s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current] { color: #fff; background: var(--primary); }
.header .search { grid-column: 1 / -1; order: 3; padding-bottom: var(--s3); }
@media (min-width: 900px) {
  .header .search { grid-column: auto; order: 0; padding: 0; max-width: 600px; width: 100%; justify-self: center; }
}
.header--home .header__main > .search { display: none; } /* en la portada manda el buscador del hero */
.hide-sm { display: none; } @media (min-width: 900px) { .hide-sm { display: inline; } .hide-lg { display: none !important; } }
.hbtn.hide-sm, .search__go.hide-sm { display: none; } @media (min-width: 900px) { .hbtn.hide-sm, .search__go.hide-sm { display: inline-flex; } }

/* ---------- Buscador ---------- */
.search { position: relative; }
.search__box { display: flex; align-items: center; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 999px; padding-left: var(--s4); transition: border-color .15s, box-shadow .15s, background .15s; }
.search__box:hover { border-color: var(--line-strong); }
.search__box:focus-within { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 4px rgb(11 122 92 / .16); }
.search__box svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; height: 48px; border: 0; background: none; padding: 0 var(--s3); outline: none; font-size: 1rem; }
.search input::placeholder { color: #5c706a; }
.search input::-webkit-search-cancel-button { display: none; }
.search__go { margin: 4px; min-height: 40px; padding: 0 var(--s5); box-shadow: none; }
.search__panel { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: min(70vh, 520px); overflow: auto; padding: var(--s2); color: var(--ink); text-align: left; }
.header .search__panel { top: calc(100% - var(--s3) + 6px); }
@media (min-width: 900px) { .header .search__panel { top: calc(100% + 8px); } }
.search__group { padding: var(--s3) var(--s3) var(--s1); font: 700 .6875rem/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.search__opt { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 10px var(--s3); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); cursor: pointer; }
.search__opt:hover, .search__opt[aria-selected="true"] { background: var(--primary-soft); color: var(--ink); }
.search__opt mark { background: #c8eedd; color: inherit; border-radius: 3px; padding: 0 1px; }
.search__opt small { color: var(--muted); display: block; }
.search__meta { text-align: right; font-size: var(--fs-sm); white-space: nowrap; }
.search__chip { display: inline-block; margin: 2px; padding: 6px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; text-decoration: none; font-size: var(--fs-sm); font-weight: 550; color: var(--ink); transition: border-color .15s, background .15s; }
.search__chip:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--ink); }
.search__empty { padding: var(--s4); }

/* ---------- Hero ---------- */
.hero { padding-block: var(--s5) 0; }
.hero__grid {
  position: relative; overflow: hidden; display: grid; gap: var(--s6); align-items: center;
  padding: clamp(1.75rem, 1rem + 4vw, 4rem); border-radius: var(--radius-lg); color: #eaf6f1;
  background:
    radial-gradient(520px 320px at 100% 0%, rgb(255 107 74 / .16), transparent 70%),
    radial-gradient(640px 420px at 0% 110%, rgb(52 211 153 / .14), transparent 70%),
    linear-gradient(135deg, #08654c 0%, var(--primary-deep) 100%);
}
.hero__grid::after { /* cruz decorativa */
  content: ""; position: absolute; right: -60px; bottom: -60px; width: 260px; height: 260px; opacity: .07; pointer-events: none;
  background: linear-gradient(#fff, #fff) center / 34% 100% no-repeat, linear-gradient(#fff, #fff) center / 100% 34% no-repeat;
  border-radius: 24px; transform: rotate(12deg);
}
@media (min-width: 980px) { .hero__grid { grid-template-columns: 1.35fr .85fr; } }
.hero__copy { position: relative; z-index: 2; min-width: 0; }
.hero .eyebrow { color: #d2ece2; }
.eyebrow--pill { padding: 7px 12px; border-radius: 999px; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .18); letter-spacing: .06em; }
.hero h1 { font-size: var(--fs-hero); max-width: 16ch; color: #fff; line-height: 1.04; letter-spacing: -.035em; margin-bottom: var(--s4); }
.hero h1 .hl { color: #7ff0c3; }
.hero p.lead { font-size: var(--fs-lg); color: #dcefe8; max-width: 50ch; }
.hero .search { max-width: 600px; margin-top: var(--s5); }
.hero .search__box { background: #fff; border-color: #fff; padding-left: var(--s5); box-shadow: 0 14px 36px rgb(0 0 0 / .22); }
.hero .search__box:focus-within { box-shadow: 0 0 0 4px rgb(127 240 195 / .55), 0 14px 36px rgb(0 0 0 / .22); }
.hero .search input { height: 58px; font-size: 1.0625rem; color: var(--ink); }
.hero .search__go { min-height: 48px; padding: 0 var(--s6); }
.hero__quick { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4); align-items: center; }
.hero__quick span { color: #c4e6d9; font-size: var(--fs-sm); margin-right: var(--s1); }
.hero__quick .search__chip { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .22); color: #fff; }
.hero__quick .search__chip:hover { background: #fff; color: var(--primary-ink); border-color: #fff; }
@media (max-width: 599px) { .hero__card { display: none; } }
.hero__card { position: relative; z-index: 2; background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: var(--s5); box-shadow: var(--shadow-lg); }
.hero__status { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding-bottom: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600; }
.perks { display: grid; gap: var(--s4); }
.perks li { display: grid; grid-template-columns: 44px 1fr; gap: var(--s3); align-items: start; }
.perks i { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.perks i svg { width: 22px; height: 22px; }
.perks strong { display: block; font-family: var(--font-display); font-weight: 700; }
.perks span { color: var(--muted); font-size: var(--fs-sm); }

/* Cómo funciona */
.howto { padding-top: var(--s5); }
.howto__steps { display: grid; gap: var(--s3); counter-reset: hs; }
@media (min-width: 800px) { .howto__steps { grid-template-columns: repeat(3, 1fr); gap: var(--s4); } }
.howto__steps li { counter-increment: hs; position: relative; display: grid; grid-template-columns: 52px 1fr; gap: var(--s4); align-items: center; padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.howto__steps b { position: relative; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--primary); color: #fff; }
.howto__steps b svg { width: 24px; height: 24px; }
.howto__steps b::after { content: counter(hs); position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 800 .75rem/1 var(--font-ui); box-shadow: 0 0 0 3px var(--surface); }
.howto__steps strong { display: block; font-family: var(--font-display); }
.howto__steps span { color: var(--muted); font-size: var(--fs-sm); }

/* Compatibilidad: tarjeta de pasos antigua */
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s5); }
.ticket__steps { counter-reset: s; display: grid; gap: var(--s4); margin-top: var(--s4); }
.ticket__steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: var(--s3); }
.ticket__steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* ---------- Categorías ---------- */
.cats { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .cats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 719px) { .cat:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.cat { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .2s var(--ease), box-shadow .2s; }
.cat:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.cat__icon { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); transition: background .2s, color .2s; }
.cat__icon svg { width: 26px; height: 26px; }
.cat:hover .cat__icon { background: var(--primary); color: #fff; }
.cat__txt { display: grid; min-width: 0; }
.cat strong { font: 700 1rem/1.25 var(--font-display); letter-spacing: -.01em; }
.cat__txt > span { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 559px) { .cat { flex-direction: column; align-items: flex-start; } .cat__icon { width: 44px; height: 44px; } .cat__icon svg { width: 22px; height: 22px; } }

/* ---------- Producto: tarjeta + marcador de imagen ---------- */
.grid { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); } }
@media (min-width: 1080px) { .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .25s, transform .25s var(--ease); }
.card:hover { border-color: #b7d3c8; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card__media { display: block; padding: 8px 8px 0; }
.card__media .tile { border-radius: 12px; aspect-ratio: 16 / 11; }
.card__body { display: flex; flex-direction: column; gap: 6px; padding: var(--s3) var(--s4) var(--s4); flex: 1; }
.card__cat { font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-ink); font-weight: 700; }
.card__title { font: 700 1.0625rem/1.25 var(--font-display); letter-spacing: -.01em; margin: 0; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; } /* toda la tarjeta clicable */
.card:hover .card__title a { color: var(--primary-ink); }
.card__pres { font-size: var(--fs-sm); color: var(--muted); }
.card__body > div:not(.card__foot) { display: flex; flex-wrap: wrap; gap: 4px; }
.card__foot { margin-top: auto; padding-top: var(--s3); display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.price { font: 800 1.1875rem/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price small { font-weight: 600; color: var(--muted); font-size: .75rem; letter-spacing: .04em; }
.card__act { position: relative; z-index: 2; } /* sobre el enlace extendido */
.fav { position: absolute; z-index: 2; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .95); box-shadow: var(--shadow-sm); display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: transform .15s var(--ease), background .15s, color .15s; }
.fav:hover { background: #fff; transform: scale(1.08); color: var(--accent-strong); }
.fav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav[aria-pressed="true"] { color: var(--accent); }
.fav[aria-pressed="true"] svg { fill: currentColor; }

/* Marcador de producto: icono de categoría sobre fondo suave (hasta subir foto real) */
.tile { aspect-ratio: 4 / 3; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; background: var(--t-bg); color: var(--t-fg); position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / .75), rgb(255 255 255 / 0) 70%); }
.tile__icon { position: relative; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: #fff; color: var(--t-fg); box-shadow: 0 6px 16px rgb(15 42 36 / .08); }
.tile__icon svg { width: 34px; height: 34px; stroke-width: 1.75; }
.tile em { position: relative; font-style: normal; font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.tile span { position: relative; font: 800 2rem/1 var(--font-display); } /* compatibilidad */
.tile--1 { --t-bg: #def3ea; --t-fg: #0b7a5c; } .tile--2 { --t-bg: #ffe9e2; --t-fg: #b8401f; }
.tile--3 { --t-bg: #e0f0f7; --t-fg: #1d6a8f; } .tile--4 { --t-bg: #efe9fb; --t-fg: #5b3fa6; }
.tile--5 { --t-bg: #fdf3d6; --t-fg: #8a5a00; } .tile--6 { --t-bg: #e3f5f1; --t-fg: #137067; }
.card.is-out .tile { filter: grayscale(1); opacity: .6; }
.card.is-out .card__title a { color: var(--muted); }

/* ---------- Catálogo ---------- */
.page-head { padding-block: var(--s6) var(--s4); }
.page-head h1 { margin: 0; }
.crumbs { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s3); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0; margin: 0; list-style: none; }
.crumbs li + li::before { content: "›"; margin-right: var(--s2); color: var(--line-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary-ink); text-decoration: underline; }
.catalog { display: grid; gap: var(--s5); padding-bottom: var(--s7); }
@media (min-width: 900px) { .catalog { grid-template-columns: 260px 1fr; align-items: start; } }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); }
@media (min-width: 900px) { .filters { position: sticky; top: calc(var(--header-h) + 64px); } }
.filters details { border-top: 1px solid var(--line); padding-block: var(--s3); }
.filters details:first-of-type { border-top: 0; padding-top: 0; }
.filters summary { font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; list-style: none; min-height: 32px; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: "+"; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--primary-ink); font-weight: 700; }
.filters details[open] summary::after { content: "−"; }
.filters .opts { display: grid; gap: var(--s2); margin-top: var(--s3); }
.filters .opts a { text-decoration: none; color: var(--ink); padding: 4px 10px; margin-inline: -10px; border-radius: 8px; font-size: var(--fs-sm); }
.filters .opts a:hover, .filters .opts a[aria-current] { background: var(--primary-soft); color: var(--primary-ink); }
.filters .check { align-items: center; font-size: var(--fs-sm); }
.filters .check small { margin-left: auto; color: var(--muted); }
.filters__toggle { display: none; }
@media (max-width: 899px) {
  .filters__toggle { display: inline-flex; }
  .filters:not(.is-open) .filters__body { display: none; }
}
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.toolbar select { min-height: 42px; width: auto; border-radius: 999px; padding-inline: 16px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.chip { display: inline-flex; align-items: center; gap: var(--s2); padding: 4px 6px 4px 14px; background: var(--primary-soft); color: var(--primary-ink); border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; }
.chip a { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; text-decoration: none; color: var(--primary-ink); }
.chip a:hover { background: #c6eadb; }
.pagination { display: flex; justify-content: center; gap: var(--s2); margin-top: var(--s6); flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0 var(--s3); border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 650; }
.pagination a:hover { border-color: var(--primary); background: var(--primary-soft); }
.pagination [aria-current] { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty { text-align: center; padding: var(--s7) var(--s4); background: var(--surface); border: 1.5px dashed #b7d3c8; border-radius: var(--radius); }
.empty h2, .empty h3 { margin-bottom: var(--s2); }
.empty p { color: var(--muted); max-width: 46ch; margin-inline: auto; }
.empty .btn { margin-top: var(--s3); }

/* ---------- Ficha de producto ---------- */
.pdp { display: grid; gap: var(--s6); padding-bottom: var(--s7); }
@media (min-width: 900px) { .pdp { grid-template-columns: 1fr 1fr; } .pdp__buy { position: sticky; top: calc(var(--header-h) + 64px); align-self: start; } }
.pdp__media .tile { border-radius: var(--radius-lg); aspect-ratio: 1; }
.pdp__media .tile__icon { width: 128px; height: 128px; border-radius: 36px; }
.pdp__media .tile__icon svg { width: 64px; height: 64px; stroke-width: 1.5; }
.pdp__media .tile em { font-size: .875rem; }
.pdp__media .tile span { font-size: clamp(3rem, 9vw, 5.5rem); }
.pdp h1 { margin-bottom: var(--s2); }
.pdp__sub { color: var(--muted); font-size: var(--fs-lg); margin-bottom: var(--s4); }
.buybox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5); margin-block: var(--s4); box-shadow: var(--shadow); }
.buybox .price { font-size: 2.25rem; letter-spacing: -.03em; }
.qty { display: inline-flex; align-items: center; justify-self: start; width: max-content; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface); overflow: hidden; }
.qty button { width: 46px; height: 46px; border: 0; background: none; font-size: 1.25rem; cursor: pointer; color: var(--primary-ink); }
.qty button:hover { background: var(--primary-soft); }
.qty input { width: 52px; height: 46px; text-align: center; border: 0; background: none; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0 var(--s5); margin: 0; }
.facts dt, .facts dd { padding: 10px 0; border-top: 1px solid var(--line); }
.facts dt:first-of-type, .facts dd:first-of-type { border-top: 0; }
.facts dt { color: var(--muted); font-size: var(--fs-sm); } .facts dd { margin: 0; font-weight: 600; }
.notice { display: flex; gap: var(--s3); padding: var(--s4); background: var(--accent-soft); border: 1px solid #ffd2c4; border-radius: var(--radius-sm); font-size: var(--fs-sm); color: #5c2414; }
.notice strong { display: block; color: var(--accent-strong); }
.avail { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.avail:first-child { border-top: 0; }

/* ---------- Farmacia ---------- */
.pharm { display: grid; gap: var(--s6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.25rem, .8rem + 2vw, 2.5rem); box-shadow: var(--shadow); }
@media (min-width: 800px) { .pharm { grid-template-columns: 1.2fr 1fr; } }
.pharm > div:last-child:has(.hours) { background: var(--surface-2); border-radius: var(--radius); padding: var(--s5); }
.hours { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.hours th, .hours td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.hours td { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours tr.today th, .hours tr.today td { font-weight: 700; color: var(--primary-ink); }
.hours tr.today th::after { content: "Hoy"; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: .6875rem; }
.services { display: grid; gap: var(--s3); }
@media (min-width: 720px) { .services { grid-template-columns: repeat(3, 1fr); } }
.service { padding: var(--s4); border-radius: var(--radius-sm); background: var(--surface-2); }
.service h3 { margin-bottom: var(--s1); font-size: 1rem; color: var(--primary-ink); }
.service p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }

/* ---------- Reserva: pasos, tabla, línea de tiempo ---------- */
.steps { display: flex; gap: var(--s4); margin-bottom: var(--s5); counter-reset: st; flex-wrap: wrap; }
.steps li { counter-increment: st; display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); font-weight: 650; color: var(--muted); }
.steps li::before { content: counter(st); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); }
.steps li[aria-current] { color: var(--ink); } .steps li[aria-current]::before { background: var(--primary); color: #fff; border-color: var(--primary); }
.steps li.done::before { content: "✓"; background: var(--success); color: #fff; border-color: var(--success); }
.two-col { display: grid; gap: var(--s5); padding-bottom: var(--s7); }
@media (min-width: 900px) { .two-col { grid-template-columns: 1.4fr 1fr; align-items: start; } .two-col aside { position: sticky; top: calc(var(--header-h) + 64px); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); }
.panel + .panel { margin-top: var(--s4); }
.panel h2, .panel h3 { font-size: var(--fs-lg); }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s4); padding: var(--s4) 0; border-top: 1px solid var(--line); align-items: center; }
.line:first-child, .panel > h2 + .line { border-top: 0; }
.line .tile { aspect-ratio: 1; border-radius: 14px; } .line .tile em, .line .tile small, .line .tile::before { display: none; }
.line .tile__icon { width: 40px; height: 40px; border-radius: 12px; box-shadow: none; background: rgb(255 255 255 / .7); } .line .tile__icon svg { width: 22px; height: 22px; }
.line .tile span { font-size: 1.1rem; }
.line__end { text-align: right; display: grid; gap: var(--s2); justify-items: end; }
.sum { display: flex; justify-content: space-between; padding: var(--s2) 0; }
.sum--total { border-top: 1px solid var(--line); margin-top: var(--s2); padding-top: var(--s3); font-weight: 800; font-size: var(--fs-lg); }
.slots { display: flex; flex-wrap: wrap; gap: var(--s2); }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.slot span { display: block; padding: 10px 16px; min-width: 80px; text-align: center; border: 1.5px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-weight: 650; font-variant-numeric: tabular-nums; transition: background .15s, border-color .15s; }
.slot input:hover + span { border-color: var(--primary); background: var(--primary-soft); }
.slot input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.daytabs { display: flex; gap: var(--s2); overflow-x: auto; margin-bottom: var(--s3); padding-bottom: 4px; }
.daytab { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 650; font-size: var(--fs-sm); white-space: nowrap; }
.daytab:hover { border-color: var(--primary); }
.daytab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.timeline { position: relative; display: grid; gap: var(--s4); margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: var(--s3); }
.timeline li::before { content: ""; width: 14px; height: 14px; margin: 5px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); position: relative; z-index: 1; }
.timeline li::after { content: ""; position: absolute; left: 13px; top: 24px; bottom: -20px; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--success); border-color: var(--success); }
.timeline li.done::after { background: var(--success); }
.timeline li.current::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.timeline li.bad::before { background: var(--error); border-color: var(--error); }
.timeline strong { display: block; } .timeline span { color: var(--muted); font-size: var(--fs-sm); }
.timeline li.todo strong { color: var(--muted); font-weight: 500; }
.code { display: inline-block; font: 800 1.375rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; padding: 10px 16px; background: var(--primary-soft); color: var(--primary-ink); border-radius: var(--radius-sm); border: 1.5px dashed #8fcdb6; }
.success-hero { text-align: center; padding: var(--s6) var(--s4); }
.success-hero svg { width: 72px; height: 72px; margin: 0 auto var(--s4); color: var(--success); }
.success-hero svg circle { stroke-dasharray: 190; stroke-dashoffset: 190; animation: draw .6s var(--ease) forwards; }
.success-hero svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .5s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Cuenta / Admin ---------- */
.app { display: grid; gap: var(--s5); padding-block: var(--s5) var(--s7); }
@media (min-width: 900px) { .app { grid-template-columns: 240px 1fr; align-items: start; } }
.sidenav { display: flex; gap: var(--s1); overflow-x: auto; padding-bottom: var(--s2); }
@media (min-width: 900px) { .sidenav { flex-direction: column; position: sticky; top: calc(var(--header-h) + 64px); overflow: visible; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2); } }
.sidenav a { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 10px var(--s4); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.sidenav a:hover { background: var(--surface-2); color: var(--ink); }
.sidenav a[aria-current] { background: var(--primary); color: #fff; }
.pill { background: var(--accent-strong); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .75rem; font-weight: 700; }
.stats { display: grid; gap: var(--s3); grid-template-columns: repeat(2, 1fr); margin-bottom: var(--s5); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.stat strong { display: block; font: 800 2.125rem/1.1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: var(--fs-sm); }
.stat--alert::before { background: var(--accent); }
.stat--alert strong { color: var(--accent-strong); }
.rcard { display: grid; gap: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .2s; }
.rcard:hover { border-color: var(--primary); box-shadow: var(--shadow); color: var(--ink); }
.rcard__top { display: flex; justify-content: space-between; gap: var(--s3); align-items: start; flex-wrap: wrap; }
.progress { display: flex; gap: 4px; } .progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.progress i.on { background: var(--success); } .progress i.cur { background: var(--primary); }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.t th, .t td { padding: 12px var(--s4); text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { background: var(--surface-2); font-weight: 700; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.t tbody tr:hover td { background: #fafdfc; }
.t tr:last-child td { border-bottom: 0; }
.t input.input, .t select.input { min-height: 38px; padding: 4px 10px; }
.t .stock-in { width: 84px; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); overflow-x: auto; }
.tabs a { padding: 10px var(--s4); text-decoration: none; color: var(--muted); font-weight: 650; font-size: var(--fs-sm); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--primary-ink); border-color: var(--primary); }
.notif { display: flex; gap: var(--s3); padding: var(--s4); border-top: 1px solid var(--line); }
.notif:first-child { border-top: 0; }
.notif.unread { background: #f3fbf8; } .notif .dot { width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.notif.read .dot { background: transparent; }

/* ---------- Auth ---------- */
.auth { display: grid; place-items: center; padding-block: var(--s7); background: radial-gradient(600px 300px at 50% 0%, var(--primary-soft), transparent 70%); }
.auth__card { width: min(100%, 460px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s6) var(--s5); box-shadow: var(--shadow-lg); }
@media (min-width: 520px) { .auth__card { padding: var(--s7) var(--s6); } }
.auth__card h1 { font-size: var(--fs-xl); }
.pwmeter { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; } .pwmeter i { display: block; height: 100%; width: 0; background: var(--error); transition: width .2s, background .2s; }

/* ---------- Pie ---------- */
.footer { background: var(--primary-deep); color: #c3ddd3; padding-block: var(--s7) var(--s5); margin-top: var(--s7); font-size: var(--fs-sm); }
.footer a { color: #fff; text-decoration: none; } .footer a:hover { text-decoration: underline; color: #7ff0c3; }
.footer h2 { font: 700 .75rem/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: #8fc3b0; margin-bottom: var(--s4); }
.footer__grid { display: grid; gap: var(--s6); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .footer__grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }
.footer__brand { grid-column: 1 / -1; } @media (min-width: 900px) { .footer__brand { grid-column: auto; } }
.footer li + li { margin-top: var(--s2); }
.footer .logo { color: #fff; } .footer .logo small { color: #7ff0c3; }
.footer__legal { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid rgb(255 255 255 / .14); display: grid; gap: var(--s3); color: #9cc6b7; }
.demo-flag { display: inline-block; padding: 2px 8px; background: var(--warn-bg); color: var(--warn); border-radius: 999px; font-weight: 700; font-size: .75rem; }

/* ---------- Navegación móvil inferior ---------- */
.bottomnav { position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: rgb(255 255 255 / .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 8px 0 6px; min-height: 62px; color: var(--muted); text-decoration: none; font-size: .6875rem; font-weight: 650; }
.bottomnav a svg { width: 24px; height: 24px; }
.bottomnav a[aria-current] { color: var(--primary-ink); }
.bottomnav a[aria-current]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.bottomnav .hbtn__count { top: 4px; right: calc(50% - 22px); }
@media (min-width: 900px) { .bottomnav { display: none; } }
@media (max-width: 899px) { body { padding-bottom: 62px; } .footer { margin-bottom: 0; } }

/* ---------- Esqueletos y movimiento ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, #f6fbf9 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: var(--radius-xs); height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }
.reveal { animation: reveal .45s var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } }
.reveal:nth-child(2) { animation-delay: .04s; } .reveal:nth-child(3) { animation-delay: .08s; } .reveal:nth-child(4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}
@media print { .header, .footer, .bottomnav, .toasts { display: none; } body { background: #fff; } }

/* Imagen real de producto (cuando se sube desde el panel) */
.tile--img { background: #fff; }
.tile--img::before { display: none; }
.tile--img img { width: 100%; height: 100%; object-fit: contain; }
.pdp__media .tile--img { aspect-ratio: 1; border: 1px solid var(--line); }

@media (max-width: 899px) {
  .pdp__media .tile, .pdp__media .tile--img { aspect-ratio: 16 / 9; }
  .pdp__media .tile__icon { width: 88px; height: 88px; border-radius: 26px; } .pdp__media .tile__icon svg { width: 44px; height: 44px; }
  .pdp__media .tile span { font-size: 2.5rem; }
  .hero { padding-top: var(--s3); }
  .hero .container.hero__grid { width: min(100% - 1rem, var(--container)); }
}

@media (min-width: 900px) { .stats--3 { grid-template-columns: repeat(3, 1fr); } }

[hidden] { display: none !important; }
.hbtn__count--inline { position: static; margin-left: -2px; box-shadow: none; }

.timeline li > span:empty { display: none; }

.app > *, .two-col > *, .catalog > * { min-width: 0; }

.toolbar > div { flex-wrap: wrap; max-width: 100%; }
.toolbar .input { max-width: 100%; }

.tablewrap, .filters, .panel { position: relative; } /* contiene los .sr-only absolutos */
@media (min-width: 900px) { .filters { position: sticky; } }

/* Paneles dentro de rejillas: el margen de apilado desalinea las columnas */
.row > .panel + .panel { margin-top: 0; }
/* Encabezados de sección dentro de cuenta/admin: escala de panel, no de portada */
.app .section__head h2 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.02em; }
.app .section__head { margin-top: var(--s5); margin-bottom: var(--s4); }
.btn + .small { margin-left: var(--s3); }
/* Cabecera compacta en móvil: el nombre no se parte y los iconos no se encogen */
.logo > span { white-space: nowrap; }
.hbtn svg, .mstatus, .logo__mark { flex: none; }
@media (max-width: 420px) {
  .header__main { gap: var(--s3); }
  .logo { font-size: 1.0625rem; gap: 8px; } .logo__mark { width: 34px; height: 34px; }
  .mstatus { padding: 5px 10px; font-size: .75rem; }
  .hbtn { padding: 0 var(--s2); }
}
/* Campos en filas: el control no se estira cuando el vecino tiene texto de ayuda */
.field { align-content: start; }

/* ---------- Pedido: recogida o domicilio ---------- */
.choice { display: grid; gap: var(--s3); border: 0; padding: 0; margin: 0 0 var(--s4); }
@media (min-width: 560px) { .choice { grid-template-columns: 1fr 1fr; } }
.choice__opt { position: relative; cursor: pointer; }
.choice__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice__card { display: flex; gap: var(--s3); align-items: center; height: 100%; padding: var(--s4); border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.choice__card i { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary-ink); }
.choice__card i svg { width: 22px; height: 22px; }
.choice__card strong { display: block; }
.choice__card small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.choice__opt:hover .choice__card { border-color: var(--primary); }
.choice__opt input:checked + .choice__card { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice__opt input:checked + .choice__card i { background: var(--primary); color: #fff; }
.choice__opt input:focus-visible + .choice__card { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Lo que solo aplica a una modalidad (sin JS: :has) */
.checkout .only-delivery { display: none; }
.checkout:has(input[name=fulfillment][value=delivery]:checked) .only-delivery { display: revert; }
.checkout:has(input[name=fulfillment][value=delivery]:checked) .only-pickup { display: none; }
.ship { padding-top: var(--s2); }
.addr, .pay { border: 0; padding: 0; margin: 0; min-width: 0; }
.addr legend, .pay legend { margin-bottom: var(--s3); }
.addr__opt { padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: var(--s2); background: var(--surface); }
.addr__opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.addr__new { display: none; margin-top: var(--s3); }
.addr__new.is-only, .addr:has(input[name=address_id][value="0"]:checked) .addr__new { display: block; }
.pay { margin-top: var(--s2); }
.pay__opts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-bottom: var(--s3); }
.pay:has(input[value=transfer]:checked) .pay__change { display: none; }

/* Etiqueta de modalidad en listas */
.mode { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.mode svg { width: 15px; height: 15px; }
.mode--delivery { color: var(--primary-ink); }

/* ---------- Panel de reparto ---------- */
.dcard { display: grid; gap: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); }
.dcard--on { border-color: var(--primary); box-shadow: inset 4px 0 0 var(--primary); }
.dcard__top { display: flex; justify-content: space-between; align-items: start; gap: var(--s3); flex-wrap: wrap; }
.dcard__addr { font-weight: 650; font-size: 1.0625rem; line-height: 1.35; }
.dcard__meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); color: var(--muted); font-size: var(--fs-sm); }
.dcard__meta span { display: inline-flex; align-items: center; gap: 6px; }
.dcard__meta svg { width: 16px; height: 16px; }
.dcard__acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.dcard__acts > * { flex: 1 1 140px; }
.collect { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
.collect strong { font: 800 1.375rem/1 var(--font-display); letter-spacing: -.02em; }
.btn--call { background: var(--surface); color: var(--primary-ink); border-color: var(--primary); box-shadow: none; }
.btn--call:hover { background: var(--primary-soft); color: var(--primary-ink); box-shadow: none; }
.fail { margin-top: var(--s2); }
.fail summary { cursor: pointer; color: var(--error); font-weight: 650; font-size: var(--fs-sm); list-style: none; }
.fail summary::-webkit-details-marker { display: none; }
.fail[open] summary { margin-bottom: var(--s3); }
.checkout:has(input[name=fulfillment][value=delivery]:checked) .sum.only-delivery { display: flex; }

/* ==========================================================================
   Lectura fácil (personas mayores o con poca experiencia digital)
   Letra base de 18 px, botones grandes, menos elementos a la vez.
   ========================================================================== */
html { font-size: 112.5%; }
.btn--sm { min-height: 44px; }
.small, .muted.small { line-height: 1.5; }
.h-simple { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; margin-bottom: var(--s4); }
.section__head .h-simple { margin: 0; }
.input--big { min-height: 56px; font-size: 1.0625rem; }

/* Cabecera: «Mi pedido» siempre visible y con texto */
.cartbtn { position: relative; display: inline-flex; align-items: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s4); border-radius: 999px; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.cartbtn:hover, .cartbtn[aria-current] { background: #cfeee2; color: var(--primary-ink); }
.cartbtn svg { width: 22px; height: 22px; flex: none; }
.cartbtn__n { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--accent-strong); color: #fff; font-size: .8125rem; line-height: 26px; text-align: center; }
@media (max-width: 420px) { .cartbtn { padding: 0 var(--s3); } }
@media (max-width: 899px) { .header__actions .hbtn { display: none; } } /* la cuenta está en la barra inferior */

/* Buscador: botón visible también en el móvil */
.search__go { min-height: 44px; }
.hero .search__go { min-height: 50px; padding: 0 var(--s5); }
@media (max-width: 899px) { .hero .search input { height: 56px; } }

/* Portada simple: una sola columna, sin decoración */
.hero__grid::after { display: none; }
@media (min-width: 980px) { .hero__grid { grid-template-columns: 1fr; } }
.hero__grid { padding: clamp(1.5rem, 1rem + 3vw, 3rem); }
.hero h1 { max-width: none; font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); }
.hero p.lead { max-width: 60ch; }
.cat { flex-direction: row; align-items: center; min-height: 72px; }
.cat strong { font-size: 1rem; }
@media (max-width: 559px) { .cat { flex-direction: column; align-items: flex-start; } }

/* Tarjeta de producto: nombre, precio y un botón grande */
.card__media .tile { aspect-ratio: 16 / 9; }
.card__title { font-size: 1.0625rem; }
.card__foot { flex-direction: column; align-items: stretch; gap: var(--s3); }
.card__act .btn { min-height: 48px; font-size: 1rem; }
.btn.is-done { background: var(--success); color: #fff; }

/* Ayuda */
.helpcard { display: grid; gap: var(--s4); align-items: center; padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
@media (min-width: 900px) { .helpcard { grid-template-columns: 1fr auto; } }
.helpcard .h-simple { margin-bottom: var(--s2); }
.helpcard__acts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.help-call { display: flex; gap: var(--s2); align-items: center; margin: var(--s4) 0 0; padding-top: var(--s3); border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.help-call svg { width: 20px; height: 20px; flex: none; color: var(--primary); }

/* Barra fija «Tienes N productos · Terminar pedido» */
.cartbar { position: fixed; z-index: 56; left: 0; right: 0; bottom: 0; background: var(--ink); color: #fff; box-shadow: 0 -6px 24px rgb(0 0 0 / .18); padding-bottom: env(safe-area-inset-bottom); }
.cartbar__in { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-block: var(--s3); }
.cartbar__txt { display: flex; align-items: center; gap: var(--s2); font-size: 1rem; }
.cartbar__txt svg { width: 24px; height: 24px; flex: none; color: #7ff0c3; }
.cartbar .btn { flex: none; min-height: 48px; background: #fff; color: var(--primary-ink); box-shadow: none; }
.cartbar .btn:hover { background: #e3f4ee; color: var(--primary-ink); }
.cartbar.is-pulse { animation: cartbar-pulse .9s var(--ease); }
@keyframes cartbar-pulse { 0% { background: var(--primary); } 100% { background: var(--ink); } }
@media (max-width: 899px) { .cartbar { bottom: 62px; padding-bottom: 0; } .cartbar__txt { font-size: .9375rem; } }
@media (max-width: 420px) { .cartbar .btn { padding: 0 var(--s4); } }
body:has(.cartbar:not([hidden])) { padding-bottom: 84px; }
@media (max-width: 899px) { body:has(.cartbar:not([hidden])) { padding-bottom: 150px; } }
body:has(.cartbar:not([hidden])) .toasts { bottom: 160px; }

/* Pedido: cantidad con − / +, hora «lo antes posible», nota plegada */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.stepper button { width: 48px; height: 48px; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--primary-ink); cursor: pointer; }
.stepper button:hover { background: var(--primary-soft); }
.stepper output { min-width: 36px; text-align: center; font-weight: 800; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.line { grid-template-columns: 56px 1fr auto; }
@media (max-width: 560px) { .line { grid-template-columns: 48px 1fr; } .line__end { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; } }
.when { display: flex; gap: var(--s3); align-items: center; padding: var(--s4); margin-bottom: var(--s3); border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-ink); }
.when svg { width: 24px; height: 24px; flex: none; }
.when__pick > summary { list-style: none; margin-bottom: var(--s3); }
.when__pick > summary::-webkit-details-marker { display: none; }
.when__pick[open] > summary { margin-bottom: var(--s4); }
.note { margin-top: var(--s4); }
.note > summary { cursor: pointer; color: var(--primary-ink); font-weight: 650; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.note textarea { margin-top: var(--s2); }
.zones { border: 0; padding: 0; margin: var(--s4) 0 0; min-width: 0; }
.zones legend { margin-bottom: var(--s3); }
.zone { justify-content: flex-start; align-items: center; }
.zone__fee { margin-left: auto; font-weight: 700; color: var(--primary-ink); white-space: nowrap; }
.pay__opts { display: grid; gap: var(--s2); }
.addr__opt { min-height: 52px; align-items: center; }

/* Navegación inferior del móvil: textos más legibles */
.bottomnav a { font-size: .75rem; }
.code--big { font-size: 1.75rem; padding: 12px 20px; }

/* Móvil: productos en lista (una columna, imagen pequeña a la izquierda) y categorías compactas */
@media (max-width: 559px) {
  .grid { grid-template-columns: 1fr; gap: var(--s3); }
  .card { display: grid; grid-template-columns: 92px 1fr; }
  .card__media { padding: 8px 0 8px 8px; }
  .card__media .tile { aspect-ratio: auto; width: 100%; height: 100%; min-height: 84px; }
  .card__media .tile em, .card__media .tile::before { display: none; }
  .card__media .tile__icon { width: 52px; height: 52px; border-radius: 16px; }
  .card__media .tile__icon svg { width: 28px; height: 28px; }
  .card__body { padding: var(--s3) var(--s3) var(--s3) var(--s4); }
  .cat { flex-direction: column; align-items: flex-start; min-height: 0; padding: var(--s3); gap: var(--s2); }
  .cat__icon { width: 36px; height: 36px; }
  .cat__icon svg { width: 20px; height: 20px; }
  .cat strong { font-size: .9375rem; line-height: 1.25; }
  .cartbar__long { display: none; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat > * { min-width: 0; }
  /* Pie compacto: enlaces en línea, sin títulos de columna */
  .footer { padding-block: var(--s5) var(--s4); margin-top: var(--s5); }
  .footer__grid { grid-template-columns: 1fr; gap: var(--s4); }
  .footer nav h2 { display: none; }
  .footer nav ul { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
  .footer li + li { margin-top: 0; }
  .footer nav[aria-label="Cuenta"] { display: none; }
  .footer__legal { margin-top: var(--s4); font-size: .8125rem; }
}
.note > summary { display: block; }
.card__media .tile em { display: none; }
@media (max-width: 559px) { .hero .search__go { padding: 0 var(--s4); } .hero .search__box { padding-left: var(--s4); } }

/* ==========================================================================
   Programa de donaciones
   ========================================================================== */
.narrow { width: min(100% - 2rem, 760px); }
.lead-text { font-size: var(--fs-lg); color: var(--ink); max-width: 60ch; }
.checklist { display: grid; gap: var(--s3); margin: 0 0 var(--s3); }
.checklist li { display: flex; gap: var(--s3); align-items: flex-start; }
.checklist svg { flex: none; width: 24px; height: 24px; padding: 3px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.checklist li.is-no { color: var(--muted); }
.checklist li.is-no svg { background: var(--neutral-bg); color: var(--muted); }
.steps-plain { counter-reset: sp; display: grid; gap: var(--s4); }
.steps-plain li { counter-increment: sp; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--s3); align-items: start; }
.steps-plain li::before { content: counter(sp); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.125rem; }
.steps-plain li > div { grid-column: 2; padding-top: 6px; } /* todo el texto en la columna ancha */
.steps-plain strong { display: block; font-size: 1.0625rem; margin-bottom: 2px; }
.steps-plain span { color: var(--muted); }
.bigacts { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s5) 0 var(--s3); }
.bigacts .btn { flex: 1 1 240px; min-height: 56px; }
.req-tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .75rem; font-weight: 700; vertical-align: middle; }
.reqs { display: grid; gap: var(--s2); }

/* Mostrador: un solo campo grande para el código */
.counter { padding: var(--s5); margin-bottom: var(--s5); border-radius: var(--radius-lg); background: var(--primary-soft); border: 1px solid #bfe5d6; }
.counter label { display: block; font-weight: 800; font-size: var(--fs-lg); margin-bottom: var(--s2); color: var(--primary-ink); }
.counter__row { display: flex; gap: var(--s2); }
.counter__row .input { flex: 1; min-height: 60px; font: 800 1.5rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.counter__row .btn { min-height: 60px; padding-inline: var(--s6); font-size: 1.0625rem; }

.items { display: grid; gap: var(--s2); }
.items__head, .items__row { display: grid; grid-template-columns: 1fr 110px; gap: var(--s2); align-items: center; }
.items__head { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.deliver tr.is-done td { color: var(--muted); }
.deliver__qty { width: 90px; font-weight: 800; font-size: 1.125rem; text-align: center; }
.note-sum { cursor: pointer; font-weight: 700; color: var(--primary-ink); list-style: none; }
.note-sum::-webkit-details-marker { display: none; }

/* ---------- Tarjeta imprimible (tamaño carné, 85,6 × 54 mm por cara) ---------- */
.printpage { background: var(--surface-2); padding: var(--s5) var(--s4); }
.printbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; max-width: 760px; margin: 0 auto var(--s5); }
.printbar p { flex: 1 1 260px; }
.cardsheet { display: grid; place-items: center; }
.dcard2 { display: flex; outline: 1px dashed #8aa39a; outline-offset: 0; background: #fff; }
.dcard2__face { width: 85.6mm; height: 54mm; overflow: hidden; color: #0f2a24; font-family: var(--font-ui); }
.dcard2__face + .dcard2__face { border-left: 1px dashed #8aa39a; }
.dcard2__front { display: grid; grid-template-rows: auto 1fr; }
.dcard2__head { display: flex; align-items: center; gap: 2.4mm; padding: 2.4mm 3.2mm; background: #0b7a5c; color: #fff; }
.dcard2__head svg { width: 7.5mm; height: 7.5mm; flex: none; }
.dcard2__head strong { display: block; font-size: 3.4mm; line-height: 1.1; }
.dcard2__head span { display: block; font-size: 2.5mm; opacity: .9; }
.dcard2__body { display: grid; grid-template-columns: 1fr 24mm; gap: 2.4mm; padding: 2.6mm 3.2mm; align-items: center; }
.dcard2__who { display: grid; min-width: 0; }
.dcard2__label { font-size: 2mm; text-transform: uppercase; letter-spacing: .08em; color: #4d625b; font-weight: 700; }
.dcard2__name { font-size: 3.6mm; line-height: 1.15; overflow-wrap: anywhere; }
.dcard2__ci { font-size: 2.5mm; color: #4d625b; }
.dcard2__code { font: 800 5.2mm/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; color: #075c44; }
.dcard2__valid { font-size: 2.5mm; font-weight: 700; }
.dcard2__qr { width: 24mm; height: 24mm; }
.dcard2__qr svg { width: 100%; height: 100%; display: block; }
.dcard2__back { padding: 3mm 3.4mm; font-size: 2.45mm; line-height: 1.35; }
.dcard2__back strong { display: block; font-size: 3mm; margin-bottom: 1.2mm; color: #075c44; }
.dcard2__back ol { list-style: decimal; padding-left: 3.6mm; margin: 0 0 1.2mm; display: grid; gap: .6mm; }
.dcard2__back p { margin: 0 0 1mm; }
.dcard2__ph { color: #4d625b; font-size: 2.2mm; }
@media screen { .dcard2 { transform: scale(1.6); transform-origin: top center; margin-bottom: 40mm; box-shadow: 0 4px 18px rgb(15 42 36 / .12); } }
@media screen and (max-width: 720px) { .dcard2 { flex-direction: column; transform: scale(1.05); margin-bottom: 8mm; } .dcard2__face + .dcard2__face { border-left: 0; border-top: 1px dashed #8aa39a; } }
@media print {
  @page { size: A4; margin: 15mm; }
  .printpage { background: #fff; padding: 0; }
  .printbar { display: none; }
  .cardsheet { place-items: start; }
  .dcard2 { transform: none; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Página de descarga de la app */
.appdl { display: grid; gap: var(--s4); }
.appdl__head { display: flex; align-items: center; gap: var(--s4); }
.appdl__head strong { display: block; font-size: var(--fs-lg); }
.appdl__icon { width: 64px; height: 64px; flex: none; }
