/* ALIMAMA USA — ACHATS & EXPÉDITIONS */

:root {
  --navy: #0f2a44;
  --navy-2: #173b5e;
  --accent: #e8a317;
  --accent-dark: #c98a0a;
  --green: #1f8a4c;
  --whatsapp: #1fa855;
  --text: #1c2733;
  --muted: #5b6875;
  --line: #dde3ea;
  --bg: #ffffff;
  --bg-alt: #f4f7fa;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 42, 68, 0.08);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--navy); }
p { margin: 0 0 1em; }
a { color: var(--navy-2); }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 760px; }
.center { text-align: center; margin-top: 32px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  border: 2px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 40px; padding: 6px 16px; font-size: .95rem; }
.btn-lg { min-height: 52px; padding: 12px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-accent { background: var(--accent); color: var(--navy); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-ghost-dark { background: #fff; border-color: var(--line); color: var(--navy); }
.btn-ghost-dark:hover { border-color: var(--navy); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { filter: brightness(.95); }

.link-btn {
  background: none; border: 0; padding: 8px 0; margin-top: 12px;
  color: var(--navy-2); font: inherit; text-decoration: underline; cursor: pointer;
}

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff; /* opaque : le logo a un fond blanc */
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 12px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-width: 0; }
/* Logo jamais compressé : proportions d'origine (3:1) conservées */
.brand { flex: none; }
.brand-logo { height: 52px; width: auto; max-width: none; flex: none; }
/* Le logo contient déjà le nom : le texte ne s'affiche que si l'image est absente. */
.brand-logo:not([hidden]) ~ .brand-text { display: none; }
@media (min-width: 960px) { .brand-logo { height: 56px; } }
.logo-slot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none;
  border: 2px dashed #b6c2cf; border-radius: 10px;
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #8a97a5;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; letter-spacing: .02em; }
.brand-text small { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  display: block; width: 20px; height: 2px; background: var(--navy); border-radius: 2px;
  position: relative; transition: transform .2s, background .2s;
}
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  position: absolute; top: 100%; left: 0; right: 0;
  display: none; flex-direction: column; gap: 4px;
  padding: 12px 16px 20px; background: #fff;
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.site-nav.open { display: flex; }
.site-nav a:not(.btn) {
  padding: 12px 8px; color: var(--text); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid var(--bg-alt);
}
.site-nav .btn { margin-top: 10px; }

@media (min-width: 1180px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static; display: flex; flex-direction: row; align-items: center; gap: 4px;
    padding: 0; border: 0; box-shadow: none; background: transparent;
  }
  .site-nav a { white-space: nowrap; }
  .site-nav a:not(.btn) { padding: 8px 10px; border: 0; border-radius: 8px; font-size: .95rem; }
  .site-nav a:not(.btn):hover { background: var(--bg-alt); }
  .site-nav .btn { margin: 0 0 0 8px; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(232,163,23,.18), transparent 45%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 48px 0 56px;
}
.hero h1 { color: #fff; font-size: clamp(1.9rem, 6vw, 3rem); }
.hero .lead { font-size: 1.08rem; color: rgba(255,255,255,.88); max-width: 40em; }
.eyebrow {
  margin: 0 0 10px; font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--accent-dark);
}
.hero .eyebrow { color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.hero-actions .btn { flex: 1 1 200px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-points li {
  padding: 6px 12px; border-radius: 999px; font-size: .9rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
}
.hero-points li::before { content: "✓ "; color: var(--accent); font-weight: 700; }

.hero-card {
  margin-top: 36px; padding: 24px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius);
}
.route { display: flex; flex-direction: column; gap: 4px; }
.route-stop { display: flex; align-items: center; gap: 14px; }
.route-stop strong { display: block; font-size: 1.1rem; }
.route-stop small { color: rgba(255,255,255,.75); }
.route-dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 0 0 5px rgba(255,255,255,.15); }
.route-dot-end { background: var(--accent); box-shadow: 0 0 0 5px rgba(232,163,23,.25); }
.route-line {
  margin-left: 7px; padding: 14px 0 14px 21px;
  border-left: 2px dashed rgba(255,255,255,.4);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.route-mode { font-size: .85rem; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.12); }

@media (min-width: 900px) {
  .hero { padding: 80px 0 88px; }
  .hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
  .hero-card { margin-top: 0; padding: 32px; }
  .hero-actions .btn { flex: 0 0 auto; }
}

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-tight { padding: 40px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(1.4rem, 4.5vw, 2rem); }
.section-head p:last-child { color: var(--muted); margin: 0; }
@media (min-width: 900px) { .section { padding: 64px 0; } .section-tight { padding: 56px 0; } }

/* Accueil : note sous l'itinéraire ; la carte d'itinéraire est masquée sur téléphone (page courte) */
.hero-card-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); font-size: .92rem; color: rgba(255,255,255,.8); }
@media (max-width: 899px) { .hero-card { display: none; } .hero { padding: 36px 0 40px; } .hero .lead { font-size: 1rem; } }

/* Comment ça marche : liste numérotée compacte */
.steps-compact {
  list-style: none; padding: 0; margin: 0; counter-reset: s;
  display: grid; gap: 8px; grid-template-columns: 1fr;
}
@media (min-width: 760px) { .steps-compact { grid-template-columns: 1fr 1fr; column-gap: 24px; } }
.steps-compact li {
  counter-increment: s; position: relative; padding: 8px 0 8px 42px; min-height: 32px;
}
.steps-compact li::before {
  content: counter(s); position: absolute; left: 0; top: 4px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: .85rem; font-weight: 800;
}

/* Catégories (exemples de produits) */
.cat-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 12px; grid-template-columns: 1fr 1fr;
}
@media (min-width: 960px) { .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.cat-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
/* Image recadrée (object-fit: cover) : jamais étirée ni déformée */
.cat-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-alt); }
.cat-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 12px; }
.cat-body h3 { margin: 0; font-size: .95rem; flex: 1; }
.cat-body p { display: none; margin: 0; color: var(--muted); font-size: .95rem; }
.cat-body .btn { align-self: stretch; min-height: 38px; padding: 6px 8px; font-size: .8rem; white-space: nowrap; }
@media (min-width: 960px) {
  .cat-body { padding: 18px; }
  .cat-body h3 { font-size: 1.08rem; flex: 0 0 auto; }
  .cat-body p { display: block; flex: 1; }
  .cat-body .btn { align-self: flex-start; min-height: 40px; padding: 6px 16px; font-size: .95rem; }
}
.cat-disclaimer { margin: 14px 0 0; font-size: .85rem; font-style: italic; color: var(--muted); }
.cat-cta {
  margin: 20px 0 16px; padding: 18px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.cat-cta p { margin: 0 0 12px; font-weight: 600; color: var(--navy); }
@media (max-width: 599px) { .cat-cta .btn { width: 100%; } }
.fineprint { margin: 0; font-size: .85rem; color: var(--muted); }

/* ---------- Rubriques refermables (FAQ, « Bon à savoir ») : fermées au chargement ---------- */
.faq details, .accordion details {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px;
}
.faq summary, .accordion summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 15px 48px 15px 18px; font-weight: 700; color: var(--navy);
}
.faq summary::-webkit-details-marker, .accordion summary::-webkit-details-marker { display: none; }
.faq summary::after, .accordion summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; line-height: 1; color: var(--accent-dark);
}
.faq details[open] summary::after, .accordion details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); }
.acc-body { padding: 0 18px 18px; color: var(--muted); }
.acc-body p { margin: 0 0 12px; }
.acc-body p:last-child { margin-bottom: 0; }
.acc-body strong { color: var(--text); }
.acc-body .btn { margin-top: 4px; }
.mini-steps { margin: 0 0 14px; padding-left: 20px; }
.mini-steps li { margin-bottom: 6px; }
.faq-group { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; }
.faq-group:first-child { margin-top: 0; }

