/* ═══════════════════════════════════════════════════════════════════════════
   ARNOREX e-MARKET — HERO CSS
   Cinematic Hero Banner · Cinema Mode · Slide Transitions ·
   Navigation Controls · Dots · Mobile Swipe · Desktop Infinite ·
   Product-linked Slides · Dynamic Text Overlays
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   1. HERO CONTAINER
───────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--ink-90);
  /* GPU layer for smooth animations */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Height scale up on wider screens */
@media (min-width: 480px) { .hero { height: 260px; } }
@media (min-width: 640px) { .hero { height: 300px; } }
@media (min-width: 900px) { .hero { height: 360px; } }

/* ─────────────────────────────────────────────────────────────────────────────
   2. SLIDE TRACK
───────────────────────────────────────────────────────────────────────────── */
.hero-track {
  display: flex;
  height: 100%;
  /* Hardware-accelerated transform */
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────────
   3. INDIVIDUAL SLIDE
───────────────────────────────────────────────────────────────────────────── */
.hero-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
  overflow: hidden;
}

/* Clickable slide (linked to product) */
.hero-slide.clickable {
  cursor: pointer;
}

.hero-slide.clickable:active .hero-bg {
  transform: scale(1.02);
}

/* ─────────────────────────────────────────────────────────────────────────────
   4. BACKGROUND IMAGE
───────────────────────────────────────────────────────────────────────────── */
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Subtle Ken Burns effect on active slide */
  transition: transform 8s ease, opacity 0.5s ease;
  transform: scale(1.0);
  will-change: transform;
}

/* Ken Burns — slight zoom on the active slide */
.hero-slide.active .hero-bg {
  transform: scale(1.06);
}

/* ─────────────────────────────────────────────────────────────────────────────
   5. GRADIENT OVERLAYS
───────────────────────────────────────────────────────────────────────────── */

/* Primary gradient — bottom to top (text readability) */
.hero-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(12, 12, 16, 0.88) 0%,
    rgba(12, 12, 16, 0.35) 40%,
    rgba(12, 12, 16, 0.05) 70%,
    transparent 100%
  );
  pointer-events: none;
}

/* Accent gradient — subtle brand colour bleed */
.hero-grad-accent {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(240, 165, 0, 0.08) 0%,
    transparent 60%
  );
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   6. SLIDE TEXT CONTENT
───────────────────────────────────────────────────────────────────────────── */
.hero-txt {
  position: relative;
  z-index: 2;
  padding: var(--s5) var(--s4) var(--s6);
  width: 100%;
  max-width: 600px;
  /* Cinema mode transition */
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

/* Cinema mode — text ghosts out */
.hero.cinema-mode .hero-txt {
  opacity: 0.06;
  transform: translateY(6px);
  pointer-events: none;
}

/* Text re-entry animation on cinema exit */
.hero.cinema-exit .hero-txt {
  animation: heroTextReturn 0.5s var(--ease-spring) forwards;
}

@keyframes heroTextReturn {
  from { opacity: 0.06; transform: translateY(6px); }
  to   { opacity: 1;    transform: translateY(0); }
}

/* Eyebrow label — small category or brand tag above title */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: var(--fw-black);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: var(--s2);
  opacity: 0.9;
}

/* Main slide headline */
.hero-tag {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: var(--fw-black);
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  letter-spacing: -.02em;
  /* Slide-in animation for text */
  animation: heroTagIn 0.7s var(--ease-spring) both;
}

@keyframes heroTagIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Subtitle */
.hero-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
  margin-bottom: var(--s3);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  animation: heroSubIn 0.7s 0.1s var(--ease-spring) both;
  max-width: 380px;
}

@keyframes heroSubIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Price tag on slide */
.hero-price-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--amber);
  color: var(--ink);
  font-family: var(--font-d);
  font-size: 13px;
  font-weight: var(--fw-black);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  box-shadow: var(--sh-amber);
  animation: heroTagIn 0.7s 0.15s var(--ease-spring) both;
  letter-spacing: -.01em;
}

/* CTA button on slide */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--white);
  color: var(--ink);
  font-size: 12px;
  font-weight: var(--fw-black);
  padding: 8px 16px;
  border-radius: var(--r-pill);
  margin-top: var(--s2);
  box-shadow: var(--sh2);
  transition: background var(--dur-fast),
              transform var(--dur-base) var(--ease-spring);
  animation: heroTagIn 0.7s 0.2s var(--ease-spring) both;
}

.hero-cta:hover { background: var(--amber); }
.hero-cta:active { transform: scale(.94); }

@media (min-width: 480px) {
  .hero-tag { font-size: 24px; }
  .hero-sub { font-size: 14px; }
}

