/**
 * Custom Flocage - Styles pour le formulaire de personnalisation avancé
 * Chargé uniquement sur les produits avec personnalisation flocage
 */

/* ============================================
   WRAPPER PRINCIPAL
   ============================================ */

.flocage-native-textarea {
  opacity: 0;
  height: 0;
}
.custom-flocage-wrapper {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid #dee2e6;
}

/* ============================================
   EN-TÊTE AVEC TOGGLE
   ============================================ */
#persoHead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #dee2e6;
}

#persoHead p {
  margin: 0;
}

.flocage-titre {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
}

.flocage-legende {
  display: block;
  font-size: 0.85rem;
  color: #28a745;
  font-weight: 500;
}

/* Radio buttons Avec/Sans */
#radioPerso {
  display: flex;
  gap: 15px;
}

#radioPerso .radio-option {
  display: flex;
  align-items: center;
  gap: 5px;
}

#radioPerso input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#radioPerso label {
  margin: 0;
  cursor: pointer;
  font-weight: 500;
}

/* ============================================
   CHAMPS DE PERSONNALISATION
   ============================================ */
#persoFields {
  padding-top: 15px;
}

/* Lien exemple */
#persoFields .exemple {
  text-align: right;
  margin-bottom: 15px;
}

#persoFields .exemple a {
  color: #007bff;
  text-decoration: underline;
  font-size: 0.9rem;
}

#persoFields .exemple a:hover {
  color: #0056b3;
}

/* Lignes de champs */
.flocage-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 0;
}

.flocage-row .small-6.columns {
  flex: 0 0 50%;
  max-width: 50%;
}

.flocage-row .label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}

.flocage-row .label label {
  margin: 0;
}

.flocage-row .fields {
  display: block;
  width: 100%;
}

/* Inputs et Selects */
.flocage-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.flocage-field:focus {
  border-color: #80bdff;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

select.flocage-field {
  cursor: pointer;
  background-color: #fff;
}

/* ============================================
   CHAMPS NATIFS PRESTASHOP - MASQUAGE PARTIEL
   Pour flocage: on garde visible le textarea 
   mais on masque le label et le helper
   ============================================ */
.flocage-label-hidden {
  display: none !important;
}

.flocage-small-hidden {
  display: none !important;
}

.flocage-info-hidden {
  display: none !important;
}

/* Textarea natif : style lecture seule */
.flocage-native-textarea {
  background-color: #e9ecef;
  border: 1px dashed #adb5bd;
  color: #495057;
  cursor: default;
  min-height: 60px;
  font-size: 0.9rem;
}

.flocage-native-textarea:focus {
  box-shadow: none;
  border-color: #adb5bd;
}

/* Label au-dessus du textarea */
.flocage-native-field {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #dee2e6;
}

/* ============================================
   POPUP EXEMPLE FLOCAGE
   ============================================ */
.flocage-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.flocage-popup-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.flocage-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background: #fff;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.flocage-popup-close:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

.flocage-popup-img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  height: auto;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  #persoHead {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .flocage-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .flocage-row .small-6.columns {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  .flocage-row .label {
    margin-bottom: 5px;
  }

  .flocage-popup-close {
    top: 5px;
    right: 5px;
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
}
