.button-customizer {
  margin-bottom: 20px;
  width: 100%;
  background-color: #2c5246 !important;
  color: #fff !important;
  padding: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#custom-builder-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#custom-builder-popup {
  background: #fff;
  padding: 30px;
  max-width: 1800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.popup-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  color: #333;
}

.popup-title {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  color: #2c5246;
}

#validate-custom-popup {
  margin-top: 20px;
  width: 100%;
  background-color: #2c5246;
  color: white;
  padding: 10px;
}

.woocommerce div.product form.cart {
  display: flex;
  flex-wrap: wrap;
}

/* Nettoyage cosmétique pour le bloc couleur WooCommerce une fois dans la pop-up */
#popup-color-selector-placeholder
  .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-name {
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
  display: block;
}

@media (max-width: 768px) {
  #custom-builder-popup #handmade-builder {
    flex-direction: column;
  }
}

#handmade-builder {
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  display: flex;
  gap: 20px;
  /* flex-wrap: wrap; */
}

#handmade-builder .builder-ui {
  width: 50%;
}

/* Contrôles de Vue */
.view-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.view-btn {
  flex: 1;
  background: #fff;
  border: 2px solid #ddd;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

.view-btn.active {
  border-color: #222;
  background: #222;
  color: #fff;
}

/* Canvas */
.canvas-container {
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

#main-canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* UI Sections */
.ui-section {
  margin-bottom: 20px;
}

.ui-section label {
  display: block;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 14px;
}

.step-num {
  background: #222;
  color: #fff;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  margin-right: 8px;
}

/* Grille de Zones */
.zone-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.zone-option {
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
}

.zone-option.active {
  border-color: #d2b48c; /* Couleur lin/beige */
  background: #fff9f0;
  font-weight: bold;
}

/* Grille horizontale ou verticale scrollable pour les motifs */
.motif-radio-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fdfdfd;
  max-height: 130px;
}

.motif-radio-grid label {
  margin-bottom: 0;
}

/* Style du bouton supprimer au sein de la grille */
.motif-radio-item.delete-motif-item .delete-box {
  border: 2px dashed #e74c3c;
  background-color: #fdf2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.motif-radio-item.delete-motif-item .delete-icon {
  font-size: 18px;
  transition: transform 0.2s ease;
}

/* Effet de survol sur la case suppression */
.motif-radio-item.delete-motif-item:hover .delete-box {
  background-color: #f8d7da;
  border-color: #c0392b;
}

.motif-radio-item.delete-motif-item:hover .delete-icon {
  transform: scale(1.15);
}

/* Cache le bouton radio radio standard */
.motif-radio-item input[type="radio"] {
  display: none;
}

/* Boîte de prévisualisation cliquable */
.motif-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 90px;
  border: 2px solid #eee;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s ease;
  padding: 5px;
}

.motif-preview-box img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  margin-bottom: 5px;
}

.motif-preview-box span {
  font-size: 9px;
  text-align: center;
  word-break: break-word;
  color: #666;
  line-height: 1;
}

/* Style lors du survol */
.motif-radio-item:hover .motif-preview-box {
  border-color: #bbb;
}

/* Style lorsque le bouton radio est sélectionné */
.motif-radio-item input[type="radio"]:checked + .motif-preview-box {
  border-color: #2c5246;
  background-color: #dcfcf1;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

.motif-radio-grid .motif-radio-item .motif-preview-box:has(img[src*="blanc"]) {
  background-color: #222222;
}

/* Boutons Taille */
.size-btns {
  display: flex;
  gap: 5px;
}

.size-btn {
  flex: 1;
  padding: 6px;
  font-size: 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
}

.size-btn.active {
  background: #e0e0e0;
  border-color: #999;
}