.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.checklist li { position: relative; padding: 7px 0 7px 30px; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 8px;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: #e7f4ec; color: var(--green); font-size: .75rem; font-weight: 800;
}

/* Fenêtre « Toutes les questions » */
.faq-dialog {
  width: min(680px, calc(100% - 24px)); max-height: calc(100% - 24px);
  padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(15,42,68,.35);
  background: var(--bg-alt); color: var(--text);
}
.faq-dialog::backdrop { background: rgba(15,42,68,.55); }
.faq-dialog-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line);
}
.faq-dialog-head h2 { margin: 0; font-size: 1.15rem; }
.faq-dialog-body { padding: 16px; }

/* ---------- Demande de devis : choix + formulaire caché ---------- */
.devis-choices { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 640px) { .devis-choices { flex-direction: row; flex-wrap: wrap; } }
.form-panel { margin-top: 16px; }
.form-panel-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.form-panel-head p { margin: 0; flex: 1 1 260px; font-size: .9rem; color: var(--muted); }

/* ---------- Formulaire ---------- */
.form, .form-result {
  padding: 22px 16px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
@media (min-width: 640px) { .form, .form-result { padding: 32px; } }
.field { margin-bottom: 18px; flex: 1 1 0; min-width: 0; }
.field-row { display: flex; flex-direction: column; gap: 0; }
@media (min-width: 640px) { .field-row { flex-direction: row; gap: 16px; } }
label { display: block; margin-bottom: 6px; font-weight: 700; color: var(--navy); }
.req { color: #c0392b; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: inherit; font-size: 16px; /* évite le zoom automatique sur iPhone */
  color: var(--text); background: #fff;
  border: 1.5px solid #c5cfd9; border-radius: 10px;
}
textarea { resize: vertical; min-height: 110px; }
input[type="file"] { padding: 10px; background: var(--bg-alt); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(23,59,94,.15); }
.invalid { border-color: #c0392b !important; }
.hint { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
.form > .hint { margin-bottom: 18px; }
.form-error {
  margin-bottom: 16px; padding: 12px 14px; border-radius: 10px;
  background: #fdecea; border: 1px solid #f5c2bc; color: #8e2a1f;
}

.form-result h3 { color: var(--green); }
.summary {
  margin: 0 0 18px; padding: 16px; max-height: 320px; overflow: auto;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px;
  font: .92rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.result-actions { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 640px) { .result-actions { flex-direction: row; flex-wrap: wrap; } }

/* Sélecteur Article / Véhicule */
.label { display: block; margin-bottom: 6px; font-weight: 700; color: var(--navy); }
.segmented { display: flex; gap: 8px; }
.segmented label { flex: 1; margin: 0; font-weight: 600; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.segmented span {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  border: 1.5px solid #c5cfd9; border-radius: 10px; color: var(--text);
}
.segmented input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.category-info { margin: -6px 0 18px; padding: 10px 14px; border-radius: 10px; background: #eef4fa; color: var(--navy); font-weight: 600; }

/* ---------- Contact : carte compacte + point de retrait ---------- */
.contact-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.contact-card, .pickup-card {
  padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.contact-card h3, .pickup-card h3 { margin: 0 0 6px; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.contact-rows { list-style: none; padding: 0; margin: 0; }
.contact-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  padding: 11px 0; border-top: 1px solid var(--line);
}
.contact-rows:first-of-type .contact-row:first-child { border-top: 0; }
.contact-info { display: flex; flex-direction: column; min-width: 0; }
.contact-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.contact-row-main .contact-label { color: var(--green); }
.contact-number { font-size: 1.1rem; font-weight: 800; color: var(--navy); white-space: nowrap; }
.contact-note { font-size: .78rem; color: var(--muted); }
.contact-actions { display: flex; gap: 6px; }
.contact-actions .btn { min-height: 38px; padding: 6px 14px; font-size: .88rem; }
.contact-value { font-weight: 600; word-break: break-word; }
.contact-value a { color: var(--navy); }
.contact-row[data-optional] { display: flex; flex-direction: column; align-items: flex-start; }
.contact-row[data-optional][hidden] { display: none; }
.pickup-card p { margin: 0 0 14px; color: var(--muted); font-size: .95rem; }
@media (max-width: 599px) { .pickup-card .btn { width: 100%; } }

.btn-whatsapp-outline { background: #fff; border-color: var(--whatsapp); color: #157a3d; }
.btn-whatsapp-outline:hover { background: #f1faf4; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.8); padding: 36px 0 96px; font-size: .92rem; }
.site-footer strong { color: #fff; }
.footer-inner { display: grid; gap: 16px; }
.footer-note { margin: 0; }
/* Fond blanc du logo : présenté sur une plaque blanche arrondie dans le pied de page sombre. */
.footer-logo { height: 60px; width: auto; margin-bottom: 14px; padding: 6px 10px; background: #fff; border-radius: 10px; }
@media (min-width: 900px) {
  .site-footer { padding-bottom: 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; align-items: end; }
  .footer-note { text-align: right; }
}

/* Bouton WhatsApp flottant : toujours visible sur téléphone */
.fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 18px; border-radius: 999px;
  background: var(--whatsapp); color: #fff; font-weight: 800; text-decoration: none;
  box-shadow: 0 8px 24px rgba(15,42,68,.3);
}
@media (min-width: 960px) { .fab { display: none; } }
/* Petits écrans : bouton remonté au-dessus du badge « Powered by Netlify » (fixé en bas à droite,
   environ 61 px de haut), et marge en bas de page pour qu'il ne masque jamais le pied de page. */
@media (max-width: 959px) {
  .fab { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .site-footer { padding-bottom: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
