/**
 * Hero Slideshow — TShop
 * Migrado desde SlideshowHero.tsx (Embla Carousel) a PHP + Embla vendored + CSS.
 * Embla controla el desplazamiento del track (transform translateX); CSS
 * resuelve overlay, tipografía y el fade/slide-up del texto por slide activo.
 */

.hero-slideshow {
  position: relative;
  width: 100%;
  height: 95vh;
  /* svh: en móvil, vh incluye la barra de URL y provoca saltos de altura. */
  height: 95svh;
  overflow: hidden;
  background-color: var(--surface-container);
}

.hero-slideshow__viewport {
  height: 100%;
  overflow: hidden;
}

.hero-slideshow__container {
  display: flex;
  height: 100%;
}

.hero-slideshow__slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
}

.hero-slideshow__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-slideshow__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgb(0 0 0 / 0.6),
    rgb(0 0 0 / 0.3) 50%,
    transparent
  );
}

.hero-slideshow__content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  align-items: center;
}

/*
 * Padding lateral: las flechas ocupan hasta 5rem desde el borde (posición
 * + tamaño). Por debajo de 1440px el contenido centrado a 1280px arranca
 * pegado al borde, así que el padding debe superar esa zona para que el
 * texto nunca quede debajo de las flechas.
 */
.hero-slideshow__content-inner {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 5.5rem;
  width: 100%;
}

@media (min-width: 1440px) {
  .hero-slideshow__content-inner {
    padding-inline: 2.5rem;
  }
}

.hero-slideshow__text {
  max-width: 32rem;
  transition:
    transform 0.7s ease-out,
    opacity 0.7s ease-out;
  transform: translateY(2rem);
  opacity: 0;
}

/* Embla marca el slide seleccionado con esta clase (ver hero.js);
   equivalente a selectedIndex === index en el componente React. */
.hero-slideshow__slide.is-selected .hero-slideshow__text {
  transform: translateY(0);
  opacity: 1;
}

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

.hero-slideshow__subtitle {
  font-size: 0.875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.8);
  margin-bottom: 0.75rem;
  font-weight: 300;
  /* Las fotos de producto son claras: la sombra garantiza legibilidad
     del texto blanco aunque el degradado no alcance. */
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}

@media (min-width: 768px) {
  .hero-slideshow__subtitle {
    font-size: 1rem;
  }
}

.hero-slideshow__title {
  font-family: var(--font-headline);
  /* vmin: escala con la dimensión menor, así no revienta en landscape
     de teléfono (antes: 58px fijos en un hero de 370px de alto). */
  font-size: clamp(1.5rem, 8vmin, 4.5rem);
  font-weight: 600;
  color: #fff;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgb(0 0 0 / 0.45);
}

.hero-slideshow__title-accent {
  color: var(--primary-container);
}

.hero-slideshow__button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #fff;
  color: var(--on-background);
  padding: 0.875rem 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition:
    background-color 0.3s ease-out,
    color 0.3s ease-out;
}

.hero-slideshow__button:hover {
  background-color: var(--primary);
  color: var(--on-primary);
}

.hero-slideshow__button:hover svg {
  transform: translateX(0.25rem);
}

.hero-slideshow__button svg {
  transition: transform 0.3s ease-out;
}

.hero-slideshow__button:focus-visible {
  outline: 2px solid var(--primary-container);
  outline-offset: 3px;
}

/* Nav arrows */
.hero-slideshow__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(255 255 255 / 0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 9999px;
  color: #fff;
  cursor: pointer;
  transition:
    background-color 0.3s ease-out,
    color 0.3s ease-out;
}

.hero-slideshow__nav:hover {
  background-color: #fff;
  color: var(--on-background);
}

.hero-slideshow__nav:focus-visible {
  outline: 2px solid var(--primary-container);
  outline-offset: 3px;
}

.hero-slideshow__nav--prev {
  left: 1rem;
}

.hero-slideshow__nav--next {
  right: 1rem;
}

@media (min-width: 768px) {
  .hero-slideshow__nav--prev {
    left: 2rem;
  }
  .hero-slideshow__nav--next {
    right: 2rem;
  }
}

/* Dots */
.hero-slideshow__dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 0.625rem;
}

.hero-slideshow__dot {
  position: relative;
  height: 0.625rem;
  width: 0.625rem;
  border-radius: 9999px;
  background-color: rgb(255 255 255 / 0.4);
  border: none;
  padding: 0;
  cursor: pointer;
  transition:
    width 0.3s ease-out,
    background-color 0.3s ease-out;
}

/* Hit-area táctil de ~38px sin cambiar el tamaño visual del punto. */
.hero-slideshow__dot::after {
  content: "";
  position: absolute;
  inset: -0.875rem;
}

.hero-slideshow__dot:hover {
  background-color: rgb(255 255 255 / 0.7);
}

.hero-slideshow__dot[aria-selected="true"] {
  width: 2rem;
  background-color: #fff;
}

.hero-slideshow__dot:focus-visible {
  outline: 2px solid var(--primary-container);
  outline-offset: 2px;
}

/* ==========================================================================
   Portrait ≤1023: overlay full-bleed con imágenes art-directed
   Las variantes 9:16 (móvil) y 3:4 (tablet) del <picture> componen el
   producto en la mitad superior y dejan la franja inferior para el texto:
   el overlay vuelve a ser inmersivo sin tapar el sujeto ni dejar franja
   negra (el layout apilado anterior quedó obsoleto con estos assets).
   ========================================================================== */

@media (max-width: 1023px) and (orientation: portrait) {
  .hero-slideshow__overlay {
    background: linear-gradient(
      to top,
      rgb(0 0 0 / 0.6),
      rgb(0 0 0 / 0.25) 40%,
      transparent 65%
    );
  }

  .hero-slideshow__content {
    align-items: flex-end;
  }

  .hero-slideshow__content-inner {
    /* Bottom alto: reserva la franja de los dots. */
    padding: 0 1.25rem 4rem;
  }

  /* Sin flechas en táctil vertical: swipe + dots. */
  .hero-slideshow__nav {
    display: none;
  }
}

/* Landscape corto (teléfonos horizontales): overlay compacto. */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-slideshow__title {
    margin-bottom: 1rem;
  }

  .hero-slideshow__button {
    padding: 0.625rem 1.5rem;
  }

  .hero-slideshow__subtitle {
    margin-bottom: 0.5rem;
  }
}
