/* ==========================================================================
   Sección "Escaparate de productos" — se dibuja con js/products-section.js
   Medidas del original: banda blanca a 40px de los bordes, título de 30px,
   6 productos por fila con borde fino, precio en morado y botones morados.
   ========================================================================== */

.products {
  --products-bg: #fff;
  --products-cols: 6;
  --products-cols-tablet: 3;
  --products-cols-mobile: 2;
  --products-border: #e6e6e6;
  --products-price: #751fff;

  padding: 0 40px 44px;
}

.products[hidden] { display: none; }

.products__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 66px 60px 68px;
  background: var(--products-bg);
}

/* font_5 del original: Avenir Heavy 30px */
.products__title {
  margin: 0 0 58px;
  font-size: 30px;
  font-weight: 700;
  line-height: normal;
  text-align: center;
}

/* Rejilla con bordes de 1px compartidos entre tarjetas */
.products__grid {
  display: grid;
  grid-template-columns: repeat(var(--products-cols), minmax(0, 1fr));
  width: 100%;
  max-width: 1400px;
  border-top: 1px solid var(--products-border);
  border-left: 1px solid var(--products-border);
}

.products__item {
  border-right: 1px solid var(--products-border);
  border-bottom: 1px solid var(--products-border);
}
.products__item[hidden] { display: none; }

.products__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.products__media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f4f4f4;
}

.products__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease, opacity .4s ease;
}
.products__card:hover .products__img { transform: scale(1.04); }

/* Foto de poca resolución: a su tamaño real como máximo, centrada sobre blanco */
.products__img--small { object-fit: scale-down; background: #fff; }

/* Segunda foto al pasar el ratón */
.products__img--hover { opacity: 0; }
.products__card.has-hover:hover .products__img--hover { opacity: 1; }

.products__ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  background: #d72d2d;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}
.products__ribbon--soldout { background: #525252; }

.products__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 15px 20px;
}

.products__name {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  transition: color .3s ease;
}
.products__card:hover .products__name { color: var(--products-price); }

.products__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.products__price {
  color: var(--products-price);
  font-size: 19px;
  font-weight: 300;
  line-height: 1.3;
}

.products__old-price {
  color: #949494;
  font-size: 15px;
  font-weight: 300;
}

.products__card:focus-visible { outline: 2px solid var(--products-price); outline-offset: -2px; }

/* Botones: "Cargar más" (308×44 en el original) y "Ver todo" (264×50) */
.products__more {
  min-width: 308px;
  height: 44px;
  margin-top: 26px;
}
.products__more[hidden] { display: none; }

.products__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 64px;
}
.products__buttons .cms-btn { min-width: 264px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .products { padding: 0 24px 32px; }
  .products__box { padding: 56px 32px; }
  .products__title { margin-bottom: 40px; }
  .products__grid { grid-template-columns: repeat(var(--products-cols-tablet), minmax(0, 1fr)); }
  .products__buttons { margin-top: 40px; }
}

@media (max-width: 700px) {
  .products { padding: 0 0 16px; }
  .products__box { padding: 44px 16px 48px; }
  .products__title { margin-bottom: 28px; font-size: 24px; }
  .products__grid { grid-template-columns: repeat(var(--products-cols-mobile), minmax(0, 1fr)); }
  .products__info { padding: 12px 10px 14px; gap: 4px; }
  .products__name { font-size: 14px; }
  .products__price { font-size: 16px; }
  .products__more { min-width: 0; width: 100%; max-width: 308px; }
  .products__buttons { margin-top: 28px; width: 100%; }
  .products__buttons .cms-btn { min-width: 0; width: 100%; max-width: 308px; }
}

@media (prefers-reduced-motion: reduce) {
  .products__img { transition: none; }
}
