/**
 * Styles pour le menu des catégories WooCommerce
 */

/* Container principal */
.wc-categories-menu-container {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

/* Support de l'ancien ID pour compatibilité */
#wc-categories-menu-container {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

/* Menu via shortcode */
.wc-categories-menu-shortcode {
    position: relative;
    display: inline-block;
    z-index: 1000;
}

/* Intégration dans les menus WordPress */
li.menu-item.wc-categories-menu-item {
    position: relative;
}

li.menu-item.wc-categories-menu-item > #wc-categories-menu-container {
    display: block;
}

/* Wrapper du menu */
.wc-categories-menu-wrapper {
    position: relative;
}

/* Trigger du menu (bouton CATÉGORIES) */
.wc-categories-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #ffffff;
    color: #333333;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    position: relative;
}

.wc-categories-menu-trigger:hover {
    color: #e74c3c;
}

.wc-categories-menu-trigger.active {
    color: #e74c3c;
}

.wc-categories-menu-trigger.active .wc-categories-arrow {
    transform: rotate(180deg);
}

.wc-categories-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    display: inline-block;
}

/* Menu déroulant */
.wc-categories-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: 5px;
    border-radius: 4px;
    overflow: hidden;
}

.wc-categories-menu-wrapper:hover .wc-categories-dropdown,
.wc-categories-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* En-tête du dropdown */
.wc-categories-dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f8f8;
}

.wc-categories-dropdown-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333333;
    text-transform: capitalize;
}

/* Liste des catégories */
.wc-categories-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 8px 0;
}

/* Item de catégorie */
.wc-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: #333333;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.wc-category-item:last-child {
    border-bottom: none;
}

.wc-category-item:hover {
    background-color: #f8f8f8;
    color: #e74c3c;
}

/* Image de la catégorie */
.wc-category-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Nom de la catégorie */
.wc-category-name {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

/* Scrollbar personnalisée */
.wc-categories-list::-webkit-scrollbar {
    width: 6px;
}

.wc-categories-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.wc-categories-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.wc-categories-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-categories-dropdown {
        min-width: 250px;
        max-width: 90vw;
    }
    
    .wc-category-image {
        width: 40px;
        height: 40px;
    }
    
    .wc-category-name {
        font-size: 13px;
    }
}

