﻿/* ═══════════════════════════════════════════════════
   FORD TRUCKS ICELAND — SMOOTH ANIMATIONS & EFFECTS
   ═══════════════════════════════════════════════════ */

/* ── Scroll Progress Bar ───────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  height: 3px; background: transparent; pointer-events: none;
}
.scroll-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--red) 0%, #ff5a4a 100%);
  transition: width 0.08s linear;
  box-shadow: 0 0 8px rgba(225, 37, 27, 0.5);
}

/* ── Reveal on scroll ───────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.reveal-left  { transform: translateX(-40px); }
.reveal.reveal-right { transform: translateX(40px); }
.reveal.reveal-scale { transform: scale(0.92); }
.reveal.is-visible   { opacity: 1; transform: none; }

/* Staggered children */
.reveal-stagger > * {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.15s; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.25s; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.35s; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.45s; opacity: 1; transform: none; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.55s; opacity: 1; transform: none; }

/* ── Hero parallax ───────────────────────────────────── */
.hero { background-attachment: fixed; }
@media (max-width: 980px) { .hero { background-attachment: scroll; } }

/* ── Nav animated underline ──────────────────────────── */
.main-nav a::after {
  content: '';
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--red);
  transition: right 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.main-nav a:hover::after { right: 0; }

/* ── Model card glow hover ───────────────────────────── */
.model-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.35s, box-shadow 0.35s;
}
.model-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(225,37,27,0.2), 0 0 40px rgba(225,37,27,0.06);
}
.model-card:hover .model-image img {
  transform: scale(1.06) translateY(-3px);
  transition: transform 0.55s cubic-bezier(0.22,1,0.36,1);
}

/* ── Hero stats pulse ────────────────────────────────── */
@keyframes statPulse {
  0%   { opacity: 0; transform: scale(0.6) translateY(10px); }
  60%  { transform: scale(1.08) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.hero-stats.animated dt { animation: statPulse 0.55s cubic-bezier(0.22,1,0.36,1) both; }
.hero-stats.animated div:nth-child(1) dt { animation-delay: 0.1s; }
.hero-stats.animated div:nth-child(2) dt { animation-delay: 0.22s; }
.hero-stats.animated div:nth-child(3) dt { animation-delay: 0.34s; }

/* ── Spec board slide ────────────────────────────────── */
.spec-row {
  opacity: 0; transform: translateX(-16px);
  transition: opacity 0.45s ease, transform 0.45s ease, background 0.2s;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.spec-row:last-child { border-bottom: 0; }
.spec-row:hover { background: rgba(255,255,255,0.03); }
.spec-board.in-view .spec-row:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.05s; }
.spec-board.in-view .spec-row:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.15s; }
.spec-board.in-view .spec-row:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.25s; }
.spec-board.in-view .spec-row:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.35s; }

/* ── Application grid hover ──────────────────────────── */
.application-grid article {
  transition: border-color 0.3s, transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s;
}
.application-grid article:hover { transform: translateY(-5px); box-shadow: 0 16px 48px rgba(0,0,0,0.5); }

/* ── Trust bar entrance ──────────────────────────────── */
.trust-bar > * {
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.trust-bar.in-view > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.05s; }
.trust-bar.in-view > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.12s; }
.trust-bar.in-view > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.19s; }
.trust-bar.in-view > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 0.26s; }

/* ── Stock card hover ────────────────────────────────── */
.stock-card { transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s; }
.stock-card:hover { transform: translateY(-5px); box-shadow: 0 20px 56px rgba(0,0,0,0.5), 0 0 0 1px rgba(225,37,27,0.15); }

/* ── Warranty card hover ─────────────────────────────── */
.warranty-card { transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), border-color 0.3s, box-shadow 0.3s; }
.warranty-card:hover { transform: translateY(-4px); box-shadow: 0 14px 44px rgba(0,0,0,0.45); }

/* ── Feature list hover ──────────────────────────────── */
.feature-list li { transition: background 0.2s, border-color 0.2s, transform 0.2s; cursor: default; }
.feature-list li:hover { background: rgba(225,37,27,0.08); border-left-color: var(--red); transform: translateX(4px); }

/* ── Hero content entrance ───────────────────────────── */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
.hero-content > * { animation: heroFadeUp 0.7s cubic-bezier(0.22,1,0.36,1) both; }
.hero-content .eyebrow      { animation-delay: 0.05s; }
.hero-content h1            { animation-delay: 0.15s; }
.hero-content .hero-copy    { animation-delay: 0.25s; }
.hero-content .hero-actions { animation-delay: 0.35s; }
.hero-content .hero-stats   { animation-delay: 0.45s; }

/* ── CTA pulse ───────────────────────────────────────── */
@keyframes ctaPulse {
  0%   { box-shadow: 0 0 0 0 rgba(225,37,27,0.45); }
  70%  { box-shadow: 0 0 0 12px rgba(225,37,27,0); }
  100% { box-shadow: 0 0 0 0 rgba(225,37,27,0); }
}
.header-cta { animation: ctaPulse 2.5s ease-out 2s 3; }

/* ── Modal entrance ──────────────────────────────────── */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(20px); }
  to   { opacity: 1; transform: none; }
}
.modal-overlay.is-open .modal-box { animation: modalIn 0.35s cubic-bezier(0.22,1,0.36,1); }

/* ── Hero stats glow ─────────────────────────────────── */
.hero-stats dt { text-shadow: 0 0 20px rgba(225,37,27,0.35); }

/* ── Red line entrance ───────────────────────────────── */
@keyframes accentSlide {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}
.hero::after { animation: accentSlide 0.8s cubic-bezier(0.22,1,0.36,1) 0.6s both; }

/* ── Lang button ─────────────────────────────────────── */
.lang-button { transition: color 0.2s, background 0.2s, transform 0.15s; }
.lang-button.active { transform: scale(1.05); }

/* ── Back-to-top button ─────────────────────────────── */
.back-to-top {
  position: fixed; bottom: 28px; right: 24px; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: var(--red); color: #fff;
  border: none; cursor: pointer;
  font-size: 20px; line-height: 1;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s, background 0.15s;
  box-shadow: 0 4px 20px rgba(225,37,27,0.4);
}
.back-to-top.is-visible { opacity: 1; transform: none; }
.back-to-top:hover { background: var(--red-dark); }

/* ── Stock price shimmer ────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.stock-price dd {
  font-weight: 900;
  background: linear-gradient(90deg, var(--red) 0%, #ff7a6a 40%, var(--red) 60%, var(--red) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3.5s linear infinite 2s;
}

/* ── Benefit value scale ─────────────────────────────── */
.benefit-value { display: block; transition: transform 0.3s cubic-bezier(0.22,1,0.36,1); }
.warranty-card:hover .benefit-value { transform: scale(1.06); }

/* ── Glassmorphism trust-bar ─────────────────────────── */
@supports (backdrop-filter: blur(12px)) {
  .trust-bar { background: rgba(14,18,24,0.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}

/* ── Filter button ───────────────────────────────────── */
.filter-button { position: relative; overflow: hidden; }
.filter-button::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(225,37,27,0.12);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.filter-button:hover::before { transform: scaleX(1); }

/* ── prefers-reduced-motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-stagger > *, .trust-bar > *, .spec-row { opacity: 1; transform: none; }
}
