/* ══════════════════════════════════════════
   GROUPE BRUYAS — styles.css
   Base globale + variables + composants
══════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
  /* Palette couleurs BRUYAS — Charte Pantone 485C */
  --brand-red: #BC1B2E;
  --brand-red-rgb: 188, 27, 46;
  /* Pantone 485C — Rouge principal (CMJN: 0% 100% 100% 0%) */
  --brand-red-dk: #941523;
  /* Pantone 485C — Variante foncée */
  --brand-red-light: #E63946;
  /* Pantone 485C — Variante claire */

  /* Variantes niveaux de gris (selon charte) */
  --grey-60: #666666;
  /* Haut du logo — 60% noir */
  --grey-35: #A8A8A8;
  /* Nom "BRUYAS" — 35% noir */
  --grey-28: #BFBFBF;
  /* Partie inférieure — 28% noir */

  --brand-dark: #0e1016;
  --brand-steel: #1a1d23;

  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #ffffff;

  --text: #1a1d23;
  --text-muted: #5a6070;
  --border: rgba(0, 0, 0, 0.065);

  --radius: 12px;
  --transition: 0.22s ease;

  --container: 1200px;
  --nav-h: 100px;
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background: #ffffff;
  color: var(--text);
  font-size: 17px;
  line-height: 1.68;
  padding-top: var(--nav-h);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(var(--brand-red-rgb), 0.36);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── CONTAINER ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(var(--brand-red-rgb), 0.1);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.navbar.scrolled,
.navbar.solid {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
  border-bottom: 1px solid rgba(var(--brand-red-rgb), 0.2);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 40px;
}

.nav-logo {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.nav-logo-img {
  width: clamp(220px, 20vw, 300px);
  height: auto;
  max-height: 76px;
  object-fit: contain;
  filter: none;
  transition: filter 0.3s ease;
}

.navbar:hover .nav-logo-img {
  filter: none;
}

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-size: 17px;
  font-weight: 700;
  color: #1a1d23;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--brand-red);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--brand-red);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-link:hover::after {
  width: 20px;
}

.nav-link.active {
  color: var(--brand-red);
}

.nav-link.active::after {
  width: 20px;
}

.nav-link.nav-cta {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dk));
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(var(--brand-red-rgb), 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 10px;
}

.nav-link.nav-cta::after {
  display: none;
}

.nav-link.nav-cta:hover {
  background: linear-gradient(135deg, var(--brand-red-dk), #7a1320);
  color: #fff;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(var(--brand-red-rgb), 0.4);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: #1a1d23;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.navbar.menu-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar.menu-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.navbar.menu-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── SECTION LABELS ── */
.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--brand-red);
  margin-bottom: 14px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 16px;
}

.section-title.center,
.section-subtitle.center {
  text-align: center;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 580px;
}

.accent {
  color: var(--brand-red);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 100px;
  transition: all var(--transition);
  border: none;
}

.btn-primary {
  background: var(--brand-red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-red-dk);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

/* ── SECTION BASE ── */
.section {
  padding: 100px 0;
}

.section-dark {
  background: var(--surface-1);
}

.section-darker {
  background: var(--surface-2);
}

#moyens .container {
  max-width: 1680px;
  padding: 0 clamp(32px, 4vw, 64px);
}

.moyens-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 22px;
}

.moyen-card {
  background: var(--surface-3);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.07);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
}

.moyen-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.12);
  border-color: rgba(var(--brand-red-rgb), 0.2);
}

.moyen-icon {
  width: 48px;
  height: 48px;
  background: #fff;
  border: 1px solid rgba(var(--brand-red-rgb), 0.24);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--brand-red);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.3s ease;
}

.moyen-card:hover .moyen-icon {
  transform: scale(1.1);
}

.moyen-icon svg {
  width: 24px;
  height: 24px;
}

