/**
 * MZ Free Bottle - Styles
 * Compatible avec le thème Savoy
 */

/* Message promotionnel - Style inspiré de nm-cart-shipping-meter */
.mz-free-bottle-promo {
    padding: 15px;
    margin: 15px 0;
    border-radius: 3px;
    background-color: #f8f8f8;
    border: 1px solid #e5e5e5;
    transition: all 0.3s ease;
}

.mz-free-bottle-promo.not-qualified {
    background-color: #fff9f0;
    border-color: #f0ad4e;
}

.mz-free-bottle-promo.qualified {
    background-color: #f0fdf4;
    border-color: #22c55e;
}

.mz-free-bottle-content {
    display: block;
}

.mz-free-bottle-text {
    font-size: 14px;
    line-height: 1.5;
}

.mz-free-bottle-text strong {
    font-weight: 600;
    color: #333;
}

/* Badge "OFFERT" dans le panier */
.mz-free-bottle-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #22c55e;
    color: #fff;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

/* Badge "OFFERT" sur la page commande (WooCommerce Blocks) */
/* Cibler le span dans un div sans classe spécifique (class="") */
.wc-block-components-product-details > div:not([class*="-"]) > .wc-block-components-product-details__value:only-child,
.wc-block-components-product-details > div[class=""] > .wc-block-components-product-details__value:only-child {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    background-color: #22c55e;
    color: #fff;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

/* Cacher le ":" avant le badge OFFERT - Structure HTML Savoy */
ul.variation li:has(.mz-free-bottle-badge) > div.variation-:first-child {
    display: none !important;
}

/* Alternative - Règle très spécifique pour le thème Savoy */
.woocommerce-cart-form ul.variation li > div.variation-:first-child:not(:has(p)):not(:has(span)) {
    display: none !important;
}

/* Cache tous les divs .variation- qui ne contiennent que ":" */
ul.variation li div.variation- {
    display: inline-block;
}

ul.variation li div.variation-:empty {
    display: none !important;
}

/* Quantité non modifiable pour la bouteille offerte */
.mz-free-bottle-quantity {
    /* Pas de text-align pour suivre l'alignement par défaut */
}

.mz-free-bottle-qty-label {
    display: inline-block;
    font-weight: normal;
    font-size: 14px;
}

/* Images des produits dans le panier - hauteur max 200px */
.woocommerce-cart-form .cart_item .product-thumbnail img,
.woocommerce-cart-form__cart-item .product-thumbnail img {
    max-height: 200px;
    width: auto;
    object-fit: contain;
}

/* Style pour le mini-cart Savoy */
#nm-cart-panel .mz-free-bottle-promo {
    margin: 0 0 15px 0;
}

/* Style pour la page panier */
.woocommerce-cart .mz-free-bottle-promo {
    margin-bottom: 20px;
}

/* Style pour la page commande */
.woocommerce-checkout .mz-free-bottle-promo {
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .mz-free-bottle-promo {
        padding: 12px;
    }
    
    .mz-free-bottle-text {
        font-size: 13px;
    }
}

/* Style pour le panier vide */
.nm-cart-panel-empty .mz-free-bottle-promo {
    display: none;
}

/* Intégration avec les styles du thème Savoy */
.nm-cart-panel-summary .mz-free-bottle-promo {
    order: -1; /* Afficher avant les boutons */
}

/* Style pour les meta data dans le panier */
.woocommerce-cart-form__cart-item .mz-free-bottle-badge,
.woocommerce-mini-cart-item .mz-free-bottle-badge {
    margin-top: 5px;
}

/* Checkout blocks compatibility */
.wp-block-woocommerce-checkout-order-summary-block .mz-free-bottle-promo {
    padding: 12px 15px;
    margin: 10px 0;
}

