/**
 * hero.css — Enterprise Store Hero Carousel
 * Full-viewport banner slider with gradient overlays and animated text.
 */

/* =============================================
   SECTION WRAPPER
============================================= */

.hero {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--navbar-height));
  min-height: 540px;
  max-height: 820px;
  overflow: hidden;
  background-color: var(--color-bg-dark);
}

/* =============================================
   SLIDER
============================================= */

.hero__slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.7s var(--ease-in-out);
  will-change: transform;
}

/* =============================================
   INDIVIDUAL SLIDE
============================================= */

.hero__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.hero__slide-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  transition: transform 8s ease;
}

.hero__slide-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  z-index: 0;
  transition: transform 8s ease, opacity 0.6s ease;
}

/* Subtle Ken Burns on active slide */
.hero__slide.active .hero__slide-bg {
  transform: scale(1.04);
}

.hero__slide.active .hero__slide-bg-img {
  transform: scale(1.06);
  opacity: 0.48;
}

.hero__illustration-img {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-xl);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
  transition: transform 0.6s var(--ease-out);
}

.hero__slide.active .hero__illustration-img {
  transform: scale(1.03);
}

/* Overlay gradient for text readability */
.hero__slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to right,
      rgba(0, 0, 0, 0.55) 0%,
      rgba(0, 0, 0, 0.20) 60%,
      rgba(0, 0, 0, 0.05) 100%);
}

/* Image-only banner slide styling */
.hero__slide--image-only .hero__slide-overlay {
  background: transparent;
}

.hero__slide--image-only .hero__slide-bg-img {
  opacity: 1;
}

.hero__slide--image-only.active .hero__slide-bg-img {
  opacity: 1;
}

.hero__slide--image-only .hero__illustration {
  display: none;
}

/* =============================================
   SLIDE CONTENT
============================================= */

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-12);
}

.hero__text {
  max-width: 560px;
}

/* Slide-in animation for text on active slide */
.hero__slide.active .hero__eyebrow,
.hero__slide.active .hero__title,
.hero__slide.active .hero__subtitle,
.hero__slide.active .hero__cta-group {
  animation: slideUp 0.7s var(--ease-out) both;
}

.hero__slide.active .hero__eyebrow {
  animation-delay: 0.1s;
}

.hero__slide.active .hero__title {
  animation-delay: 0.2s;
}

.hero__slide.active .hero__subtitle {
  animation-delay: 0.3s;
}

.hero__slide.active .hero__cta-group {
  animation-delay: 0.4s;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--space-4);
  opacity: 0;
}

.hero__eyebrow-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: currentColor;
  flex-shrink: 0;
}

.hero__title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl));
  font-weight: var(--font-extrabold);
  color: var(--color-text-inverse);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-5);
  letter-spacing: var(--tracking-tight);
  opacity: 0;
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.80);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
  max-width: 460px;
  opacity: 0;
}

/* ─── Badge ──── */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  color: var(--color-text-inverse);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  backdrop-filter: blur(8px);
  margin-bottom: var(--space-5);
}

.hero__badge-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ─── CTA Group ──── */
.hero__cta-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  opacity: 0;
}

/* ─── Illustration side ──── */
.hero__illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero__illustration-inner {
  width: 360px;
  height: 360px;
  border-radius: var(--radius-3xl);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Animated ring behind illustration */
.hero__illustration-ring {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: float 4s ease-in-out infinite;
}

.hero__illustration-ring:nth-child(2) {
  width: 320px;
  height: 320px;
  animation-delay: -2s;
  border-color: rgba(255, 255, 255, 0.12);
}

/* SVG illustration placeholder */
.hero__illustration-svg {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 220px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease 0.5s, transform 0.6s var(--ease-spring) 0.5s;
}

.hero__slide.active .hero__illustration-svg {
  opacity: 1;
  transform: scale(1);
}

/* =============================================
   NAVIGATION ARROWS
============================================= */

.hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-raised);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: var(--color-text-inverse);
  cursor: pointer;
  transition: var(--transition-base);
}

.hero__arrow svg {
  width: 20px;
  height: 20px;
}

.hero__arrow:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.08);
}

.hero__arrow--prev {
  left: var(--space-6);
}

.hero__arrow--next {
  right: var(--space-6);
}

/* =============================================
   DOTS INDICATOR
============================================= */

.hero__dots {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-raised);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.35);
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  padding: 0;
}

.hero__dot.active {
  width: 28px;
  background-color: var(--color-text-inverse);
  border-radius: var(--radius-full);
}

.hero__dot:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.65);
}

/* =============================================
   PROGRESS BAR
============================================= */

.hero__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.1);
  z-index: var(--z-raised);
}

.hero__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent-500), var(--color-primary-400));
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: width 0.1s linear;
  width: 0%;
}

/* =============================================
   RESPONSIVE
============================================= */

