/* ============================================================
   DONADÓN · componentes de producto
   Cada bloque corresponde 1:1 con un componente standalone de
   Angular (ver ANGULAR.md).
   ============================================================ */

/* ─── 1. Botones ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.9em; font-weight: 600; letter-spacing: -0.01em;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(0.1rem); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn-primary   { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-press); border-color: var(--accent-press); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--fg); }
.btn-ghost     { background: transparent; color: var(--fg); padding-inline: var(--sp-3); }
.btn-ghost:hover { color: var(--accent); }
.btn-invert    { background: var(--fg-invert); color: var(--bg-deep); }
.btn-invert:hover { background: var(--muted-invert); }
.btn-sm { min-height: 2.2rem; padding-inline: var(--sp-4); font-size: 0.9em; }
.btn-lg { min-height: 3.2rem; padding-inline: var(--sp-6); font-size: 1em; }
.btn-block { width: 100%; }
.btn-arrow::after { content: '→'; transition: transform var(--dur) var(--ease); }
.btn-arrow:hover::after { transform: translateX(0.2rem); }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap);
  border-radius: var(--radius);
  color: var(--fg);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--fg-soft); }
.icon-btn svg { width: 1.3rem; height: 1.3rem; }
.icon-btn .count {
  position: absolute; top: 0.2rem; right: 0.2rem;
  min-width: 1.1rem; height: 1.1rem; padding: 0 0.2rem;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 0.7em; font-weight: 600;
}
.icon-btn .count[hidden] { display: none; }

/* ─── 2. Encabezado y navegación ─────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: var(--sp-5);
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.2em; letter-spacing: -0.03em; }
.brand .spark { width: 1.4rem; height: 1.4rem; color: var(--accent); }
/* el logo real de la empresa, sin recolorear: es la marca registrada */
.brand-logo { width: 3.5rem; height: auto; border-radius: 0.2rem; flex: none; }
.brand-name { display: inline-grid; line-height: 1; }
.brand small { font-family: var(--font-mono); font-size: 0.42em; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; padding-top: 0.25rem; font-weight: 400; }
@media (max-width: 30em) { .brand small { display: none; } }

.main-nav { display: flex; gap: var(--sp-5); }
.main-nav a {
  position: relative; padding-block: 0.4rem;
  font-size: var(--fs-sm); color: var(--muted);
  transition: color var(--dur) var(--ease);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--fg); }
.main-nav a[aria-current="page"]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -0.1rem;
  height: 0.1rem; background: var(--accent); border-radius: 0.1rem;
}
.header-actions { display: flex; align-items: center; gap: 0.1rem; }

.searchbar { position: relative; display: flex; align-items: center; width: 100%; max-width: 28.8rem; }
.searchbar svg { position: absolute; left: 0.8rem; width: 1.1rem; height: 1.1rem; color: var(--muted); pointer-events: none; }
.searchbar input {
  width: 100%; min-height: 2.6rem;
  padding: 0 var(--sp-4) 0 2.5rem;
  background: var(--surface-2);
  border: 1px solid transparent; border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.searchbar input::placeholder { color: var(--muted); }
.searchbar input:focus { background: var(--surface); border-color: var(--border-strong); outline: none; }
.searchbar:focus-within { outline: 2px solid var(--accent-soft); outline-offset: 0.1rem; border-radius: var(--radius-pill); }

.suggest {
  position: absolute; top: calc(100% + 0.5rem); left: 0; right: 0; z-index: 70;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--sp-2); max-height: 21.2rem; overflow-y: auto;
}
.suggest[hidden] { display: none; }
.suggest a { display: flex; align-items: center; gap: var(--sp-3); padding: 0.5rem 0.6rem; border-radius: var(--radius-xs); min-height: 2.8rem; }
.suggest a:hover, .suggest a:focus-visible { background: var(--surface-2); }
.suggest .s-name { font-size: var(--fs-sm); }
.suggest .s-cat { font-family: var(--font-mono); font-size: 0.7em; color: var(--muted); }

