/* =========================================================
   CAROUSEL — Galería de fotos de viandas
   ---------------------------------------------------------
   Estructura (la arma js/render.js → galleryCard):

   .product--gallery        → la tarjeta (mismo tamaño que las demás)
     .gallery               → contenedor del carrusel
       .gallery__track      → "pista" con las fotos una al lado de la otra
         .gallery__slide    → cada foto + su texto (.gallery__caption)
       .gallery__head       → título arriba, sobre la foto
       .gallery__arrow      → flechas ‹ ›
       .gallery__dots       → puntitos (uno por foto)

   El movimiento automático lo hace js/carousel.js.
   ========================================================= */

/* La tarjeta: sin fondo blanco, la foto ocupa todo */
.product--gallery {
  min-height: 420px;
  border: 0;
  background: var(--c-dark);
  box-shadow: var(--shadow);
}
.product--gallery:hover { transform: none; }

.gallery {
  position: relative;
  flex: 1;
  display: flex;
  overflow: hidden;
  border-radius: inherit;
}

/* Pista: se desliza de costado. scroll-snap = siempre frena en una foto */
.gallery__track {
  display: flex;
  flex: 1;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;            /* oculta la barra de scroll (Firefox) */
  -webkit-overflow-scrolling: touch;
}
.gallery__track::-webkit-scrollbar { display: none; } /* (Chrome, Safari) */
.gallery__track:focus-visible { outline: 3px solid var(--c-green); outline-offset: -3px; }

.gallery__slide {
  position: relative;
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: start;
}
.gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Texto de cada foto, abajo, sobre un degradé oscuro para que se lea */
.gallery__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 48px 18px 38px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent);
}

/* Título de la tarjeta, arriba */
.gallery__head {
  position: absolute;
  inset: 0 0 auto 0;
  padding: 18px 18px 40px;
  pointer-events: none;           /* deja tocar la foto de abajo */
  background: linear-gradient(to bottom, rgba(0, 0, 0, .6), transparent);
}
.gallery__head .product__tagline { color: #8BD66F; }
.gallery__head .product__name { color: #fff; }

/* Flechas redondas a los costados */
.gallery__arrow {
  position: absolute;
  top: 50%;
  width: 38px; height: 38px;
  display: grid; place-content: center;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--c-title);
  background: rgba(255, 255, 255, .85);
  box-shadow: var(--shadow-sm);
  transform: translateY(-50%);
  opacity: 0;                     /* aparecen al pasar el mouse (en compu) */
  transition: opacity var(--t-fast), background var(--t-fast);
}
.gallery__arrow--prev { left: 10px; }
.gallery__arrow--next { right: 10px; }
.gallery:hover .gallery__arrow,
.gallery__arrow:focus-visible { opacity: 1; }
.gallery__arrow:hover { background: #fff; }

/* Puntitos: el activo se estira y se pone verde */
.gallery__dots {
  position: absolute;
  left: 0; right: 0; bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.gallery__dot {
  width: 8px; height: 8px;
  padding: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, .55);
  transition: width var(--t) var(--ease), background var(--t);
}
.gallery__dot.is-active { width: 22px; background: var(--c-green); }

/* En pantallas táctiles no hay "mouse encima": las flechas no hacen falta */
@media (hover: none) {
  .gallery__arrow { display: none; }
}
