/* bouton initial */
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;
}

/* bouton hoverisé   */
main .vitrage-btn:hover {
  background-color: #3d8f51;
  color: white;
}

/* css sur mobile */
@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;
  }
}

/* css sur mobile */
@media (max-width: 768px) {
  form {
    flex-direction: column;
  }

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

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

/* div 2  */
.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;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: stretch;
  justify-content: center;
  border-radius: 5px;
}

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

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

/* Séparateur */
.vitrage-separator {
  border: none;
  border-top: 1px solid #ddd;
  margin: 1rem 0;
}

/* Grilles de vitrages et 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 deux colonnes */
.vitrage-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-columns {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

label {
  display: flex;
  flex-direction: column;
  font-weight: 600; 
  font-size: 0.9rem;
  color: #333;
}

input,
select {
  margin-top: 0.3rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

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

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

.measure-row label {
  flex: 1;
}

.submit-btn {
  background: #4FA862;
  color: white;
  border: none;
  padding: 0.7rem 2rem;
  font-weight: 600;
  cursor: pointer;
  align-self: center;
  transition: background 0.3s ease;
}

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

/* État sélectionné pour vitrage ou cadre */
.vitrage-item.selected img {
    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; /* ✅ garde le ratio naturel */
    object-fit: contain; /* ✅ plus de découpe */
    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;
  }

  .form-columns {
    flex-direction: column;
  }

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

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