.promo-strip {
  background: var(--bg-deep); color: var(--muted-invert);
  font-family: var(--font-mono); font-size: 0.7em; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.promo-strip .container { display: flex; justify-content: center; gap: var(--sp-5); padding-block: 0.6rem; flex-wrap: wrap; }
.promo-strip b { color: var(--fg-invert); font-weight: 600; }

/* ─── 3. Superficies ─────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
}
.card-tight { padding: var(--sp-4); }
.panel-dark { background: var(--bg-deep); color: var(--fg-invert); border-radius: var(--radius-xl); }
.panel-dark .lead, .panel-dark .muted { color: var(--muted-invert); }

/* ─── 4. Píldoras y etiquetas ────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 0.7em; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--fg-soft); color: var(--muted);
}
.pill-accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill-ok     { background: var(--ok-soft); color: var(--ok); }
.pill-warn   { background: var(--warn-soft); color: color-mix(in oklch, var(--warn) 70%, var(--fg)); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-info   { background: var(--info-soft); color: var(--info); }
.pill .dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-flex; align-items: center; padding: 0.2rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 0.8em; color: var(--muted);
}

.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 2.1rem; padding: 0 0.4rem 0 0.8rem;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); font-size: 0.8em;
}
.chip button { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; color: var(--muted); }
.chip button:hover { background: var(--fg-soft); color: var(--fg); }

/* ─── 5. Ficha de producto ───────────────────────────────── */
.ph-prod {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  display: grid; place-items: center;
}
.ph-prod::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--fg-softer) 0.1rem, transparent 0.1rem),
    linear-gradient(90deg, var(--fg-softer) 0.1rem, transparent 0.1rem);
  background-size: 1.5rem 1.5rem;
}
.ph-prod svg { position: relative; width: 46%; max-width: 8.2rem; height: auto; color: var(--muted); }
.ph-prod img { position: relative; width: 100%; height: 100%; object-fit: contain; padding: 0.5rem; }
.ph-prod:has(img) { background: var(--photo-bg); }
.ph-prod:has(img)::before { opacity: 0; }
.ph-prod.square { aspect-ratio: 1 / 1; }
.ph-prod.lg svg { width: 52%; max-width: 15rem; color: var(--accent-ink); }

/* Ficha de producto — caja con la imagen embebida arriba, chip de familia
   pisando el borde inferior de la imagen, y debajo título, estado con
   unidades y precio en su propia línea. */
