/*
 * Páginas de listado y detalle del sistema: catálogo/categoría/búsqueda,
 * /ofertas, /promociones/{slug}, /combos y /combos/{slug}.
 */

/* ── Cabecera de página ────────────────────────────────────────────────── */
.a-page__head {
  padding-top: var(--a-space-5);
}

.a-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--a-space-3);
  font-size: var(--a-text-sm);
  color: var(--a-muted);
}

.a-crumbs a,
.a-crumbs a:hover { color: var(--a-brand-700); text-decoration: none; }
.a-crumbs a:hover { text-decoration: underline; }
.a-crumbs [aria-current] { color: var(--a-ink-2); font-weight: 600; }

.a-page__title {
  font-size: var(--a-text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--a-ink);
}

.a-page__lead {
  max-width: 68ch;
  margin-top: var(--a-space-2);
  font-size: var(--a-text-base);
  line-height: var(--a-leading);
  color: var(--a-muted);
}

.a-results {
  font-size: var(--a-text-sm);
  font-weight: 600;
  color: var(--a-muted);
}

.a-section > .a-results { margin-bottom: var(--a-space-4); }

/* ── Catálogo: layout ──────────────────────────────────────────────────── */
.a-catalog {
  display: grid;
  gap: var(--a-space-6);
  margin-top: var(--a-space-5);
}

@media (min-width: 1024px) {
  .a-catalog { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
}

.a-catalog__side { display: none; }

@media (min-width: 1024px) {
  .a-catalog__side {
    position: sticky;
    top: 9rem;
    display: block;
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    padding-right: var(--a-space-2);
  }
}

.a-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--a-space-3);
  margin-bottom: var(--a-space-4);
}

.a-toolbar .a-results { margin-right: auto; }

.a-toolbar__filters { order: -1; }

@media (min-width: 1024px) {
  .a-toolbar__filters { display: none; }
}

.a-toolbar__filters > summary { list-style: none; position: relative; }
.a-toolbar__filters > summary::-webkit-details-marker { display: none; }

.a-toolbar__panel {
  margin-top: var(--a-space-3);
  padding: var(--a-space-4);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-lg);
  background: var(--a-surface);
  box-shadow: var(--a-shadow);
}

.a-toolbar__filters[open] {
  flex-basis: 100%;
}

.a-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--a-offer-600);
}

.a-sort {
  display: flex;
  align-items: center;
  gap: var(--a-space-2);
}

.a-sort__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--a-text-sm);
  font-weight: 600;
  color: var(--a-muted);
}

.a-sort__select,
.a-sort__select:focus {
  width: auto;
  min-height: 40px;
  padding: 0 var(--a-space-8) 0 var(--a-space-3);
  border: 1px solid var(--a-line-strong);
  border-radius: var(--a-radius-pill);
  background: var(--a-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b6577' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--a-ink);
  font-family: var(--a-font);
  font-size: var(--a-text-sm);
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}

.a-sort__select:focus {
  outline: none;
  border-color: var(--a-brand-700);
  box-shadow: 0 0 0 3px var(--a-brand-100);
}

/* ── Filtros ───────────────────────────────────────────────────────────── */
.a-filters {
  display: grid;
  gap: var(--a-space-6);
}

.a-filters__group { display: grid; gap: var(--a-space-2); }

.a-filters__label {
  font-size: var(--a-text-sm);
  font-weight: 800;
  color: var(--a-ink);
}

.a-filters__search {
  position: relative;
  display: flex;
}

.a-filters__search input,
.a-filters__price input { width: 100%; }

.a-filters__search input,
.a-filters__search input:focus {
  height: 42px;
  padding: 0 44px 0 var(--a-space-4);
  border: 1px solid var(--a-line-strong);
  border-radius: var(--a-radius-pill);
  background: var(--a-surface);
  color: var(--a-ink);
  font-size: var(--a-text-md);
}

.a-filters__search input:focus {
  outline: none;
  border-color: var(--a-brand-700);
  box-shadow: 0 0 0 3px var(--a-brand-100);
}

.a-filters__search button {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--a-brand-700);
  cursor: pointer;
}

.a-filters__cats { display: grid; gap: 2px; }

.a-filters__cat,
.a-filters__cat:hover {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-space-2);
  min-height: 38px;
  padding: 0 var(--a-space-3);
  border-radius: var(--a-radius-sm);
  color: var(--a-ink-2);
  font-size: var(--a-text-md);
  text-decoration: none;
}

.a-filters__cat:hover { background: var(--a-surface-2); }

.a-filters__cat[aria-current] {
  background: var(--a-brand-50);
  color: var(--a-brand-800);
  font-weight: 700;
}

.a-filters__count { font-size: var(--a-text-xs); color: var(--a-muted); }

.a-filters__price {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: var(--a-space-2);
}

