/**
 * Variation Swatches - Frontend Styles
 * 
 * Style sobre noir et blanc pour les boutons de sélection de variantes
 * et les contrôles de quantité
 */

/* ===================================
   BOUTONS DE VARIANTES (SWATCHES)
   =================================== */

/* Container des swatches */
.gioya-variation-swatches {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 10px 0 !important;
}

/* Bouton swatch - Style compact horizontal */
.gioya-swatch-button {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-width: auto !important;
    height: auto !important;
    padding: 8px 14px !important;
    background: #fff !important;
    border: 1px solid #000 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #000 !important;
    text-transform: none !important;
    position: relative !important;
    line-height: 1.2 !important;
}

/* Hover - non sélectionné */
.gioya-swatch-button:hover:not(.selected) {
    background: #f5f5f5 !important;
}

/* Sélectionné */
.gioya-swatch-button.selected {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

/* Icône - petite et inline */
.gioya-swatch-button .swatch-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.gioya-swatch-button .swatch-icon img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 18px !important;
    height: 18px !important;
    object-fit: contain !important;
    transition: filter 0.15s ease !important;
}

/* Inverser l'icône quand sélectionné */
.gioya-swatch-button.selected .swatch-icon img {
    filter: invert(1) !important;
}

/* Label - inline avec l'icône */
.gioya-swatch-button .swatch-label {
    display: inline !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

/* Focus pour accessibilité */
.gioya-swatch-button:focus {
    outline: 2px solid #000 !important;
    outline-offset: 2px !important;
}

.gioya-swatch-button:focus:not(:focus-visible) {
    outline: none !important;
}

/* Disabled / Out of stock */
.gioya-swatch-button.out-of-stock {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}

/* ===================================
   BOUTONS DE QUANTITÉ (+/-)
   =================================== */

/* Container de quantité */
.woocommerce div.product form.cart .quantity,
.variations_form .quantity,
.elementor-widget-woocommerce-product-add-to-cart .quantity,
.gioya-quantity-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
}

/* Boutons - et + personnalisés */
.gioya-qty-minus,
.gioya-qty-plus {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    background: #fff !important;
    border: 1px solid #000 !important;
    color: #000 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    font-family: 'Montserrat', sans-serif !important;
}

.gioya-qty-minus {
    border-radius: 4px 0 0 4px !important;
    border-right: none !important;
}

.gioya-qty-plus {
    border-radius: 0 4px 4px 0 !important;
    border-left: none !important;
}

.gioya-qty-minus:hover,
.gioya-qty-plus:hover {
    background: #000 !important;
    color: #fff !important;
}

/* Input de quantité */
.gioya-quantity-wrapper input.qty,
.woocommerce div.product form.cart .quantity input.qty,
.variations_form .quantity input.qty,
.elementor-widget-woocommerce-product-add-to-cart .quantity input.qty,
input.qty {
    width: 50px !important;
    height: 36px !important;
    border: 1px solid #000 !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 0 !important;
    margin: 0 !important;
    -moz-appearance: textfield !important;
    background: #fff !important;
    color: #000 !important;
}

.woocommerce div.product form.cart .quantity input.qty::-webkit-inner-spin-button,
.woocommerce div.product form.cart .quantity input.qty::-webkit-outer-spin-button,
input.qty::-webkit-inner-spin-button,
input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

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

.single_add_to_cart_button {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #000 !important;
    border-radius: 4px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 10px 24px !important;
    transition: all 0.15s ease !important;
}

.single_add_to_cart_button:hover {
    background: #fff !important;
    color: #000 !important;
}

/* ===================================
   LIEN EFFACER
   =================================== */

.reset_variations {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 12px !important;
    color: #666 !important;
    text-decoration: none !important;
    margin-top: 8px !important;
    display: inline-block !important;
}

.reset_variations:hover {
    color: #000 !important;
    text-decoration: underline !important;
}

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

.variations {
    width: 100% !important;
    margin-bottom: 15px !important;
}

.variations th.label {
    font-family: 'Syne', sans-serif !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: #000 !important;
    padding: 0 0 8px 0 !important;
    text-align: left !important;
}

.variations td.value {
    padding: 0 !important;
}

.variations tr {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

/* ===================================
   CACHER LE SELECT ORIGINAL
   =================================== */

.gioya-swatch-select-hidden,
.variations select[style*="display:none"] {
    display: none !important;
    position: absolute !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

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

@media (max-width: 768px) {
    .gioya-variation-swatches {
        gap: 6px !important;
    }
    
    .gioya-swatch-button {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    .gioya-swatch-button .swatch-icon,
    .gioya-swatch-button .swatch-icon img {
        width: 16px !important;
        height: 16px !important;
    }
    
    .gioya-qty-minus,
    .gioya-qty-plus {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 16px !important;
    }
    
    .gioya-quantity-wrapper input.qty,
    .woocommerce div.product form.cart .quantity input.qty,
    .variations_form .quantity input.qty,
    input.qty {
        width: 40px !important;
        height: 32px !important;
    }
}

/* ===================================
   INTÉGRATION ELEMENTOR
   =================================== */

.elementor-widget-woocommerce-product-add-to-cart .gioya-variation-swatches {
    margin-top: 10px !important;
}

/* S'assurer que les boutons de quantité sont visibles */
.elementor-widget-woocommerce-product-add-to-cart .quantity {
    display: inline-flex !important;
    align-items: center !important;
}

.elementor-widget-woocommerce-product-add-to-cart .gioya-qty-minus,
.elementor-widget-woocommerce-product-add-to-cart .gioya-qty-plus {
    display: inline-flex !important;
}
