/* =========================================================================
   Tienda web · Sabor & Cifras
   Diseño mobile first, adaptable a escritorio. Todos los pares texto/fondo
   cumplen WCAG AA (≥ 4.5:1) en modo claro y oscuro; ver la tabla al final.
   ========================================================================= */

:root {
  color-scheme: light;
  /* Superficies */
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --surface-2: #F4F1EC;
  --surface-3: #E9E4DC;
  --line: #E6E0D8;
  --line-strong: #D3CBC0;
  /* Texto */
  --text: #1B1814;
  --text-2: #3E3832;
  --muted: #675F56;
  --placeholder: #7A7166;
  /* Marca */
  --brand: #B4380F;
  --brand-hover: #962E0B;
  --on-brand: #FFFFFF;
  --brand-ink: #8E2C0B;
  --brand-soft: #FCEEE7;
  --brand-soft-2: #F8DFD2;
  --brand-line: #F0CDBB;
  /* Estados */
  --ok: #15803D;
  --ok-ink: #14532D;
  --ok-soft: #E6F4EA;
  --warn-ink: #7C3A06;
  --warn-soft: #FDF1D6;
  --bad: #B91C1C;
  --bad-ink: #8F1515;
  --bad-soft: #FCEBEB;
  --info-ink: #1D3F95;
  --info-soft: #E9F0FD;
  --whatsapp: #15803D;
  --whatsapp-hover: #116A32;
  --on-whatsapp: #FFFFFF;
  --focus: #2563EB;
  --overlay: rgba(20, 16, 12, .55);
  /* Forma */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-xs: 0 1px 2px rgba(27, 24, 20, .05);
  --shadow-sm: 0 1px 3px rgba(27, 24, 20, .07), 0 1px 2px rgba(27, 24, 20, .04);
  --shadow: 0 6px 20px rgba(27, 24, 20, .08), 0 2px 6px rgba(27, 24, 20, .05);
  --shadow-lg: 0 18px 50px rgba(27, 24, 20, .20), 0 4px 12px rgba(27, 24, 20, .08);
  /* Tipografía */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font);
  /* Medidas */
  --header-h: 64px;
  --gutter: 16px;
  --panel-w: 372px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #110F0D;
    --surface: #1B1815;
    --surface-2: #24201C;
    --surface-3: #302B25;
    --line: #322D27;
    --line-strong: #4A433B;
    --text: #F7F4F0;
    --text-2: #DDD6CD;
    --muted: #ADA398;
    --placeholder: #8A8178;
    --brand: #F08452;
    --brand-hover: #F59A6F;
    --on-brand: #1F0E06;
    --brand-ink: #FFA47C;
    --brand-soft: #34201A;
    --brand-soft-2: #43281F;
    --brand-line: #5A3427;
    --ok: #4ADE80;
    --ok-ink: #86EFAC;
    --ok-soft: #14301F;
    --warn-ink: #FCD34D;
    --warn-soft: #362A0F;
    --bad: #F87171;
    --bad-ink: #FCA5A5;
    --bad-soft: #3A1717;
    --info-ink: #A5C8FF;
    --info-soft: #172A48;
    --whatsapp: #22C55E;
    --whatsapp-hover: #4ADE80;
    --on-whatsapp: #052E14;
    --focus: #7AA7FF;
    --overlay: rgba(0, 0, 0, .66);
    --shadow-xs: none;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 8px 24px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
  }
}

/* ----------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 72px); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); color: var(--text); letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15.5px; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none; transform: translateY(-160%);
}
.skip:focus { transform: none; }

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

/* --------------------------------------------------------------- header */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  height: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: inherit; text-decoration: none; }
.brand__logo {
  width: 40px; height: 40px; border-radius: 12px; overflow: hidden; flex: none;
  display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand);
  font: 800 18px/1 var(--font-display);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.brand__logo img { width: 100%; height: 100%; object-fit: cover; }
