@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Open+Sans:wght@400;600&display=swap');
@import url('tokens.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--color-text); background: var(--color-bg); line-height: 1.65; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.05rem, 2.5vw, 1.35rem); }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--color-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding-left: 1.25rem; }
li { margin-bottom: 0.3rem; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

.skip-nav { position: absolute; left: -9999px; top: 0; z-index: 9999; }
.skip-nav:focus { left: 0; padding: 0.5rem 1rem; background: var(--color-secondary); color: #111; font-weight: 700; }

/* ── Header ── */
header { background: var(--color-primary); color: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 1.25rem; gap: 1rem; }
.logo-link { display: flex; align-items: center; flex-shrink: 0; }
.logo-link img { height: 44px; width: auto; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.phone-cta { color: var(--color-secondary); font-family: var(--font-display); font-weight: 700; font-size: 1rem; white-space: nowrap; display: none; }
.phone-cta:hover { text-decoration: underline; }
.burger { background: none; border: none; cursor: pointer; padding: 0.3rem; color: #fff; line-height: 1; }
.burger:focus { outline: 2px solid var(--color-secondary); border-radius: 2px; }

/* ── Nav ── */
nav { display: none; background: color-mix(in srgb, var(--color-primary) 90%, #000); }
nav.open { display: block; }
nav ul { list-style: none; padding: 0; margin: 0; }
nav ul li { border-top: 1px solid rgba(255,255,255,0.08); }
nav ul li a { display: block; padding: 0.85rem 1.25rem; color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
nav ul li a:hover { color: var(--color-secondary); text-decoration: none; background: rgba(255,255,255,0.04); }
nav ul li a[aria-current="page"] { color: var(--color-secondary); border-left: 3px solid var(--color-secondary); }

/* ── Buttons ── */
.btn { display: inline-block; padding: 0.75rem 1.5rem; border-radius: 4px; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; cursor: pointer; text-decoration: none; transition: opacity 0.15s, transform 0.1s; border: 2px solid transparent; line-height: 1.4; }
.btn:hover { opacity: 0.88; text-decoration: none; transform: translateY(-1px); }
.btn:focus { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
.btn-primary { background: var(--color-secondary); color: #111827; border-color: var(--color-secondary); }
.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.btn-accent { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* ── Visual Placeholder (WEB-715) ── */
.visual-placeholder {
  display: block;
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-primary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-secondary) 18%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-aspect="4:3"]  { aspect-ratio: 4 / 3; }
.visual-placeholder[data-aspect="1:1"]  { aspect-ratio: 1 / 1; }
.visual-placeholder[data-aspect="3:4"]  { aspect-ratio: 3 / 4; }
.visual-placeholder[data-aspect="21:9"] { aspect-ratio: 21 / 9; }

.visual-placeholder[data-tone="secondary"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-secondary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-secondary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-primary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="accent"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-accent, var(--color-primary)) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 12%, var(--color-bg)) 60%,
      color-mix(in srgb, var(--color-secondary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="muted"] {
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-bg));
}

/* ── Hero ── */
.hero { background: var(--color-primary); color: #fff; padding: 2.5rem 1.25rem 2rem; }
.hero-body { max-width: 680px; }
.hero h1 { color: #fff; margin-bottom: 0.9rem; }
.hero h1 em { font-style: normal; color: var(--color-secondary); }
.hero .lead { font-size: 1.08rem; opacity: 0.88; margin-bottom: 1.5rem; max-width: 560px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.75rem; }
.rating-badge { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.1); border-radius: 6px; padding: 0.45rem 0.9rem; font-size: 0.9rem; color: rgba(255,255,255,0.9); }
.rating-badge .stars { color: var(--color-secondary); letter-spacing: 1px; }
.hero-visual { margin-top: 2rem; }

/* ── Highlights strip ── */
.highlights-strip { background: var(--color-secondary); padding: 1.5rem 1.25rem; }
.highlights-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 800px; margin: 0 auto; }
.hl-item { text-align: center; }
.hl-number { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--color-primary); line-height: 1; }
.hl-label { font-size: 0.8rem; font-weight: 600; color: #111827; margin-top: 0.2rem; }

/* ── Sections ── */
.section { padding: 3rem 1.25rem; }
.section-dark { background: var(--color-primary); color: #fff; }
.section-alt { background: #F9FAFB; }
.section + .section { padding-top: 2rem; }
.section h2 { margin-bottom: 1.5rem; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-intro { max-width: 640px; color: #4B5563; margin-bottom: 2rem; font-size: 1.02rem; }
.section-dark .section-intro { color: rgba(255,255,255,0.8); }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

/* ── Cards ── */
.card { background: #fff; border-radius: 8px; padding: 1.5rem; box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card h3 { color: var(--color-primary); margin-bottom: 0.6rem; }
.card p { color: #4B5563; font-size: 0.95rem; }

/* ── Service cards ── */
.service-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,0.08); border-top: 4px solid var(--color-secondary); }
.service-card .service-body { padding: 1.25rem; }
.service-card h3 { color: var(--color-primary); font-size: 1.1rem; margin-bottom: 0.6rem; }
.service-card p { color: #4B5563; font-size: 0.9rem; margin-bottom: 0.6rem; }
.service-card ul { color: #4B5563; font-size: 0.88rem; padding-left: 1.1rem; }
.service-card li { margin-bottom: 0.2rem; }

/* ── Testimonial ── */
.testimonial { background: #F3F4F6; border-left: 4px solid var(--color-secondary); padding: 1.25rem 1.5rem; border-radius: 0 8px 8px 0; margin: 1.5rem 0; }
.testimonial p { font-style: italic; color: #374151; margin-bottom: 0.3rem; font-size: 1.02rem; }
.testimonial cite { font-size: 0.85rem; color: #6B7280; font-style: normal; }

/* ── CTA strip ── */
.cta-strip { background: var(--color-accent); color: #fff; text-align: center; padding: 3rem 1.25rem; }
.cta-strip h2 { color: #fff; margin-bottom: 0.75rem; }
.cta-strip p { opacity: 0.9; margin-bottom: 1.5rem; max-width: 560px; margin-left: auto; margin-right: auto; }
.cta-strip .btn-primary { background: #fff; color: var(--color-accent); border-color: #fff; }
.cta-strip .btn-outline { border-color: rgba(255,255,255,0.7); margin-left: 0.5rem; }

/* ── Hours table ── */
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table tr { border-bottom: 1px solid #E5E7EB; }
.hours-table tr:last-child { border-bottom: none; }
.hours-table td { padding: 0.65rem 0.5rem; font-size: 0.95rem; }
.hours-table td:first-child { font-weight: 600; color: var(--color-primary); width: 45%; }
.hours-table .closed { color: #9CA3AF; font-style: italic; }

/* ── Contact info ── */
.contact-block { display: flex; flex-direction: column; gap: 1.5rem; }
.info-item { display: flex; gap: 0.85rem; align-items: flex-start; }
.info-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1.4; }
.info-text { flex: 1; }
.info-text strong { display: block; font-family: var(--font-display); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-primary); margin-bottom: 0.2rem; }
.info-text a { color: var(--color-text); }
.info-text a:hover { color: var(--color-secondary); }

/* ── Form ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--color-primary); }
.form-group input,
.form-group textarea,
.form-group select { width: 100%; padding: 0.65rem 0.85rem; border: 1px solid #D1D5DB; border-radius: 4px; font-family: var(--font-body); font-size: 1rem; color: var(--color-text); background: #fff; transition: border-color 0.15s; }
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-secondary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-secondary) 20%, transparent); }
.form-group textarea { resize: vertical; min-height: 120px; }
.rgpd-note { font-size: 0.8rem; color: #6B7280; margin-top: 1rem; line-height: 1.5; }

/* ── Map ── */
.map-wrapper { border-radius: 8px; overflow: hidden; border: 1px solid #E5E7EB; }
.map-wrapper iframe { display: block; width: 100%; height: 280px; border: none; }

/* ── Page hero ── */
.page-hero { background: var(--color-primary); color: #fff; padding: 2.5rem 1.25rem 2rem; }
.page-hero h1 { color: #fff; margin-bottom: 0.5rem; }
.page-hero .lead { opacity: 0.85; font-size: 1.02rem; max-width: 600px; }
.breadcrumb { font-size: 0.82rem; color: rgba(255,255,255,0.55); margin-bottom: 0.75rem; }
.breadcrumb a { color: rgba(255,255,255,0.65); }
.breadcrumb a:hover { color: var(--color-secondary); text-decoration: none; }
.breadcrumb span { color: rgba(255,255,255,0.4); margin: 0 0.3rem; }

/* ── About stats ── */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.stat-box { text-align: center; padding: 1.5rem 1rem; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.stat-box .stat-val { font-family: var(--font-display); font-weight: 800; font-size: 2.5rem; color: var(--color-secondary); line-height: 1; }
.stat-box .stat-lbl { font-size: 0.85rem; color: #6B7280; margin-top: 0.3rem; }

/* ── Legal ── */
.legal-content h2 { font-size: 1.2rem; margin: 2.5rem 0 0.75rem; color: var(--color-primary); border-bottom: 2px solid var(--color-secondary); padding-bottom: 0.35rem; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content address { font-size: 0.95rem; color: #374151; font-style: normal; margin-bottom: 0.75rem; }
.legal-content ul { color: #374151; font-size: 0.95rem; }

/* ── Footer ── */
footer { background: #111827; color: #D1D5DB; padding: 3rem 1.25rem 1.5rem; }
.footer-inner { max-width: 1140px; margin: 0 auto; }
.footer-grid { display: grid; gap: 2rem; margin-bottom: 2.5rem; }
footer h4 { color: #fff; font-family: var(--font-display); margin-bottom: 0.75rem; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; }
footer ul { list-style: none; padding: 0; }
footer ul li { margin-bottom: 0.4rem; }
footer ul li a { color: #9CA3AF; font-size: 0.9rem; }
footer ul li a:hover { color: var(--color-secondary); }
.footer-logo { margin-bottom: 0.75rem; }
.footer-logo img { height: 36px; filter: brightness(0) invert(1) sepia(1) saturate(0); }
.footer-tagline { font-size: 0.88rem; color: #9CA3AF; }
.footer-phone { color: var(--color-secondary); font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.footer-phone:hover { text-decoration: underline; }
.footer-bottom { border-top: 1px solid #374151; padding-top: 1.25rem; text-align: center; font-size: 0.8rem; color: #6B7280; }
.footer-bottom a { color: #9CA3AF; }
.footer-bottom a:hover { color: var(--color-secondary); }

/* ── Tablet ── */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .highlights-grid { grid-template-columns: repeat(4, 1fr); }
  .map-wrapper iframe { height: 360px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .phone-cta { display: inline; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .contact-block { flex-direction: row; flex-wrap: wrap; gap: 2rem; }
  .contact-block .info-item { flex: 1 1 calc(50% - 1rem); }
}

/* ── Desktop ── */
@media (min-width: 1024px) {
  .header-inner { padding: 0.65rem 2rem; }
  .burger { display: none; }
  nav { display: flex !important; align-items: center; }
  nav ul { display: flex; padding: 0; gap: 0; }
  nav ul li { border-top: none; }
  nav ul li a { padding: 0.55rem 0.85rem; font-size: 0.9rem; }
  nav ul li a[aria-current="page"] { border-left: none; border-bottom: 2px solid var(--color-secondary); color: var(--color-secondary); }
  .hero { padding: 4.5rem 2rem 3rem; }
  .hero-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
  .hero-visual { margin-top: 0; }
  .section { padding: 4.5rem 2rem; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
  .contact-block { flex-direction: column; }
  .contact-block .info-item { flex: none; }
}

/* ═══════════════════════════════════════════════════════════════
   Animation Pass — WEB-1754 (AnimationDesigner)
   Template A — vitrine auto/artisanat · Pneus Discount Baie-Mahault
   Effets : 1-hero entrance · 2-scroll reveal cards · 3-card hover lift
            4-highlights scroll-driven · 5-placeholder gradient drift
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: no-preference) {

  /* ── 1. Hero entrance — fade+slide au chargement de la page ── */
  @keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .hero-body {
    animation: fadeSlideUp 0.6s ease-out both;
  }
  .hero-visual {
    animation: fadeSlideUp 0.65s 0.18s ease-out both;
  }

  /* ── 2. Scroll reveal — câblage CSS pour l'IO existant dans main.js ── */
  /* main.js ajoute .visible quand l'élément entre dans le viewport */
  .fade-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease-out, transform 0.55s ease-out;
  }
  .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Décalage en cascade pour les 3 service-cards */
  .grid-3 .service-card:nth-child(2).fade-in { transition-delay: 0.10s; }
  .grid-3 .service-card:nth-child(3).fade-in { transition-delay: 0.20s; }

  /* ── 3. Hover lift sur .service-card ── */
  .service-card {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
  }
  /* Après révélation : réinitialiser la transition pour un hover réactif */
  .service-card.fade-in.visible {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
  }
  .service-card:hover,
  .service-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  }

  /* ── 4. Highlights strip — révélation CSS scroll-driven (Chromium 115+) ── */
  /* Fallback gracieux : l'animation joue au chargement sur les autres navigateurs */
  .hl-item {
    animation: fadeSlideUp 0.5s ease-out both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }
  .hl-item:nth-child(2) { animation-delay: 0.06s; }
  .hl-item:nth-child(3) { animation-delay: 0.12s; }
  .hl-item:nth-child(4) { animation-delay: 0.18s; }

  /* ── 5. Visual placeholder — dérive douce du dégradé ── */
  .visual-placeholder {
    background-size: 200% 200%;
    animation: gradientDrift 10s ease-in-out infinite alternate;
    transition: transform 0.32s ease, box-shadow 0.32s ease;
  }
  @keyframes gradientDrift {
    from { background-position: 0% 0%; }
    to   { background-position: 100% 100%; }
  }
  .visual-placeholder:hover {
    transform: translateY(-2px) scale(1.008);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.10);
  }

  /* ── Focus visible amélioré pour les liens et cartes ── */
  a:focus-visible,
  button:focus-visible {
    outline: 2.5px solid var(--color-secondary);
    outline-offset: 3px;
    border-radius: 3px;
    transition: outline-offset 0.12s ease;
  }

}

/* ── Filet de sécurité accessibilité — reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