.prod-card {
  position: relative;
  display: grid;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.prod-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.prod-media {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3;
  margin: 0.6rem 0.6rem 0;
  border-radius: var(--radius-xs);
  background:
    radial-gradient(120% 80% at 50% 12%, var(--water-soft), transparent 68%),
    var(--surface-2);
  display: grid; place-items: center;
}
.prod-media > svg {
  width: 58%; max-width: 11.9rem; height: auto; color: var(--fg);
  transition: transform var(--dur-slow) var(--ease);
}
/* Las fotos del catálogo vienen sobre fondo blanco y en formato apaisado:
   se encuadran completas (contain) sobre superficie plana, nunca recortadas. */
.prod-media > img { width: 100%; height: 100%; object-fit: contain; padding: 0.6rem; }
.prod-media:has(> img) { background: var(--photo-bg); }
.prod-media .fill-accent { fill: var(--accent-soft); stroke: none; }
.prod-media .fill-water  { fill: var(--water-soft); stroke: none; }
.prod-card:hover .prod-media > svg { transform: scale(1); }

.prod-flags {
  position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2;
  display: grid; justify-items: end; gap: 0.2rem;
}
.badge-cat {
  position: absolute; left: 0.5rem; bottom: 0.5rem; z-index: 2;
  max-width: calc(100% - 1rem);
  padding: 0.2rem 0.5rem; border-radius: var(--radius-xs);
  background: color-mix(in oklch, var(--fg) 86%, transparent); color: var(--fg-invert);
  font-size: 0.7em; line-height: 1.4; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity var(--dur) var(--ease);
}
.prod-quick {
  position: absolute; left: 0.5rem; right: 0.5rem; bottom: 0.5rem; z-index: 3;
  opacity: 0; transform: translateY(0.5rem);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.prod-card:hover .prod-quick, .prod-card:focus-within .prod-quick { opacity: 1; transform: none; }
.prod-card:hover .badge-cat, .prod-card:focus-within .badge-cat { opacity: 0; }
@media (hover: none) { .prod-card .prod-quick { opacity: 1; transform: none; } .prod-card .badge-cat { opacity: 0; } }

.prod-body { display: grid; gap: 0.4rem; padding: 0.8rem 0.9rem 0.9rem; }
/* Nombre y dato técnico reservan DOS líneas siempre.
   36 de 49 nombres y 33 de 49 líneas técnicas pasan a la segunda; sin reservar
   el alto, las cards de una misma fila quedan desparejas y los precios no
   alinean entre sí. El nombre más largo mide 50 caracteres y la línea técnica
   más larga 55: las dos entran en dos renglones, así que no se corta nada —
   el clamp queda de red por si el PIM carga algo más largo.
   El ::after que hace clickeable toda la card se ancla a .prod-card, que es el
   contexto posicionado, así que este overflow no lo recorta. */
.prod-name {
  font-family: var(--font-display); font-size: 0.9em; font-weight: 600;
  line-height: 1.3; letter-spacing: -0.012em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.6em;
}
.prod-name a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.prod-spec {
  font-family: var(--font-mono); font-size: 0.7em; color: var(--muted);
  line-height: 1.4;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.8em;
}
.prod-stockline { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.prod-state {
  font-family: var(--font-mono); font-size: 0.7em;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok);
}
.prod-state.low  { color: color-mix(in oklch, var(--warn) 78%, var(--fg)); }
.prod-state.none { color: var(--danger); }
.prod-units { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.8em; color: var(--muted); }
.prod-price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.1em; font-weight: 500; letter-spacing: -0.02em; }
/* el em compone sobre .prod-price (17px): se recalibran los hijos */
.prod-price .was { font-size: 0.7em; }
.prod-price .desde { font-size: 0.8em; color: var(--muted); font-weight: 400; }
.prod-card.out-of-stock .prod-media { opacity: 0.6; }

.price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -0.02em; }
.price-lg { font-size: clamp(1.6em, 3vw, 2.1em); line-height: 1.1; }
.price-md { font-size: 1.2em; }
.installment { font-size: 0.8em; color: var(--ok); }
.was { font-family: var(--font-mono); font-size: 0.8em; text-decoration: line-through; color: var(--muted); }

.stock { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8em; color: var(--muted); }
.stock .dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--ok); }
.stock.low .dot { background: var(--warn); }
.stock.none .dot { background: var(--danger); }

/* lista horizontal (carrito, pedidos) */
.line-item { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: var(--sp-4); align-items: start; padding-block: var(--sp-4); border-top: 1px solid var(--border); }
.line-item:first-child { border-top: 0; }
.line-item .ph-prod { aspect-ratio: 1 / 1; }
@media (max-width: 35em) {
  .line-item { grid-template-columns: 4rem minmax(0, 1fr); }
  .line-item .li-total { grid-column: 2; text-align: left; }
}

/* ─── 6. Categorías ──────────────────────────────────────── */
.cat-tile {
  display: grid; align-content: space-between; gap: var(--sp-6);
  min-height: 10.5rem; padding: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.cat-tile:hover { border-color: var(--fg); transform: translateY(-0.1rem); }
.cat-tile svg { width: 2.1rem; height: 2.1rem; color: var(--accent-ink); }
.cat-tile .c-name { font-family: var(--font-display); font-weight: 600; font-size: 0.9em; }
.cat-tile .c-count { font-family: var(--font-mono); font-size: 0.7em; color: var(--muted); }

/* ─── 7. Filtros ─────────────────────────────────────────── */
.filters { display: grid; gap: var(--sp-5); }
.filter-group { border-top: 1px solid var(--border); padding-top: var(--sp-4); }
.filter-group:first-child { border-top: 0; padding-top: 0; }
.filter-group > h3 { font-size: 0.8em; letter-spacing: 0.02em; margin-bottom: var(--sp-3); }
.check {
  display: flex; align-items: center; gap: 0.6rem;
  min-height: 2.4rem; font-size: var(--fs-sm); color: var(--muted); cursor: pointer;
}
.check:hover { color: var(--fg); }
.check input { appearance: none; width: 1.1rem; height: 1.1rem; flex: 0 0 1.1rem; border: 1.5px solid var(--border-strong); border-radius: 0.3rem; background: var(--surface); transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ''; display: block; width: 100%; height: 100%; background: var(--on-accent); clip-path: polygon(20% 52%, 42% 72%, 80% 26%, 87% 34%, 43% 86%, 13% 60%); }
.check .c-num { margin-left: auto; font-family: var(--font-mono); font-size: 0.8em; color: var(--muted); }

.switch { display: flex; align-items: center; gap: 0.6rem; min-height: 2.4rem; font-size: var(--fs-sm); cursor: pointer; }
.switch input { appearance: none; width: 2.4rem; height: 1.4rem; flex: 0 0 2.4rem; border-radius: var(--radius-pill); background: var(--surface-sunk); position: relative; transition: background var(--dur) var(--ease); }
.switch input::after { content: ''; position: absolute; top: 0.2rem; left: 0.2rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(1rem); }

.range { width: 100%; appearance: none; height: 1.9rem; background: transparent; }
.range::-webkit-slider-runnable-track { height: 0.2rem; border-radius: 0.1rem; background: var(--surface-sunk); }
.range::-webkit-slider-thumb { appearance: none; width: 1.2rem; height: 1.2rem; margin-top: -0.5rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm); }
.range::-moz-range-track { height: 0.2rem; border-radius: 0.1rem; background: var(--surface-sunk); }
.range::-moz-range-thumb { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  padding-block: var(--sp-4);
}