.brand__text { display: grid; min-width: 0; }
.brand__text strong {
  font: 700 16px/1.25 var(--font-display); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand__text small {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }

.topbar__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.iconbtn {
  position: relative; height: 44px; min-width: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.iconbtn__label { display: none; }
.iconbtn .count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--brand); color: var(--on-brand);
  font-size: 11.5px; font-weight: 700; line-height: 1;
  border: 2px solid var(--surface);
}
@media (hover: hover) {
  .iconbtn:hover { background: var(--surface-2); border-color: var(--text-2); }
}

/* --------------------------------------------------------------- layout */
.layout { max-width: 1280px; margin: 0 auto; }
.main { padding: 18px var(--gutter) calc(112px + var(--safe-b)); min-width: 0; outline: none; }
.cart-panel { display: none; }

/* ----------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 22px 20px 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--brand-soft-2) 0%, transparent 55%),
    linear-gradient(180deg, var(--brand-soft) 0%, var(--surface) 100%);
  border: 1px solid var(--brand-line);
}
.hero::after {
  content: ''; position: absolute; z-index: -1; right: -48px; bottom: -64px; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 14%, transparent) 0%, transparent 70%);
}
.hero h1 { font-size: 26px; line-height: 1.15; }
.hero p { margin-top: 8px; color: var(--text-2); font-size: 15px; max-width: 56ch; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero__pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-xs);
}
.hero__pill svg { width: 16px; height: 16px; color: var(--brand-ink); }
a.hero__pill { color: var(--text); }
a.hero__pill svg { color: var(--whatsapp); }
@media (hover: hover) { a.hero__pill:hover { border-color: var(--line-strong); background: var(--surface-2); } }

/* ------------------------------------------------- buscador y categorías */
.toolbar {
  position: sticky; top: var(--header-h); z-index: 20;
  margin: 0 calc(-1 * var(--gutter)); padding: 12px var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.search { position: relative; }
.search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 48px; padding: 0 46px 0 44px;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 16px;
  box-shadow: var(--shadow-xs); appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--placeholder); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.search__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted);
}
.search__clear:hover { background: var(--surface-2); color: var(--text); }

.chips {
  display: flex; gap: 8px; margin: 10px calc(-1 * var(--gutter)) 0; padding: 2px var(--gutter);
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text-2); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
@media (hover: hover) { .chip:not([aria-pressed="true"]):hover { border-color: var(--text-2); color: var(--text); } }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 14px 2px 12px; }
.section-title h2 { font-size: 20px; }
.section-title span { color: var(--muted); font-size: 13px; font-weight: 500; }

