/* Configurateur de l'Enjambeur (configurateur.html) :
   page plein écran, grande image à gauche, chapitres d'options à droite. */

/* ---------- En-tête réduit : menu (trois traits) et logo, fixés en haut à gauche ---------- */

.cfg-page .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  width: auto;
  height: auto;
  background: transparent;
  z-index: 50;
}

.cfg-page .site-header .navigation {
  background: transparent;
  min-height: 0;
}

.cfg-page .site-header .navigation > .container {
  width: auto;
  padding: 0;
}

.cfg-page .site-header .navbar-header {
  float: none;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 12px 18px 12px 16px;
  background: rgba(255, 255, 255, .94);
  border-radius: 0 0 14px 0;
  box-shadow: 0 2px 10px rgba(30, 33, 61, .08);
}

.cfg-page .site-header .navbar-header .open-btn {
  display: block;
  position: static;
  width: 40px;
  height: 35px;
  padding: 5px 10px;
  border: 0;
  border-radius: 3px;
  background-color: #CF3476;
}

.cfg-page .site-header .navbar-header .open-btn .icon-bar {
  display: block;
  width: auto;
  height: 2px;
  margin: 0 0 5px;
  background-color: #fff;
  border-radius: 0;
}

.cfg-page .site-header .navbar-header .open-btn .icon-bar:last-child {
  margin: 0;
}

.cfg-page .site-header .navbar-brand {
  float: none;
  margin: 0 !important;
  padding: 0;
}

.cfg-page .site-header .navbar-brand img {
  height: 38px;
  width: auto;
}

.cfg-page .site-header .cart-search-contact {
  display: none;
}

/* Le menu s'ouvre en volet depuis la gauche, sur PC comme sur téléphone */
.cfg-page .site-header #navbar {
  display: block !important;
  position: fixed;
  top: 0;
  left: -300px;
  right: auto;
  width: 280px;
  height: 100% !important;
  margin: 0;
  padding: 60px 0 0;
  background: #fff;
  border: 0;
  box-shadow: 4px 0 18px rgba(30, 33, 61, .15);
  z-index: 100;
}

.cfg-page .site-header #navbar.slideInn {
  left: 0 !important;
  right: auto !important;
}

.cfg-page .site-header #navbar .close-navbar {
  display: block;
  position: absolute;
  top: 12px;
  right: 14px;
  left: auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background-color: #CF3476;
  color: #fff;
  /* Croix centrée dans le rond */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.cfg-page .site-header #navbar .close-navbar i {
  display: block;
  margin: 0;
  line-height: 1;
}

/* Bouton Contact en bas du volet */
.cfg-page .site-header #navbar .cfg-menu-contact {
  padding: 24px 30px;
}

.cfg-page .site-header #navbar .cfg-menu-contact .theme-btn {
  display: block;
  text-align: center;
}

.cfg-page .site-header #navbar {
  overflow-y: auto;
}

.cfg-page .site-header #navbar .navbar-nav {
  float: none;
  margin: 0;
  height: auto;
  overflow: visible;
}

.cfg-page .site-header #navbar .navbar-nav > li {
  float: none;
  border-bottom: 1px solid #e6e6e6;
}

.cfg-page .site-header #navbar .navbar-nav > li > a {
  padding: 14px 15px 14px 30px;
  color: #1E213D;
  font-size: 17px;
}

.cfg-page .site-header #navbar .navbar-nav > li.mobile-only {
  display: block !important;
}

/* On est déjà sur le configurateur : pas de bouton Configurateur ni de lien Contact dans le menu latéral */
.cfg-page .site-header #navbar .navbar-nav > li.menu-configurateur,
.cfg-page .site-header #navbar .navbar-nav > li.menu-contact {
  display: none !important;
}

/* ---------- Pied réduit : seulement les crédits ---------- */

.cfg-page .cfg-pied .lower-footer {
  padding: 0;
}

.cfg-page .cfg-pied .lower-footer .row {
  padding: 6px 0;
}

.cfg-page .cfg-pied .separator {
  display: none;
}

