/**
 * Henny 3D — Estilos do Carrossel Promocional do Hero
 */

.hero-carousel-wrapper {
  position: relative;
  width: 100%;
  border-radius: 1.5rem;
  overflow: hidden;
  background-color: #0f172a;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.18);
}

/* Fallback estrutural para ambientes sem o runtime do Tailwind CDN. */
@media (min-width: 1024px) {
  main > section[aria-label="Apresentação dos Plugins Henny 3D"] > .max-w-7xl {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 2rem;
    align-items: center;
  }

  #hero-copy { grid-column: span 5 / span 5; }
  #hero-carousel-column { grid-column: span 7 / span 7; }
}

@media (max-width: 1023px) {
  #hero-carousel-column { margin-top: 0; }
}

.hero-carousel-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1.5rem;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1), visibility 600ms;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.hero-slide-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  cursor: pointer;
  outline: none;
}

.hero-slide-link:focus-visible {
  box-shadow: inset 0 0 0 4px #2563eb;
  border-radius: 1.5rem;
}

.hero-slide-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 1.5rem;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
  image-rendering: high-quality;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  outline: 1px solid transparent;
}

.hero-slide-cta {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 4;
  display: none;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(2, 15, 27, 0.82);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  box-shadow: 0 0.35rem 1rem rgba(2, 15, 27, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Controles de Navegação (Setas) */
.hero-carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 250ms ease, visibility 250ms ease, background-color 200ms ease, transform 200ms ease;
}

.hero-carousel-wrapper:hover .hero-carousel-nav-btn,
.hero-carousel-wrapper:focus-within .hero-carousel-nav-btn {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hero-carousel-nav-btn:hover {
  background: rgba(15, 23, 42, 0.9);
  transform: translateY(-50%) scale(1.06);
}

.hero-carousel-nav-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.hero-carousel-nav-btn:focus-visible {
  opacity: 1;
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

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

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

/* Barra inferior de indicadores: visível somente durante interação */
.hero-carousel-bar {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.35rem);
  transition: opacity 250ms ease, visibility 250ms ease, transform 250ms ease;
}

.hero-carousel-wrapper:hover .hero-carousel-bar,
.hero-carousel-wrapper:focus-within .hero-carousel-bar {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hero-carousel-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: auto;
}

.hero-carousel-touch-hint {
  display: none;
  align-items: center;
  min-height: 1.35rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.58);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.025em;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-carousel-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 250ms ease;
}

.hero-carousel-dot.active {
  width: 1.5rem;
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.hero-carousel-dot:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

@media (max-width: 1023px) {
  .hero-carousel-bar {
    bottom: 0.5rem;
    flex-direction: column;
    gap: 0.3rem;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .hero-carousel-touch-hint,
  .hero-slide-cta {
    display: inline-flex;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .home-hero-section {
    padding-block: 3rem;
  }

  .home-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 1.5rem;
    align-items: center;
  }

  #hero-copy,
  #hero-carousel-column {
    min-width: 0;
  }

  #hero-title {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 4vw, 2.5rem);
  }

  #hero-description {
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
  }

  .hero-actions {
    flex-direction: column !important;
    gap: 0.55rem !important;
  }

  #hero-secondary-cta {
    padding-block: 0.7rem;
  }
}

@media (max-width: 640px) {
  .home-hero-section {
    padding-block: 2rem 2.25rem;
  }

  .home-hero-grid {
    gap: 1.5rem;
  }

  .home-hero-section #hero-copy > span {
    margin-bottom: 1rem;
  }

  #hero-title {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 9.5vw, 2.45rem);
  }

  #hero-description {
    margin-bottom: 1.25rem;
  }

  .hero-actions {
    gap: 0.3rem !important;
  }

  #hero-primary-cta {
    padding-block: 0.9rem;
  }

  #hero-secondary-cta {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.75rem;
    background: transparent;
    color: #475569;
    box-shadow: none;
  }

  #hero-secondary-cta::after {
    margin-left: 0.35rem;
    content: '\2192';
  }

  .hero-carousel-stage {
    aspect-ratio: 16 / 9;
  }

  .hero-slide-media {
    object-fit: contain;
  }
}

/* Acessibilidade: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    transition: none !important;
  }
  .hero-carousel-nav-btn,
  .hero-carousel-dot {
    transition: none !important;
  }
}
