/* =========================================================================
   Tienda web — "la vitrina del negocio".
   Mobile-first. El color de marca (--brand) se toma del logo de la tienda.
   ========================================================================= */
:root {
  --paper: #f6f7f9;
  --surface: #ffffff;
  --ink: #18202b;
  --muted: #687385;
  --line: #e4e7ec;
  --brand: #1e4e8c;
  --brand-ink: #ffffff;       /* texto sobre el color de marca */
  --brand-text: #1e4e8c;      /* color de marca legible sobre fondo claro */
  --brand-soft: #e3ebf5;      /* fondos suaves (chips, foco) */
  --tile: #edf1f6;            /* fondo de las fotos */
  --brand-deep: #163a69;      /* letrero */
  --ok: #1a8f52;
  --wa: #1fa855;
  --warn: #b25e09;
  --danger: #c0392b;

  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1318;
    --surface: #171c23;
    --ink: #e9edf2;
    --muted: #9aa5b4;
    --line: #262e38;
    --brand-soft: #1d2a3b;
    --tile: #1d242d;
    --brand-text: #8db8ee;
    --ok: #3ccf7f;
    --warn: #f0a33a;
    --danger: #f2786a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 140px; }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  background: var(--paper); color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.has-cart { padding-bottom: calc(88px + var(--safe-b)); }
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 560px; }

/* ---------- Logo (insignia) */
.logo-badge {
  flex: none; width: 76px; height: 76px; border-radius: 22px;
  background: var(--surface); display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 10px 24px rgba(0,0,0,.18);
  color: var(--brand-text); font-weight: 800; font-size: 30px; letter-spacing: -.02em;
}
.logo-badge img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo-badge.sm { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; box-shadow: 0 0 0 1px var(--line); }

