.hero-carousel {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin: 0 calc(50% - 50vw) 1.75rem;
  font-family: var(--font-body);
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

html[data-theme="dark"] .hero-carousel {
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42);
}

.hero-clip-defs {
  position: absolute;
}

.hero-carousel__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  min-height: clamp(220px, 33vw, 420px);
}

.hero-carousel__track {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(2%);
  transition:
    opacity 0.85s cubic-bezier(0.32, 0.72, 0, 1),
    transform 0.85s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0s linear 0.85s;
  pointer-events: none;
  overflow: hidden;
}

.hero-carousel--fade .hero-slide {
  transform: none;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition:
    opacity 0.85s cubic-bezier(0.32, 0.72, 0, 1),
    transform 0.85s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0s;
  pointer-events: auto;
  z-index: 2;
}

.hero-slide.is-exiting {
  z-index: 1;
  opacity: 0;
  transform: translateX(-2%);
}

.hero-carousel--fade .hero-slide.is-exiting {
  transform: none;
}

.hero-slide__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-slide__media--fallback {
  background: linear-gradient(135deg, #1e3a8a, #312e81 55%, #0f172a);
}

.hero-slide__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.08);
  transition: transform 1.1s cubic-bezier(0.32, 0.72, 0, 1);
}

.hero-slide__media--hover:hover .hero-slide__bg {
  transform: scale(1.12);
}

.hero-slide__overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  opacity: var(--hero-overlay-opacity);
  pointer-events: none;
}

