/* v6: catálogo único, ofertas, ahorro por cantidad, encabezado móvil compacto y legibilidad.
   Se carga al final y ajusta las hojas anteriores sin reescribirlas. */
:root {
  --offer: #d9262c;
  --offer-soft: #fdecec;
  --saving: #0b7a4b;
  --saving-soft: #e6f5ee;
}

/* ---------- Encabezado ---------- */
.header-whatsapp {
  display: none;
}
.category-bar .offers-link {
  color: #ffb4b4;
  font-weight: 700;
}
.category-bar .offers-link.active,
.category-bar .offers-link:hover {
  color: #fff;
}

/* ---------- Distintivos de oferta y ahorro ---------- */
.offer-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 3px;
  background: var(--offer);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1.2;
}
.product-photo .offer-badge,
.offer-card-photo .offer-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.pack-saving {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 8px;
  padding: 6px 9px;
  border-radius: 4px;
  background: var(--saving-soft);
  color: var(--saving);
  font-size: 13px;
  line-height: 1.35;
}
.pack-saving .icon {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
}
.pack-saving strong {
  font-weight: 800;
}
.sku-card-price s,
.offer-card-price s,
.product-offer-line s {
  color: #6b7c86;
  font-size: 14px;
  margin-right: 6px;
}
.sku-card.is-offer .sku-card-price strong {
  color: var(--offer);
}
.offer-text {
  color: var(--offer) !important;
  font-weight: 700;
}
.sale-options-grid button .pack-saving {
  display: flex;
  margin-top: 10px;
}
.product-offer-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 15px;
  color: #34505f;
}

/* ---------- Presentaciones por metro / rollo ---------- */
.roll-presentations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}
.roll-presentations > .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}
.roll-presentations a {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 12px 14px;
  border: 1px solid #c9d8e0;
  background: #fff;
  color: #20343f;
  font-size: 14px;
  text-decoration: none;
}
.roll-presentations a:hover {
  border-color: var(--cyan);
}
.roll-presentations a[aria-current='page'] {
  border: 2px solid #1e5874;
  background: #eef6fa;
}
.roll-presentations a span {
  font-size: 16px;
  font-weight: 700;
}
.roll-presentations a small {
  color: #50656f;
  font-size: 13px;
}
.roll-presentations .pack-saving {
  justify-self: start;
}

/* ---------- Portada: ofertas ---------- */
.hero-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  font-size: 15px;
}
.hero-mode a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9fdcf2;
  font-weight: 700;
}
.hero-mode .icon {
  width: 15px;
  height: 15px;
}
.offers-section {
  padding: 56px 0 48px;
  background: linear-gradient(180deg, #fff 0%, #f2f7fa 100%);
  border-bottom: 1px solid #dbe6ec;
}
.offers-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.offers-head h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 46px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--brand-navy);
  text-transform: uppercase;
}
.offers-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.offers-controls .text-link {
  margin-left: 10px;
}
.offers-nav {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #a9c1ce;
  background: #fff;
  color: #1e4458;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.offers-nav:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.offers-nav .icon {
  width: 18px;
  height: 18px;
}
.offers-nav[data-offers='prev'] .icon {
  transform: rotate(180deg);
}
.offers-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 12px;
}
.offers-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * 18px) / 4);
  column-gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.offer-card {
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  border: 1px solid #d6e2e8;
  background: #fff;
}
.offer-card-photo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  padding: 18px;
  background: #fff;
  border-bottom: 1px solid #e3ecf0;
}
.offer-card-photo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.offer-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
  padding: 16px 16px 18px;
}
.offer-card-body .eyebrow {
  margin: 0;
}
.offer-card-name {
  color: #18303c;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.offer-card-name:hover {
  color: var(--cyan);
}
.offer-card-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 4px 0 0;
}
.offer-card-price strong {
  color: var(--offer);
  font-size: 24px;
  font-weight: 800;
}
.offer-card-price small {
  flex-basis: 100%;
  color: #50656f;
  font-size: 13px;
}
.offer-card .pack-saving {
  align-self: flex-start;
}
.offer-add {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}
.offer-card-body .offer-add {
  margin-top: 14px;
}

/* ---------- Filtros transversales ---------- */
.category-filters .virtual-filter {
  font-weight: 700;
}
.category-filters .virtual-filter[data-filter='ofertas'] {
  color: var(--offer);
}