/* ------------------------------------------------------------ productos */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-xs);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s;
}
@media (hover: hover) {
  .product:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-strong); }
  .product:hover .product__media img { transform: scale(1.04); }
}
.product__media {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--surface-2);
}
.product__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.product__placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted);
  background:
    radial-gradient(circle at 30% 20%, var(--brand-soft) 0, transparent 60%),
    var(--surface-2);
}
.product__placeholder svg { width: 40px; height: 40px; opacity: .7; }
.tag {
  position: absolute; top: 8px; left: 8px; max-width: calc(100% - 16px);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 999px;
  background: var(--brand); color: var(--on-brand);
  font-size: 11.5px; font-weight: 700; line-height: 1.25; text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.tag svg { width: 13px; height: 13px; }
.tag--muted { background: var(--text); color: var(--bg); }
.soldout-veil { position: absolute; inset: 0; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.product--soldout .product__media img { filter: grayscale(1); }
.product--soldout .product__name, .product--soldout .price { color: var(--muted); }

.product__body { display: flex; flex-direction: column; flex: 1; padding: 11px 12px 12px; min-width: 0; }
.product__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em; text-align: left;
  font-size: 15px; font-weight: 650; line-height: 1.3; color: var(--text);
}
.product__desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--muted);
}
.product__foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.price { font: 800 18px/1.15 var(--font-display); color: var(--text); letter-spacing: -.01em; }
.price small { display: block; font: 600 11px/1.3 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.price-ves { margin-top: 2px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Botón agregar (siempre ancho completo en la tarjeta: alturas iguales). */
.add {
  height: 42px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid var(--brand-line);
  font-size: 14px; font-weight: 700;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.add svg { width: 18px; height: 18px; }
.add:not(.add--text)::after { content: 'Agregar'; }
.add:active:not(:disabled) { transform: scale(.98); }
.add:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
@media (hover: hover) { .add:not(:disabled):hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); } }

.stepper {
  height: 42px; width: 100%;
  display: grid; grid-template-columns: 42px 1fr 42px; align-items: center;
  border-radius: var(--radius-sm); background: var(--brand); color: var(--on-brand);
  overflow: hidden;
}
.stepper button { height: 100%; display: grid; place-items: center; color: inherit; transition: background .15s; }
.stepper button svg { width: 18px; height: 18px; }
.stepper button:hover { background: rgba(0, 0, 0, .12); }
.stepper output { text-align: center; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.stepper--sm {
  width: 112px; height: 34px; grid-template-columns: 34px 1fr 34px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong);
}
.stepper--sm button { color: var(--brand-ink); }
.stepper--sm button:hover { background: var(--surface-2); }
.stepper--sm output { font-size: 14px; }

/* ------------------------------------------------------------ información */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card__pad { padding: 18px; }
.card h3 { margin-bottom: 4px; }
.info-list li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.info-list li + li { border-top: 1px solid var(--line); }
.info-list svg { width: 18px; height: 18px; margin-top: 1px; color: var(--brand-ink); }
.footer { margin: 28px 0 0; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ----------------------------------------------------- estados vacíos */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty > svg {
  width: 72px; height: 72px; padding: 20px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); display: block;
}
.empty h2 { font-size: 18px; margin-bottom: 6px; }
.skeleton {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.skeleton-card { aspect-ratio: 3 / 4; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* -------------------------------------------------------------- botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 15px; font-weight: 650; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .55; }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.btn--primary:not(:disabled):hover { background: var(--brand-hover); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn--secondary:not(:disabled):hover { background: var(--surface-2); border-color: var(--text-2); }
.btn--ghost { color: var(--text-2); }
.btn--ghost:not(:disabled):hover { background: var(--surface-2); color: var(--text); }
.btn--whatsapp { background: var(--whatsapp); color: var(--on-whatsapp); }
.btn--whatsapp:not(:disabled):hover { background: var(--whatsapp-hover); }
.btn--lg { height: 54px; font-size: 16px; border-radius: var(--radius); }
.btn--sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; }

/* ------------------------------------------------------- barra carrito */
.cart-bar {
  position: fixed; z-index: 25; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b));
  animation: rise .3s var(--ease);
}
.cart-bar__btn {
  height: 58px; padding: 0 10px; justify-content: flex-start; gap: 12px;
  box-shadow: var(--shadow-lg);
}
.cart-bar__count {
  min-width: 38px; height: 38px; padding: 0 8px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(0, 0, 0, .18); font-weight: 800; font-size: 15px;
}
.cart-bar__label { flex: 1; text-align: left; font-weight: 700; }
.cart-bar__btn b { padding-right: 10px; font: 800 17px/1 var(--font-display); }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

/* --------------------------------------------------- hoja (dialog) */
.sheet {
  width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 0;
  border: 0; border-radius: 24px 24px 0 0;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .32s var(--ease); }
.sheet::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.sheet__grip { width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 10px auto 0; flex: none; }
.sheet__close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line);
}
.sheet__close:hover { background: var(--surface-3); }
.sheet__body { padding: 14px 20px 0; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sheet__body > h2 { padding-right: 48px; font-size: 21px; }
.sheet__media { margin: 4px 0 16px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); }
.sheet__media img { width: 100%; height: 100%; object-fit: cover; }
.sheet__footer {
  position: sticky; bottom: 0; z-index: 2;
  margin: 18px -20px 0; padding: 14px 20px calc(16px + var(--safe-b));
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; gap: 8px;
}
.sheet .cart-head { padding-right: 48px; }