.cfg-page .cfg-pied p,
.cfg-page .cfg-pied ul {
  font-size: 12px;
  margin: 0;
}

/* Mobile : pas de bandeau des mentions légales sous le configurateur */
@media (max-width: 991px) {
  .cfg-page .cfg-pied {
    display: none;
  }
}

/* ---------- PC : tout tient dans l'écran, seul le panneau d'options défile ---------- */

@media (min-width: 992px) {
  /* clip (et non seulement hidden) : la page ne peut pas non plus défiler par programme */
  .cfg-page {
    overflow: hidden;
    overflow: clip;
  }
  .cfg-page .page-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow: clip;
  }
  .cfg-page .cfg {
    flex: 1;
    min-height: 0;
  }
  .cfg-page .cfg-cadre {
    height: 100%;
    max-width: none;
  }
  .cfg-page .cfg-scene {
    position: relative;
    height: 100%;
    padding: 80px 40px 24px;
  }
  .cfg-page .cfg-image {
    flex: 1;
    min-height: 0;
    aspect-ratio: auto;
  }
  .cfg-page .cfg-panneau {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
  }
  .cfg-page .cfg-pied {
    flex: none;
  }
}

.cfg {
  background: #f8f8f8;
}

.cfg-cadre {
  display: flex;
  align-items: flex-start;
  max-width: 1600px;
  margin: 0 auto;
}

/* ---------- Partie gauche : l'image ---------- */

.cfg-scene {
  flex: 1 1 62%;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
  min-width: 0;
}

.cfg-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #e8e8e8;
}

.cfg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .25s ease;
}

.cfg-image img.cfg-fondu {
  opacity: 0;
}

.cfg-photo-a-venir {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(30, 33, 61, .85);
  color: #fff;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
}

.cfg-legende {
  margin: 14px 0 0;
  text-align: center;
  font-size: 18px;
  color: #1E213D;
  font-weight: 600;
}

.cfg-points {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.cfg-points button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c9c9d3;
}

.cfg-points button.actif {
  background: #CF3476;
}

/* ---------- Partie droite : les chapitres ---------- */

.cfg-panneau {
  flex: 0 0 440px;
  background: #fff;
  min-height: 100vh;
  padding: 30px 32px 50px;
  box-shadow: -4px 0 18px rgba(30, 33, 61, .06);
}

.cfg-chapitres {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  border-bottom: 1px solid #e6e6e6;
}

.cfg-chapitres[hidden] {
  display: none;
}

.cfg-chapitres li {
  flex: 1;
}

.cfg-chapitres button {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 0;
  color: #727780;
  font-family: "Oswald", sans-serif;
  font-size: 16px;
  text-transform: uppercase;
}

.cfg-chapitres button span {
  display: inline-block;
  width: 22px;
  height: 22px;
  line-height: 22px;
  border-radius: 50%;
  background: #e6e6e6;
  color: #1E213D;
  font-size: 12px;
  margin-right: 4px;
}

/* Onglet qu'on ne peut pas encore atteindre : pointeur normal */
.cfg-chapitres button.cfg-bloque {
  cursor: default;
}

.cfg-chapitres button.actif {
  color: #1E213D;
  border-bottom-color: #CF3476;
}

.cfg-chapitres button.actif span {
  background: #CF3476;
  color: #fff;
}

.cfg-chapitre h2 {
  font-size: 28px;
  margin: 0 0 8px;
  color: #1E213D;
}

.cfg-chapitre h3 {
  font-size: 18px;
  margin: 24px 0 6px;
  color: #1E213D;
}

.cfg-aide {
  color: #727780;
  font-size: 15px;
  margin-bottom: 12px;
}

/* Avec JavaScript, un seul chapitre visible à la fois (sans JavaScript, tout reste affiché) */
.cfg-js .cfg-chapitre {
  display: none;
}

.cfg-js .cfg-chapitre.actif {
  display: block;
}

.cfg-chapitre[data-chapitre="merci"] {
  display: none;
}

/* Largeurs de voie : grille de pastilles */
.cfg-voies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

