/* =====================================================
   FICHIER : css/pop_up.css
   RÔLE : Style la pop-up d'achat pour les articles avec options.
   ===================================================== */

/* Le fond sombre et flou derrière la pop-up */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: block;
  opacity: 1;
}

/* La pop-up elle-même */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 1001;
  background: linear-gradient(135deg, rgba(40, 40, 40, 0.95), rgba(30, 30, 30, 0.98));
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  display: none;
  opacity: 0;
  transition: all 0.3s ease;
}

.modal.active {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Contenu de la pop-up */
#product-modal-content {
  padding: 2rem;
  position: relative;
}

/* Bouton de fermeture */
.modal .close-button {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #ff6b6b;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1002;
}

.modal .close-button:hover {
  background: rgba(255, 107, 107, 0.1);
  color: #ff4757;
  transform: rotate(90deg);
}

/* Titre et prix */
.modal h3 {
  color: #ffffff;
  font-size: 1.8rem;
  margin: 0 0 1rem 0;
  text-align: center;
  font-weight: 600;
  padding-right: 40px; /* Espace pour le bouton fermer */
}

.modal .price-display {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.modal .price-display span {
  font-size: 2.2rem;
  font-weight: bold;
  color: #ffd700;
}

/* Formulaire dans la pop-up */
.modal h4 {
  color: #ffd700;
  font-size: 1.2rem;
  margin: 1.5rem 0 1rem 0;
  text-align: left;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  padding-bottom: 0.5rem;
}

.modal .form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.modal .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #ccc;
  font-size: 0.9rem;
}

.modal .form-control {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #555;
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.modal .form-control:focus {
  outline: none;
  border-color: #ffd700;
}

.modal .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

.modal .form-message {
  margin-top: 1rem;
  font-weight: bold;
  text-align: center;
}

/* ============================================= */
/* == Styles pour le Calculateur de Montant == */
/* ============================================= */

/* Le parent doit être en position relative pour positionner le symbole */
.form-group {
  position: relative;
}

/* Style pour le symbole dollar ($) qui sera ajouté par JavaScript */
.dollar-sign {
  position: absolute;
  left: 12px;
  top: 42px;
  color: #aaa;
  font-size: 1rem;
  font-weight: bold;
  pointer-events: none;
}

/* Style pour le champ de texte qui a un symbole dollar */
.form-group input.has-dollar-sign {
  padding-left: 25px !important;
}

/* Style pour le champ de coût calculé (pour le rendre grisé) */
.form-group input[readonly],
.form-group input[type="calculated_cost"] {
  background-color: #2c2c2c;
  color: #aaa;
  cursor: not-allowed;
  border-color: #444;
}

/* ============================================= */
/* == Styles Responsive pour Pop-up == */
/* ============================================= */
@media (max-width: 768px) {
  .modal {
    width: 95%;
    padding: 1.5rem;
  }
  
  .modal h3 {
    font-size: 1.5rem;
    padding-right: 35px;
  }
  
  .modal .price-display span {
    font-size: 1.8rem;
  }
  
  .modal .form-control {
    padding: 10px;
  }
  
  .modal .btn-primary {
    padding: 10px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .modal {
    width: 100%;
    border-radius: 0;
    max-height: 100vh;
    padding: 1rem;
  }
  
  #product-modal-content {
    padding: 1rem;
  }
  
  .modal h3 {
    font-size: 1.3rem;
    padding-right: 30px;
  }
  
  .modal .close-button {
    top: 10px;
    right: 15px;
    font-size: 1.8rem;
  }
}