/* ---------- Legibilidad ----------
   Piso de tamaño para textos auxiliares que en las hojas anteriores quedaban entre 7 y 11 px.
   Se usa !important solo en font-size porque esas reglas tienen selectores más específicos. */
.eyebrow,
.footer-title,
.sidebar-label,
.import-image-caption,
.gallery-import,
.builder-category-number,
.hero-photo-caption span,
.topbar strong,
.topbar span,
.footer-bottom span,
.footer-bottom button,
.quote-count,
.account-button small {
  font-size: 12px !important;
}
.topbar a,
.add-product,
.shop-breadcrumbs a,
.shop-breadcrumbs span,
.shop-breadcrumbs strong,
.catalog-source-note span,
#results-count,
.clear-filters,
.gallery-zoom,
.gallery-caption,
.sale-options-grid small,
.product-payment-note,
.product-minimum-note,
.catalog-price-note,
.summary-smallprint,
.sidebar-help p,
.builder-category small,
.builder-product-identity p,
.shop-steps li,
.product-tabs button,
.product-information-panel dt,
.product-information-panel dd,
.footer-utility a,
.site-footer a,
.site-footer p,
.mobile-quote-bar a,
.sale-options-grid span,
.price-breakdown span,
.product-information-panel p,
.summary-totals span,
.summary-totals small,
.summary-confidence strong,
.summary-confidence small,
.offers-controls span {
  font-size: 13px !important;
}
.btn,
.text-link,
.hero-link,
.category-bar a,
.category-filters button,
.account-button strong,
.builder-fields label,
.sku-quantity-heading label,
.product-price > span,
.product-price small {
  font-size: 14px !important;
}
.sku-card-price small,
.product-content .eyebrow {
  font-size: 13px;
}

@media (max-width: 1100px) {
  .offers-track {
    grid-auto-columns: calc((100% - 2 * 18px) / 3);
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 130px;
  }
  /* Encabezado compacto: marca + acciones en una fila, buscador a todo el ancho. */
  .topbar,
  .category-bar {
    display: none;
  }
  .primary-row {
    padding-block: 10px 10px;
    gap: 10px;
  }
  .brand {
    width: 124px;
  }
  .header-actions {
    gap: 4px;
  }
  .header-actions > .btn {
    display: none;
  }
  .header-whatsapp,
  .header-actions .account-button,
  .bag-button,
  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
  }
  .header-whatsapp {
    color: #7ee0a1;
  }
  .header-whatsapp .icon,
  .account-button > .icon {
    width: 22px;
    height: 22px;
  }
  .account-button > span {
    display: none;
  }
  .quote-count {
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    right: 2px;
    top: 2px;
  }
  .header-tools {
    order: 3;
    flex-basis: 100%;
  }
  .header-search {
    height: 46px;
  }
  .header-search input {
    font-size: 16px; /* evita el zoom automático de iOS al enfocar */
    padding-inline: 14px;
  }
  .header-search button {
    width: 46px;
  }
  .mobile-nav a {
    font-size: 16px;
  }
  /* Textos auxiliares legibles */
  .eyebrow {
    font-size: 11px;
  }
  .mobile-quote-bar strong {
    font-size: 14px;
  }
  .offers-section {
    padding: 36px 0 30px;
  }
  .offers-head h2 {
    font-size: 36px;
  }
  .offers-controls .text-link {
    margin-left: 0;
  }
  .offers-controls {
    width: 100%;
    flex-wrap: wrap;
  }
  .offers-track {
    grid-auto-columns: 78%;
    column-gap: 12px;
  }
  .hero-mode {
    font-size: 14px;
  }
}

/* ---------- Contraste (WCAG AA) ----------
   El cian de marca #008fc1 con texto blanco da 3,7:1; los botones usan un cian más profundo (5,0:1). */
.btn-cyan {
  background: #0077a3;
  border-color: #0077a3;
}
.btn-cyan:hover {
  background: #00628a;
  border-color: #00628a;
}
.offer-text,
.sku-card.is-offer .sku-card-price strong,
.offer-card-price strong {
  color: #c4161c !important;
}
.gallery-import,
.gallery-zoom {
  color: #46637a;
}

