/* ===== HERO SECTION - Banner principal ===== */

.hero-section {
  position: relative;
  margin-top: 1.5rem;
  border-radius: 1rem;
  overflow: hidden;
  background-color: #f5f8fa;
}

/* Banner de inicio (imagen completa con copy integrado) */
.hero-section--banner {
  display: block;
  min-height: 0;
}

.hero-section--banner .layout-edge--hero {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
}

.hero-banner-link {
  display: block;
  line-height: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(18, 42, 62, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(18, 42, 62, 0.16);
}

.hero-banner-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center center;
}

/* ===== Hero en rebanadas (hero-inicio) — carga por lotes ===== */
.hero-slices-link {
  display: block;
}

.hero-slices {
  --hs-cols: 5px 438fr 1px 122fr 463fr;
  --hs-rows: 128fr 2fr 167fr 316fr 1fr 68fr;
  display: grid;
  grid-template-columns: var(--hs-cols);
  grid-template-rows: var(--hs-rows);
  grid-template-areas:
    "s01 s01 s01 s01 s02"
    "s03 s03 s04 s04 s02"
    "s03 s03 s05 s05 s02"
    "sp  s06 s06 s07 s07"
    "sp  s06 s06 s08 s08"
    "sp  s09 s09 s09 s09";
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  aspect-ratio: 1024 / 683;
  background:
    linear-gradient(135deg, #e8f2f8 0%, #f7fafc 45%, #dfeaf2 100%);
  overflow: hidden;
  line-height: 0;
}

.hero-slice {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  transition: opacity 220ms ease;
  background: transparent;
}

.hero-slice.is-loaded,
.hero-slice[data-hero-batch="1"] {
  opacity: 1;
}

.hero-slice--s01 { grid-area: s01; }
.hero-slice--s02 { grid-area: s02; }
.hero-slice--s03 { grid-area: s03; }
.hero-slice--s04 { grid-area: s04; }
.hero-slice--s05 { grid-area: s05; }
.hero-slice--s06 { grid-area: s06; }
.hero-slice--s07 { grid-area: s07; }
.hero-slice--s08 { grid-area: s08; }
.hero-slice--s09 { grid-area: s09; }

.hero-slices--booting .hero-slice[data-hero-batch="2"],
.hero-slices--booting .hero-slice[data-hero-batch="3"] {
  opacity: 0;
}

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

/* Layout legacy (fondo + dos columnas) — conservado por si se reutiliza */
.hero-section:not(.hero-section--banner) {
  --hero-bg-image: url('/images/hero-inicio.jpg');
  min-height: 560px;
  display: flex;
  align-items: center;
  background-color: #2d4a62;
  background-image: var(--hero-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero-section--banner::before {
  display: none;
}

/* Capa sobre la foto: oscuro a la izquierda (texto), claro a la derecha (carrusel) */
.hero-section:not(.hero-section--banner)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    102deg,
    rgba(18, 42, 62, 0.92) 0%,
    rgba(22, 48, 70, 0.82) 32%,
    rgba(40, 72, 95, 0.45) 48%,
    rgba(255, 255, 255, 0.72) 62%,
    rgba(255, 255, 255, 0.9) 78%,
    rgba(255, 255, 255, 0.94) 100%
  );
}

.hero-section .container,
.hero-section .layout-edge--hero {
  position: relative;
  z-index: 2;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
}

/* Contenedor de dos columnas */
.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 520px;
}

/* Columna izquierda: texto (panel sutil para contraste extra) */
.hero-text {
  flex: 0 1 52%;
  max-width: 560px;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  background: rgba(12, 32, 48, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Etiqueta superior (ej. NOVEDADES) */
.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0.5rem;
}

/* Título del hero (h2): mensaje de venta, por debajo de la marca h1 del header */
.hero-section .hero-title {
  font-size: clamp(1.05rem, 2.5vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  margin-bottom: 1rem;
  color: #fff;
}

.hero-title-line1 {
  color: #ffffff;
  display: block;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero-title-line2 {
  color: #a8dce0;
  display: block;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Párrafo descriptivo */
.hero-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 420px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}

/* Botón CTA */
.hero-cta {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a3d52;
  background-color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 0.25rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-cta:hover {
  background-color: #e8f4f6;
  color: #0f2a3d;
  border-color: #e8f4f6;
  transform: translateY(-1px);
}

/* Columna derecha: slide de imágenes (más grande) */
.hero-image-wrap {
  flex: 0 1 55%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 1rem 0;
}

.hero-image-wrap .hero-carousel {
  flex-shrink: 0;
}

/* Carrusel del hero */
.hero-carousel {
  width: 100%;
  max-width: 100%;
  position: relative;
}

.hero-carousel .carousel-inner {
  border-radius: 0.5rem;
  width: 100%;
  overflow: hidden;
}

/* Cada item ocupa todo el ancho; solo el activo se muestra (no pisar display de Bootstrap en inactivos) */
.hero-carousel .carousel-item {
  min-height: 480px;
  width: 100%;
  background: transparent;
  transition: transform 0.5s ease-in-out;
}

.hero-carousel .carousel-item.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-product-img {
  max-width: 100%;
  width: 100%;
  max-height: 520px;
  height: auto;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.08));
}

/* Controles del carrusel (flechas) */
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
  width: 48px;
  height: 48px;
  top: 50%;
  transform: translateY(-50%);
  bottom: auto;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  opacity: 1;
  transition: background 0.2s ease;
}

.hero-carousel .carousel-control-prev {
  left: -12px;
}

.hero-carousel .carousel-control-next {
  right: -12px;
}

.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover {
  background: rgba(0, 0, 0, 0.2);
}

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
  width: 24px;
  height: 24px;
}

