/* ============================================================================
   CSS FORMULAIRE VARIATIONS WOOCOMMERCE - STYLE MENUISIA
   ============================================================================ */

/* ========================================
   CONTENEUR PRINCIPAL
   ======================================== */

.variations_form {
    margin: 30px 0;
}

/* ========================================
   TABLEAU DES VARIATIONS
   ======================================== */

.variations {
    width: 100%;
    border: none;
    margin-bottom: 20px;
}

.variations tbody {
    width: 100%;
}

.variations tr {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

/* Label de la variation */
.variations .label {
    width: 100%;
    padding: 0;
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    color: #333;
    text-align: left;
}

.variations .label label {
    margin: 0;
    cursor: pointer;
}

/* Conteneur de la valeur */
.variations .value {
    width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ========================================
   NICE SELECT (SELECT PERSONNALISÉ)
   ======================================== */

.nice-select {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    
    width: 100%;
    max-width: 400px;
    height: 50px;
    padding: 0 20px;
    
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    
    font-size: 16px;
    color: #333;
    font-weight: 500;
    
    cursor: pointer;
    transition: all 0.3s ease;
    
    position: relative;
    user-select: none;
}

/* Hover */
.nice-select:hover {
    border-color: #EE9818;
    background: #FFF8ED;
}

/* Focus / Active */
.nice-select.open,
.nice-select:active {
    border-color: #EE9818;
    box-shadow: 0 0 0 3px rgba(238, 152, 24, 0.1);
}

/* Texte sélectionné */
.nice-select .current {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flèche */
.nice-select::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.nice-select.open::after {
    transform: rotate(180deg);
}

/* Liste déroulante */
.nice-select .list {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 100;
    
    background: #ffffff;
    border: 2px solid #EE9818;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    
    max-height: 300px;
    overflow-y: auto;
    
    list-style: none;
    margin: 0;
    padding: 8px 0;
    
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.nice-select.open .list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Options de la liste */
.nice-select .list .option {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    transition: all 0.2s ease;
}

.nice-select .list .option:hover {
    background: #FFF8ED;
    color: #EE9818;
}

.nice-select .list .option.selected {
    background: #EE9818;
    color: white;
    font-weight: 600;
}

.nice-select .list .option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar personnalisée */
.nice-select .list::-webkit-scrollbar {
    width: 6px;
}

.nice-select .list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.nice-select .list::-webkit-scrollbar-thumb {
    background: #EE9818;
    border-radius: 4px;
}

/* ========================================
   BOUTON "EFFACER"
   ======================================== */

.reset_variations {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    
    padding: 8px 16px;
    
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    
    transition: all 0.3s ease;
}

.reset_variations::before {
    content: '✕';
    font-size: 16px;
}

.reset_variations:hover {
    background: #ffebeb;
    border-color: #ff4444;
    color: #ff4444;
}

/* ========================================
   CONTENEUR AJOUT AU PANIER
   ======================================== */

.single_variation_wrap {
    margin-top: 20px;
}

.variations_button {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ========================================
   SÉLECTEUR DE QUANTITÉ
   ======================================== */

.quantity {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.quantity input[type="number"] {
    width: 80px;
    height: 50px;
    
    padding: 0 15px;
    
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
    
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    
    transition: all 0.3s ease;
    
    /* Masquer les flèches par défaut */
    -moz-appearance: textfield;
}

.quantity input[type="number"]::-webkit-outer-spin-button,
.quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity input[type="number"]:hover {
    border-color: #EE9818;
}

.quantity input[type="number"]:focus {
    outline: none;
    border-color: #EE9818;
    box-shadow: 0 0 0 3px rgba(238, 152, 24, 0.1);
}

/* ========================================
   BOUTON AJOUTER AU PANIER
   ======================================== */

.single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    
    min-width: 200px;
    height: 50px;
    padding: 0 30px;
    
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    background: linear-gradient(135deg, #EE9818 0%, #D88516 100%);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(238, 152, 24, 0.3);
    
    cursor: pointer;
    transition: all 0.3s ease;
}

.single_add_to_cart_button::before {
    content: '🛒';
    font-size: 18px;
}

.single_add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 152, 24, 0.4);
    background: linear-gradient(135deg, #D88516 0%, #C67514 100%);
}

.single_add_to_cart_button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(238, 152, 24, 0.3);
}

/* État désactivé */
.single_add_to_cart_button:disabled,
.single_add_to_cart_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* État loading */
.single_add_to_cart_button.loading {
    position: relative;
    color: transparent;
}

.single_add_to_cart_button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   MESSAGE DE VARIATION (Prix, Stock, etc.)
   ======================================== */

.single_variation {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #FFF8ED;
    border-left: 4px solid #EE9818;
    border-radius: 6px;
}

.single_variation .price {
    font-size: 28px;
    font-weight: 700;
    color: #EE9818;
    margin: 0;
}

.single_variation .woocommerce-variation-description {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.single_variation .woocommerce-variation-availability {
    margin-top: 10px;
}

.single_variation .stock {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
}

.single_variation .stock.in-stock {
    background: #d4edda;
    color: #155724;
}

.single_variation .stock.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

/* ========================================
   RESPONSIVE MOBILE
   ======================================== */

@media (max-width: 768px) {
    .variations tr {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .nice-select {
        max-width: 100%;
        height: 48px;
        font-size: 15px;
    }
    
    .variations_button {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .quantity {
        width: 100%;
        justify-content: center;
    }
    
    .quantity input[type="number"] {
        width: 100px;
        height: 48px;
    }
    
    .single_add_to_cart_button {
        width: 100%;
        min-width: auto;
        height: 48px;
        font-size: 15px;
    }
    
    .single_variation .price {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .variations .label {
        font-size: 15px;
    }
    
    .nice-select {
        height: 44px;
        font-size: 14px;
        padding: 0 15px;
    }
    
    .quantity input[type="number"] {
        width: 80px;
        height: 44px;
        font-size: 15px;
    }
    
    .single_add_to_cart_button {
        height: 44px;
        font-size: 14px;
        padding: 0 20px;
    }
}

/* ========================================
   DARK MODE (OPTIONNEL)
   ======================================== */

.dark .variations .label {
    color: #ffffff;
}

.dark .nice-select {
    background: #2a2a2a;
    border-color: #444444;
    color: #ffffff;
}

.dark .nice-select:hover {
    border-color: #EE9818;
    background: #333333;
}

.dark .nice-select .list {
    background: #2a2a2a;
    border-color: #EE9818;
}

.dark .nice-select .list .option {
    color: #ffffff;
}

.dark .nice-select .list .option:hover {
    background: #333333;
}

.dark .quantity input[type="number"] {
    background: #2a2a2a;
    border-color: #444444;
    color: #ffffff;
}

.dark .single_variation {
    background: rgba(238, 152, 24, 0.1);
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

/* Focus visible pour accessibilité clavier */
.nice-select:focus-visible,
.quantity input:focus-visible,
.single_add_to_cart_button:focus-visible {
    outline: 3px solid rgba(238, 152, 24, 0.5);
    outline-offset: 2px;
}

/* ========================================
   ANIMATIONS D'ENTRÉE (OPTIONNELLES)
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.variations_form {
    animation: fadeInUp 0.5s ease;
}