.a-filters__price label { display: grid; gap: 4px; font-size: var(--a-text-xs); color: var(--a-muted); }

.a-filters__price input,
.a-filters__price input:focus {
  height: 38px;
  padding: 0 var(--a-space-2);
  border: 1px solid var(--a-line-strong);
  border-radius: var(--a-radius-sm);
  background: var(--a-surface);
  color: var(--a-ink);
  font-size: var(--a-text-md);
}

.a-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.a-chip,
.a-chip:hover {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 var(--a-space-3);
  border: 1px solid var(--a-line-strong);
  border-radius: var(--a-radius-pill);
  color: var(--a-ink-2);
  font-size: var(--a-text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--a-dur) ease, background-color var(--a-dur) ease;
}

.a-chip:hover { border-color: var(--a-brand-700); }

.a-chip[aria-current] {
  border-color: var(--a-brand-700);
  background: var(--a-brand-700);
  color: var(--a-on-primary);
}

.a-filters__toggles { display: grid; gap: 2px; }

.a-toggle,
.a-toggle:hover {
  display: flex;
  align-items: center;
  gap: var(--a-space-3);
  min-height: 38px;
  color: var(--a-ink-2);
  font-size: var(--a-text-md);
  text-decoration: none;
}

.a-toggle__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--a-line-strong);
  border-radius: 5px;
  color: transparent;
}

.a-toggle[aria-current] .a-toggle__box {
  border-color: var(--a-brand-700);
  background: var(--a-brand-700);
  color: var(--a-on-primary);
}

/* ── Paginación ────────────────────────────────────────────────────────── */
.a-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: var(--a-space-8);
}

.a-pager__btn,
.a-pager__btn:hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 var(--a-space-2);
  border: 1px solid var(--a-line-strong);
  border-radius: var(--a-radius);
  color: var(--a-ink);
  font-weight: 700;
  text-decoration: none;
}

.a-pager__btn:hover { border-color: var(--a-brand-700); }

.a-pager__btn[aria-current="page"] {
  border-color: var(--a-brand-700);
  background: var(--a-brand-700);
  color: var(--a-on-primary);
}

.a-pager__gap { align-self: center; color: var(--a-muted); }

.a-pager__info {
  margin-top: var(--a-space-2);
  font-size: var(--a-text-sm);
  color: var(--a-muted);
  text-align: center;
}

/* ── Promoción ─────────────────────────────────────────────────────────── */
.a-promo-hero {
  display: grid;
  gap: var(--a-space-5);
  margin-top: var(--a-space-2);
}

.a-promo-hero__media img {
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: var(--a-radius-xl);
  object-fit: cover;
}

@media (max-width: 767px) {
  .a-promo-hero__media img { border-radius: var(--a-radius-lg); }
}

.a-promo-hero__body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--a-space-5);
}

.a-promo-hero__text {
  display: flex;
  flex: 1 1 22rem;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--a-space-3);
  min-width: 0;
}

.a-promo-hero__flags { display: flex; flex-wrap: wrap; gap: 6px; }

.a-promo-hero__title {
  font-size: var(--a-text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--a-ink);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.a-promo-hero__lead {
  max-width: 60ch;
  font-size: var(--a-text-base);
  line-height: var(--a-leading);
  color: var(--a-ink-2);
}

.a-promo-hero__count { font-size: var(--a-text-sm); font-weight: 700; color: var(--a-ink-2); }

/* Sin banner del POS: panel rosado (offer-600 con tinta blanca, 4.8:1), como "Bombas de hoy". */
.a-promo-hero.is-panel .a-promo-hero__body {
  padding: var(--a-space-6) var(--a-space-5);
  border-radius: var(--a-radius-xl);
  background: var(--a-offer-600);
}

@media (min-width: 768px) {
  .a-promo-hero.is-panel .a-promo-hero__body { padding: var(--a-space-8) var(--a-space-10); }
}

.a-promo-hero.is-panel .a-promo-hero__title,
.a-promo-hero.is-panel .a-promo-hero__lead,
.a-promo-hero.is-panel .a-promo-hero__count,
.a-promo-hero.is-panel .a-countdown__label { color: var(--a-on-fill); }

.a-promo-list { display: grid; gap: var(--a-space-2); }

.a-promo-row,
.a-promo-row:hover {
  display: flex;
  align-items: center;
  gap: var(--a-space-3);
  padding: var(--a-space-4);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-lg);
  background: var(--a-surface);
  color: var(--a-ink);
  text-decoration: none;
}

.a-promo-row:hover { border-color: var(--a-line-strong); box-shadow: var(--a-shadow-sm); }
.a-promo-row__text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.a-promo-row__title { font-weight: 800; }
.a-promo-row__meta { font-size: var(--a-text-sm); color: var(--a-muted); }

