/* ==============================
   🔘 Bouton principal
============================== */
main .vitrage-btn {
  background-color: #eeeeee;
  color: black;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  width: 110px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

main .vitrage-btn:hover {
  background-color: #3d8f51;
  color: white;
}

/* ==============================
   📱 Responsive mobile (vitrage container)
============================== */
@media (max-width: 768px) {
  .vitrage-container {
    flex-direction: column;
    /* Empile les blocs */
  }

  .vitrage-container>div:first-child {
    order: 1;
    /* image en premier */
    width: 100%;
    /* prend toute la largeur */
  }

  .vitrage-container>div:last-child {
    order: 2;
    width: 100%;
    padding-top: 2rem;
  }

  form {
    flex-direction: column;
  }

  /* ✅ Centrer le bouton sur mobile */
  .btn-container {
    justify-content: center !important;
  }

  .btn-container button {
    max-width: 100% !important;
  }
}

/* ==============================
   🪟 Section principale
============================== */
.vitrage-section {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem;
  box-sizing: border-box;
}

/* ----- Image gauche ----- */
.vitrage-left {
  flex: 0 0 45%;
}

.vitrage-left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ----- Bloc droit ----- */
.vitrage-right {
  flex: 0 0 55%;
  background: #fff;
  border: 2px solid #0b9866;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.vitrage-content {
  width: 90%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 0;
}

/* ==============================
   🏷️ Titres et séparateur
============================== */
.vitrage-title {
  color: #4FA862;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  text-align: center;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.vitrage-separator {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1rem 0;
}

/* ==============================
   🧩 Grilles (vitrages / cadres)
============================== */
.vitrage-grid,
.cadre-placeholder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 1rem;
  justify-items: center;
}

.vitrage-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.vitrage-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.vitrage-item img:hover {
  transform: scale(1.05);
}

.vitrage-item span {
  color: #333;
  font-weight: 500;
  font-size: 0.9rem;
}

/* ==============================
   🧾 Formulaire 2 colonnes
============================== */
.vitrage-form-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem;
  /* gap vertical et horizontal */
  align-items: start;
}

.vitrage-form-2col .form-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* espace vertical uniforme */
}

.vitrage-form-2col label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
  display: block;
}

.vitrage-form-2col input,
.vitrage-form-2col select {
  width: 100%;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  outline: none;
  border-radius: 4px;
  height: 38px;
  /* même hauteur pour tout */
  box-sizing: border-box;
}

.measure-row {
  display: flex;
  gap: 0.8rem;
}

.measure-row input {
  flex: 1;
  height: 38px;
  /* même hauteur que les autres inputs */
}

/* Bouton Envoyer */
.submit-area {
  background: #4FA862;
  color: white;
  text-align: center;
  padding: 0.7rem 2rem;
  font-weight: 600;
  cursor: pointer;
  align-self: center;
  width: fit-content;
  margin: 1.2rem auto 0;
  transition: background 0.3s ease;
  user-select: none;
  border: none;
  border-radius: 4px;
}

.submit-area:hover {
  background: #3c8a56;
}

/* ----- Labels & Inputs ----- */
label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}

input,
select {
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  /* ✅ assure un alignement parfait */
}

input:focus,
select:focus {
  border-color: #4FA862;
}

/* ----- Sélection d’un vitrage ----- */
.vitrage-item img.selected {
  outline: 3px solid #4FA862;
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* ==============================
   📱 Responsive professionnel
============================== */
@media (max-width: 991px) {
  .vitrage-section {
    flex-direction: column;
    padding: 1rem;
  }

  .vitrage-left,
  .vitrage-right {
    flex: 0 0 100%;
  }

  .vitrage-left img {
    height: auto;
    object-fit: contain;
    max-height: 350px;
    margin: 0 auto;
  }

  .vitrage-content {
    width: 100%;
    padding: 1rem;
  }

  .vitrage-grid,
  .cadre-placeholder {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 0.6rem;
  }

  .vitrage-item img {
    width: 65px;
    height: 65px;
  }

  .vitrage-item span {
    font-size: 0.8rem;
  }

  /* ✅ Tous les champs passent en colonne */
  .vitrage-form-2col {
    grid-template-columns: 1fr;
  }

  .measure-row {
    flex-direction: column;
  }

  .submit-area {
    width: 100%;
  }
}

/* --- MODAL GLOBALE --- */
.custom-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: white;
    padding: 1.8rem 2.5rem;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
    z-index: 9999;
    font-family: sans-serif;
    text-align: center;
    min-width: 300px;
}

/* Apparition */
.custom-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Styles différents */
.modal-error {
    border-left: 6px solid #D9534F;
}

.modal-success {
    border-left: 6px solid #4FA862;
}

.custom-modal h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.custom-modal p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.85;
}