.moyen-card h3 {
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.moyen-card p {
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
  font-size: 15px;
  font-weight: 400;
}

/* Carte « moyen » sans vidéo disponible : informative, non cliquable. */
.moyen-card--pending {
  cursor: default;
}

.moyen-card--pending:hover {
  transform: none;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.07);
  border-color: rgba(15, 23, 42, 0.1);
}

.moyen-card--pending:hover .moyen-icon {
  transform: none;
}

.moyen-card-action--pending {
  color: var(--text-muted);
}

.moyens-video-cta {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 760px;
  margin: 42px auto 0;
  text-align: center;
}

.moyens-video-cta p {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.65;
}

.btn-moyens-video {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 24px 12px 14px;
  border: 1px solid rgba(var(--brand-red-rgb), 0.28);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-red);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 16px 42px rgba(var(--brand-red-rgb), 0.14);
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.btn-moyens-video:hover {
  background: var(--brand-red);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 22px 52px rgba(var(--brand-red-rgb), 0.24);
}

.btn-video-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(var(--brand-red-rgb), 0.1);
  transition: background 0.22s ease;
}

.btn-moyens-video:hover .btn-video-icon {
  background: rgba(255, 255, 255, 0.18);
}

.btn-video-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  margin-left: 2px;
}

.section-header {
  max-width: 760px;
  margin: 0 auto 40px;
}

/* ── DIVIDER ── */
.divider {
  width: 48px;
  height: 3px;
  background: var(--brand-red);
  border-radius: 2px;
  margin: 20px 0 32px;
}

.divider.center {
  margin-left: auto;
  margin-right: auto;
}

/* ── SCROLLBAR ── */
html {
  scrollbar-color: rgba(var(--brand-red-rgb), 0.72) #eef1f5;
  scrollbar-width: auto;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #f6f7f9 0%, #e9edf2 100%);
  border-left: 1px solid rgba(15, 18, 26, 0.06);
}

::-webkit-scrollbar-thumb {
  min-height: 56px;
  border: 3px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(var(--brand-red), var(--brand-red-dk)) padding-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(var(--brand-red-light), var(--brand-red)) padding-box;
}

::-webkit-scrollbar-corner {
  background: #e9edf2;
}

@media (max-width: 1500px) {
  #moyens .container {
    max-width: var(--container);
    padding: 0 32px;
  }

  .moyens-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .moyens-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

/* ── RESPONSIVE NAV ── */
@media (max-width: 768px) {
  :root {
    --nav-h: 76px;
  }

  html,
  body {
    overflow-x: hidden;
  }

  body.nav-open {
    overflow: hidden;
  }

  .nav-inner {
    padding: 0 16px;
  }

  .nav-logo-img {
    width: min(205px, calc(100vw - 86px));
    height: auto;
    max-height: 50px;
  }

  .nav-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
    max-height: calc(100svh - var(--nav-h));
    overflow-y: auto;
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }

  .navbar.menu-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 10px;
    border-radius: 8px;
    font-size: 16px;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.nav-cta {
    margin-left: 0;
    margin-top: 6px;
    justify-content: center;
    padding: 13px 18px;
  }

  .container {
    padding: 0 16px;
  }

  #moyens .container {
    padding: 0 16px;
  }

  .moyens-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 62px 0;
  }

  .section-label {
    letter-spacing: 2.4px;
  }

  .section-title {
    font-size: clamp(28px, 8vw, 34px);
  }

  .section-subtitle {
    font-size: 16px;
    line-height: 1.65;
  }

  .moyen-card {
    padding: 22px 20px;
  }
}

@media (max-width: 420px) {
  .nav-logo-img {
    width: min(178px, calc(100vw - 78px));
  }

  .nav-inner {
    padding: 0 12px;
  }
}

/* ── FLOATING CTA ── */
.floating-cta {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--brand-red);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 16px 24px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(var(--brand-red-rgb), 0.5);
  transition: all 0.3s ease;
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.floating-cta.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.floating-cta:hover {
  background: var(--brand-red-dk);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 40px rgba(var(--brand-red-rgb), 0.6);
  color: #fff;
}

