/**
 * BadgeWoo - Frontend Styles
 * Styles pour l'affichage des badges de stock sur le frontend
 */

/* Container relatif pour le positionnement des badges */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.woocommerce div.product div.images,
.woocommerce-page div.product div.images {
    position: relative;
}

/* Style de base des badges */
.badgewoo-badge {
    position: absolute;
    z-index: 10;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Effet au survol */
.badgewoo-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Badge En Stock */
.badgewoo-badge--instock {
    background-color: #28a745;
    color: #ffffff;
}

/* Badge Sur Commande */
.badgewoo-badge--onbackorder {
    background-color: #ffc107;
    color: #212529;
}

/* Badge Rupture de Stock */
.badgewoo-badge--outofstock {
    background-color: #dc3545;
    color: #ffffff;
}

/* Positionnement par défaut (sera surchargé par les styles inline) */
.badgewoo-badge {
    top: 10px;
    left: 10px;
}

/* Responsive - Tablettes */
@media screen and (max-width: 992px) {
    .badgewoo-badge {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* Responsive - Mobile */
@media screen and (max-width: 576px) {
    .badgewoo-badge {
        padding: 4px 8px;
        font-size: 10px;
        letter-spacing: 0.3px;
    }
}

/* Thème sombre (pour les thèmes qui supportent prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
    .badgewoo-badge {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
}

/* Animation d'apparition */
@keyframes badgewoo-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badgewoo-badge {
    animation: badgewoo-fade-in 0.3s ease-out;
}

/* Correction pour certains thèmes qui utilisent overflow: hidden */
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    position: relative;
    display: block;
    overflow: visible;
}

/* S'assurer que le badge est visible au-dessus de l'image */
.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img {
    position: relative;
    z-index: 1;
}

/* Compatibilité avec le badge de vente WooCommerce */
.woocommerce span.onsale {
    z-index: 11;
}

/* Badge en mode liste (si le thème le supporte) */
.woocommerce ul.products.list li.product .badgewoo-badge {
    position: static;
    display: inline-block;
    margin-bottom: 10px;
}