/* ---------- Letrero de la tienda (hero) */
.hero {
  position: relative; color: var(--brand-ink);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255,255,255,.14) 0%, transparent 55%),
    linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%);
  padding: calc(22px + var(--safe-t)) 0 26px;
  border-radius: 0 0 28px 28px;
}
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.hero-text { min-width: 0; }
.store-name {
  margin: 0; font-size: clamp(24px, 7vw, 40px); line-height: 1.08; font-weight: 800; letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.hero-sub { margin: 6px 0 0; font-size: 14.5px; line-height: 1.4; opacity: .86; max-width: 40ch; }
.rate-pill {
  display: inline-flex; align-items: baseline; gap: 6px; margin: 12px 0 0;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap;
  background: color-mix(in srgb, var(--brand-ink) 16%, transparent); color: inherit;
}
.rate-pill strong { font-size: 14.5px; font-variant-numeric: tabular-nums; }

/* ---------- Búsqueda, categorías y barra compacta (fijas) */
.tools {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  padding-top: var(--safe-t);
}
body.scrolled .tools { box-shadow: 0 1px 0 var(--line); }
.compact { max-height: 0; overflow: hidden; transition: max-height .2s ease; }
body.scrolled .compact { max-height: 56px; }
.compact-inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px 0; display: flex; align-items: center; gap: 10px; }
.compact-name { font-weight: 750; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-rate { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tools-inner { max-width: 1120px; margin: 0 auto; padding: 12px 16px 0; }
.search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  background: var(--surface); border-radius: var(--r-md); color: var(--muted);
  box-shadow: 0 0 0 1px var(--line), 0 2px 8px rgba(16, 24, 40, .04);
}
.search:focus-within { box-shadow: 0 0 0 2px var(--brand); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
  max-width: 1120px; margin: 0 auto; padding: 10px 16px 12px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip .n { color: var(--muted); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }

/* ---------- Catálogo */
.status-msg { color: var(--muted); text-align: center; padding: 48px 16px; margin: 0; }
.section { padding-top: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 2px 12px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.015em; }
.section-head span { color: var(--muted); font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }

.product { min-width: 0; display: flex; flex-direction: column; }
.tile {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-lg); overflow: hidden;
  background: var(--tile); display: grid; place-items: center; color: var(--muted);
}
.tile .open { all: unset; position: absolute; inset: 0; cursor: pointer; display: grid; place-items: center; border-radius: inherit; }
.tile .open:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile .ph { opacity: .35; }
.tile .flag {
  position: absolute; left: 8px; top: 8px; pointer-events: none;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.94); color: var(--warn); box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.tile .flag.out { color: var(--danger); }
.tile .photos {
  position: absolute; left: 8px; bottom: 8px; pointer-events: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; background: rgba(16, 20, 28, .6); color: #fff; font-size: 11.5px; font-weight: 700;
}
.product.is-out .tile img, .product.is-out .tile .ph { filter: grayscale(1); opacity: .55; }

/* Botón + sobre la foto y selector de cantidad */
.add {
  position: absolute; right: 8px; bottom: 8px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.add:active { transform: scale(.94); }
.qty {
  position: absolute; left: 8px; right: 8px; bottom: 8px; height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--brand); color: var(--brand-ink); border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.qty button {
  width: 44px; height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer;
  display: grid; place-items: center; border-radius: 50%;
}
.qty button:disabled { opacity: .35; }
.qty span { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }

.p-body { padding: 10px 2px 0; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.p-name {
  margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.3; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.p-size { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-usd { font-size: 18px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.p-bs { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* Esqueleto de carga */
.skeleton .tile, .skeleton .bar { background: linear-gradient(90deg, var(--tile) 0%, var(--line) 50%, var(--tile) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton .bar { height: 12px; border-radius: 6px; margin-top: 10px; }
.skeleton .bar.short { width: 45%; height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; line-height: 1.25;
  min-height: 46px; padding: 0 18px; border-radius: var(--r-md); border: 0; cursor: pointer;
  font-weight: 700; font-size: 15.5px; text-decoration: none; user-select: none;
}
.btn.lg { min-height: 54px; font-size: 16.5px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:disabled { opacity: .55; cursor: default; }
.btn.primary:active { filter: brightness(.94); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.wa { background: var(--wa); color: #fff; }
.btn.wa svg { flex: none; }

/* ---------- Barra del pedido */
.cart-bar-wrap {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; pointer-events: none;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--paper) 55%, transparent);
}
.cart-bar {
  pointer-events: auto; width: 100%; max-width: 520px; margin: 0 auto; min-height: 58px;
  display: flex; align-items: center; gap: 12px; padding: 0 10px 0 10px;
  border: 0; border-radius: 18px; cursor: pointer;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 16px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .28);
}
.cart-count { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 12px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.cart-bar-text { flex: 1; text-align: left; }
.cart-bar-total { padding-right: 8px; font-variant-numeric: tabular-nums; }
.cart-bar.bump { animation: bump .32s ease; }
@keyframes bump { 40% { transform: translateY(-3px) scale(1.02); } }

/* ---------- Hojas (teléfono) */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(12, 16, 22, .5); }
.sheet {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; max-height: 94dvh;
  display: flex; flex-direction: column; background: var(--surface);
  border-radius: 24px 24px 0 0; box-shadow: 0 -16px 48px rgba(0,0,0,.24);
  animation: rise .24s cubic-bezier(.2,.8,.2,1);
}
.sheet.tall { height: 94dvh; }
@keyframes rise { from { transform: translateY(32px); opacity: .5; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 42px; height: 5px; border-radius: 5px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 12px 20px; flex: none; }
.sheet-head h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.015em; }
.sheet-close {
  width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: var(--tile); color: var(--ink);
}
.sheet-close.floating { position: absolute; top: 16px; right: 14px; z-index: 2; background: rgba(255,255,255,.92); color: #18202b; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 20px 16px; }
.sheet-foot { flex: none; padding: 12px 20px calc(14px + var(--safe-b)); background: var(--surface); box-shadow: 0 -1px 0 var(--line); }
.hint { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 12.5px; }

/* Detalle */
.pd { padding: 0 0 12px; }
.pd-media { position: relative; }

/* Galería deslizable: una foto por pantalla, con puntos, contador y miniaturas */
.gallery { position: relative; margin-top: 10px; background: var(--tile); }
.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  overscroll-behavior-x: contain; scrollbar-width: none; outline: none;
  aspect-ratio: 1 / 1; max-height: 56dvh;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%; scroll-snap-align: center; display: grid; place-items: center; color: var(--muted);
  cursor: zoom-in; border: 0; padding: 0; background: transparent; height: 100%;
}
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.gallery-slide .ph { opacity: .35; }
.gallery-count {
  position: absolute; left: 14px; top: 16px; padding: 4px 10px; border-radius: 999px;
  background: rgba(16, 20, 28, .62); color: #fff; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.gallery-zoom {
  position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(255,255,255,.92); color: #18202b; box-shadow: 0 2px 10px rgba(0,0,0,.14);
}
.gallery-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.gallery-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(24, 32, 43, .25); transition: width .2s ease, background .2s ease; }
.gallery-dots i.on { width: 20px; border-radius: 4px; background: var(--brand); }
.gallery-nav {
  display: none; position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0;
  cursor: pointer; place-items: center; background: rgba(255,255,255,.94); color: #18202b; box-shadow: 0 2px 10px rgba(0,0,0,.14);
}
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery-nav:disabled { opacity: 0; pointer-events: none; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 20px 0; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs:empty { display: none; }
.thumb-btn {
  flex: none; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--tile); box-shadow: inset 0 0 0 2px transparent; opacity: .7; transition: opacity .15s ease;
}
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.thumb-btn[aria-selected="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--brand); }

.pd-info { padding: 18px 20px 0; }
.pd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.pd-cat { color: var(--brand-text); font-weight: 700; font-size: 13.5px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 999px; cursor: pointer; background: var(--tile); color: var(--ink); font-weight: 650; font-size: 13.5px;
}
.pd-info h2 { margin: 6px 0 0; font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.pd-size { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.pd-size:empty { display: none; }
.pd-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; margin-top: 14px; }
.pd-price .usd { font-size: 32px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pd-price .bs { color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; }
.pd-stock {
  display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent);
}
.pd-stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pd-stock.low { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.pd-stock.out { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.pd-desc-wrap { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.pd-desc-wrap h3, .related h3 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.pd-desc { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; max-width: 62ch; color: var(--ink); }

/* Más productos de la misma categoría */
.related { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.related-list { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.related-list::-webkit-scrollbar { display: none; }
.rel { flex: none; width: 124px; scroll-snap-align: start; border: 0; padding: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.rel .rel-img { width: 124px; height: 124px; border-radius: 16px; overflow: hidden; background: var(--tile); display: grid; place-items: center; color: var(--muted); }
.rel .rel-img img { width: 100%; height: 100%; object-fit: cover; }
.rel .rel-img .ph { opacity: .35; }
.rel .rel-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.rel .rel-price { font-weight: 800; font-size: 14.5px; font-variant-numeric: tabular-nums; }

/* Visor a pantalla completa con zoom */
.viewer { position: fixed; inset: 0; z-index: 70; background: #07090c; color: #fff; display: flex; flex-direction: column; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.viewer-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-t)) 12px 10px 18px; background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); }
.viewer-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.viewer-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: rgba(12,15,20,.55); color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.viewer-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; display: grid; place-items: center; cursor: zoom-in; }
.viewer-stage.zoomed { cursor: grab; }
.viewer-stage img { max-width: 100%; max-height: 100%; user-select: none; -webkit-user-drag: none; transform-origin: center center; will-change: transform; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 12px; }
.viewer-nav:disabled { opacity: 0; pointer-events: none; }
.viewer-hint { position: absolute; left: 0; right: 0; bottom: calc(16px + var(--safe-b)); margin: 0; text-align: center; font-size: 13px; color: rgba(255,255,255,.7); pointer-events: none; transition: opacity .3s ease; }
@media (hover: none) { .viewer-nav { display: none; } }

.pd-actions { display: flex; gap: 10px; }
.pd-actions > * { flex: 1; }
.stepper {
  display: flex; align-items: center; justify-content: space-between; min-height: 54px;
  border-radius: var(--r-md); background: var(--tile);
}
.stepper button { width: 54px; height: 54px; border: 0; background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; border-radius: var(--r-md); }
.stepper button:disabled { opacity: .3; }
.stepper span { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.stepper.sm { min-height: 40px; border-radius: 12px; }
.stepper.sm button { width: 40px; height: 40px; }
.stepper.sm span { font-size: 15.5px; }

/* Pedido */
.cart-list { list-style: none; margin: 0; padding: 0; }
.cart-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 4px 12px; padding: 12px 0; align-items: center; }
.cart-item + .cart-item { border-top: 1px solid var(--line); }
.thumb { grid-row: span 2; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--tile); display: grid; place-items: center; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .name { font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.cart-item .unit { color: var(--muted); font-size: 13px; }
.cart-item .line-total { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cart-item .stepper { width: 128px; }
.cart-item .ctl { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.remove { border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13.5px; min-height: 40px; padding: 0 4px; cursor: pointer; }

.totals { margin: 6px 0 4px; padding: 14px 16px; border-radius: var(--r-md); background: var(--tile); display: grid; gap: 2px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.total-row strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

.form { display: grid; gap: 14px; margin-top: 22px; }
.form h3 { margin: 0; font-size: 17px; font-weight: 800; }
.form label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 650; color: var(--ink); }
.form .opt { color: var(--muted); font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 400px) { .field-row { grid-template-columns: 1fr 1fr; } }
.form input, .form select, .form textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 0; border-radius: 12px;
  background: var(--tile); color: var(--ink); font-size: 16px; font-weight: 400;
  box-shadow: inset 0 0 0 1px transparent;
}
.form textarea { min-height: 76px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--brand); }
.form input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--danger); }
.joined { display: flex; gap: 6px; }
.joined select { width: auto; flex: none; padding: 0 8px 0 12px; }
.joined input { flex: 1; min-width: 0; }
.form-error { margin: 0 0 10px; color: var(--danger); font-size: 14px; font-weight: 650; text-align: center; }

/* ---------- Confirmación del pedido */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: 10px 0 4px; color: var(--ink); text-decoration: none; font-weight: 650; }
.receipt { background: var(--surface); border-radius: 24px; padding: 24px 20px; box-shadow: 0 1px 0 var(--line), 0 12px 32px rgba(16,24,40,.06); margin-bottom: 20px; }
.receipt-top { text-align: center; }
.check { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.check.wait { background: var(--brand-soft); color: var(--brand-text); }
.check.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.receipt h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.015em; }
.receipt .code-label { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.receipt .code { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: .12em; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.steps { list-style: none; margin: 22px 0 6px; padding: 0; display: grid; gap: 0; }
.steps li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding-bottom: 16px; color: var(--muted); }
.steps li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::before { display: none; }
.steps .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--tile); color: var(--muted); }
.steps .done { color: var(--ink); }
.steps .done .dot { background: var(--ok); color: #fff; }
.steps .current { color: var(--ink); }
.steps .current .dot { background: var(--brand); color: var(--brand-ink); }
.steps strong { display: block; font-size: 15px; }
.steps small { font-size: 13px; color: var(--muted); }
.receipt-items { list-style: none; margin: 18px 0 0; padding: 0; }
.receipt-items li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.receipt-items li span { overflow-wrap: anywhere; }
.receipt-items li strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt .totals { margin-top: 8px; }
.receipt-actions { display: grid; gap: 10px; margin-top: 20px; }

/* ---------- Pie */
.footer { margin-top: 36px; padding: 24px 0 calc(28px + var(--safe-b)); border-top: 1px solid var(--line); }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.footer strong { font-size: 15px; }
.footer p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.footer .btn { grid-column: 1 / -1; }

/* ---------- Teléfonos muy angostos */
@media (max-width: 340px) {
  .wrap, .tools-inner, .compact-inner, .footer-inner { padding-left: 12px; padding-right: 12px; }
  .chips { padding-left: 12px; padding-right: 12px; }
  .grid { gap: 16px 10px; }
  .logo-badge { width: 60px; height: 60px; border-radius: 18px; font-size: 24px; }
  .p-usd { font-size: 16.5px; }
  .qty { left: 6px; right: 6px; }
  .qty button { width: 38px; }
  .compact-rate { display: none; }
  .rate-pill .long { display: none; }
  .hero-sub { font-size: 13.5px; }
}

/* ---------- Tablet */
@media (min-width: 600px) {
  .hero { padding: calc(36px + var(--safe-t)) 0 40px; border-radius: 0 0 36px 36px; }
  .hero-inner { gap: 24px; padding: 0 24px; }
  .logo-badge { width: 104px; height: 104px; border-radius: 28px; font-size: 40px; }
  .logo-badge.sm { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; }
  .wrap, .tools-inner, .compact-inner, .footer-inner { padding-left: 24px; padding-right: 24px; }
  .chips { padding-left: 24px; padding-right: 24px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 18px; }
  .sheet { left: 50%; right: auto; width: min(560px, 100%); transform: translateX(-50%); animation: none; }
  .footer-inner { grid-template-columns: auto 1fr auto; }
  .footer .btn { grid-column: auto; }
}

/* ---------- PC */
@media (min-width: 960px) {
  body { font-size: 15.5px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chips { flex-wrap: wrap; overflow: visible; }
  .tile img { transition: transform .35s ease; }
  .product:hover .tile img { transform: scale(1.04); }
  #cartSheet { left: auto; right: 0; top: 0; bottom: 0; transform: none; width: 460px; height: auto; max-height: none; border-radius: 24px 0 0 24px; }
  #cartSheet .sheet-grip { display: none; }
  /* Detalle en dos columnas: foto a la izquierda, datos y botón a la derecha */
  #productSheet {
    top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(1040px, 94vw); height: min(640px, 88vh); max-height: none;
    border-radius: 28px; overflow: hidden;
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto;
  }
  #productSheet .sheet-grip { display: none; }
  #productSheet .pd { display: contents; }
  #productSheet .pd-media { grid-column: 1; grid-row: 1 / 3; display: flex; flex-direction: column; min-height: 0; background: var(--tile); }
  #productSheet .gallery { flex: 1; margin: 0; min-height: 0; }
  #productSheet .gallery-track { aspect-ratio: auto; height: 100%; max-height: none; }
  #productSheet .thumbs { padding: 12px 16px 16px; justify-content: center; }
  #productSheet .gallery-nav { display: grid; }
  #productSheet .pd-info { grid-column: 2; grid-row: 1; padding: 30px 32px 16px; overflow-y: auto; min-height: 0; }
  #productSheet .pd-top { padding-right: 52px; }
  #productSheet .related-list { margin: 0 -32px; padding: 2px 32px 6px; }
  #productSheet .sheet-foot { grid-column: 2; grid-row: 2; box-shadow: none; padding: 0 32px 32px; }
  .cart-bar-wrap { background: none; padding-right: 28px; }
  .cart-bar { max-width: 380px; margin: 0 0 0 auto; }
}
@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

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

/* =========================================================================
   Mi cuenta: compras, deudas y pagos con comprobante
   ========================================================================= */
.account-btn {
  position: absolute; top: calc(12px + var(--safe-t)); right: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--brand-ink) 16%, transparent); color: var(--brand-ink);
  text-decoration: none; font-weight: 700; font-size: 14px;
}
.hero { position: relative; }
.hero-inner { padding-top: 34px; }
@media (min-width: 600px) { .hero-inner { padding-top: 10px; } .account-btn { top: calc(18px + var(--safe-t)); right: 24px; } }
.compact-account { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.footer-actions { grid-column: 1 / -1; display: grid; gap: 10px; }
@media (min-width: 600px) { .footer-actions { grid-column: auto; display: flex; } }
.field-hint { color: var(--muted); font-weight: 500; font-size: 12.5px; }

.acct-card { background: var(--surface); border-radius: 22px; padding: 20px; box-shadow: 0 1px 0 var(--line), 0 10px 28px rgba(16,24,40,.05); margin-bottom: 14px; }
.acct-card h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.acct-card h2 { margin: 0 0 12px; font-size: 17px; font-weight: 800; }
.acct-card p.lead { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.acct-login .form { margin-top: 18px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 14px; }
.acct-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.link-btn { border: 0; background: none; color: var(--muted); font-weight: 650; font-size: 14px; cursor: pointer; min-height: 40px; padding: 0 4px; }

.balance { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%); color: var(--brand-ink); }
.balance .lbl { font-size: 14px; opacity: .85; }
.balance .usd { font-size: 36px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.balance .bs { font-size: 15px; opacity: .9; font-variant-numeric: tabular-nums; }
.balance.clear { background: var(--surface); color: var(--ink); }
.balance.clear .usd { color: var(--ok); font-size: 22px; }

.pm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.pm-row + .pm-row { border-top: 1px solid var(--line); }
.pm-row .k { color: var(--muted); font-size: 13px; }
.pm-row .v { font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.copy-btn { flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--tile); color: var(--ink); font-weight: 650; font-size: 13px; cursor: pointer; }
.copy-btn.done { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }

.purchase { padding: 16px 0; }
.purchase + .purchase { border-top: 1px solid var(--line); }
.purchase-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.purchase-top strong { font-size: 16px; }
.purchase .date { color: var(--muted); font-size: 13px; }
.tag { flex: none; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--tile); color: var(--muted); }
.tag.debt { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.tag.paid { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tag.wait { background: var(--brand-soft); color: var(--brand-text); }
.tag.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.purchase .lines { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13.5px; }
.purchase .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.purchase .nums div { background: var(--tile); border-radius: 12px; padding: 8px 10px; }
.purchase .nums span { display: block; color: var(--muted); font-size: 12px; }
.purchase .nums b { font-variant-numeric: tabular-nums; font-size: 15px; }
.purchase .pend { margin: 8px 0 0; color: var(--brand-text); font-size: 13px; font-weight: 600; }
.purchase .btn { margin-top: 12px; }

.payment { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 0; }
.payment + .payment { border-top: 1px solid var(--line); }
.payment .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.payment .meta { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); margin: 0; }

/* Hoja de pago */
.pay-amount { background: var(--tile); border-radius: 16px; padding: 14px 16px; margin-top: 4px; }
.pay-amount .lbl { color: var(--muted); font-size: 13px; }
.pay-amount .big { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pay-amount .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pay-steps { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.pay-steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.pay-steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 13px; }
.pay-steps li > div { padding-top: 3px; }
.pay-steps .pm { margin-top: 8px; background: var(--surface); border-radius: 14px; padding: 2px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.drop {
  margin-top: 10px; width: 100%; min-height: 120px; border-radius: 16px; border: 2px dashed var(--line); background: var(--surface);
  display: grid; place-items: center; gap: 6px; padding: 16px; cursor: pointer; color: var(--muted); font-weight: 650; text-align: center;
}
.drop svg { color: var(--brand-text); }
.drop.has { border-style: solid; border-color: var(--brand); padding: 8px; }
.drop img { max-height: 280px; max-width: 100%; border-radius: 10px; }
.pay-result { text-align: center; padding: 12px 0 4px; }
.pay-result .check { margin-bottom: 12px; }
.pay-result h3 { margin: 0; font-size: 20px; font-weight: 800; }
.pay-result p { margin: 8px auto 0; color: var(--muted); max-width: 40ch; line-height: 1.5; }
.problems { text-align: left; margin: 14px 0 0; padding: 12px 14px 12px 32px; border-radius: 14px; background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--ink); }
.problems li + li { margin-top: 6px; }
.read-data { text-align: left; margin-top: 14px; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--tile); border-top-color: var(--brand); margin: 18px auto 8px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mt { margin-top: 10px; }