.floating-cta svg {
  width: 18px;
  height: 18px;
}

.floating-cta .pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 100px;
  border: 2px solid var(--brand-red);
  opacity: 0;
  animation: cta-pulse 2.5s infinite;
}

@keyframes cta-pulse {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}

@media (max-width: 600px) {
  .floating-cta {
    right: 16px;
    bottom: 16px;
    font-size: 0;
    gap: 0;
    padding: 16px;
  }

  .floating-cta svg {
    width: 22px;
    height: 22px;
  }
}

/* ── FOOTER ── */
.footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  padding: 60px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.footer-links a {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
  position: relative;
}

.footer-links a:hover {
  color: var(--brand-red);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .footer-links {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ── BREADCRUMB (partagé pages détail) ── */
.breadcrumb-nav {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: 6px;
  opacity: 0.4;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.breadcrumb a:hover          { color: var(--brand-red); }
.breadcrumb [aria-current]   { color: var(--text); font-weight: 600; }

/* ── BTN OUTLINE (partagé pages détail) ── */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 100px;
  border: 1.5px solid var(--brand-red);
  color: var(--brand-red);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.btn-outline:hover {
  background: var(--brand-red);
  color: #fff;
}

/* ── BACK TO TOP ── */
.back-to-top {
  position: fixed;
  bottom: 6.5rem;
  right: 1.75rem;
  width: 44px;
  height: 44px;
  background: var(--brand-red);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition), transform var(--transition),
    visibility 0s var(--transition), background var(--transition);
  z-index: 998;
  box-shadow: 0 4px 16px rgba(var(--brand-red-rgb), 0.35);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--transition), transform var(--transition),
    visibility 0s, background var(--transition);
}

.back-to-top:hover {
  background: var(--brand-red-dk);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 3px;
}

/* Sur mobile, on évite d'empiler deux pastilles flottantes :
   on garde le CTA « Demander un devis » et on masque le retour-en-haut. */
@media (max-width: 768px) {
  .back-to-top {
    display: none;
  }
}

/* == DIAGNOSTIC PERF (classes posees par main.js via ?noblur / ?nozoom / ?noanim) == */
html.perf-noblur *,
html.perf-noblur *::before,
html.perf-noblur *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
}

html.perf-nozoom .hero-slide img,
html.perf-nozoom .hero-slide.active img {
  animation: none !important;
}

html.perf-noanim *,
html.perf-noanim *::before,
html.perf-noanim *::after {
  animation: none !important;
  transition: none !important;
}

/* == CORRECTIF FIREFOX : flou permanent sur les petits elements seulement ==
   Firefox recalcule les backdrop-filter en continu pendant le scroll
   (14-20 fps mesures avec flou partout ; toute bascule dynamique saccade
   au scroll molette). Regle permanente, sans aucun basculement :
   - les PETITS elements (pastilles hero, boutons) GARDENT leur flou,
     surface minuscule = cout negligeable, rendu identique a Chrome ;
   - les GRANDES surfaces le perdent : navbar quasi opaque (invisible),
     cartes metiers blanches sur fond blanc (indetectable), fonds de
     fenetres deja tres sombres (opacite legerement remontee). */
@supports (-moz-appearance: none) {

  .navbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.97);
  }

  /* Menu mobile deplie (seul cas ou .nav-links a un fond floute) */
  @media (max-width: 768px) {
    .nav-links {
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      background: rgba(255, 255, 255, 0.99);
    }
  }

  .navbar.scrolled,
  .navbar.solid {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.99);
  }

  .metier-card,
  .video-index-section {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .exametal-lightbox-backdrop,
  .moyens-media-backdrop,
  .article-modal,
  .proj-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .exametal-lightbox-backdrop,
  .moyens-media-backdrop {
    background: rgba(8, 10, 16, 0.9) !important;
  }

  .article-modal {
    background: rgba(0, 0, 0, 0.88) !important;
  }
}
