/* ============================================
   CUSTOM CSS - Global Tack Express
   Couche visuelle + animations
   ============================================ */

:root {
  --brand: #0a4ab8;
  --brand-dark: #062a78;
  --accent: #f46a0a;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[x-cloak] { display: none !important; }
body { top: 0px !important; }
.skiptranslate iframe { visibility: hidden !important; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: linear-gradient(#4c85f0, #0a4ab8); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #08399a; }

/* ---------- Transitions ciblées (remplace le "* { transition: all }" qui ralentissait tout) ---------- */
a, button, input, textarea, select, img, .card-lift {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity, filter;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

::selection { background: #0a4ab8; color: #fff; }

/* ---------- Barre de progression de scroll ---------- */
#scrollProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, #0a4ab8, #4c85f0, #f46a0a);
  z-index: 10000; transition: width 0.1s linear;
}

/* ---------- Preloader ---------- */
#preloader { transition: opacity 0.5s ease, visibility 0.5s ease; }
.loader-ring {
  position: absolute; inset: -10px; border-radius: 9999px;
  border: 3px solid transparent; border-top-color: #0a4ab8; border-right-color: #4c85f0;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-bar { width: 160px; height: 4px; background: #e2e8f0; border-radius: 9999px; overflow: hidden; margin: 1.25rem auto 0; }
.loader-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, #0a4ab8, #4c85f0); border-radius: 9999px; animation: loadbar 1.2s ease-in-out infinite; }
@keyframes loadbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ---------- Header collant en verre ---------- */
#siteHeader { position: sticky; top: 0; z-index: 60; transition: box-shadow 0.3s ease, transform 0.4s var(--ease-out); }
#siteHeader .topbar { transition: margin-top 0.4s var(--ease-out), opacity 0.3s ease; }
#siteHeader.is-scrolled { box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.25); }
#siteHeader.is-scrolled .topbar { margin-top: -40px; opacity: 0; pointer-events: none; }
#siteHeader nav { background: rgba(255, 255, 255, 0.85); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); }

/* Soulignement animé des liens du menu */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 50%; bottom: -2px; height: 2px; width: 0;
  background: linear-gradient(90deg, #0a4ab8, #4c85f0); transform: translateX(-50%);
  transition: width 0.35s var(--ease-out); border-radius: 2px;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* ---------- Apparition au scroll ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); will-change: opacity, transform; }
.reveal.from-left { transform: translateX(-60px); }
.reveal.from-right { transform: translateX(60px); }
.reveal.zoom { transform: scale(0.9); }
.reveal.in-view { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Cartes : relief + brillance ---------- */
.card-lift { position: relative; }
.card-lift:hover { transform: translateY(-8px); box-shadow: 0 25px 50px -12px rgba(10, 74, 184, 0.25); }
.card-lift::before {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg); pointer-events: none; z-index: 5;
}
.card-lift:hover::before { left: 140%; transition: left 0.9s ease; }
.group:hover .bg-cover { transform: scale(1.08); }
.bg-cover { transition: transform 0.8s var(--ease-out); }

/* Icônes qui flottent */
.float-y { animation: floatY 4s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.pulse-ring { position: relative; }
.pulse-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 9999px;
  box-shadow: 0 0 0 0 rgba(10, 74, 184, 0.5); animation: pulseRing 2.4s infinite;
}
@keyframes pulseRing { 70% { box-shadow: 0 0 0 18px rgba(10, 74, 184, 0); } 100% { box-shadow: 0 0 0 0 rgba(10, 74, 184, 0); } }

/* ---------- Boutons ---------- */
.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
}
.btn-shine:hover::after { left: 130%; transition: left 0.7s ease; }
.btn-shine:active { transform: scale(0.97); }

/* ---------- Texte dégradé ---------- */
.text-gradient {
  background: linear-gradient(90deg, #8cb2ff, #ffffff, #ff8527, #ffb347, #8cb2ff); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: gradientMove 6s linear infinite;
}
@keyframes gradientMove { to { background-position: 300% 0; } }

/* ---------- Hero ---------- */
.hero-zoom { animation: kenburns 14s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
.hero-blob { position: absolute; border-radius: 9999px; filter: blur(70px); opacity: 0.35; pointer-events: none; animation: blob 12s ease-in-out infinite alternate; }
@keyframes blob { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, -30px) scale(1.25); } }

/* ---------- Défilement infini des partenaires ---------- */
.marquee { overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Champs de formulaire ---------- */
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 4px rgba(10, 74, 184, 0.15); outline: none; }

/* ---------- Bouton retour haut ---------- */
#backToTop:hover { transform: translateY(-4px) scale(1.08); }

/* ---------- Leaflet (tracking-result) ---------- */
#shipment_map { position: relative !important; overflow: hidden; border-radius: 0.5rem; }
.leaflet-container { position: absolute !important; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; }
.leaflet-pane { z-index: 1; }

/* ---------- Accessibilité : réduire les animations ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
