/* ================================================================
   ELIOR ENERGY · INICIO
   Estilos que SOLO usa la página de inicio (carrusel, categorías, marcas, carruseles de producto,
   «Nuestra empresa», servicios…). La base, el encabezado, el buscador, el menú y el pie
   son globales: ver compartido/layout-global.css (se carga antes que esta hoja).
   ================================================================ */

/* La posición horizontal se calcula en JavaScript según el espacio visible. */

/* ---------------------- CARRUSEL ---------------------- */
.carousel {
  position: relative;
  overflow: hidden;
  background: var(--prussian-soft);
}

.carousel__slide[hidden] {
  display: none;
}

.carousel__arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(0, 119, 150, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--prussian-soft);
  cursor: pointer;
  transform: translateY(-50%);
  transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.carousel__arrow:hover,
.carousel__arrow:focus-visible {
  border-color: var(--prussian-soft);
  background: var(--bg);
  outline: none;
  transform: translateY(-50%);
}

.carousel__arrow--previous {
  left: 16px;
}

.carousel__arrow--next {
  right: 16px;
}

.carousel__dots {
  position: absolute;
  z-index: 4;
  bottom: 17px;
  left: 50%;
  display: flex;
  transform: translateX(-50%);
}

/* Cada punto mide 8 px, pero el botón que se toca mide 20 × 24 px (relleno transparente; el color solo pinta el centro): objetivo táctil mínimo de WCAG 2.5.8. */
.carousel__dots button {
  box-sizing: border-box;
  width: 20px;
  height: 24px;
  padding: 8px 6px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  background-clip: content-box;
  cursor: pointer;
}

.carousel__dots button.is-active {
  width: 37px;
  border-radius: 12px;
  background: var(--bg);
  background-clip: content-box;
}

/* --------------------- CATEGORÍAS --------------------- */
/* Densidad (2026-10-13): las secciones de Inicio son tarjetas compactas (antes 34–48 px de relleno, esquinas de 24 px y títulos de 36–62 px: la primera pantalla
   era casi un solo título). Las escalas vienen de compartido/paleta-global.css. */