/* ─── 8. Formularios ─────────────────────────────────────── */
.field { display: grid; gap: 0.4rem; }
.field > label { font-size: 0.8em; font-weight: 600; }
.field .hint { font-size: 0.8em; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap);
  padding: 0.6rem var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 5.8rem; resize: vertical; line-height: 1.6; }
.select {
  appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.2rem) calc(50% + 0.1rem), calc(100% - 0.9rem) calc(50% + 0.1rem);
  background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
  background-repeat: no-repeat;
}
.field.invalid .input, .field.invalid .select { border-color: var(--danger); }
.field .error { display: none; font-size: 0.8em; color: var(--danger); }
.field.invalid .error { display: block; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
@media (max-width: 35em) { .field-row { grid-template-columns: minmax(0, 1fr); } }

.radio-card {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4); min-height: var(--tap);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.radio-card:hover { border-color: var(--fg); }
.radio-card input { appearance: none; width: 1.1rem; height: 1.1rem; flex: 0 0 1.1rem; margin-top: 0.2rem; border: 1.5px solid var(--border-strong); border-radius: 50%; }
.radio-card input:checked { border: 0.3rem solid var(--accent); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card .rc-title { font-weight: 600; font-size: var(--fs-sm); }
.radio-card .rc-sub { font-size: 0.8em; color: var(--muted); }
.radio-card .rc-price { margin-left: auto; font-family: var(--font-mono); font-size: 0.8em; font-weight: 600; }

/* ─── 9. Stepper de cantidad ─────────────────────────────── */
.stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.stepper button { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; font-size: 1.1em; color: var(--muted); }
.stepper button:hover { background: var(--fg-soft); color: var(--fg); }
.stepper input {
  width: 2.8rem; height: 2.5rem; text-align: center; border: 0;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.9em;
  background: transparent;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.stepper input[type=number] { appearance: textfield; -moz-appearance: textfield; }

/* ─── 10. Pestañas ───────────────────────────────────────── */
.tabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button {
  position: relative; min-height: var(--tap); padding-block: 0.6rem;
  font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600;
  color: var(--muted); white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { color: var(--fg); }
.tabs button[aria-selected="true"]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -0.1rem; height: 0.1rem;
  background: var(--accent); border-radius: 0.1rem;
}
.tabpanel[hidden] { display: none; }

/* ─── 11. Tablas de especificaciones ─────────────────────── */
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.spec-table th, .spec-table td { padding: 0.7rem 0; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table th { width: 42%; color: var(--muted); font-weight: 400; }
.spec-table td { font-variant-numeric: tabular-nums; }

/* ─── 12. Resumen de compra ──────────────────────────────── */
.summary-row { display: flex; justify-content: space-between; gap: var(--sp-4); font-size: var(--fs-sm); padding-block: 0.4rem; }
.summary-row .s-val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.summary-total { border-top: 1px solid var(--fg); margin-top: var(--sp-3); padding-top: var(--sp-4); display: flex; justify-content: space-between; align-items: baseline; }
.summary-total .s-val { font-family: var(--font-mono); font-size: 1.5em; font-weight: 700; letter-spacing: -0.02em; }

.coupon { display: flex; gap: var(--sp-2); }
.coupon .input { flex: 1 1 auto; text-transform: uppercase; }

/* ─── 13. Pasos del checkout ─────────────────────────────── */
.steps { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.8em; color: var(--muted); }
.steps li + li::before { content: ''; width: 1.4rem; height: 0.1rem; background: var(--border-strong); }
.steps .s-num {
  width: 1.5rem; height: 1.5rem; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: 0.9em;
}
.steps li[data-state="current"] { color: var(--fg); font-weight: 600; }
.steps li[data-state="current"] .s-num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps li[data-state="done"] .s-num { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }

/* ─── 14. Línea de tiempo del pedido ─────────────────────── */
.timeline { display: grid; }
.timeline li { position: relative; padding: 0 0 var(--sp-5) var(--sp-6); }
.timeline li::before {
  content: ''; position: absolute; left: 0.3rem; top: 0.2rem;
  width: 0.7rem; height: 0.7rem; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.timeline li::after { content: ''; position: absolute; left: 0.6rem; top: 1.1rem; bottom: 0; width: 0.1rem; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li[data-state="done"]::before { background: var(--ok); border-color: var(--ok); }
.timeline li[data-state="current"]::before { background: var(--accent); border-color: var(--accent); }
.timeline .t-title { font-weight: 600; font-size: var(--fs-sm); }
.timeline .t-when { font-family: var(--font-mono); font-size: 0.8em; color: var(--muted); }

/* ─── 15. Acordeón (detalle de pedido) ───────────────────── */
.acc { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.acc + .acc { margin-top: var(--sp-3); }
.acc > .acc-head {
  display: flex; align-items: center; gap: var(--sp-4); width: 100%;
  min-height: 4rem; padding: var(--sp-3) var(--sp-4); text-align: left;
  cursor: pointer; list-style: none;
}
.acc > .acc-head::-webkit-details-marker { display: none; }
.acc > .acc-head:hover { background: var(--surface-2); }
.acc > .acc-head .caret { margin-left: auto; transition: transform var(--dur) var(--ease); color: var(--muted); }
.acc[open] > .acc-head .caret { transform: rotate(180deg); }
.acc-body { padding: 0 var(--sp-4) var(--sp-4); border-top: 1px solid var(--border); }
.acc-body[hidden] { display: none; }

/* ─── 16. Cajón lateral (mini-carrito, filtros móviles) ──── */
.scrim {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in oklch, var(--bg-deep) 45%, transparent);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(26.2rem, 100vw);
  display: grid;
  background: var(--bg); border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease);
}
.drawer.open { transform: translateX(0); }
.drawer.left { right: auto; left: 0; border-left: 0; border-right: 1px solid var(--border); transform: translateX(-100%); }
.drawer.left.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-4); }
.drawer-foot { border-top: 1px solid var(--border); padding: var(--sp-4); background: var(--surface); }

/* ─── 17. Avisos y vacíos ────────────────────────────────── */
.empty {
  display: grid; justify-items: center; gap: var(--sp-4);
  padding: clamp(2.5rem, 8vw, 5.5rem) var(--sp-4); text-align: center;
}
.empty svg { width: 3.4rem; height: 3.4rem; color: var(--border-strong); }
.empty h2 { font-size: var(--fs-h2); }
.empty p { color: var(--muted); max-width: 44ch; }

.note { display: flex; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--radius); font-size: 0.8em; background: var(--info-soft); color: var(--fg); }
.note svg { flex: 0 0 1.1rem; width: 1.1rem; height: 1.1rem; color: var(--info); margin-top: 0.1rem; }
.note-ok { background: var(--ok-soft); }
.note-ok svg { color: var(--ok); }
.note-warn { background: var(--warn-soft); }
.note-warn svg { color: color-mix(in oklch, var(--warn) 70%, var(--fg)); }

.toast-stack { position: fixed; left: 50%; bottom: 1.5rem; z-index: 200; transform: translateX(-50%); display: grid; gap: var(--sp-2); width: min(26.2rem, calc(100vw - 2rem)); }
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0.8rem var(--sp-4);
  background: var(--bg-deep); color: var(--fg-invert);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: 0.8em;
  animation: toast-in var(--dur-slow) var(--ease);
}
.toast svg { width: 1.1rem; height: 1.1rem; flex: 0 0 1.1rem; color: var(--ok); }
.toast a { color: var(--fg-invert); text-decoration: underline; margin-left: auto; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(0.8rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ─── 18. Migas y pie ────────────────────────────────────── */
.crumbs { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8em; color: var(--muted); padding-block: var(--sp-4); }
.crumbs a:hover { color: var(--fg); }
.crumbs span[aria-hidden] { opacity: 0.5; }

.site-footer { background: var(--bg-deep); color: var(--muted-invert); margin-top: var(--sp-8); }
.site-footer a:hover { color: var(--fg-invert); }
.site-footer h4 { font-family: var(--font-display); font-size: 0.8em; color: var(--fg-invert); margin-bottom: var(--sp-3); letter-spacing: 0.02em; }
.site-footer li { padding-block: 0.3rem; font-size: 0.8em; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--sp-6); padding-block: var(--sp-7); }
.footer-legal .meta { font-size: 1em; }
.footer-legal { border-top: 1px solid var(--border-invert); padding-block: var(--sp-4); display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; font-size: 0.8em; }
@media (max-width: 53.8em) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 28.8em) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

/* ─── 19. Barra inferior móvil (PDP / carrito) ───────────── */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: none; align-items: center; gap: var(--sp-3);
  padding: 0.6rem var(--sp-4) calc(0.6rem + env(safe-area-inset-bottom));
  background: color-mix(in oklch, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
@media (max-width: 56.2em) {
  .buybar { display: flex; }
  .has-buybar { padding-bottom: 5.2rem; }
}

/* ─── 20. Fila de navegación y ajustes del encabezado ────── */
.nav-row { border-top: 1px solid var(--border); }
.menu-btn { margin-left: -0.6rem; }
.prod-card .prod-quick .btn { position: relative; z-index: 2; }
.cat-tile svg { color: var(--water); }

/* barra de acento a la izquierda del título de sección */
.h-bar { display: flex; align-items: center; gap: 0.8rem; }
.h-bar::before {
  content: ''; flex: 0 0 0.2rem; width: 0.2rem; height: 1em;
  border-radius: 0.1rem; background: var(--accent);
}

/* ─── 22. Objetivos táctiles ─────────────────────────────────
   Los controles compactos (.btn-sm, quitar chip, filas de filtro,
   stepper) miden menos de 44px para sostener la densidad de
   escritorio. Con puntero grueso suben al mínimo táctil. */
@media (pointer: coarse) {
  .btn-sm { min-height: var(--tap); }
  .chip { min-height: var(--tap); padding-right: 0.5rem; }
  .chip button { width: 2.2rem; height: 2.2rem; }
  .check, .switch { min-height: var(--tap); }
  .stepper button { width: var(--tap); height: var(--tap); }
  .stepper input { height: var(--tap); }
  .side-nav button { min-height: var(--tap); }
}

/* el tema se cruza con una transición corta, no elemento por elemento */
html { transition: background-color var(--dur) var(--ease); }
body { transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }

@media (max-width: 56.2em) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: 'menu brand actions' 'search search search';
    gap: var(--sp-2) var(--sp-3);
    padding-bottom: 0.6rem;
  }
  .header-inner .menu-btn { grid-area: menu; }
  .header-inner .brand { grid-area: brand; }
  .header-inner .header-actions { grid-area: actions; }
  .header-inner .searchbar { grid-area: search; max-width: none; }
}
@media (max-width: 22.5em) {
  .brand small { display: none; }
}

/* ─── 21. Barra de progreso de envío gratis ──────────────── */
.freeship { display: grid; gap: 0.4rem; font-size: 0.8em; color: var(--muted); }
.freeship .track { height: 0.4rem; border-radius: 0.2rem; background: var(--surface-sunk); overflow: hidden; }
.freeship .fill { height: 100%; background: var(--ok); border-radius: 0.2rem; transition: width var(--dur-slow) var(--ease); }