/* ---------- Anchos chicos ---------- */
.catalog-grid > *,
.sku-card .product-content,
.sku-card-price {
  min-width: 0;
}
.sku-card-price strong {
  overflow-wrap: anywhere;
}
@media (max-width: 1080px) {
  /* La barra superior conserva WhatsApp y el botón de arrepentimiento; el resto está en el menú y el pie. */
  .topbar a:not(.top-whatsapp):not(.top-withdrawal) {
    display: none;
  }
}
@media (max-width: 390px) {
  .sku-card-price strong {
    font-size: 17px;
  }
}
/* Textos auxiliares sobre fondos claros: tono más oscuro para llegar a 4,5:1. */
.section-heading .eyebrow,
.quick-list-inner .eyebrow,
.closing-inner .eyebrow,
.closing-inner p:not(.eyebrow),
.product-content .eyebrow {
  color: #4a6576;
}
.sku-card-price s,
.offer-card-price s,
.product-offer-line s {
  color: #5a6b75;
}

/* ---------- Presentaciones en filas compactas (29/10) ----------
   Reemplazan las tarjetas grandes: una fila por presentación con nombre, precio y ahorro. */
.sale-rows {
  display: grid;
  gap: 8px;
}
.sale-rows legend {
  font-size: 14px !important;
  color: #1e4458;
}
.sale-options .sale-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  flex-direction: row;
}
.sale-options .sale-row[aria-pressed='true']:after {
  content: none;
}
.sale-row-check {
  width: 18px;
  height: 18px;
  border: 2px solid #7e9fb2;
  border-radius: 50%;
  background: #fff;
}
.sale-row[aria-pressed='true'] .sale-row-check {
  border-color: #0077a3;
  box-shadow: inset 0 0 0 4px #fff;
  background: #0077a3;
}
.sale-options .sale-row-name {
  display: grid;
  gap: 1px;
  line-height: 1.3;
  min-width: 0;
}
.sale-options .sale-row-name strong {
  color: #18303c;
  font-size: 15px;
}
.sale-options .sale-row-name small {
  color: #4a6576;
  font-size: 13px !important;
}
.sale-options .sale-row-price {
  display: grid;
  justify-items: end;
  gap: 3px;
  line-height: 1.2;
}
.sale-options .sale-row-price b {
  color: #18303c;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}
.sale-row .pack-saving {
  display: inline-block;
  margin: 0;
  padding: 2px 7px;
  font-size: 12px !important;
  white-space: nowrap;
}

/* Ahorro en tarjetas: una línea discreta, sin recuadro. */
.pack-saving-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 6px 0 0;
  color: var(--saving);
  font-size: 13px;
  line-height: 1.35;
}
.pack-saving-line .icon {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
}

/* Aviso de stock bajo: visible junto al precio. */
.low-stock-alert {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-left: 4px solid #e08a00;
  background: #fff4e0;
  color: #7a4300;
  font-size: 14px;
  font-weight: 700;
}
.low-stock-alert::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e08a00;
}
.sku-card .low-stock-alert {
  margin: 8px 0 0;
  font-size: 12px;
  padding: 3px 8px;
}

/* Enlaces para volver: flecha hacia la izquierda y antes del texto. */
.text-link.is-back > .icon {
  order: -1;
  transform: rotate(180deg);
}

/* Factura */
.invoice-hint {
  display: block;
  margin-top: 6px;
  color: #4a6576;
  font-size: 13px;
  font-weight: 400;
}
.summary-invoice-total strong {
  font-size: 17px;
}
.pickup-note strong {
  font-weight: 700;
}

/* Encabezado en celulares angostos: todo en una fila. */
@media (max-width: 400px) {
  .main-header .wrap {
    width: calc(100% - 24px);
  }
  .brand {
    width: 104px;
  }
  .header-actions {
    gap: 0;
  }
  .header-whatsapp,
  .header-actions .account-button,
  .bag-button,
  .menu-button {
    width: 40px;
    height: 40px;
  }
}
/* Pago y comprobante: los dos campos alineados aunque uno tenga una aclaración debajo. */
.checkout-field-grid {
  align-items: start;
}
/* Pedido registrado */
.checkout-privacy {
  margin: 10px 0 0;
  color: #4a6576;
  font-size: 13px;
}
.prepared-order-id {
  font-size: 16px;
}
.prepared-order-id strong {
  letter-spacing: 0.5px;
}