@media (min-width: 640px) {
  .hero-tag { font-size: 30px; }
  .hero-txt { padding: var(--s6) var(--s6) var(--s8); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   7. NAV ARROWS (PREV / NEXT)
───────────────────────────────────────────────────────────────────────────── */
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background var(--dur-base),
              transform var(--dur-base) var(--ease-spring),
              border-color var(--dur-base);
  -webkit-tap-highlight-color: transparent;
  /* Hide on mobile by default, show on wider screens */
  opacity: 0;
  pointer-events: none;
}

/* Show nav on desktop hover */
.hero:hover .hero-nav {
  opacity: 1;
  pointer-events: auto;
}

/* Always show on larger screens */
@media (min-width: 640px) {
  .hero-nav {
    opacity: 1;
    pointer-events: auto;
    width: 40px;
    height: 40px;
  }
}

.hero-nav.prev { left: 12px; }
.hero-nav.next { right: 12px; }

.hero-nav:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.4);
}

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

.hero-nav.prev:active { transform: translateY(-50%) scale(0.88) translateX(-2px); }
.hero-nav.next:active { transform: translateY(-50%) scale(0.88) translateX(2px); }

/* ─────────────────────────────────────────────────────────────────────────────
   8. SLIDE INDICATOR DOTS
───────────────────────────────────────────────────────────────────────────── */
.hero-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 5;
}

.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.35s var(--ease-spring);
  cursor: pointer;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.hero-dot:hover {
  background: rgba(255, 255, 255, 0.65);
  transform: scale(1.2);
}

.hero-dot.on {
  background: var(--white);
  width: 22px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* ─────────────────────────────────────────────────────────────────────────────
   9. CINEMA MODE
   Text fades to ghost after 5s of inactivity.
   Returns immediately on touch/hover/click.
───────────────────────────────────────────────────────────────────────────── */

/* Cinema indicator — subtle top-right dot when active */
.hero-cinema-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 5;
  pointer-events: none;
}

.hero.cinema-mode .hero-cinema-indicator {
  opacity: 0.6;
  animation: cinemaBlink 2s ease-in-out infinite;
}

@keyframes cinemaBlink {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 0.2; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   10. HERO LOADING STATE
   Shown while Firestore slides are being fetched
───────────────────────────────────────────────────────────────────────────── */
.hero-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-90);
  z-index: 10;
}

.hero-loading-pulse {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(240, 165, 0, 0.2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─────────────────────────────────────────────────────────────────────────────
   11. PRODUCT-LINKED SLIDE BADGE
   Visual hint that a slide is tappable / linked to product
───────────────────────────────────────────────────────────────────────────── */
.hero-link-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(12, 12, 16, 0.6);
  color: var(--amber);
  font-size: 10px;
  font-weight: var(--fw-black);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  letter-spacing: .06em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(240, 165, 0, 0.3);
  z-index: 4;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   12. HERO SLIDE TRANSITION VARIANTS
───────────────────────────────────────────────────────────────────────────── */

/* Fade variant (alternative to slide) */
.hero-track.fade-mode {
  transition: none;
}

.hero-track.fade-mode .hero-slide {
  position: absolute;
  inset: 0;
  min-width: 100%;
  opacity: 0;
  transition: opacity 0.8s var(--ease-in-out);
}

.hero-track.fade-mode .hero-slide.active {
  opacity: 1;
  position: relative;
}

/* ─────────────────────────────────────────────────────────────────────────────
   13. SWIPE HINT ANIMATION
   Shown once on first load to hint at swipeable slides
───────────────────────────────────────────────────────────────────────────── */
.hero-swipe-hint {
  position: absolute;
  bottom: 36px;
  right: var(--s4);
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  font-weight: var(--fw-semi);
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: swipeHintFade 3s 2s ease-in-out forwards;
  pointer-events: none;
}

@keyframes swipeHintFade {
  0%   { opacity: 0; transform: translateX(0); }
  20%  { opacity: 1; }
  60%  { opacity: 1; transform: translateX(-6px); }
  100% { opacity: 0; transform: translateX(0); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   14. HERO SCORE OVERLAY
   For top-scoring products — show subtle glow on slide
───────────────────────────────────────────────────────────────────────────── */
.hero-slide.top-score::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(240, 165, 0, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
}

/* ─────────────────────────────────────────────────────────────────────────────
   15. RESPONSIVE REFINEMENTS
───────────────────────────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .hero-dots { bottom: var(--s4); }
  .hero-dot.on { width: 28px; }
  .hero-nav { opacity: 1; pointer-events: auto; }
}

@media (min-width: 900px) {
  .hero-txt { max-width: 520px; }
  .hero-tag { font-size: 36px; }
  .hero-sub { font-size: 16px; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   16. HERO EMPTY STATE
   Shown when no slides exist yet
───────────────────────────────────────────────────────────────────────────── */
.hero-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
  color: rgba(255,255,255,.3);
  background: linear-gradient(
    135deg,
    var(--ink-90) 0%,
    var(--ink-80) 100%
  );
}

.hero-empty-icon {
  width: 48px; height: 48px;
  border: 2px dashed rgba(255,255,255,.2);
  border-radius: var(--r);
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.2);
}

.hero-empty p {
  font-size: var(--text-xs);
  font-weight: var(--fw-semi);
  letter-spacing: .06em;
  text-transform: uppercase;
}
