/* =========================================================
   TURBO PIEZAS — styles communs (tokens, boutons, micro-interactions)
   ========================================================= */
:root {
  /* Charte TURBO PIEZAS : jaune industriel + anthracite */
  --navy-900: #0E1013;
  --navy-800: #16191F;
  --navy-700: #1F232B;
  --navy-600: #2A2F38;
  --brand-500: #F5A800;   /* fonds, boutons (texte foncé dessus) */
  --brand-600: #9A6700;   /* texte jaune foncé sur fond clair (contraste suffisant) */
  --brand-100: #FFF0C7;
  --brand-ink: #16191F;   /* texte posé sur le jaune */
  --blue-500: #2F6BFF;
  --blue-100: #E6EEFF;

  --bg: #F3F5FA;
  --surface: #FFFFFF;
  --surface-2: #F7F8FC;
  --border: #E4E8F1;
  --text: #0F172A;
  --text-2: #475569;
  --muted: #8592A6;

  --success: #16A34A;
  --success-bg: #E7F6EC;
  --warning: #D97706;
  --warning-bg: #FEF3DC;
  --danger: #DC2626;
  --danger-bg: #FDE8E8;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, .16);

  /* Courbe "rebond" utilisée par toutes les micro-interactions */
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Logo TURBO PIEZAS ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; line-height: 1; }
.brand-mark { width: 48px; height: 48px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.15), 0 6px 16px rgba(0,0,0,.25); transition: transform .6s var(--ease-bounce); }
.brand:hover .brand-mark { transform: rotate(-10deg) scale(1.08); }
.brand-text b { display: block; font-size: 21px; font-weight: 800; letter-spacing: .02em; font-style: italic; }
.brand-text b em { font-style: italic; color: #FFC21A; }
.brand-text small { display: block; margin-top: 5px; font-size: 10.5px; font-weight: 700; color: #FFD666; letter-spacing: .32em; text-transform: uppercase; }
.brand.dark .brand-text b em { color: var(--brand-600); }
.brand.dark { color: var(--navy-800); }
.brand.dark .brand-text small { color: var(--muted); }
/* Sélecteur de langue ES / DE */
/* Sélecteur de langue : bouton compact + menu */
.lang-switch { position: relative; display: inline-flex; color: inherit; }
.lang-switch .flag { width: 20px; height: 15px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex: none; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px 0 9px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); color: inherit; font: 600 13px var(--font); letter-spacing: .02em; cursor: pointer; transition: border-color .2s, background .2s, transform .4s var(--ease-bounce); }
.lang-btn:hover { border-color: var(--brand-500); transform: scale(1.04); }
.lang-btn .chev { opacity: .7; transition: transform .25s; }
.lang-switch.open .lang-btn .chev { transform: rotate(180deg); }
.lang-switch.light .lang-btn { background: #fff; border-color: var(--border); color: var(--navy-800); }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 80; min-width: 170px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--border); box-shadow: 0 18px 40px -12px rgba(22,25,31,.3); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .18s, transform .22s var(--ease-out); }
.lang-switch.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-menu button, .lang-switch.inline button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--navy-800); font: 500 14px var(--font); text-align: left; cursor: pointer; transition: background .15s; }
.lang-menu button:hover, .lang-switch.inline button:hover { background: var(--surface-2); }
.lang-menu button.active, .lang-switch.inline button.active { background: var(--brand-100); color: var(--brand-600); font-weight: 600; }
.lang-menu button.active::after { content: "✓"; margin-left: auto; font-weight: 700; }
.lang-switch.inline { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lang-switch.inline button { justify-content: center; padding: 8px; font-size: 13px; }
.flag { display: inline-block; vertical-align: middle; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(15,23,42,.08); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Boutons + micro-interaction (agrandissement + rebond) ---------- */
.btn {
  --btn-bg: var(--brand-500);
  --btn-fg: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px;
  border: 0; border-radius: 12px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: 14px; letter-spacing: .02em;
  cursor: pointer; white-space: nowrap;
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .45s var(--ease-bounce), box-shadow .3s ease, background-color .3s ease, color .3s ease;
}
/* reflet lumineux qui traverse le bouton au survol */
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease-out);
}
.btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 24px -8px rgba(245,168,0, .55); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.96); transition-duration: .12s; }
.btn:focus-visible { outline: 3px solid rgba(245,168,0, .45); outline-offset: 3px; }

.btn .btn-icon {
  display: grid; place-items: center;
  width: 28px; height: 28px; margin-right: -8px;
  border-radius: 8px; background: var(--brand-ink); color: var(--brand-500);
  transition: transform .45s var(--ease-bounce);
}
.btn:hover .btn-icon { transform: translateX(4px) rotate(-8deg); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-dark { --btn-bg: var(--navy-800); --btn-fg: #fff; }
.btn-dark:hover { box-shadow: 0 12px 24px -8px rgba(22,25,31, .55); }
.btn-blue { --btn-bg: var(--blue-500); --btn-fg: #fff; }
.btn-blue:hover { box-shadow: 0 12px 24px -8px rgba(47, 107, 255, .55); }
.btn-ghost { --btn-bg: var(--surface); --btn-fg: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { box-shadow: var(--shadow); }
.btn-danger { --btn-bg: var(--danger-bg); --btn-fg: var(--danger); }
.btn-danger:hover { box-shadow: 0 10px 20px -10px rgba(220, 38, 38, .5); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 10px; }
.btn.is-busy, .btn:disabled { opacity: .65; pointer-events: none; }
.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; position: relative;
  transition: transform .45s var(--ease-bounce), box-shadow .3s, background .3s;
}
.icon-btn:hover { transform: scale(1.1); box-shadow: var(--shadow); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Cartes : soulèvement au survol ---------- */
.hover-lift { transition: transform .5s var(--ease-bounce), box-shadow .4s ease; }
.hover-lift:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

/* ---------- Images : zoom doux au survol ---------- */
.hover-zoom { overflow: hidden; }
.hover-zoom img { transition: transform 1s var(--ease-out); }
.hover-zoom:hover img { transform: scale(1.08); }

/* ---------- Petit rebond (icônes) ---------- */
.hover-bounce:hover > .bounce-target,
.hover-bounce:hover .bounce-target { animation: bounce .7s var(--ease-bounce); }
@keyframes bounce {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-8px) scale(1.08); }
  55% { transform: translateY(0) scale(.96); }
  75% { transform: translateY(-3px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

/* ---------- Apparition au défilement ---------- */
/* "translate" (et non "transform") pour ne pas entrer en conflit avec les effets de survol */
.reveal { opacity: 0; translate: 0 28px; transition: opacity .8s var(--ease-out), translate .8s var(--ease-out), transform .5s var(--ease-bounce), box-shadow .4s ease, background-color .3s ease; }
.reveal.is-visible { opacity: 1; translate: 0 0; }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }

/* ---------- Formulaires ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(245,168,0, .14); }
.textarea { resize: vertical; min-height: 90px; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 44px; }

/* ---------- Badges de statut (toujours icône/point + libellé) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--blue-100); color: var(--blue-500); }
/* "En tránsito" reste orange pour ne pas se confondre avec "Entregado" (vert) */
.badge-orange { background: #FFEDE1; color: #E35D10; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 9999; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--navy-800); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in .5s var(--ease-bounce);
}
.toast svg { width: 18px; height: 18px; color: var(--brand-500); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; translate: 0 0; }
}
