/* ============================================
   MEGA AUTO PARTS — Cinematic Hero v2
   Apple / Porsche-inspired premium design
   ============================================ */

/* ── Base ── */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 700px;
  overflow: hidden;
  background: #000;
}

/* ── Background layers ── */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  animation: heroKenBurns 25s ease-in-out infinite alternate;
}

@keyframes heroKenBurns {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.06) translate(-0.5%, -0.5%); }
}

/* Cinematic multi-layer overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    /* Top fade — navbar bleed */
    linear-gradient(180deg,
      rgba(0,0,0,0.75) 0%,
      rgba(0,0,0,0.25) 20%,
      transparent 35%
    ),
    /* Center spotlight — keeps content readable */
    radial-gradient(ellipse 70% 50% at 50% 45%,
      rgba(0,0,0,0.3) 0%,
      rgba(0,0,0,0.55) 100%
    ),
    /* Bottom heavy fade into stats bar */
    linear-gradient(0deg,
      rgba(0,0,0,0.9) 0%,
      rgba(0,0,0,0.5) 15%,
      transparent 40%
    ),
    /* Subtle side vignettes */
    linear-gradient(90deg,
      rgba(0,0,0,0.4) 0%,
      transparent 25%,
      transparent 75%,
      rgba(0,0,0,0.4) 100%
    );
}

/* Film grain texture */
.hero-noise {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 150px;
  pointer-events: none;
}

/* Deep vignette */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  box-shadow: inset 0 0 250px 40px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Animated light sweep — premium feel */
.hero-light-sweep {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.hero-light-sweep::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 35%,
    rgba(255,255,255,0.015) 45%,
    rgba(255,255,255,0.04) 50%,
    rgba(255,255,255,0.015) 55%,
    transparent 65%,
    transparent 100%
  );
  animation: lightSweep 8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: 3s;
}

@keyframes lightSweep {
  0%   { left: -120%; }
  40%  { left: 120%; }
  100% { left: 120%; }
}

/* ── Hero container ── */
.hero-container {
  position: relative;
  z-index: 5;
  height: 100vh;
  height: 100dvh;
  min-height: 700px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 80px;
  padding-bottom: 140px;
}

/* ── Content block ── */
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 900px;
  width: 100%;
}

