/*
Theme Name: Wolmart Child
Theme URI: https://wolmart.org/
Author: D-THEMES
Author URI: https://wolmart.org/about-me/
Description: Wolmart Responsive WordPress + eCommerce Theme.
Version: 1.0
Template: wolmart
License: Commercial
License URI: http://themeforest.net/licenses/regular_extended
Tags: woocommerce, corporate, ecommerce, responsive, blue, black, green, white, light, dark, red, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
*/

/*************** ADD YOUR CUSTOM CSS HERE  ***************/


/* Séparation des catégories et produits + style moderne et compact */
.products {
    display: flex;
    flex-wrap: wrap;
    position: relative;
}
/* Forcer les catégories et produits à être sur des lignes séparées avec trait gris SEULEMENT s'il y a des catégories */
.products:has(.category-wrap)::after {
    content: "";
    flex-basis: 100%;
    width: 100%;
    height: 3px;
    background: #f5f5f5;
    margin: 30px 0;
    order: 9; /* Assure que ce séparateur apparaît après toutes les catégories */
}
/* Suppression du titre "Nos Catégories" */
.products::before {
    display: none;
}
/* Placez toutes les catégories avant les produits */
.category-wrap {
    order: 0;
    margin-bottom: 20px; /* Ajusté pour créer un espacement vertical cohérent */
    width: 33.333%; /* 3 catégories par ligne */
    padding: 0 10px;
    box-sizing: border-box;
}
/* Placez tous les produits après les catégories */
.product-wrap {
    order: 10;
}
/* Masquer le nombre de produits et le bouton acheter */
.category-content mark,
.category-content .btn-link {
    display: none !important;
}

/* Style de base pour toutes les catégories */
.product-category {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    background: #fff;
    height: 100%;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.product-category:hover {
    box-shadow: 0 5px 15px rgba(0, 101, 153, 0.15);
    border-color: rgba(0, 101, 153, 0.1);
    transform: translateY(-3px);
}

/* Gestion des images pour TOUTES les catégories */
.product-category figure {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.product-category figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Masquer les images placeholder de WooCommerce */
.product-category figure img.woocommerce-placeholder,
.product-category figure img[src*="woocommerce-placeholder"],
.product-category figure img[src*="placeholder"] {
    display: none;
}

/* S'assurer que les figures avec des placeholders sont traitées comme vides */
.product-category figure:has(img.woocommerce-placeholder),
.product-category figure:has(img[src*="woocommerce-placeholder"]),
.product-category figure:has(img[src*="placeholder"]) {
    display: none;
}

/* Overlay sombre pour toutes les catégories ayant une image - ASSOMBRI */
.product-category figure::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55); /* Augmenté de 0.5 à 0.75 pour assombrir */
    z-index: 1;
}

/* Correction pour les catégories sans images */
.product-category figure:empty {
    display: none;
}

/* Style conditionnel pour le contenu basé sur la présence d'une image */
.category-content {
    padding: 0;
    position: relative;
    z-index: 2;
    color: #333;
}

.woocommerce-loop-category__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.woocommerce-loop-category__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.woocommerce-loop-category__title a:hover {
    color: #006599;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 0; /* Suppression de l'espace pour les flèches */
}

.category-list li:last-child {
    margin-bottom: 0;
}

/* Supprimer les flèches des sous-menus */
.category-list li::before {
    display: none;
}

.category-list li a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 13px;
}

.category-list li a:hover {
    color: #006599;
}

/* Styles pour les catégories avec image (vérification via l'élément img) */
.product-category:has(figure img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) .category-content {
    color: #fff;
}

.product-category:has(figure img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) .woocommerce-loop-category__title {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.product-category:has(figure img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) .woocommerce-loop-category__title a,
.product-category:has(figure img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) .category-list li a {
    color: #fff;
}

.product-category:has(figure img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) .woocommerce-loop-category__title a:hover,
.product-category:has(figure img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) .category-list li a:hover {
    color: #f0f0f0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Support pour la catégorie "chaud" spécifiquement */
.category-chaud.product-category .category-content {
    color: #fff;
}

.category-chaud.product-category .woocommerce-loop-category__title {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.category-chaud.product-category .woocommerce-loop-category__title a,
.category-chaud.product-category .category-list li a {
    color: #fff;
}

.category-chaud.product-category .woocommerce-loop-category__title a:hover,
.category-chaud.product-category .category-list li a:hover {
    color: #f0f0f0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* NOUVEAU: Style spécial pour les catégories sans sous-catégories */
.product-category:not(:has(.category-list)) {
    aspect-ratio: 1/1; /* Format carré */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0; /* Suppression du padding intérieur */
}

.product-category:not(:has(.category-list)) .category-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 15px;
}

.product-category:not(:has(.category-list)) .woocommerce-loop-category__title {
    margin: 0;
    padding: 0;
    border-bottom: none; /* Suppression de la ligne de séparation */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Style pour le titre des catégories sans sous-catégories avec une image */
.product-category:not(:has(.category-list)):has(figure img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) .woocommerce-loop-category__title {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.product-category:not(:has(.category-list)):has(figure img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) .woocommerce-loop-category__title a {
    color: #fff;
}

.product-category:not(:has(.category-list)):has(figure img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) .woocommerce-loop-category__title a:hover {
    color: #f0f0f0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Cas spécial : catégories sans liste mais avec image */
.product-category:not(:has(.category-list)) figure:not(:empty):has(img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) + .category-content {
    color: #fff;
}

.product-category:not(:has(.category-list)) figure:not(:empty):has(img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) + .category-content .woocommerce-loop-category__title a {
    color: #fff;
}

.product-category:not(:has(.category-list)) figure:not(:empty):has(img:not(.woocommerce-placeholder):not([src*="woocommerce-placeholder"]):not([src*="placeholder"])) + .category-content .woocommerce-loop-category__title a:hover {
    color: #f0f0f0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Classe de fallback pour JS */
.has-background-image .category-content {
    color: #fff;
}

.has-background-image .woocommerce-loop-category__title {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.has-background-image .woocommerce-loop-category__title a,
.has-background-image .category-list li a {
    color: #fff;
}

.has-background-image .woocommerce-loop-category__title a:hover,
.has-background-image .category-list li a:hover {
    color: #f0f0f0;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Fallback pour les catégories sans sous-catégories */
.no-subcategories {
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.no-subcategories .category-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 15px;
}

.no-subcategories .woocommerce-loop-category__title {
    margin: 0;
    padding: 0;
    border-bottom: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Responsive design */
@media (max-width: 992px) {
    .category-wrap {
        width: 50%; /* 2 catégories par ligne sur tablette */
    }
}
@media (max-width: 576px) {
    .category-wrap {
        width: 100%; /* 1 catégorie par ligne sur mobile */
    }
    
    .product-wrap:first-of-type::before {
        font-size: 20px;
    }
}

.attribute-filter-description {
    padding-bottom: 20px;
}