/**
 * Framework CSS pour le système de bundles
 * Styles pour l'affichage front-end des bundles
 */

/* Container principal des bundles */
.bundles-selector-container {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bundles-selector-container h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Options de bundles */
.bundles-options {
    margin-bottom: 20px;
}

.bundle-option {
    margin-bottom: 10px;
}

.bundle-option input[type="radio"] {
    display: none;
}

.bundle-option label {
    display: block;
    padding: 8px 12px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
}

.bundle-option label:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.bundle-option input[type="radio"]:checked + label {
    border-color: #0073aa;
    background: #e3f2fd;
    box-shadow: 0 1px 8px rgba(0, 115, 170, 0.15);
}

.bundle-option label::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background: #fff;
    transition: all 0.3s ease;
}

.bundle-option input[type="radio"]:checked + label::before {
    border-color: #0073aa;
    background: #0073aa;
    box-shadow: inset 0 0 0 3px #fff;
}

.bundle-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-left: 30px;
    display: inline-block;
}

.bundle-price {
    color: #0073aa;
    font-size: 14px;
    font-weight: 700;
    margin-left: 30px;
    display: inline-block;
    margin-top: 2px;
}

.bundle-price-per-unit {
    font-size: 12px;
    color: #666;
    margin-left: 30px;
    display: inline-block;
    margin-top: 2px;
}



/* Responsive */
@media (max-width: 768px) {
    .bundles-selector-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .bundles-selector-container h3 {
        font-size: 16px;
    }
    
    .bundle-option label {
        padding: 10px 12px;
    }
    
    .bundle-label,
    .bundle-price,
    .bundle-price-per-unit {
        margin-left: 25px;
    }
}


/* États de chargement */
.bundles-selector-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.bundles-selector-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Styles pour le champ quantité désactivé */
input[name="quantity"]:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

input[name="quantity"]:disabled + .action {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   AFFICHAGE DU PRIX - BOÎTE FLOTTANTE
   ======================================== */

.configurateur-price-display {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(0) !important;
    z-index: 9999 !important;
    
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
/*     border: 2px solid #28a745; */
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInFromBottom 0.6s ease-out;
}

.configurateur-price-display:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.configurateur-price-display h3 {
    margin: 0;
    color: #28a745;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.configurateur-price-display .price-extra {
    color: #6c757d;
    font-size: 10px;
    margin-top: 3px;
    line-height: 1.3;
}

.configurateur-price-display .price-extra .extra-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
    font-size: 9px;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(40, 167, 69, 0.3);
}

.configurateur-price-display .price-base {
    color: #6c757d;
    font-size: 9px;
    margin-top: 3px;
    font-style: italic;
}

/* Animation d'entrée */
@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Animation de mise à jour du prix */
@keyframes priceUpdate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.configurateur-price-display.price-updating h3 {
    animation: priceUpdate 0.4s ease-in-out;
}

/* Masquer le prix WooCommerce natif quand les bundles sont activés */
.bundles-selector-container ~ .brxe-product-price,
.bundles-selector-container ~ .single-product-4__price,
.bundles-selector-container ~ .price {
    display: none !important;
}

/* Alternative : masquer le prix si un conteneur bundles existe */
body:has(.bundles-selector-container) .brxe-product-price,
body:has(.bundles-selector-container) .single-product-4__price,
body:has(.bundles-selector-container) .price {
    display: none !important;
}

/* ========================================
   STYLES POUR L'AFFICHAGE DANS LE PANIER
   ======================================== */

/* Informations des bundles dans le panier */
/*
.bundles-info {
    color: #666;
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
    display: block;
}
*/

/* Prix par unité dans le panier */
/*
.cart .bundles-info {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
    margin-top: 6px;
}
*/

/* Métadonnées des bundles dans le panier */
.cart .woocommerce-cart-form__cart-item .product-name .bundles-meta {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    padding: 4px 0;
}

.cart .woocommerce-cart-form__cart-item .product-name .bundles-meta dt {
    font-weight: 600;
    color: #333;
    display: inline;
}

.cart .woocommerce-cart-form__cart-item .product-name .bundles-meta dd {
    display: inline;
    margin-left: 4px;
}

/* Style pour le prix par unité dans les métadonnées */
.cart .woocommerce-cart-form__cart-item .product-name .bundles-meta .price-per-unit {
    color: #0073aa;
    font-weight: 600;
}

/* ========================================
   STYLES POUR L'AFFICHAGE DU CONDITIONNEMENT DANS LE PANIER
   ======================================== */

/* Conteneur principal du conditionnement */
.bundles-cart-conditioning {
    margin-top: 5px;
    padding: 5px 8px;
    background: #f8f9fa;
    border-left: 3px solid #0073aa;
    border-radius: 3px;
    font-size: 12px;
}

/* Label "Conditionnement:" */
.bundles-cart-conditioning-label {
    color: #333;
    font-size: 12px;
}

/* Label "Prix par unité:" */
.bundles-cart-price-per-unit-label {
    color: #0073aa;
    font-size: 12px;
}

/* Styles pour les pages ORDER */
.order .bundles-cart-conditioning {
    margin-top: 5px;
    padding: 5px 8px;
    background: #f8f9fa;
    border-left: 3px solid #0073aa;
    border-radius: 3px;
    font-size: 12px;
}

.order .bundles-cart-conditioning-label {
    color: #333;
    font-size: 12px;
}

.order .bundles-cart-price-per-unit-label {
    color: #0073aa;
    font-size: 12px;
}

/* Styles pour les emails */
.email .bundles-cart-conditioning {
    margin-top: 5px;
    padding: 5px 8px;
    background: #f8f9fa;
    border-left: 3px solid #0073aa;
    border-radius: 3px;
    font-size: 12px;
}

.email .bundles-cart-conditioning-label {
    color: #333;
    font-size: 12px;
}

.email .bundles-cart-price-per-unit-label {
    color: #0073aa;
    font-size: 12px;
}