/* Opciones de un producto */
.options { display: grid; gap: 10px; margin-top: 16px; }
.option {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 14px;
  padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
}
.option__name { font-weight: 650; font-size: 15px; }
.option__meta { font-size: 13px; color: var(--muted); }
.option__meta:empty { display: none; }
.option .add { width: auto; padding: 0 16px; }
.option .stepper { width: 132px; }
.option .offer-note { grid-column: 1 / -1; justify-self: start; margin-top: 0; }

/* ---------------------------------------------------------------- pedido */
.cart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.cart-head h2 { font-size: 20px; }
.cart-lines { margin-top: 6px; }
.cart-line {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.cart-line:last-child { border-bottom: 0; }
.thumb {
  width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); color: var(--muted); display: grid; place-items: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 24px; height: 24px; }
.cart-line__name { font-weight: 650; font-size: 14.5px; line-height: 1.3; }
.cart-line__meta { margin-top: 2px; font-size: 13px; color: var(--muted); }
.cart-line__right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-line__total { font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums; }
.offer-note {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok-ink);
  font-size: 12.5px; font-weight: 600; line-height: 1.35;
}
.offer-note svg { width: 13px; height: 13px; }
.empty-cart { text-align: center; padding: 28px 8px 20px; color: var(--muted); }
.empty-cart svg { width: 64px; height: 64px; padding: 16px; margin: 0 auto 12px; border-radius: 50%; background: var(--surface-2); display: block; }
.empty-cart p + p { margin-top: 4px; }

