/**
 * Styles pour le Widget WooCommerce Subcategories - UX Optimized
 */

.woo-subcategories-widget {
    margin-bottom: 30px;
    background: #fff;
}

.woo-subcategories-widget .widget-title,
.woo-subcategories-widget .widgettitle {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    color: #233a5c;
    border-bottom: 3px solid #2bbef9;
    line-height: 1.2;
}

.woo-subcategories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woo-subcategory-item {
    margin: 0 0 6px 0;
    padding: 0;
    list-style: none;
}

.woo-subcategory-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    text-decoration: none;
    color: #233a5c;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    background: #f8f9fb;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

.woo-subcategory-link:hover {
    background: #fff;
    border-left-color: #2bbef9;
    color: #2bbef9;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(43,190,249,0.15);
}

.woo-subcategory-link::before {
    content: "→";
    margin-right: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #2bbef9;
    transition: transform 0.3s ease;
}

.woo-subcategory-link:hover::before {
    transform: translateX(3px);
}

.woo-subcategory-image {
    display: none;
}

.woo-subcategory-name {
    flex-grow: 1;
    font-weight: 500;
}

.woo-subcategory-count {
    background: #2bbef9;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* Responsive Widget Sidebar */
@media (max-width: 768px) {
    .woo-subcategories-widget {
        margin-bottom: 25px;
        background: #fff;
    }
    
    .woo-subcategories-widget .widget-title,
    .woo-subcategories-widget .widgettitle {
        font-size: 14px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .woo-subcategory-item {
        margin: 0 0 5px 0;
    }
    
    .woo-subcategory-link {
        padding: 9px 10px;
        font-size: 13px;
        background: #f8f9fb;
        border-radius: 6px;
        border-left: 3px solid transparent;
        color: #233a5c;
        text-decoration: none;
    }
    
    .woo-subcategory-link:hover,
    .woo-subcategory-link:focus,
    .woo-subcategory-link:active {
        background: #fff;
        border-left-color: #2bbef9;
        color: #2bbef9;
        text-decoration: none;
    }
    
    .woo-subcategory-link::before {
        font-size: 14px;
        margin-right: 8px;
    }
    
    .woo-subcategory-count {
        background: #2bbef9;
        color: #fff;
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .woo-subcategories-widget {
        margin-bottom: 20px;
    }
    
    .woo-subcategories-widget .widget-title,
    .woo-subcategories-widget .widgettitle {
        font-size: 13px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .woo-subcategory-link {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .woo-subcategory-link::before {
        font-size: 13px;
        margin-right: 6px;
    }
}

/* ============================================
   Affichage horizontal en haut de page avec carousel
   ============================================ */

.woo-subcategories-top {
    margin-bottom: 25px;
    width: 100%;
    position: relative;
}

.woo-subcat-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.woo-subcat-filters-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.woo-subcat-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    transition: transform 0.3s ease;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
}

.woo-subcat-filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.woo-subcat-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 50px;
    text-decoration: none;
    color: #233a5c;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.woo-subcat-filter-btn:hover {
    background: #fff;
    color: #233a5c;
    border-color: #2bbef9;
    text-decoration: none;
}

.woo-subcat-filter-btn .subcat-count {
    margin-left: 8px;
    background: #f0f0f0;
    color: #687188;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.woo-subcat-filter-btn:hover .subcat-count {
    background: #f0f0f0;
    color: #687188;
}

/* Boutons de navigation carousel */
.woo-subcat-nav-btn {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #233a5c;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    user-select: none;
}

.woo-subcat-nav-btn:hover {
    border-color: #2bbef9;
    color: #2bbef9;
    background: #fff;
}

.woo-subcat-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Version verticale compacte pour top */
.woo-subcat-vertical .woo-subcat-filters {
    flex-direction: column;
    align-items: stretch;
}

.woo-subcat-vertical .woo-subcat-filter-btn {
    justify-content: space-between;
    border-radius: 6px;
}

/* Responsive pour affichage horizontal */
@media (max-width: 768px) {
    .woo-subcategories-top {
        margin-bottom: 20px;
    }
    
    .woo-subcat-carousel-wrapper {
        gap: 10px;
    }
    
    .woo-subcat-filters {
        gap: 8px;
    }
    
    .woo-subcat-filter-btn {
        padding: 8px 16px;
        font-size: 13px;
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 50px;
        color: #233a5c;
        text-decoration: none;
    }
    
    .woo-subcat-filter-btn:hover,
    .woo-subcat-filter-btn:focus,
    .woo-subcat-filter-btn:active {
        background: #fff;
        color: #233a5c;
        border-color: #2bbef9;
        text-decoration: none;
    }
    
    .woo-subcat-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 50%;
        color: #233a5c;
    }
    
    .woo-subcat-nav-btn:hover,
    .woo-subcat-nav-btn:focus {
        border-color: #2bbef9;
        color: #2bbef9;
        background: #fff;
    }
}

@media (max-width: 480px) {
    .woo-subcategories-top {
        margin-bottom: 15px;
    }
    
    .woo-subcat-carousel-wrapper {
        gap: 8px;
    }
    
    .woo-subcat-filters {
        gap: 6px;
    }
    
    .woo-subcat-filter-btn {
        padding: 7px 14px;
        font-size: 12px;
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 50px;
        color: #233a5c;
        text-decoration: none;
        font-weight: 500;
    }
    
    .woo-subcat-filter-btn:hover,
    .woo-subcat-filter-btn:focus,
    .woo-subcat-filter-btn:active {
        background: #fff;
        color: #233a5c;
        border-color: #2bbef9;
        text-decoration: none;
    }
    
    .woo-subcat-filter-btn .subcat-count {
        margin-left: 6px;
        padding: 2px 6px;
        font-size: 10px;
        background: #f0f0f0;
        color: #687188;
        border-radius: 10px;
    }
    
    .woo-subcat-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 50%;
        color: #233a5c;
    }
    
    .woo-subcat-nav-btn:hover,
    .woo-subcat-nav-btn:focus {
        border-color: #2bbef9;
        color: #2bbef9;
        background: #fff;
    }
}

/* Fix pour les devices tactiles */
@media (hover: none) and (pointer: coarse) {
    .woo-subcat-filter-btn {
        -webkit-tap-highlight-color: transparent;
    }
    
    .woo-subcat-filter-btn:active {
        background: #fff;
        color: #233a5c;
        border-color: #2bbef9;
    }
    
    .woo-subcat-filters-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Sidebar widget sur tactile */
    .woo-subcategory-link {
        -webkit-tap-highlight-color: transparent;
    }
    
    .woo-subcategory-link:active {
        background: #fff;
        border-left-color: #2bbef9;
        color: #2bbef9;
    }
}