.hero-slide__split {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.hero-slide__zone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.hero-slide__zone--text {
  z-index: 2;
  background: var(--hero-text-bg);
  padding: clamp(1rem, 3.2vw, 2.75rem);
  justify-content: flex-start;
}

.hero-slide__zone--products {
  z-index: 1;
  background: var(--hero-products-bg);
  padding-block: clamp(0.85rem, 2vw, 1.5rem);
  padding-inline: clamp(1.25rem, 3.2vw, 2.25rem);
  justify-content: flex-end;
  box-sizing: border-box;
}

.hero-slide--products-right .hero-slide__zone--products {
  padding-left: clamp(1rem, 2.4vw, 1.65rem);
  padding-right: clamp(1.35rem, 4.2vw, 2.75rem);
}

.hero-slide--products-left .hero-slide__zone--products {
  padding-left: clamp(1.35rem, 4.2vw, 2.75rem);
  padding-right: clamp(1rem, 2.4vw, 1.65rem);
  justify-content: flex-start;
}

.hero-slide--products-right .hero-slide__zone--text {
  clip-path: url(#heroClipTextRight);
}

.hero-slide--products-right .hero-slide__zone--products {
  clip-path: url(#heroClipProdRight);
}

.hero-slide--products-left .hero-slide__zone--text {
  clip-path: url(#heroClipTextLeft);
  justify-content: flex-end;
}

.hero-slide--products-left .hero-slide__zone--products {
  clip-path: url(#heroClipProdLeft);
  justify-content: flex-start;
}

.hero-slide__zone-inner {
  transform-origin: left center;
  transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-slide--products-right .hero-slide__zone-inner--products,
.hero-slide--products-left .hero-slide__zone-inner--text {
  transform-origin: right center;
}

.hero-slide--section-hover[data-hover-zone="text"] .hero-slide__zone-inner--text,
.hero-slide--section-hover[data-hover-zone="products"] .hero-slide__zone-inner--products {
  transform: scale(1.035);
}

.hero-slide--section-hover[data-hover-zone="text"] .hero-slide__zone-inner--products,
.hero-slide--section-hover[data-hover-zone="products"] .hero-slide__zone-inner--text {
  transform: scale(0.95);
}

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

.hero-slide__zone-inner--text {
  max-width: min(36ch, 38vw);
  margin-left: clamp(0.5rem, 2vw, 2rem);
}

.hero-slide--products-left .hero-slide__zone-inner--text {
  margin-left: 0;
  margin-right: clamp(0.5rem, 2vw, 2rem);
}

.hero-slide__zone-inner--products {
  width: 54%;
  max-width: 100%;
  margin-left: auto;
  margin-right: 0;
  padding-inline: clamp(0.6rem, 1.6vw, 1.15rem);
  box-sizing: border-box;
}

.hero-slide--products-left .hero-slide__zone-inner--products {
  margin-left: 0;
  margin-right: auto;
}

.hero-slide__title {
  margin: 0 0 0.75rem;
  color: var(--hero-text-color);
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 3.15vw, 2.65rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.hero-slide__subtitle {
  margin: 0 0 clamp(1.35rem, 2.6vw, 1.9rem);
  color: var(--hero-subtitle-color);
  font-size: clamp(0.82rem, 1.35vw, 1.02rem);
  line-height: 1.45;
  max-width: 42ch;
}

.hero-slide__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.55rem 0.55rem 1.15rem;
  border-radius: 999px;
  background: var(--hero-btn-bg);
  color: var(--hero-btn-text);
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}

.hero-slide__btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.hero-slide__btn:active {
  transform: scale(0.98);
}

.hero-slide__btn-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hero-btn-text) 12%, transparent);
  font-size: 0.95rem;
  transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
}

.hero-slide__btn:hover .hero-slide__btn-icon {
  transform: translate(2px, -2px) scale(1.05);
}

.hero-slide__products {
  /* El alto del hero es 1/3 del ancho: la tarjeta escala con vw y deja ~90px para nombre y precio. */
  --hero-frame-w: calc(min(19vw, 440px) * 3 / 4);
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, var(--hero-frame-w));
  justify-content: center;
  column-gap: clamp(1rem, 1.9vw, 2.25rem);
  align-items: start;
}

.hero-product {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #fff;
  text-decoration: none;
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.hero-product--hover:hover {
  transform: translateY(-4px);
  text-decoration: none;
}

.hero-product__frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: clamp(10px, 1.2vw, 16px);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: clamp(0.45rem, 1vw, 0.75rem);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-sizing: border-box;
}

.hero-product__img-wrap {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.22));
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

.hero-product--hover:hover .hero-product__img-wrap {
  transform: scale(1.04);
}

.hero-product__img-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.hero-product__name {
  margin: 0.65rem 0 0.45rem;
  font-size: clamp(0.62rem, 0.82vw, 0.95rem);
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.hero-product__price {
  display: inline-block;
  padding: 0.26rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #c2410c;
  font-weight: 800;
  font-size: clamp(0.74rem, 0.95vw, 1.1rem);
}

.hero-slide__empty {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  margin: 0;
}

.hero-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.hero-carousel__nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.hero-carousel__nav--prev { left: 0.75rem; }
.hero-carousel__nav--next { right: 0.75rem; }

.hero-carousel__dots {
  position: absolute;
  bottom: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.35rem;
  z-index: 6;
}

.hero-carousel__dot {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s ease, background 0.3s ease;
}

.hero-carousel__dot.is-active {
  background: #fff;
  transform: scale(1.25);
}

@media (max-width: 960px) {
  .hero-carousel {
    margin-bottom: 1.25rem;
  }

  .hero-carousel__viewport {
    aspect-ratio: auto;
    min-height: 0;
  }

  .hero-slide {
    position: relative;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-height: 0;
  }

  .hero-slide.is-active {
    display: block;
  }

  .hero-carousel__track {
    position: relative;
    inset: auto;
  }

  .hero-slide__media {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 200px;
  }

  .hero-slide__bg {
    transform: scale(1.04);
  }

  .hero-slide__split {
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .hero-slide__zone--text,
  .hero-slide__zone--products {
    position: relative;
    inset: auto;
    clip-path: none !important;
    height: auto;
    transform: none !important;
  }

  .hero-slide__zone-inner--text,
  .hero-slide__zone-inner--products {
    width: 100%;
    max-width: none;
    margin: 0 !important;
    transform: none !important;
  }

  .hero-slide__zone--products {
    justify-content: center;
    padding-inline: clamp(1rem, 4.5vw, 1.75rem);
    padding-block: clamp(0.85rem, 3.2vw, 1.25rem);
  }

  .hero-slide--products-right .hero-slide__zone--products,
  .hero-slide--products-left .hero-slide__zone--products {
    padding-inline: clamp(1rem, 4.5vw, 1.75rem);
  }

  .hero-slide__zone-inner--products {
    width: 100%;
    max-width: min(300px, 100%);
    margin-inline: auto;
    padding-inline: clamp(0.35rem, 1.5vw, 0.65rem);
  }

  .hero-slide__products {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    max-width: none;
    margin-inline: 0;
  }

  .hero-slide__products .hero-product:nth-child(n + 2) {
    display: none;
  }
}

@media (min-width: 961px) and (max-width: 1199px) {
  .hero-slide__products {
    grid-template-columns: repeat(2, var(--hero-frame-w));
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  .hero-slide__products .hero-product:nth-child(3) {
    display: none;
  }
}
