/* APT — Auto Pièces Techniques — feuille de style du site vitrine.
   Un seul fichier, servi tel quel : tokens du design system APT (_ds) + règles
   globales + classes de composants + points de rupture responsive.
   Les valeurs de mise en page vivent en styles inline dans les pages (repris
   fidèlement du prototype de design) ; ce fichier porte les tokens, les états
   (survol, focus), le responsive et les composants ajoutés en production
   (bandeau cookies, consentement carte, états du formulaire). */

/* ============================= Tokens (_ds) ============================= */
:root {
  /* Couleurs de marque */
  --apt-anthracite: #1c1f21;
  --apt-gold: #e7a33a;
  --apt-blanc: #f5f3ed;

  /* Rampe anthracite */
  --apt-anthracite-900: #141618;
  --apt-anthracite-800: #1c1f21;
  --apt-anthracite-700: #24282b;
  --apt-anthracite-600: #2f3438;
  --apt-anthracite-500: #40474c;
  --apt-anthracite-400: #5b6469;
  --apt-anthracite-300: #838d92;

  /* Rampe blanc / neutre chaud */
  --apt-blanc-pure: #ffffff;
  --apt-blanc-100: #f5f3ed;
  --apt-blanc-200: #ece8de;
  --apt-blanc-300: #ded8c9;
  --apt-blanc-400: #c9c1ad;

  /* Rampe or (accent, à doser) */
  --apt-gold-600: #c9862a;
  --apt-gold-500: #e7a33a;
  --apt-gold-400: #efb85f;
  --apt-gold-100: #f7e6c4;

  /* Statuts (discrets) */
  --apt-success: #4f7a52;
  --apt-danger:  #b4432f;
  --apt-info:    #46707d;

  /* Surfaces */
  --surface-base: var(--apt-anthracite-800);
  --surface-raised: var(--apt-anthracite-700);
  --surface-sunken: var(--apt-anthracite-900);
  --surface-light: var(--apt-blanc-100);
  --surface-light-raised: var(--apt-blanc-pure);
  --surface-card: var(--apt-anthracite-700);

  /* Texte sur sombre */
  --text-strong: var(--apt-blanc-100);
  --text-body: #d7d2c6;
  --text-muted: var(--apt-anthracite-300);

  /* Texte sur clair */
  --text-strong-on-light: var(--apt-anthracite-800);
  --text-body-on-light: var(--apt-anthracite-600);
  --text-muted-on-light: var(--apt-anthracite-400);

  /* Accent — l'unique touche or */
  --accent: var(--apt-gold-500);
  --accent-hover: var(--apt-gold-400);
  --accent-press: var(--apt-gold-600);
  --accent-contrast: var(--apt-anthracite-900);

  /* Filets / bordures */
  --line-on-dark: rgba(245,243,237,0.14);
  --line-on-light: rgba(28,31,33,0.14);
  --line-strong: rgba(245,243,237,0.28);

  /* Typographie */
  --font-display: 'Mukta Mahee', system-ui, sans-serif;
  --font-body: 'Montserrat', system-ui, sans-serif;

  /* Rayons */
  --radius-0: 0;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-round: 999px;

  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(20,22,24,0.25);
  --shadow-md: 0 4px 14px rgba(20,22,24,0.35);
  --shadow-lg: 0 18px 48px rgba(20,22,24,0.45);
  --shadow-gold: 0 6px 20px rgba(231,163,58,0.28);

  /* Mouvement */
  --ease-standard: cubic-bezier(0.2, 0, 0.1, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;
}

/* ============================= Globales ============================= */
* { box-sizing: border-box; }

body {
  /* Correctif du piège connu : typography.css redéfinissait --text-body en
     *taille*. On rétablit la *couleur* --text-body sur la racine, comme le
     prototype. */
  --text-body: #d7d2c6;
  margin: 0;
  font-family: var(--font-body);
  background: var(--apt-anthracite-900);
  color: var(--text-body);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img, iframe { max-width: 100%; }
/* Le cadre parallélogramme contient une image en width:120% — ne pas la brider. */
.apt-frame-img { max-width: none; }

main section { overflow-x: clip; }

/* Accès clavier : contour or net et homogène. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: var(--apt-anthracite-400); }

/* Lien d'évitement */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-contrast);
  padding: 10px 16px; font-weight: 600; border-radius: var(--radius-md);
}
.skip-link:focus { left: 12px; top: 12px; color: var(--accent-contrast); }

/* ============================= Composants ============================= */
.apt-btn-primary:hover { background: var(--accent-hover); }
.apt-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.apt-nav-item { white-space: nowrap; color: var(--text-body); transition: color .15s; }
.apt-nav-item:hover { color: var(--text-strong); }
.apt-service:hover { border-color: rgba(231,163,58,0.45); }
.apt-marque:hover { border-color: rgba(231,163,58,0.45); }

/* Lien de navigation actif : couleur or + filet or sous le libellé. */
.apt-nav-item.is-active { color: var(--accent); }
.apt-nav-item.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; background: var(--accent);
}

.apt-burger { display: none; }

/* Bandeau cookies */
.apt-cookies {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--apt-anthracite-800);
  border-top: 1px solid var(--line-on-dark);
  padding: 16px 40px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.apt-cookies p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-body); max-width: 70ch; }
.apt-cookies .apt-cookies-actions { display: flex; gap: 10px; margin-left: auto; }

/* Consentement carte (Google Maps chargé au clic seulement) */
.apt-map-consent {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px;
  background: var(--apt-anthracite-700); color: var(--text-body);
}
.apt-map-consent p { margin: 0; font-size: 13.5px; line-height: 1.5; max-width: 40ch; }

.is-hidden { display: none !important; }

/* ============================= Responsive ============================= */
@media (max-width: 1024px) {
  main section > div, footer > div { padding-left: 26px !important; padding-right: 26px !important; }
  .apt-split { grid-template-columns: 1fr !important; gap: 36px !important; }
  .apt-g3 { grid-template-columns: repeat(2, 1fr) !important; }
  .apt-g6 { grid-template-columns: repeat(3, 1fr) !important; }
  .apt-gfooter { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
}
@media (max-width: 940px) {
  .apt-nav-desktop, .apt-cta-desktop { display: none !important; }
  .apt-burger { display: flex !important; }
  .apt-hero-deco { display: none !important; }
  .apt-cookies { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 640px) {
  .apt-header { padding-left: 18px !important; padding-right: 18px !important; }
  main section > div, footer > div { padding-left: 18px !important; padding-right: 18px !important; padding-top: 48px !important; padding-bottom: 48px !important; }
  footer > div:last-child { padding-top: 16px !important; padding-bottom: 16px !important; }
  .apt-g3, .apt-g6, .apt-g2, .apt-gfooter { grid-template-columns: 1fr !important; }
  .apt-g4 { grid-template-columns: 1fr 1fr !important; gap: 22px !important; }
  .apt-row { grid-template-columns: 1fr !important; gap: 14px !important; }
  .apt-row > div:first-child { border-right: none !important; border-left: 2px solid var(--accent); padding-right: 0 !important; padding-left: 14px !important; }
  .apt-typerow { flex-direction: column !important; }
  .apt-logo { height: 38px !important; }
}

/* Respect de la préférence « mouvement réduit » */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