/* Choix de la machine (Enjambeur ou Broco'lit) et des deux modèles de Broco'lit */
.cfg-voies-brocolit {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Voie et planche sur une seule ligne chacune, même sur petit téléphone */
.cfg-voies-brocolit .cfg-voie span {
  padding-left: 3px;
  padding-right: 3px;
}

.cfg-voies-brocolit .cfg-voie small {
  white-space: nowrap;
}

/* Très petits écrans (320 px) : on laisse le texte passer à la ligne plutôt que déborder */
@media (max-width: 359px) {
  .cfg-voies-brocolit .cfg-voie small { white-space: normal; }
}

.cfg-machines strong {
  font-size: 18px;
}

/* PC et téléphone : les deux boutons machine se partagent toute la ligne,
   pour que « Porte-outils électrique » tienne sur une ligne */
.cfg-machines {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cfg-machines .cfg-voie small {
  white-space: nowrap;
}

/* Très petits écrans (320 px) : passage à la ligne plutôt que débordement */
@media (max-width: 359px) {
  .cfg-machines .cfg-voie small { white-space: normal; }
}

/* Questions propres à chaque machine : seule celle de la machine choisie s'affiche */
.cfg-js .cfg-variante {
  display: none;
}

.cfg-js .cfg-variante.actif {
  display: block;
}

.cfg-note-l {
  margin-top: 10px;
}

.cfg-voie {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

.cfg-voie[hidden] {
  display: none;
}

.cfg-voie input,
.cfg-ligne input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.cfg-voie span {
  /* Tous les boutons d'une même ligne prennent la hauteur du plus haut,
     texte centré verticalement (ex. Enjambeur / Broco'lit, « À définir ») */
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 9px 6px;
  border: 2px solid #e6e6e6;
  border-radius: 10px;
  color: #1E213D;
  transition: border-color .15s, background-color .15s;
}

.cfg-voie small {
  display: block;
  font-size: 12px;
  color: #727780;
}

/* Broco'lit : largeur de planche en plus petit sous la voie */
.cfg-voie small.cfg-planche {
  font-size: 11px;
  opacity: .85;
}

.cfg-voie:hover span {
  border-color: #CF3476;
}

.cfg-voie input:checked + span {
  border-color: #CF3476;
  background: #fbeaf1;
}

/* Lignes à cocher (série et outils) */
.cfg-ligne {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 12px 4px;
  border-bottom: 1px solid #f1f1f1;
  font-weight: normal;
  cursor: pointer;
}

.cfg-coche {
  flex: 0 0 24px;
  height: 24px;
  border: 2px solid #c9c9d3;
  border-radius: 6px;
  position: relative;
  transition: background-color .15s, border-color .15s;
}

.cfg-ligne input:checked ~ .cfg-coche {
  background: #CF3476;
  border-color: #CF3476;
}

.cfg-ligne input:checked ~ .cfg-coche::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 1px;
  width: 8px;
  height: 14px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.cfg-serie input:checked ~ .cfg-coche {
  background: #1E213D;
  border-color: #1E213D;
}

.cfg-voie input:focus-visible + span,
.cfg-ligne input:focus-visible ~ .cfg-coche {
  outline: 3px solid #1E213D;
  outline-offset: 2px;
}

.cfg-texte {
  flex: 1;
  min-width: 0;
}

.cfg-texte strong {
  display: block;
  color: #1E213D;
}

.cfg-texte small {
  color: #727780;
  font-size: 13px;
}

.cfg-quantite {
  flex: 0 0 auto;
  border: 1px solid #c9c9d3;
  border-radius: 6px;
  padding: 4px 6px;
  background: #fff;
  color: #1E213D;
}

.cfg-quantite:disabled {
  visibility: hidden;
}

.cfg-manquant {
  outline: 2px solid #CF3476;
  outline-offset: 6px;
  border-radius: 6px;
}

/* Phrase qui dit ce qui manque, juste au-dessus du cadre rose */
.cfg-manque {
  color: #CF3476;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 14px;
}

/* Configuration en cours reprise au retour sur le configurateur */
.cfg-reprise {
  margin: -12px 0 20px;
  padding: 10px 14px;
  background: #f4f5f8;
  border-radius: 8px;
  color: #1E213D;
  font-size: 14px;
  line-height: 1.5;
}

.cfg-reprise[hidden] {
  display: none;
}

.cfg-reprise button {
  background: none;
  border: 0;
  padding: 0;
  color: #CF3476;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Demande de devis : une étape à la fois (sans JavaScript, toutes s'affichent) */
.cfg-js .cfg-etape-devis {
  display: none;
}

.cfg-js .cfg-etape-devis.actif {
  display: block;
}

.cfg-etape-devis + .cfg-etape-devis {
  margin-top: 20px;
}

.cfg-js .cfg-etape-devis + .cfg-etape-devis {
  margin-top: 0;
}

.cfg-champs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cfg-champs .form-control {
  height: 44px;
  border-radius: 6px;
  margin: 0;
}

.cfg-champs .cfg-large {
  grid-column: 1 / -1;
}

/* Liste des pays : grisée comme un champ vide tant que rien n'est choisi */
.cfg-champs select.cfg-vide {
  color: #999;
}

.cfg-champs textarea.form-control {
  height: 100px;
}

/* Champ refusé : entouré en rouge, avec la raison juste en dessous */
.cfg-champs .form-control.cfg-invalide {
  border-color: #CF3476;
  box-shadow: 0 0 0 2px rgba(207, 52, 118, .25);
}

.cfg-champ-erreur {
  grid-column: 1 / -1;
  margin: -4px 0 4px;
  color: #CF3476;
  font-size: 14px;
  line-height: 1.4;
}

.cfg-question-libre {
  display: block;
  margin: 0 0 10px;
  color: #1E213D;
  font-size: 17px;
}

.cfg-erreur {
  color: #CF3476;
  margin-top: 12px;
}

.cfg-chapitre[data-chapitre="merci"] .cfg-actions .theme-btn {
  margin-left: 0;
}

.cfg-merci {
  font-size: 16px;
  color: #1E213D;
  margin: 10px 0;
}

.cfg-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.cfg-actions .theme-btn {
  margin-left: auto;
  color: #fff;
  border: 0;
}

.cfg-retour {
  background: none;
  border: 0;
  color: #727780;
  text-decoration: underline;
  padding: 0;
}

/* Champ piège à robots, invisible pour les visiteurs */
.cfg .hp-field {
  position: absolute;
  left: -9999px;
}

/* ---------- Tablette et téléphone : image en haut, options dessous ---------- */
@media (max-width: 991px) {
  /* Bandeau menu + logo en haut sur toute la largeur ; il défile avec le haut de la page */
  .cfg-page .site-header {
    position: absolute;
    right: 0;
    width: 100%;
  }
  .cfg-page .site-header .navbar-header {
    padding: 10px 16px;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(30, 33, 61, .12);
  }
  .cfg-cadre {
    flex-direction: column;
    align-items: stretch;
  }
  .cfg-scene {
    position: relative;
    height: auto;
    padding: 72px 16px 10px;
    background: #f8f8f8;
    z-index: 5;
  }
  .cfg-image {
    aspect-ratio: 16 / 9;
    max-height: 34vh;
  }
  .cfg-legende {
    font-size: 15px;
    margin-top: 6px;
  }
  .cfg-panneau {
    flex-basis: auto;
    min-height: 0;
    padding: 20px 16px 40px;
    box-shadow: none;
  }
  .cfg-champs {
    grid-template-columns: 1fr;
  }
}

/* Chapitre Devis : modes de livraison et extension de garantie, une option par ligne (textes plus longs) */
.cfg-livraisons,
.cfg-garanties {
  grid-template-columns: 1fr;
}

.cfg-livraisons .cfg-voie span,
.cfg-garanties .cfg-voie span {
  text-align: left;
  padding: 10px 14px;
}

.cfg-livraisons .cfg-voie[hidden] {
  display: none;
}

.cfg-note-palette {
  margin-top: 10px;
}
