/* MonCGPvirtuel — styles communs ajoutés à toutes les pages */

/* Bouton menu mobile (masqué sur grand écran) */
.nav-burger {
  display: none;
  background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 10px;
  flex-direction: column; justify-content: center; gap: 5px;
}
.nav-burger span {
  display: block; height: 2px; width: 100%;
  background: #fff; border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
.nav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-burger { display: flex; }
  nav .nav-links {
    display: flex !important;
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0 !important;
    background: rgba(13,33,55,0.98);
    border-bottom: 1px solid rgba(62,207,178,0.2);
    padding: 0.5rem 5% 1.25rem;
    transform: translateY(-8px); opacity: 0; pointer-events: none; visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
  }
  nav.nav-open .nav-links { transform: none; opacity: 1; pointer-events: auto; visibility: visible; }
  nav .nav-links li a { display: block; padding: 0.9rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  nav .nav-links li:last-child a { border-bottom: 0; margin-top: 0.75rem; text-align: center; padding: 0.85rem 1rem; }
}

/* Lien actif dans la navigation */
.nav-links a[aria-current="page"] { color: var(--gold); }

/* Curseurs des simulateurs : piste visible, remplie en céladon jusqu'au curseur */
.field input[type="range"],
.sim-field input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; padding: 0; margin: 0.7rem 0 0.4rem;
  border: none; border-radius: 3px; outline: none; cursor: pointer;
  background: linear-gradient(to right, var(--gold) var(--fill, 50%), var(--range-track, #C9D4E0) var(--fill, 50%));
}
.sim-field input[type="range"] { --range-track: rgba(255,255,255,0.25); }
.field input[type="range"]::-webkit-slider-thumb,
.sim-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold); border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(13,33,55,0.35);
}
.field input[type="range"]::-moz-range-thumb,
.sim-field input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(13,33,55,0.35);
}
.field input[type="range"]::-moz-range-track,
.sim-field input[type="range"]::-moz-range-track { background: transparent; }
.field input[type="range"]:focus-visible,
.sim-field input[type="range"]:focus-visible { box-shadow: 0 0 0 3px rgba(62,207,178,0.35); }

/* ─── AFFICHAGE MOBILE ───
   Chargé après les styles inline des pages : ces règles priment à spécificité égale. */

/* Empêche le navigateur de grossir le texte (iPhone en paysage) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Les cartes de l'accueil sont des liens : pas de soulignement */
a.service-card { text-decoration: none; color: inherit; }

@media (max-width: 900px) {
  /* Accueil : passage en une colonne (la règle d'origine était écrasée par la suite du CSS) */
  .sim-layout, .approach-layout { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .sim-intro .section-sub { max-width: none; }

  /* Bandeau CTA : boutons empilés et contenus dans l'écran */
  .cta-mid-btns { flex-shrink: 1; width: 100%; }

  /* Partenaires : catégorie au-dessus du défilement */
  .partners-category { flex-direction: column; align-items: stretch; gap: 0.6rem; margin-bottom: 1.75rem; }
  .cat-label { text-align: left; min-width: 0; }
  .ticker-wrap { border-left: 0; padding-left: 0; }
  .ticker span { padding: 0.4rem 1.5rem; }

  /* Champs à 16 px minimum : sinon iOS zoome sur la page à chaque saisie */
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
}

@media (max-width: 600px) {
  /* Boutons pleine largeur, faciles à toucher */
  .hero-actions a, .cta-mid-btns a, .cta-band-btns a { width: 100%; justify-content: center; }

  /* Accueil : cartes et mini-simulateur plus compacts */
  .sim-card { padding: 1.5rem 1.25rem; }
  .sim-tab { padding: 0.6rem 0.25rem; }
  .approach-visual { padding: 2rem 1.5rem; }
  .service-card { padding: 1.75rem 1.5rem; }

  /* Simulateurs : la valeur saisie ne se coupe pas en deux lignes */
  .field label .field-val { white-space: nowrap; }

  /* Pied de page */
  .footer-links { gap: 2rem; }
}

/* Effet verre sur Safari */
.sim-card { -webkit-backdrop-filter: blur(10px); }

/* Filet de sécurité : aucun élément ne doit élargir la page */
html, body { overflow-x: clip; }
/* Anciens iPhone (iOS < 16) qui ne connaissent pas « clip » */
@supports not (overflow: clip) {
  body { overflow-x: hidden; position: relative; }
}