.summary { display: grid; gap: 6px; }
.summary__row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.summary__row--save { color: var(--ok-ink); font-weight: 600; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 2px; }
.summary__total span { font-weight: 650; color: var(--text-2); }
.summary__total b { font: 800 26px/1.1 var(--font-display); letter-spacing: -.02em; color: var(--text); }
.summary__ves { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------- formularios */
.form { display: grid; gap: 14px; margin-top: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.field label .muted { font-weight: 500; }
.input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 16px;
  transition: border-color .15s, box-shadow .15s; appearance: none;
}
textarea.input { padding: 12px 14px; min-height: 84px; resize: vertical; line-height: 1.45; }
select.input {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23928A80'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 22px;
}
.input::placeholder { color: var(--placeholder); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 16%, transparent); }
.grid-2 { display: grid; gap: 14px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented button {
  min-height: 54px; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 650; transition: background .12s, border-color .12s, color .12s;
}
.segmented button[aria-pressed="true"] {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; line-height: 1.45;
}
.notice svg { width: 18px; height: 18px; margin-top: 1px; }
.notice a { color: inherit; font-weight: 700; }
.notice--info { background: var(--info-soft); color: var(--info-ink); }
.notice--error { background: var(--bad-soft); color: var(--bad-ink); margin-top: 12px; }

.file {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 16px;
  border-radius: var(--radius); border: 1.5px dashed var(--line-strong);
  background: var(--surface-2); color: var(--text-2);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s;
}
.file:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.file svg { width: 22px; height: 22px; color: var(--brand-ink); }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ------------------------------------------------- página del pedido */
.order-hero { padding: 28px 20px 22px; text-align: center; }
.order-hero__icon {
  width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
}
.order-hero__icon svg { width: 34px; height: 34px; }
.order-hero__icon--ok { background: var(--ok-soft); color: var(--ok); }
.order-hero__icon--bad { background: var(--bad-soft); color: var(--bad); }
.order-hero__icon--wait { background: var(--warn-soft); color: var(--warn-ink); }
.order-hero h1 { font-size: 25px; }
.code {
  display: inline-block; margin-top: 14px; padding: 7px 14px; border-radius: 10px;
  border: 1.5px dashed var(--line-strong); background: var(--surface-2);
  font: 700 16px/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .08em; color: var(--text);
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.step { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.step::before { content: ''; display: block; height: 5px; border-radius: 999px; background: var(--surface-3); margin-bottom: 8px; }
.step--done { color: var(--ok-ink); }
.step--done::before { background: var(--ok); }
.step--bad { color: var(--bad-ink); }
.step--bad::before { background: var(--bad); }

.list > li + li, .list > .list-item + .list-item { border-top: 1px solid var(--line); }
.list-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 14px 18px; color: inherit; text-decoration: none; }
a.list-item { transition: background .15s; }
a.list-item:hover { background: var(--surface-2); }
.list-item__title { font-weight: 650; font-size: 15px; }
.list-item__meta { margin-top: 2px; font-size: 13px; color: var(--muted); }
.list-item__lines { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.list-item__lines li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; text-align: right; }
.amount { font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums; }
.amount--debt { color: var(--bad-ink); font-weight: 700; }

.pill {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.pill--new, .pill--pending, .pill--warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill--accepted, .pill--confirmed, .pill--ok { background: var(--ok-soft); color: var(--ok-ink); }
.pill--rejected, .pill--expired, .pill--bad { background: var(--bad-soft); color: var(--bad-ink); }
.pill--neutral { background: var(--surface-3); color: var(--text-2); }

/* ----------------------------------------------------------- Mi cuenta */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 14px; }
.kpi {
  display: grid; gap: 2px; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.kpi span { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi b { font: 800 26px/1.15 var(--font-display); letter-spacing: -.02em; color: var(--text); }
.kpi small { font-size: 12.5px; color: var(--muted); }
.kpi--debt { background: var(--bad-soft); border-color: transparent; }
.kpi--debt span, .kpi--debt b, .kpi--debt small { color: var(--bad-ink); }
.kpi--clear { background: var(--ok-soft); border-color: transparent; }
.kpi--clear span, .kpi--clear b, .kpi--clear small { color: var(--ok-ink); }

.tabs {
  display: flex; gap: 4px; margin: 18px 0 12px; padding: 4px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1 0 auto; height: 40px; padding: 0 14px; border-radius: 11px;
  font-size: 14px; font-weight: 650; color: var(--muted); white-space: nowrap; transition: background .12s, color .12s;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs button:not([aria-selected="true"]):hover { color: var(--text); }

.auth { max-width: 440px; margin: 16px auto; text-align: center; padding: 28px 22px; }
.auth .form { text-align: left; }
.auth__icon {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink);
}
.auth__icon svg { width: 28px; height: 28px; }

/* ---------------------------------------------------------------- aviso */
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(84px + var(--safe-b));
  transform: translateX(-50%); max-width: calc(100% - 32px); width: max-content;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: toast-in .25s var(--ease);
}
.toast--error { background: var(--bad-soft); color: var(--bad-ink); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
@keyframes toast-in { from { transform: translate(-50%, 10px); opacity: 0; } }

/* ------------------------------------------------------------- pagos */
.segmented button span { display: grid; text-align: left; line-height: 1.25; }
.segmented button small { font-size: 12px; font-weight: 500; color: var(--muted); }
.segmented button[aria-pressed="true"] small { color: var(--brand-ink); }

.pay-box {
  display: grid; gap: 12px; padding: 16px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line);
}
.pay-box .info-list li { padding: 8px 0; font-size: 13.5px; }
.pay-box__amount {
  display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line);
}
.pay-box__amount span { font-size: 13px; font-weight: 600; color: var(--muted); }
.pay-box__amount b { font: 800 26px/1.15 var(--font-display); letter-spacing: -.02em; color: var(--text); }
.pay-box__amount small { font-size: 12.5px; color: var(--muted); }
.pay-box__note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.pay-box__note svg { width: 16px; height: 16px; margin-top: 2px; color: var(--info-ink); }

.file { background: var(--surface); }
.file > span { display: grid; gap: 2px; min-width: 0; }
.file__title { font-weight: 700; color: var(--text); }
.file__hint { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file--ready { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.file--ready svg, .file--ready .file__hint { color: var(--ok-ink); }
.file--error { border-color: var(--bad); background: var(--bad-soft); }
.file--error .file__hint { color: var(--bad-ink); }

.pay-result {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius);
}
.pay-result b { font: 700 16px/1.3 var(--font-display); }
.pay-result p { margin-top: 4px; font-size: 14px; line-height: 1.45; }
.pay-result__icon { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.pay-result__icon svg { width: 22px; height: 22px; }
.pay-result--ok { background: var(--ok-soft); color: var(--ok-ink); }
.pay-result--ok .pay-result__icon { background: var(--ok); color: var(--surface); }
.pay-result--partial { background: var(--info-soft); color: var(--info-ink); }
.pay-result--partial .pay-result__icon { background: var(--info-ink); color: var(--info-soft); }
.pay-result--review { background: var(--warn-soft); color: var(--warn-ink); }
.pay-result--review .pay-result__icon { background: var(--warn-ink); color: var(--warn-soft); }
.pay-result__debt { font-size: 14px; }
.checks { margin-top: 12px; display: grid; gap: 6px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; color: var(--text-2); }
.check svg { width: 16px; height: 16px; margin-top: 1px; }
.check--ok svg { color: var(--ok); }
.check--error { color: var(--bad-ink); }

.pay-status { display: flex; gap: 14px; align-items: center; padding: 16px 18px; }
.pay-status svg { width: 40px; height: 40px; padding: 8px; border-radius: 50%; flex: none; }
.pay-status b { font: 700 17px/1.25 var(--font-display); }
.pay-status p { font-size: 14px; }
.pay-status--paid { background: var(--ok-soft); border-color: transparent; color: var(--ok-ink); }
.pay-status--paid svg { background: var(--ok); color: var(--surface); }

.notice--warn { background: var(--warn-soft); color: var(--warn-ink); }
.kpi--warn { background: var(--warn-soft); border-color: transparent; }
.kpi--warn span, .kpi--warn b, .kpi--warn small { color: var(--warn-ink); }
.pill--verified, .pill--pay-paid { background: var(--ok-soft); color: var(--ok-ink); }
.pill--pay-partial { background: var(--info-soft); color: var(--info-ink); }
.pill--pay-review, .pill--pay-pending { background: var(--warn-soft); color: var(--warn-ink); }
.list-item__end .pill + .pill { margin-top: 0; }

.pay-cta { border: 2px solid var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); scroll-margin-top: calc(var(--header-h) + 12px); }
.pay-cta h2 { font-size: 21px; }
.pay-cta__step {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; margin-bottom: 8px; border-radius: 999px;
  background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}

.ordered { margin-top: 14px; }
.ordered__head { display: flex; align-items: center; gap: 12px; }
.ordered__head > svg { width: 40px; height: 40px; padding: 9px; border-radius: 50%; flex: none; background: var(--ok-soft); color: var(--ok); }
.ordered__head > div { flex: 1; min-width: 0; }
.ordered__head b { font: 700 17px/1.25 var(--font-display); }
.ordered__head p { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.ordered .pay-cta__step { display: flex; width: max-content; }

.segmented button:disabled { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
.capture-error { margin-top: 4px; }
.capture-error > div { display: grid; gap: 4px; }
.capture-error .checks { margin-top: 6px; }
.capture-error .check { color: var(--bad-ink); }
.capture-error .check--ok { color: var(--text-2); }

.copy-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .copy-grid { grid-template-columns: 1fr 1fr; } }
.copy {
  position: relative; display: grid; gap: 2px; align-content: start; text-align: left; min-width: 0;
  padding: 10px 38px 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: border-color .15s, background .15s;
}
.copy--wide { grid-column: 1 / -1; }
.copy__label { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.copy__value { font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; overflow-wrap: anywhere; }
.copy > svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--brand-ink); }
button.copy:hover { border-color: var(--brand-line); background: var(--brand-soft); }
button.copy:active { transform: scale(.99); }
.copy--static { padding-right: 12px; background: transparent; border-style: dashed; }
.copy--done { border-color: var(--ok); background: var(--ok-soft); }
.copy--done > svg { color: var(--ok); }
.copy--done .copy__label::after { content: ' · copiado'; color: var(--ok-ink); }
.copy-hint { font-size: 12px; color: var(--muted); margin-top: -4px; }
.notice--ok { background: var(--ok-soft); color: var(--ok-ink); }
.file--checking { border-style: solid; border-color: var(--info-ink); background: var(--info-soft); }
.file--checking .file__hint { color: var(--info-ink); }
.file--checking svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.btn:disabled { cursor: not-allowed; }

/* ===================================================== tablet y escritorio */
@media (min-width: 520px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 640px) {
  :root { --gutter: 24px; }
  body { font-size: 15.5px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .hero { padding: 30px 30px 26px; }
  .hero h1 { font-size: 32px; }
  .product__body { padding: 13px 14px 14px; }
  .iconbtn__label { display: inline; }
  .iconbtn--cart .iconbtn__label { display: none; }
  .cart-bar { left: 50%; right: auto; width: min(520px, calc(100% - 48px)); transform: translateX(-50%); animation-name: rise-center; }
  .toast { bottom: calc(96px + var(--safe-b)); }
}
@keyframes rise-center { from { transform: translate(-50%, 24px); opacity: 0; } }

@media (min-width: 720px) {
  .sheet {
    margin: auto; width: min(560px, calc(100% - 48px)); max-height: min(86dvh, 820px);
    border-radius: var(--radius-lg);
  }
  .sheet[open] { animation: sheet-pop .22s var(--ease); }
  .sheet__grip { display: none; }
  .sheet__body { padding: 22px 26px 0; }
  .sheet__footer { margin: 20px -26px 0; padding: 16px 26px 22px; }
}

@media (min-width: 900px) {
  .toolbar { position: static; margin: 0; padding: 18px 0 4px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .chips { flex-wrap: wrap; overflow: visible; margin: 12px 0 0; padding: 0; -webkit-mask-image: none; mask-image: none; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .main { padding-bottom: 64px; }
  .section-title { margin-top: 20px; }
}

@media (min-width: 1080px) {
  .layout.has-panel {
    display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w);
    gap: 28px; padding-right: var(--gutter); align-items: start;
  }
  .layout.has-panel .main { padding-right: 0; }
  .layout.has-panel .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout.has-panel .cart-panel {
    display: flex; flex-direction: column;
    position: sticky; top: calc(var(--header-h) + 18px); margin-top: 18px;
    max-height: calc(100dvh - var(--header-h) - 36px);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); overflow: hidden;
  }
  .cart-panel__body { padding: 20px 20px 8px; overflow-y: auto; }
  .cart-panel__footer { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: var(--surface); }
  .layout.has-panel ~ .cart-bar { display: none !important; }
  .iconbtn--cart.in-panel { display: none; }
  .toast { bottom: 28px; }
}

@media (min-width: 1280px) {
  .layout.has-panel .grid { gap: 18px; }
}

/* Contraste verificado (WCAG AA ≥ 4.5:1), claro / oscuro:
   text/surface 17.7 / 16.1 · text-2/surface 11.6 / 12.3 · muted/surface 6.3 / 7.1 · muted/surface-2 5.6 / 6.5
   on-brand/brand 6.0 / 7.2 · brand-ink/brand-soft 7.4 / 7.9 · ok-ink/ok-soft 8.0 / 10.2
   warn-ink/warn-soft 7.6 / 9.7 · bad-ink/bad-soft 8.0 / 8.4 · info-ink/info-soft 8.4 / 8.4 · whatsapp 5.0 / 6.6 */