.categories-section {
  margin: 20px auto 20px;
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.section-heading h2,
.quote-section h2 {
  margin: 0;
  color: var(--prussian);
  font-size: var(--title-section);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-heading > p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.category-showcase {
  position: relative;
}

.category-showcase__arrow {
  display: none;
}

.category-card {
  display: grid;
  min-height: 118px;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: var(--radius-md);
  padding: 12px;
  background: linear-gradient(150deg, #05476f 0%, var(--azure) 100%);
  box-shadow: 0 10px 20px -16px rgb(0 49 83 / 70%);
  color: var(--bg);
  transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}

.category-card:hover {
  box-shadow: 0 16px 26px -16px rgb(0 49 83 / 80%);
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.category-card__media {
  display: grid;
  min-height: 62px;
  place-items: center;
  padding: 1px 4px 6px;
}

.category-card__media img {
  width: 100%;
  height: 100%;
  max-height: 72px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 15px 13px rgba(0, 0, 0, 0.28));
  transition: transform 0.25s ease;
}
/* Foto rectangular (no un ícono recortado como las demás categorías): a la
   misma altura máxima se ve angosta, así que necesita algo más de espacio. */
.category-card__media img[src*="Material_Electrico_Cat"] {
  max-height: 84px;
}

.category-card__media.is-empty::after {
  content: "Imagen por agregar";
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 600;
}

.category-card__media.is-empty img {
  display: none;
}

.category-card__name {
  min-height: 20px;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.category-card--offer {
  background: linear-gradient(150deg, #1c2b3a 0%, var(--ink) 100%);
}

/* --------------------- COTIZACIÓN --------------------- */
.quote-section {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.quote-section > img {
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
}

.quote-section__content {
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(20px, 3vw, 32px);
}

.quote-section__content > span {
  max-width: 510px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.quote-section__content > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ---------------------- RESPONSIVE --------------------- */
@media (max-width: 1099px) and (min-width: 901px) {
  .category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .category-showcase {
    padding-inline: 34px;
  }
  .category-showcase__arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    color: var(--prussian-soft);
    cursor: pointer;
    transform: translateY(-50%);
    transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease;
  }
  .category-showcase__arrow:hover,
.category-showcase__arrow:focus-visible {
    border-color: var(--prussian-soft);
    background: var(--surface);
    outline: none;
    transform: translateY(-50%);
  }
  .category-showcase__arrow--previous { left: -4px; }
  .category-showcase__arrow--next { right: -4px; }
  .category-grid {
    grid-template-columns: none;
    grid-template-rows: repeat(3, 136px);
    grid-auto-columns: calc((100% - 24px) / 3);
    grid-auto-flow: column;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 10px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .category-grid::-webkit-scrollbar { display: none; }
  .category-card {
    min-height: 0;
    scroll-snap-align: start;
  }
  .quote-section {
    grid-template-columns: 1fr;
  }
  .quote-section > img {
    max-height: 280px;
  }
}

@media (max-width: 680px) {
  .carousel__arrow {
    top: 180px;
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
  .carousel__dots {
    bottom: 12px;
  }
  .section-heading {
    align-items: start;
    flex-direction: column;
  }
  .categories-section {
    padding: 16px 12px;
  }
  .category-showcase { padding-inline: 28px; }
  .category-grid {
    grid-template-columns: none;
    grid-template-rows: repeat(2, 130px);
    grid-auto-columns: calc((100% - 10px) / 2);
    grid-auto-flow: column;
    gap: 10px;
  }
  .category-card {
    min-height: 0;
    padding: 13px;
  }
  .category-card__media {
    min-height: 82px;
  }
  .category-card__name {
    font-size: 14px;
  }
  .quote-section__content {
    padding: 32px 24px;
  }
}

/* ---------------- BANNER PROMOCIONAL COMPACTO ----------------
   Las imágenes entregadas son cuadradas/casi cuadradas. Se usa
   object-fit: contain para que cada producto se vea entero, sin estirarlo. */
.carousel {
  padding: 22px 0 12px;
  background: var(--surface);
}

.carousel__track {
  width: min(100% - 48px, 1180px);
  margin: 0 auto;
}

.carousel__arrow {
  top: calc(50% + 5px);
  background: rgba(255, 255, 255, 0.9);
}

.carousel__dots {
  bottom: 20px;
}

@media (max-width: 680px) {
  .carousel {
    padding-top: 14px;
  }

  .carousel__track {
    width: min(100% - 28px, 1180px);
  }

  .carousel__arrow {
    display: none;
  }
}

/* ------------------- CATEGORÍAS Y MARCAS ------------------- */
/* El título queda como único encabezado, centrado sobre la cuadrícula. */
.section-heading--centered {
  display: block;
  margin-bottom: 16px;
  text-align: center;
}

.section-heading--centered .eyebrow,
.section-heading--centered > p {
  display: none;
}

/* Degradado BASE de la marca para los títulos de sección (--title-gradient: del azul Prusia al verde fresco; estático: es el que ve quien reduce el movimiento). Sin soporte de recorte del fondo
   en el texto, quedan en azul Prusia sólido. Los títulos de página usan la misma técnica (.page-title en layout-global.css). */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .title-gradient-text {
    width: fit-content;
    max-width: 100%;
    background-image: var(--title-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

/* Los títulos de sección de Inicio fluyen igual que el título de página: la MISMA baldosa cíclica (--title-gradient-flow) y los MISMOS fotogramas (title-gradient-drift, definidos
   en layout-global.css): 14 s por vuelta en 168 pasos (12 repintados por segundo), siempre en el mismo sentido y sin salto al repetirse. Solo con prefers-reduced-motion: no-preference (si no, queda el degradado
   estático de arriba). Solo anima background-position: cero layouts, cero CLS. Son cinco títulos en toda la página y el navegador no repinta los que están fuera de pantalla. */
@media (prefers-reduced-motion: no-preference) {
  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .title-gradient-text {
      background-image: var(--title-gradient-flow);
      background-size: 200% 100%;
      animation: title-gradient-drift 14s steps(168, end) infinite;
    }
  }
}

/* Títulos de sección: escala común (--title-section, 22 → 30 px) y el degradado de la marca (.title-gradient-text, justo arriba); sin soporte de recorte del
   fondo en el texto quedan en azul Prusia sólido. */
.section-heading--centered h2,
.content-section-heading h2 {
  color: var(--prussian);
}

.section-heading--centered h2 {
  margin-inline: auto;
}

.brands-section {
  padding: 0 0 24px;
}

.brands-section h2 {
  display: block;
  width: fit-content;
  max-width: 690px;
  margin: 0 auto 14px;
  color: var(--prussian);
  font-size: var(--title-section);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
  text-wrap: balance;
}

.brands-carousel {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

/**
 * Columna fija explícita para cada hijo: con columnas implícitas, ocultar la
 * flecha izquierda (display:none, ver updateBrandsLoopMode en inicio.js)
 * hace que el grid reubique a los elementos visibles restantes en las
 * primeras columnas — el viewport terminaba encogido en la columna de 46px
 * de la flecha en vez de la columna central. Fijar la columna de cada uno
 * evita que la visibilidad de sus hermanos afecte su tamaño.
 */
.brands-carousel .slider-arrow--previous {
  grid-column: 1;
}

.brands-carousel__viewport {
  grid-column: 2;
  overflow: hidden;
  scrollbar-width: none;
}

.brands-carousel .slider-arrow--next {
  grid-column: 3;
}

.brands-carousel__viewport::-webkit-scrollbar,
.product-slider::-webkit-scrollbar {
  display: none;
}

.brands-carousel__track {
  display: flex;
  width: max-content;
  padding: 8px 4px;
}

/**
 * Aplicada por inicio.js (updateBrandsLoopMode) cuando las marcas reales no
 * alcanzan a desbordar el viewport: sin esto, un track angosto quedaría
 * pegado a la izquierda en vez de centrado.
 */
.brands-carousel__track--static {
  width: 100%;
  justify-content: center;
}

.brands-carousel__group {
  display: flex;
  gap: clamp(13px, 2vw, 24px);
  padding-right: clamp(13px, 2vw, 24px);
}

.brand-logo {
  display: grid;
  flex: 0 0 clamp(116px, 12vw, 148px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--prussian-soft);
  border-radius: 50%;
  background: var(--bg);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.brand-logo img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

/* Logo con sitio web oficial: el enlace ocupa todo el círculo (el área pulsable es la del logo) y muestra el foco de teclado. */
.brand-logo__link {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 50%;
}

.brand-logo__link:focus-visible {
  outline: 3px solid var(--prussian-soft);
  outline-offset: 3px;
}

.brand-logo:hover {
  border-color: var(--prussian);
}

/**
 * .slider-arrow define su propio "display" con especificidad normal, así que
 * gana sobre el [hidden] nativo del navegador (un author-rule normal siempre
 * gana sobre la UA stylesheet, sin importar el orden). Sin esto, ocultar las
 * flechas del carrusel de marcas por JS (updateBrandsLoopMode) no tenía
 * ningún efecto visual.
 */
.slider-arrow[hidden] {
  display: none;
}

/* ----------------- PRODUCTOS: MÁS VENDIDOS + VISTOS RECIENTEMENTE ----------------- */
/* Un solo bloque con tarjetas compactas (imagen de 128 px, marca, nombre, precio y dos acciones pequeñas; antes 340 px de alto con dos botones lima a todo el ancho).
   «Productos más vendidos» ocupa el ancho completo y, cuando la persona ya vio fichas y aceptó las cookies funcionales, «Vistos recientemente» ocupa una columna lateral
   (inicio.js añade `.has-recent`); en tableta y móvil se apilan. Cuántas tarjetas caben por página lo decide productos-inicio.js según el ancho REAL de la lista (--per-page). */
.home-products {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0 auto 20px;
}

.home-products.has-recent {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
}

.products-section {
  min-width: 0;
  margin: 0;
  padding: clamp(14px, 1.6vw, 20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.content-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.content-section-heading h2 {
  margin: 0;
  font-size: var(--title-section);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.content-section-heading--centered {
  justify-content: center;
  text-align: center;
}

.content-section-heading__tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* La columna lateral es angosta: su título es más pequeño que el de la sección principal para no partirse en dos líneas. */
.products-section--recent .content-section-heading h2 {
  font-size: clamp(19px, 0.4vw + 16px, 22px);
}

.section-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--azure);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.section-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section-link:focus-visible {
  outline: 2px solid var(--azure-bright);
  outline-offset: 3px;
  border-radius: 3px;
}

.slider-arrow {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--prussian-soft);
  line-height: 1;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.slider-arrow svg,
.carousel__arrow svg,
.category-showcase__arrow svg,
.home-product-card__image-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.slider-arrow:hover,
.slider-arrow:focus-visible {
  border-color: var(--prussian-soft);
  background: var(--surface);
  outline: none;
}

.product-slider-shell {
  position: relative;
}

/* Los controles viven sobre el carrusel, a la altura del centro de la imagen (128 px): no compiten con el título. */
.product-slider__control {
  position: absolute;
  z-index: 2;
  top: 68px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgb(0 49 83 / 16%);
  border-radius: 50%;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 6px 14px -8px rgb(0 49 83 / 55%);
  color: var(--prussian-soft);
  cursor: pointer;
  opacity: 0.8;
  transform: translateY(-50%);
  transition: opacity 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.product-slider__control[hidden] {
  display: none;
}

.product-slider__control svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.product-slider__control--previous { left: -14px; }

.product-slider__control--next { right: -14px; }

.product-slider-shell:hover .product-slider__control,
.product-slider__control:focus-visible {
  opacity: 1;
}

.product-slider__control:hover,
.product-slider__control:focus-visible {
  border-color: var(--azure-bright);
  background: #fff;
  color: var(--azure);
  outline: none;
}

.product-slider__control:disabled {
  cursor: default;
  opacity: 0.3;
  pointer-events: none;
}

.product-slider::-webkit-scrollbar {
  display: none;
}

.product-slider {
  display: grid;
  grid-template-columns: repeat(var(--per-page, 3), minmax(0, 1fr));
  gap: 12px;
  overflow: hidden;
  padding: 3px 2px 6px;
  transition: opacity 110ms ease, transform 110ms ease;
}

.product-page-status {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.home-product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.product-slider.is-page-transitioning[data-page-direction="next"] .home-product-card {
  animation: product-page-enters-next 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--page-card-delay, 0ms);
}

.product-slider.is-page-transitioning[data-page-direction="previous"] .home-product-card {
  animation: product-page-enters-previous 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--page-card-delay, 0ms);
}

/* Antes de dibujar la página siguiente se atenúa brevemente la anterior.
   El cambio comunica desplazamiento sin el salto brusco del scroll nativo. */
.product-slider.is-page-leaving[data-page-direction="next"] {
  opacity: 0;
  transform: translateX(-8px);
}

.product-slider.is-page-leaving[data-page-direction="previous"] {
  opacity: 0;
  transform: translateX(8px);
}

.home-product-card:hover {
  border-color: color-mix(in srgb, var(--azure-bright) 50%, var(--border));
  box-shadow: 0 12px 24px -18px rgb(0 49 83 / 60%);
  transform: translateY(-2px);
}

.home-product-card__media {
  position: relative;
  display: grid;
  height: 128px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.home-product-card__image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.home-product-card__image {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
  opacity: 1;
  transition: opacity 160ms ease, transform 300ms ease;
}

.home-product-card__image.is-changing {
  opacity: 0;
}

/* Descuento: pastilla azul Prusia (el lima queda para las acciones). */
.home-product-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--prussian);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
}

/* Producto destacado sin imagen (o con una imagen que ya no carga): recuadro controlado, la tarjeta conserva su tamaño. */
.home-product-card__media.is-empty .home-product-card__image-link::after {
  content: "Sin imagen";
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 600;
}

.home-product-card__media.is-empty .home-product-card__image {
  display: none;
}

/* Flechas de la galería: esquinas inferiores de la imagen, discretas (aparecen al pasar el cursor; siempre visibles en pantallas táctiles). */
.home-product-card__image-arrow {
  position: absolute;
  bottom: 6px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 94%);
  color: var(--prussian-soft);
  cursor: pointer;
  opacity: 0;
  transition: opacity 180ms ease, background 180ms ease;
}

.home-product-card__image-arrow[hidden] {
  display: none;
}

.home-product-card__image-arrow svg {
  width: 16px;
  height: 16px;
}

.home-product-card__image-arrow--previous { left: 8px; }

.home-product-card__image-arrow--next { right: 8px; }

.home-product-card:hover .home-product-card__image-arrow,
.home-product-card__image-arrow:focus-visible {
  opacity: 1;
}

.home-product-card__image-arrow:hover,
.home-product-card__image-arrow:focus-visible {
  background: #fff;
  color: var(--azure);
  outline: none;
}

.home-product-card__details {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 10px 12px 12px;
}

.home-product-card__brand {
  margin: 0 0 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-product-card h3 {
  display: -webkit-box;
  min-height: 2.56em;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-product-card h3 a {
  color: var(--ink);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.home-product-card h3 a:hover {
  color: var(--azure);
}

.home-product-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 6px 0 0;
}

.home-product-card__price strong {
  color: var(--prussian);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.home-product-card__price s {
  color: var(--muted);
  font-size: 12px;
}

.home-product-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
}

.home-product-card__action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.home-product-card__action svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* «Ver producto»: contorno azul (secundaria); «Agregar»: el único relleno lima, contenido (la acción principal). */
.home-product-card__action--buy {
  border-color: var(--prussian);
  background: transparent;
  color: var(--prussian);
}

.home-product-card__action--buy:hover,
.home-product-card__action--buy:focus-visible {
  background: var(--prussian);
  color: #fff;
  outline: none;
}

.home-product-card__action--cart {
  border-color: var(--lime-edge);
  background: var(--lime-fill);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 50%);
  color: #14240a;
}

.home-product-card__action--cart:hover,
.home-product-card__action--cart:focus-visible {
  background: var(--lime-fill-hover);
  outline: none;
}

.home-product-card__action:focus-visible {
  outline: 2px solid var(--azure-bright);
  outline-offset: 2px;
}

.home-product-card__action--cart.is-added {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.home-product-card__action:disabled {
  cursor: progress;
  opacity: 0.7;
}

.home-product-card__note {
  margin: 0;
  min-height: 0;
  padding-top: 6px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.35;
}

.home-product-card__note:empty {
  display: none;
}

/* Vistos recientemente: lista compacta (miniatura, nombre y precio actual). */
.recent-products {
  display: grid;
  gap: 8px;
}

.recent-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.recent-item:hover,
.recent-item:focus-visible {
  border-color: color-mix(in srgb, var(--azure-bright) 50%, var(--border));
  box-shadow: 0 10px 20px -16px rgb(0 49 83 / 60%);
  outline: none;
}

.recent-item:focus-visible {
  outline: 2px solid var(--azure-bright);
  outline-offset: 2px;
}

.recent-item__media {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
}

.recent-item__media img {
  width: 100%;
  height: 100%;
  padding: 4px;
  object-fit: contain;
}

.recent-item__text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.recent-item__name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.recent-item__price {
  color: var(--prussian);
  font-size: 13px;
  font-weight: 800;
}

/* Tableta y móvil: «Vistos recientemente» pasa debajo y su lista se reparte en columnas. */
@media (max-width: 1023px) {
  .home-products.has-recent {
    grid-template-columns: minmax(0, 1fr);
  }

  .recent-products {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}

/* ------------------- NUESTRA EMPRESA ------------------- */
.about-section {
  position: relative;
  overflow: hidden;
  margin: 0 0 104px;
  padding: clamp(70px, 9vw, 128px) 0;
  background: var(--surface);
  color: var(--ink);
}

.about-section::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  width: 42%;
  height: 100%;
  background: var(--surface);
  content: "";
}

.about-section__grid {
  display: grid;
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(260px, 0.8fr) minmax(440px, 1.2fr);
  grid-template-areas:
    "header media"
    "note media";
  align-items: center;
  column-gap: clamp(38px, 7vw, 110px);
  row-gap: 46px;
}

.about-section__header {
  grid-area: header;
  align-self: end;
}

.about-section__header h2 {
  max-width: 420px;
  margin: 8px 0 18px;
  color: var(--ink);
  font-size: clamp(45px, 5vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

.about-section__header > p:not(.eyebrow) {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.about-section__media {
  grid-area: media;
  margin: 0;
  overflow: hidden;
  border-top: 5px solid var(--prussian-soft);
  background: var(--bg);
}

.about-section__media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.about-section__note {
  grid-area: note;
  max-width: 390px;
  padding: 0 0 0 24px;
  border-left: 3px solid var(--prussian-soft);
}

.about-section__years {
  display: block;
  color: var(--prussian-soft);
  font-size: clamp(58px, 6vw, 86px);
  font-weight: 800;
  line-height: 0.78;
  letter-spacing: -0.08em;
}

.about-section__years-label {
  display: block;
  margin: 9px 0 20px;
  color: var(--prussian-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.about-section__note > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  color: var(--prussian-soft);
  font-weight: 800;
}

.text-link span {
  display: inline-block;
  transition: transform 180ms ease;
}

.text-link:hover span,
.text-link:focus-visible span {
  transform: translateX(5px);
}

.text-link--light {
  color: var(--bg);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(-64px);
  transition: opacity 700ms ease, transform 850ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.about-section__media.reveal-on-scroll {
  transition-delay: 100ms;
}

.about-section__note.reveal-on-scroll {
  transition-delay: 210ms;
}

/* ----------------------- SERVICIOS ----------------------- */
.services-section {
  padding-bottom: 100px;
}

.services-heading {
  max-width: 760px;
  margin: 0 0 52px;
}

.services-heading h2 {
  margin: 8px 0 18px;
  color: var(--ink);
  font-size: clamp(45px, 5.8vw, 78px);
  line-height: 0.93;
  letter-spacing: -0.075em;
}

.services-heading > p:not(.eyebrow) {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.services-stack {
  overflow: hidden;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.service-card {
  display: grid;
  grid-template-columns: minmax(290px, 0.92fr) minmax(0, 1.08fr);
  align-items: stretch;
  min-height: 370px;
  background: var(--bg);
}

.service-card + .service-card {
  border-top: 1px solid var(--border);
}

.service-card--reverse .service-card__video {
  grid-column: 2;
}

.service-card--reverse .service-card__content {
  grid-row: 1;
  grid-column: 1;
}

.service-card__video {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  background: var(--ink);
}

.service-card__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.service-card__content {
  display: grid;
  align-content: center;
  padding: clamp(34px, 5vw, 74px);
}

.service-card h3 {
  max-width: 540px;
  margin: 0 0 18px;
  color: var(--ink);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.service-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.66;
}

.service-card .text-link {
  margin-top: 26px;
}

.services-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(28px, 4vw, 46px);
  border-top: 1px solid var(--border);
  background: var(--prussian-soft);
  color: var(--bg);
}

.services-cta .eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.85);
}

.services-cta h3 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(28px, 3.4vw, 45px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.services-cta__button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  padding: 15px 21px;
  border-radius: 9px;
  background: var(--bg);
  color: var(--prussian-soft);
  font-weight: 850;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.services-cta__button span {
  transition: transform 180ms ease;
}

.services-cta__button:hover,
.services-cta__button:focus-visible {
  outline: none;
}

.services-cta__button:hover span,
.services-cta__button:focus-visible span {
  transform: translateX(4px);
}

.site-footer__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 52px;
  padding: clamp(26px, 4vw, 42px);
  border-radius: 0;
  background: var(--prussian-soft);
  color: var(--bg);
}

.site-footer__intro p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.site-footer__intro h2 {
  max-width: 650px;
  margin: 0;
  color: var(--bg);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.site-footer__intro a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  color: var(--bg);
  font-weight: 800;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-footer__intro a:hover,
.site-footer__intro a:focus-visible {
  outline: none;
  background: var(--bg);
  color: var(--prussian-soft);
}

@media (max-width: 680px) {
  .section-heading--centered {
    margin-bottom: 12px;
  }

  .brands-section {
    padding-bottom: 20px;
  }

  .brands-section h2 {
    margin-bottom: 12px;
  }

  .brand-logo {
    flex-basis: 104px;
  }

  .brands-carousel {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .brands-carousel .slider-arrow {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .products-section {
    padding: 14px 12px;
  }

  .product-slider__control {
    width: 34px;
    height: 34px;
    opacity: 0.94;
  }

  .product-slider__control--previous { left: -6px; }
  .product-slider__control--next { right: -6px; }

  .content-section-heading {
    gap: 10px;
  }

  /* Dos tarjetas por página en el celular: los botones van uno sobre otro para que quepan sus textos, y las flechas de la galería siempre a la vista. */
  .home-product-card__actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-product-card__image-arrow {
    opacity: 1;
  }

  .about-section {
    margin-bottom: 68px;
  }

  .about-section__grid {
    grid-template-areas:
      "header"
      "media"
      "note";
    grid-template-columns: 1fr;
  }

  .about-section__grid {
    gap: 30px;
  }

  .about-section__header h2 {
    font-size: clamp(47px, 14vw, 62px);
  }

  .service-card {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .service-card--reverse .service-card__video,
.service-card--reverse .service-card__content {
    grid-column: auto;
    grid-row: auto;
  }

  .service-card__video {
    min-height: 210px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-heading--centered h2,
.content-section-heading h2,
.brand-logo,
.home-product-card,
.home-product-card__image,
.reveal-on-scroll,
.text-link span {
    animation: none;
    transition: none;
  }
}

@keyframes product-page-enters-next {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes product-page-enters-previous {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ------------------- CARRUSEL: PAUSAR LA ROTACIÓN (WCAG 2.2.2) ------------------- */
.carousel__pause {
  position: absolute;
  z-index: 4;
  right: 16px;
  bottom: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(0, 119, 150, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--prussian-soft);
  cursor: pointer;
}

.carousel__pause[hidden] {
  display: none;
}

.carousel__pause:hover,
.carousel__pause:focus-visible {
  border-color: var(--prussian-soft);
  background: var(--bg);
}

.carousel__pause:focus-visible {
  outline: 2px solid var(--prussian-soft);
  outline-offset: 2px;
}

.carousel__pause svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carousel__pause[data-state="playing"] .carousel__pause-icon--play,
.carousel__pause[data-state="paused"] .carousel__pause-icon--pause {
  display: none;
}
