/* ============================================
 * PAGE-CATEGORIES-ANCHOR-NAV.CSS
 * Navigation par ancres pour la page catégories
 * Style identique aux filtres de categories.php
 * ============================================ */

/* Conteneur de la navigation par ancres */
.categories-anchor-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

/* Style des boutons d'ancre - identique aux filter-button */
.categories-anchor-nav .filter-button {
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--text-color);
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: none;
}

.categories-anchor-nav .filter-button:hover {
    background-color: #f0f0f0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* État actif pour le bouton correspondant à la section visible */
.categories-anchor-nav .filter-button.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3);
}

.categories-anchor-nav .filter-button.active:hover {
    background-color: var(--primary-color);
    color: white;
    opacity: 0.9;
}

/* Mode sombre */
.dark-mode .categories-anchor-nav .filter-button {
    background-color: #333;
    color: #f0f0f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-mode .categories-anchor-nav .filter-button:hover {
    background-color: #444;
    color: var(--primary-color);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.dark-mode .categories-anchor-nav .filter-button.active {
    background-color: var(--primary-color);
    color: white;
}

/* Défilement smooth pour toute la page */
html {
    scroll-behavior: smooth;
}

/* Ajustement pour compenser le header fixe si nécessaire */
.category-item {
    scroll-margin-top: 80px; /* Ajuster selon la hauteur du header */
}

/* ============================================
 * RESPONSIVE
 * ============================================ */

/* Tablettes */
@media screen and (max-width: 768px) {
    .categories-anchor-nav {
        gap: 8px;
        margin-bottom: 25px;
    }
    
    .categories-anchor-nav .filter-button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .category-item {
        scroll-margin-top: 70px;
    }
}

/* Smartphones */
@media screen and (max-width: 480px) {
    .categories-anchor-nav {
        gap: 6px;
        margin-bottom: 20px;
        /* Permettre le scroll horizontal sur mobile si nécessaire */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    .categories-anchor-nav .filter-button {
        padding: 7px 14px;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .category-item {
        scroll-margin-top: 60px;
    }
    
    /* Masquer la scrollbar mais garder le scroll fonctionnel */
    .categories-anchor-nav::-webkit-scrollbar {
        height: 3px;
    }
    
    .categories-anchor-nav::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .categories-anchor-nav::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }
}

/* Très petits smartphones */
@media screen and (max-width: 320px) {
    .categories-anchor-nav .filter-button {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}