header {
  height: 350px;
}
.titre-header {
  position: absolute;
  top: 45%;
  left: 60% !important;
}

.titre-header h1 {
  font-size: 4rem;
}
section {
  width: 80%;
  margin: auto;
}
/* Section panier */
main h1 {
  color: #3a5151;
  font-size: 30px;
  display: flex;
  justify-content: start;
  width: 80%;
  margin: 40px auto;
}
.panier-page {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

#panier-container {
  flex: 2 1 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panier-card {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #ddd;
  align-items: flex-start;
}

.panier-card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow 0.3s;
}
.panier-card img:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.panier-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  min-width: 0;
}

.panier-details h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: #3a5151;
}
.panier-details h3 a {
  color: #3a5151;
  text-decoration: none;
}
.panier-details h3 a:hover {
  text-decoration: underline;
}

.prix-unitaire {
  font-size: 14px;
  color: #555;
  margin: 4px 0;
}

.panier-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.panier-actions input[type='number'] {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

.btn-supprimer {
  background: none;
  border: none;
  color: #3a5151;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.btn-supprimer:hover {
  text-decoration: underline;
  color: red;
}

#total-section {
  color: #3a5151 !important;
  flex: 1 1 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 24px;
  box-sizing: border-box;
  background: #fafafa;
  max-height: fit-content;
}

#total-section h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 18px;
}

#total-section .frais-livraison-ligne,
#total-section .total-ligne {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 16px;
}
.frais-livraison-ligne {
  flex-direction: column;
}
.frais-livraison-ligne div {
  display: flex;
  justify-content: space-between;
}
#total-section .total-ligne {
  font-weight: bold;
  border-top: 1px solid #3a5151;
  padding-top: 12px;
}

#btn-checkout {
  width: 100%;
  padding: 12px;
  background-color: #3a5151;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 16px;
  transition: 0.3s;
}
#btn-checkout:hover {
  background-color: #324646;
}

/* Section formulaire d'achat */
/* Masquer le formulaire au départ */
#form-livraison {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  margin-top: 16px;
}

/* Quand on ajoute la classe .open, on déploie */
#form-livraison.open {
  max-height: 800px; /* assez grand pour contenir le form */
}

/* Styles de base du formulaire */
#form-livraison h3 {
  margin-top: 0;
  font-size: 16px;
  color: #333;
}
#form-livraison .form-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}
#form-livraison .form-group label {
  font-size: 14px;
  margin-bottom: 4px;
}
#form-livraison .form-group label span {
  color: red;
}
#form-livraison .form-group input {
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#form-livraison .form-group input:invalid {
  border-color: red;
}

/* Bouton de soumission du formulaire */
#btn-submit-livraison {
  background-color: #3a5151;
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.3s;
  width: 100%;
}
#btn-submit-livraison:hover {
  background-color: #3a5151;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal-content {
  background: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.modal-content h2 {
  margin-top: 0;
  color: #c0392b;
}
.modal-content button {
  margin-top: 15px;
  padding: 10px 20px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.modal-content button:hover {
  background: #a93226;
}

/* responsive */
@media (max-width: 1440px) {
  .titre-header h1 {
    font-size: 42px;
  }
}
@media (max-width: 1024px) {
  .titre-header h1 {
    font-size: 32px;
  }
}
@media (max-width: 768px) {
  .titre-header h1 {
    font-size: 28px;
  }
  #form-livraison .form-group {
    margin-bottom: 10px;
  }
}
@media (max-width: 550px) {
  .titre-header h1 {
    font-size: 22px;
  }
  .titre-header {
    position: absolute;
    top: 55%;
    left: 60% !important;
  }
}
@media (max-width: 425px) {
  .titre-header h1 {
    font-size: 18px;
  }
  .titre-header {
    position: absolute;
    top: 55%;
    left: 60% !important;
  }
}