/* ── Combos (/combos): los bloques por tipo viven en shelf.css ─────────── */
.a-ctypenav-wrap + .a-shelf { margin-top: var(--a-space-6); }

/* ── Combos de un tipo (/combos?tipo=…) ────────────────────────────────── */
.a-chero {
  display: grid;
  gap: var(--a-space-5);
  overflow: hidden;
  padding: var(--a-space-6) var(--a-space-5);
  border: 1px solid var(--t-line);
  border-radius: var(--a-radius-xl);
  background: var(--t-tint);
  color: var(--a-ink);
}

.a-chero.is-ink-light:not(.has-image),
.a-chero.is-ink-dark:not(.has-image) { border-color: transparent; background: var(--t); }
.a-chero.is-ink-light:not(.has-image) { color: var(--a-on-fill); }
.a-chero.is-ink-dark:not(.has-image) { color: var(--a-paper-ink); }

@media (min-width: 768px) {
  .a-chero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    min-height: 240px;
    padding: var(--a-space-8) var(--a-space-10);
  }
}

.a-chero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--a-space-3);
  min-width: 0;
}

.a-chero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--a-radius-lg);
  background: var(--a-surface);
  color: var(--t-strong);
  box-shadow: var(--a-shadow-sm);
}

.a-chero__title {
  font-size: var(--a-text-4xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.a-chero__lead {
  max-width: 52ch;
  font-size: var(--a-text-base);
  line-height: var(--a-leading);
}

.a-chero:not(.is-ink-light):not(.is-ink-dark) .a-chero__lead,
.a-chero.has-image .a-chero__lead { color: var(--a-ink-2); }

.a-chero__count {
  padding: 4px 12px;
  border-radius: var(--a-radius-pill);
  background: var(--a-surface);
  color: var(--a-ink);
  font-size: var(--a-text-sm);
  font-weight: 800;
}

.a-chero__media { display: grid; place-items: center; min-width: 0; }

.a-chero__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--a-radius-lg);
  background: var(--a-surface);
  object-fit: cover;
}

.a-chero__glyph { width: clamp(88px, 12vw, 148px); height: auto; color: var(--t-strong); }
.a-chero.is-ink-light:not(.has-image) .a-chero__glyph,
.a-chero.is-ink-dark:not(.has-image) .a-chero__glyph { color: currentColor; }

@media (max-width: 767px) {
  .a-chero:not(.has-image) .a-chero__media { display: none; }
}

.a-ctypenav-wrap { margin-top: var(--a-space-5); }

/* ── Combo (detalle) ───────────────────────────────────────────────────── */
.a-cdetail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--a-space-6);
  margin-top: var(--a-space-2);
}

@media (min-width: 900px) {
  .a-cdetail { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--a-space-10); align-items: start; }
}

.a-cdetail__stage {
  display: grid;
  gap: var(--a-space-3);
  padding: var(--a-space-3);
  border: 1px solid var(--t-line);
  border-radius: var(--a-radius-xl);
  background: var(--t-tint);
}

.a-cdetail__media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--a-radius-lg);
  background: var(--a-paper);
}

.a-cdetail__media img { width: 100%; height: 100%; object-fit: contain; }
.a-cdetail__media .a-pcard__flags { top: 14px; left: 14px; right: 14px; }

.a-cdetail__strip,
.a-cdetail__strip:hover {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-space-2) var(--a-space-3);
  padding: var(--a-space-2) var(--a-space-4) var(--a-space-2) var(--a-space-3);
  border-radius: var(--a-radius-lg);
  background: var(--a-surface);
  color: var(--a-ink);
  text-decoration: none;
}

.a-cdetail__strip { transition: box-shadow var(--a-dur) ease; }
.a-cdetail__strip:hover { box-shadow: var(--a-shadow); }
.a-cdetail__strip:focus-visible { outline: none; box-shadow: var(--a-focus); }
.a-cdetail__strip .a-ccard__thumbs > * + * { margin-left: -10px; }

.a-cdetail__strip-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--a-text-md);
  font-weight: 800;
  white-space: nowrap;
}

.a-cdetail__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--a-space-4);
  min-width: 0;
}

.a-cdetail__title {
  font-size: var(--a-text-3xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--a-ink);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.a-cdetail__lead {
  max-width: 62ch;
  margin-top: calc(var(--a-space-2) * -1);
  font-size: var(--a-text-base);
  line-height: var(--a-leading);
  color: var(--a-ink-2);
}

.a-combo__code { font-size: var(--a-text-sm); color: var(--a-muted); }

.a-combo__until {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--a-text-md);
  font-weight: 600;
  color: var(--a-ink-2);
}

/* Bloque de precio: por separado → combo, con el ahorro */
.a-cdeal {
  display: grid;
  gap: var(--a-space-3);
  width: 100%;
  max-width: 480px;
  padding: var(--a-space-4) var(--a-space-5);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-lg);
  background: var(--a-surface);
}