@media (max-width: 1024px) {
  .hero__content {
    grid-template-columns: 1fr;
  }

  .hero__illustration {
    display: none;
  }

  .hero__text {
    max-width: 100%;
    text-align: center;
  }

  .hero__subtitle {
    max-width: 100%;
  }

  .hero__cta-group {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .hero {
    background-color: var(--color-bg-secondary);
    padding-inline: var(--container-padding-mobile);
    padding-block: var(--space-4);
    max-width: var(--container-max-width);
    margin-inline: auto;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: unset;
    max-height: unset;
    overflow: visible;
  }

  .hero__slider {
    position: relative;
    width: 100%;
    height: 310px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background-color: var(--color-bg-dark);
  }

  /* Rich product photography filling the standardized Vivo V80 reference frame */
  .hero__slide-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background-color: #080e1c;
  }

  .hero__slide-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
    z-index: 1;
  }

  /* Fill complete banner frame without blank areas or distortion */
  .hero__slide-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 1;
    filter: contrast(1.03) saturate(1.05);
    transition: opacity 0.5s ease;
  }

  /* Prevent zoom scaling on mobile to preserve frame consistency */
  .hero__slide.active .hero__slide-bg-img,
  .hero__slide-bg-img {
    opacity: 1;
    transform: none !important;
  }

  .hero__slide.active .hero__slide-bg,
  .hero__slide-bg {
    transform: none !important;
  }

  /* Balanced vignette overlay: ensures text readability without washing out product image */
  .hero__slide-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg,
        rgba(8, 14, 28, 0.52) 0%,
        rgba(8, 14, 28, 0.28) 45%,
        rgba(8, 14, 28, 0.68) 100%);
    pointer-events: none;
  }

  /* Image-only slides get clear view with full visibility */
  .hero__slide--image-only .hero__slide-overlay {
    background: transparent !important;
  }

  .hero__slide--image-only .hero__slide-bg::after {
    display: none !important;
  }

  .hero__slide--image-only .hero__slide-bg-img {
    opacity: 1 !important;
    object-fit: cover !important;
    object-position: center center !important;
    filter: none !important;
  }

  /* Safe container width with gutters to prevent arrow overlap */
  .hero__content {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    height: 100%;
    padding-inline: clamp(36px, 9.5vw, 44px);
    padding-top: var(--space-2);
    padding-bottom: calc(var(--space-4) + 10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }

  .hero__text {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero__badge {
    padding: 2.5px 9px;
    font-size: 10px;
    font-weight: var(--font-semibold);
    margin-bottom: 4px;
    gap: 4px;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  }

  .hero__badge-icon {
    width: 11px;
    height: 11px;
  }

  .hero__eyebrow {
    font-size: 9.5px;
    font-weight: var(--font-semibold);
    margin-bottom: 2px;
    gap: 4px;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  }

  /* Responsive typography with natural wrapping */
  .hero__title {
    font-size: clamp(1.12rem, 4.4vw, 1.35rem);
    line-height: 1.15;
    margin-bottom: 4px;
    overflow-wrap: break-word;
    word-break: normal;
    text-align: center;
    max-width: 100%;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.6);
  }

  .hero__subtitle {
    font-size: clamp(10.5px, 2.7vw, 11.5px);
    line-height: 1.25;
    margin-bottom: 8px;
    max-width: 280px;
    margin-inline: auto;
    text-align: center;
    overflow-wrap: break-word;
    word-break: normal;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  }

  /* CTA buttons parity: exact width, height, border radius and spacing */
  .hero__cta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 220px;
    margin-inline: auto;
    gap: 5px;
    box-sizing: border-box;
  }

  .hero__cta-group .btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 var(--space-4) !important;
    font-size: 11px !important;
    font-weight: var(--font-semibold) !important;
    border-radius: var(--radius-lg) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    gap: 6px !important;
    white-space: nowrap !important;
    letter-spacing: 0.02em !important;
    text-decoration: none !important;
  }

  .hero__cta-group .btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
  }

  /* Compact navigation arrows outside content safe-zone */
  .hero__arrow {
    width: 28px;
    height: 28px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.28);
  }

  .hero__arrow svg {
    width: 12px;
    height: 12px;
  }

  .hero__arrow--prev {
    left: 4px;
  }

  .hero__arrow--next {
    right: 4px;
  }

  /* Carousel indicators consistently positioned */
  .hero__dots {
    bottom: 6px;
    gap: 4px;
    z-index: var(--z-raised);
  }

  .hero__dot {
    width: 5px;
    height: 5px;
  }

  .hero__dot.active {
    width: 16px;
    height: 5px;
  }

  .hero__progress {
    height: 2px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-inline: var(--container-padding-mobile);
    padding-block: var(--space-4);
  }

  .hero__slider {
    height: 250px;
  }

  .hero__subtitle {
    max-width: 260px;
  }

  .hero__cta-group {
    max-width: 210px;
  }
}

@media (max-width: 360px) {
  .hero {
    padding-inline: var(--space-2);
  }

  .hero__slider {
    height: 245px;
  }

  .hero__content {
    padding-inline: 30px;
    padding-top: var(--space-1);
    padding-bottom: calc(var(--space-2) + 10px);
  }

  .hero__title {
    font-size: 1.02rem;
    line-height: 1.14;
    margin-bottom: 2px;
  }

  .hero__subtitle {
    font-size: 10px;
    line-height: 1.2;
    margin-bottom: 6px;
    max-width: 210px;
  }

  .hero__cta-group {
    max-width: 185px;
    gap: 4px;
  }

  .hero__cta-group .btn {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    font-size: 10px !important;
    padding: 0 8px !important;
  }

  .hero__arrow {
    width: 24px;
    height: 24px;
  }

  .hero__arrow svg {
    width: 10px;
    height: 10px;
  }

  .hero__arrow--prev {
    left: 2px;
  }

  .hero__arrow--next {
    right: 2px;
  }
}