/* Indicadores (puntos) del carrusel */
.hero-carousel .carousel-indicators {
  margin-bottom: 0.5rem;
}

.hero-carousel .carousel-indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.35);
}

.hero-carousel .carousel-indicators .active {
  background-color: #609ba0;
}

/* Responsive: apilar en móvil */
@media (max-width: 991px) {
  .hero-section--banner {
    margin-top: 1rem;
    border-radius: 0.75rem;
  }

  .hero-section--banner .layout-edge--hero {
    gap: 0.5rem;
  }

  .hero-section:not(.hero-section--banner)::before {
    background: linear-gradient(
      180deg,
      rgba(18, 42, 62, 0.9) 0%,
      rgba(22, 48, 70, 0.82) 28%,
      rgba(255, 255, 255, 0.88) 52%,
      rgba(255, 255, 255, 0.94) 100%
    );
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
    min-height: auto;
    padding: 2rem 0;
  }

  .hero-text {
    max-width: 100%;
    background: rgba(12, 32, 48, 0.5);
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-image-wrap {
    justify-content: flex-start;
    order: -1;
    max-width: 100%;
  }

  .hero-carousel .carousel-item {
    min-height: 340px;
  }

  .hero-product-img {
    max-height: 320px;
    object-position: center;
  }

  .hero-carousel .carousel-control-prev {
    left: 4px;
  }

  .hero-carousel .carousel-control-next {
    right: 4px;
  }
}

@media (max-width: 576px) {
  .hero-section {
    min-height: auto;
  }

  .hero-inner {
    min-height: auto;
  }

  .hero-section .hero-title {
    font-size: 1.2rem;
  }

  .hero-carousel .carousel-item {
    min-height: 260px;
  }

  .hero-product-img {
    max-height: 240px;
  }
}

/* Optimizado para móviles ~430px (ej. iPhone 14 Pro Max, Galaxy S21) */
@media (max-width: 430px) {
  .hero-section--banner {
    margin-top: 0.75rem;
    border-radius: 0.5rem;
  }

  .hero-banner-link {
    border-radius: 0.5rem;
  }

  .hero-section:not(.hero-section--banner) {
    min-height: auto;
    margin-top: 0.75rem;
    border-radius: 0.5rem;
    padding: 0.5rem 0;
  }

  .hero-section .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hero-inner {
    gap: 1rem;
    padding: 1rem 0;
  }

  .hero-text {
    padding: 0 0.25rem;
  }

  .hero-eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    margin-bottom: 0.25rem;
  }

  .hero-section .hero-title {
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }

  .hero-desc {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
  }

  .hero-cta {
    padding: 0.65rem 1.25rem;
    font-size: 0.7rem;
  }

  .hero-image-wrap {
    padding: 0.5rem 0;
  }

  .hero-carousel .carousel-item {
    min-height: 200px;
  }

  .hero-product-img {
    max-height: 200px;
  }

  .hero-carousel .carousel-control-prev,
  .hero-carousel .carousel-control-next {
    width: 36px;
    height: 36px;
  }

  .hero-carousel .carousel-control-prev-icon,
  .hero-carousel .carousel-control-next-icon {
    width: 18px;
    height: 18px;
  }

  .hero-carousel .carousel-control-prev {
    left: 2px;
  }

  .hero-carousel .carousel-control-next {
    right: 2px;
  }

  .hero-carousel .carousel-indicators {
    margin-bottom: 0.25rem;
  }

  .hero-carousel .carousel-indicators [data-bs-target] {
    width: 6px;
    height: 6px;
  }
}