.a-cdeal.is-offer { border-color: var(--a-offer-100); background: var(--a-offer-50); }
.a-cdeal .a-countdown__cell { background: var(--a-surface); }

.a-cdeal__compare { display: grid; gap: var(--a-space-2); }

.a-cdeal__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--a-space-1) var(--a-space-3);
}

.a-cdeal__row dt { font-size: var(--a-text-md); font-weight: 600; color: var(--a-ink-2); }
.a-cdeal__row s { font-size: var(--a-text-lg); font-weight: 700; color: var(--a-muted); }
.a-cdeal__row--now dt { font-weight: 800; color: var(--a-ink); }

.a-cdeal__save {
  display: flex;
  align-items: flex-start;
  gap: var(--a-space-2);
  padding: var(--a-space-2) var(--a-space-3);
  border-radius: var(--a-radius);
  background: var(--a-success-50);
  color: var(--a-success);
  font-size: var(--a-text-md);
  font-weight: 600;
  line-height: 1.35;
}

.a-cdeal__save .a-icon { flex-shrink: 0; margin-top: 1px; }
.a-cdeal__save b { font-weight: 800; }
.a-cdeal__pct { font-weight: 700; white-space: nowrap; }

.a-cdeal__regular { font-size: var(--a-text-sm); color: var(--a-muted); }

.a-cdeal__promo,
.a-cdeal__promo:hover {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--a-text-sm);
  font-weight: 700;
  color: var(--a-offer-700);
}

.a-cdeal__promo { min-width: 0; max-width: 100%; }
.a-cdeal > * { min-width: 0; }
.a-cdeal__promo .a-icon { flex-shrink: 0; }
.a-cdeal__promo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.a-cdeal__promo:hover span { text-decoration: underline; }

.a-cdetail__buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--a-space-3);
  width: 100%;
  max-width: 480px;
}

.a-cdetail__add { flex: 1 1 200px; }
.a-cdetail__wa { max-width: 480px; }

.a-cdetail__delivery {
  display: grid;
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-lg);
}

.a-cdetail__delivery li {
  display: flex;
  gap: var(--a-space-3);
  padding: var(--a-space-3) var(--a-space-4);
  font-size: var(--a-text-sm);
  line-height: 1.45;
  color: var(--a-muted);
}

.a-cdetail__delivery li + li { border-top: 1px solid var(--a-line); }
.a-cdetail__delivery .a-icon { flex-shrink: 0; margin-top: 1px; color: var(--a-brand-700); }
.a-cdetail__delivery b { display: block; font-size: var(--a-text-md); font-weight: 700; color: var(--a-ink); }

/* Qué incluye: una tarjeta por producto, cada una enlaza a su ficha */
.a-cincl__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--a-space-3);
}

.a-citem {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--a-space-4);
  padding: var(--a-space-3);
  border: 1px solid var(--a-line);
  border-radius: var(--a-radius-lg);
  background: var(--a-surface);
  transition: border-color var(--a-dur) ease, box-shadow var(--a-dur) ease;
}

@media (hover: hover) {
  .a-citem:has(.a-citem__link:hover) { border-color: var(--t-line); box-shadow: var(--a-shadow); }
  .a-citem:has(.a-citem__link:hover) .a-citem__go .a-icon { transform: translateX(3px); }
}

.a-citem:has(.a-citem__link:focus-visible) { box-shadow: var(--a-focus); }

.a-citem__media { position: relative; flex-shrink: 0; }
.a-citem__media .a-cthumb { border-radius: var(--a-radius); }

.a-citem__qty {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--a-radius-pill);
  background: var(--a-paper-ink);
  box-shadow: 0 0 0 2px var(--a-surface);
  color: var(--a-on-fill);
  font-size: var(--a-text-sm);
  font-weight: 800;
}

.a-citem__body { display: grid; gap: 4px; min-width: 0; }

.a-citem__name {
  font-size: var(--a-text-md);
  font-weight: 700;
  line-height: 1.3;
  color: var(--a-ink);
  overflow-wrap: anywhere;
}

.a-citem__link,
.a-citem__link:hover { color: var(--a-ink); text-decoration: none; }
.a-citem__link:focus-visible { box-shadow: none; }
.a-citem__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.a-citem__meta { font-size: var(--a-text-sm); color: var(--a-muted); }

.a-citem__go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--a-text-sm);
  font-weight: 700;
  color: var(--a-brand-700);
}

.a-citem__go .a-icon { transition: transform var(--a-dur) var(--a-ease-out); }

@media (prefers-reduced-motion: reduce) {
  .a-citem,
  .a-citem__go .a-icon,
  .a-cdetail__strip { transition: none; }
}