/* ── Staggered entrance animation ── */
.hero-anim {
  opacity: 0;
  transform: translateY(30px);
  animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Overline ── */
.hero-overline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.overline-text {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.35em;
}

.overline-dash {
  width: 32px;
  height: 1px;
  background: rgba(255,255,255,0.15);
}

/* ── Headline ── */
.hero-headline {
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(3rem, 2rem + 7vw, 8rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: #fff;
  margin: 0 0 24px;
}

.hero-headline span {
  display: block;
}

.hero-headline-accent {
  color: transparent;
  background: linear-gradient(135deg, #5B8AF7 0%, #8BAAFF 50%, #CBD9FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  padding-bottom: 0.05em;
}

/* ── Description ── */
.hero-description {
  font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1.05rem);
  color: rgba(255,255,255,0.45);
  line-height: 1.8;
  max-width: 520px;
  margin: 0 auto 32px;
  font-weight: 400;
}

/* ── Search bar ── */
.hero-search-wrap {
  width: 100%;
  max-width: 540px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

form.hero-search-bar,
div.hero-search-bar,
.hero-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 5px 5px 22px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9999px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-search-bar:focus-within {
  background: rgba(255,255,255,0.1);
  border-color: rgba(91, 138, 247, 0.4);
  box-shadow: 0 0 0 3px rgba(91, 138, 247, 0.08), 0 12px 48px rgba(0,0,0,0.4);
}

.hero-search-bar > svg {
  color: rgba(255,255,255,0.25);
  flex-shrink: 0;
}

.hero-search-bar input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 0.875rem;
  outline: none;
  padding: 12px 0;
  min-width: 0;
}

.hero-search-bar input::placeholder {
  color: rgba(255,255,255,0.25);
}

.hero-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--mega-orange, #204081);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 9999px;
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.hero-search-btn:hover {
  background: #1B3060;
  box-shadow: 0 4px 20px rgba(32, 64, 129, 0.5);
  transform: translateY(-1px);
}

.hero-search-btn svg {
  transition: transform 0.3s;
}

.hero-search-btn:hover svg {
  transform: translateX(3px);
}

/* Search tags */
.hero-search-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.hero-search-tags > span {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.hero-search-tags a {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  padding: 4px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9999px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 500;
}

.hero-search-tags a:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
}

/* ── CTA buttons ── */
.hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

/* Primary CTA */
.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  background: var(--mega-orange, #204081);
  color: #fff;
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.hero-btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.hero-btn-primary:hover::before {
  opacity: 1;
}

.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(32, 64, 129, 0.5), 0 2px 8px rgba(0,0,0,0.2);
}

.hero-btn-primary svg {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-btn-primary:hover svg {
  transform: translateX(4px);
}

/* Outline CTA */
.hero-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-btn-outline:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Ghost CTA */
.hero-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 14px 16px;
  color: rgba(255,255,255,0.4);
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.hero-btn-ghost svg {
  transition: transform 0.3s;
}

.hero-btn-ghost:hover {
  color: rgba(255,255,255,0.85);
}

.hero-btn-ghost:hover svg {
  transform: translateY(-1px);
}

/* ── Stats bar ── */
.hero-stats-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 6;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.hero-stats-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.hero-stat {
  flex: 1;
  text-align: center;
  position: relative;
}

/* Thin divider lines between stats */
.hero-stat + .hero-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.06);
}

.hero-stat-num {
  display: block;
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.6rem, 1rem + 1.5vw, 2.6rem);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero-stat-label {
  display: block;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-top: 8px;
  font-weight: 500;
}

/* ── Scroll indicator ── */
.hero-scroll-cue {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  opacity: 0;
  animation: heroReveal 0.6s ease 2.2s forwards;
}

.scroll-line-anim {
  width: 1px;
  height: 48px;
  position: relative;
  overflow: hidden;
}

.scroll-line-anim::before {
  content: '';
  position: absolute;
  top: 0;
  width: 1px;
  height: 18px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.45), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%   { top: -18px; opacity: 0; }
  30%  { opacity: 1; }
  100% { top: 48px; opacity: 0; }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
  .hero-stats-inner {
    padding: 20px var(--space-4, 1rem);
  }
  .hero-stat-num {
    font-size: clamp(1.3rem, 1rem + 1vw, 1.8rem);
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hero-container {
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 160px;
  }

  .hero-headline {
    font-size: clamp(2.6rem, 1.5rem + 6vw, 5rem);
    line-height: 0.95;
  }

  .hero-cta-row {
    flex-direction: column;
    gap: 10px;
  }

  .hero-btn-primary,
  .hero-btn-outline {
    width: 100%;
    justify-content: center;
    max-width: 320px;
  }

  .hero-btn-ghost {
    display: none;
  }

  .hero-stats-inner {
    gap: 0;
    padding: 16px var(--space-4, 1rem);
  }

  .hero-stat-num {
    font-size: 1.2rem;
  }

  .hero-stat-label {
    font-size: 0.5rem;
    letter-spacing: 0.1em;
  }

  .hero-stat + .hero-stat::before {
    height: 24px;
  }

  .hero-scroll-cue {
    display: none;
  }

  .hero-search-bar {
    width: 100%;
  }

  .hero-search-tags {
    justify-content: center;
  }

  .hero-search-btn span {
    display: none;
  }

  .hero-search-btn svg {
    display: block;
  }

  .hero-search-btn {
    padding: 10px 14px;
  }

  .hero-light-sweep {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-headline {
    font-size: clamp(2.2rem, 1rem + 6vw, 3.5rem);
  }

  .hero-stats-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 0;
  }

  .hero-stat {
    flex: 0 0 33.33%;
    padding: 8px 0;
  }

  .hero-stat + .hero-stat::before {
    display: none;
  }

  .hero-stat:nth-child(4),
  .hero-stat:nth-child(5) {
    flex: 0 0 50%;
  }

  .hero-search-bar {
    border-radius: 14px;
    padding: 4px 4px 4px 16px;
  }
}
