/* ============================================
   MENU CATÉGORIES HORIZONTAL PREMIUM
   Le Bulletin Économique - Design Innovant
   ============================================ */

/* --- CONTENEUR PRINCIPAL --- */
.be-category-nav {
    position: relative;
    background: var(--be-bg-surface);
    border-top: 1px solid var(--be-border);
    border-bottom: 1px solid var(--be-border);
    padding: 0;
    margin-bottom: 40px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Light Mode - Fond blanc pur */
[data-theme="light"] .be-category-nav {
    background: #ffffff;
}

/* Dark Mode - Fond sombre élégant */
[data-theme="dark"] .be-category-nav {
    background: #1e293b;
    border-top-color: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.be-category-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* --- MENU SCROLLABLE --- */
.be-category-menu {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    flex: 1;
    padding: 8px 0;
}

.be-category-menu::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* --- ITEMS DU MENU --- */
.be-cat-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    text-decoration: none;
    color: var(--be-text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    flex-shrink: 0;
}

/* Hover Effect */
.be-cat-item:hover {
    color: var(--be-text-main);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .be-cat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Active State - Bordure colorée dynamique */
.be-cat-item.active {
    color: var(--be-text-main) !important;
    border-bottom-color: var(--cat-color);
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.02) 100%);
}

[data-theme="dark"] .be-cat-item.active {
    background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.05) 100%);
}

/* --- ICÔNES --- */
.be-cat-icon {
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.be-cat-item:hover .be-cat-icon {
    transform: scale(1.15) rotate(-5deg);
}

.be-cat-item.active .be-cat-icon {
    transform: scale(1.2);
}

/* --- LABELS --- */
.be-cat-label {
    font-family: var(--be-font-heading, 'Sora', sans-serif);
    letter-spacing: 0.3px;
}

/* --- COMPTEUR D'ARTICLES --- */
.be-cat-count {
    background: var(--be-bg-secondary);
    color: var(--be-text-muted);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.3s;
    min-width: 24px;
    text-align: center;
}

.be-cat-item:hover .be-cat-count,
.be-cat-item.active .be-cat-count {
    background: var(--cat-color);
    color: white;
    transform: scale(1.1);
}

/* --- INDICATEUR VISUEL (Subtile glow) --- */
.be-cat-indicator {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--cat-color);
    border-radius: 2px;
    transition: width 0.3s ease;
    opacity: 0;
}

.be-cat-item.active .be-cat-indicator {
    width: 100%;
    opacity: 1;
    box-shadow: 0 0 10px var(--cat-color);
}

/* --- BOUTONS DE SCROLL (MOBILE) --- */
.be-cat-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--be-bg-surface);
    border: 1px solid var(--be-border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: none; /* Caché par défaut */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.be-cat-scroll-btn:hover {
    background: var(--be-primary);
    color: white;
    border-color: var(--be-primary);
    transform: translateY(-50%) scale(1.1);
}

[data-theme="dark"] .be-cat-scroll-btn:hover {
    background: var(--be-accent-gold);
    color: #000;
    border-color: var(--be-accent-gold);
}

.be-cat-scroll-left {
    left: 10px;
}

.be-cat-scroll-right {
    right: 10px;
}

/* --- GRADIENT FADE EFFECT (Extrémités) --- */
.be-category-wrapper::before,
.be-category-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.3s;
}

.be-category-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--be-bg-surface), transparent);
}

.be-category-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--be-bg-surface), transparent);
}

[data-theme="dark"] .be-category-wrapper::before {
    background: linear-gradient(to right, #1e293b, transparent);
}

[data-theme="dark"] .be-category-wrapper::after {
    background: linear-gradient(to left, #1e293b, transparent);
}

/* --- ANIMATIONS --- */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.be-category-nav {
    animation: slideIn 0.5s ease-out;
}

/* --- RESPONSIVE --- */

/* Tablettes */
@media (max-width: 1024px) {
    .be-cat-item {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .be-cat-icon {
        font-size: 1.2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .be-category-nav {
        margin-bottom: 30px;
    }
    
    .be-cat-item {
        padding: 12px 18px;
        font-size: 0.875rem;
    }
    
    .be-cat-icon {
        font-size: 1.1rem;
    }
    
    /* Afficher les boutons de scroll sur mobile */
    .be-cat-scroll-btn {
        display: flex;
    }
    
    /* Masquer les gradients sur mobile si boutons visibles */
    .be-category-wrapper::before,
    .be-category-wrapper::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .be-cat-item {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .be-cat-count {
        font-size: 0.7rem;
        padding: 1px 6px;
    }
    
    /* Sur très petits écrans, cacher le compteur */
    .be-cat-count {
        display: none;
    }
}

/* --- STICKY VERSION (Optionnel) --- */
.be-category-nav.sticky {
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- PRINT (Masquer à l'impression) --- */
@media print {
    .be-category-nav {
        display: none;
    }
}

/* --- ACCESSIBILITÉ --- */
.be-cat-item:focus {
    outline: 2px solid var(--be-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .be-cat-item,
    .be-cat-icon,
    .be-cat-count,
    .be-cat-indicator {
        transition: none;
    }
    
    .be-category-nav {
        animation: none;
    }
}
