/* ============================================
   PAGE CATÉGORIE - STYLES SPÉCIFIQUES
   ============================================ */

/* Test de chargement CSS - à retirer après vérification */
body:has(.breadcrumb-section) {
    /* CSS chargé avec succès */
}

/* Breadcrumb */
.breadcrumb-section {
    background-color: #000 !important;
    padding: 1rem 0 !important;
}

.breadcrumb-section nav {
    font-family: 'MADE TOMMY', sans-serif;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.breadcrumb-section a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb-section a:hover {
    opacity: 0.8;
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-card {
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-card img {
    transition: transform 0.5s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* Prix multi-devises */
.product-card .price-main {
    font-weight: 500;
    color: #000;
}

.product-card .price-secondary {
    color: #9CA3AF;
    font-size: 11px;
}

/* ============================================
   FILTER PANEL
   ============================================ */
#filterPanel {
    transition: transform 0.3s ease-in-out;
    box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1);
}

#filterPanel.open {
    transform: translateX(0);
}

/* Assurer que le panneau est caché par défaut */
#filterPanel:not(.open) {
    transform: translateX(100%);
}

/* Filter checkboxes custom */
.filter-group input[type="radio"]:checked + span,
.filter-group input[type="checkbox"]:checked + span {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

/* Size boxes */
.filter-group .size-box {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #D1D5DB;
    font-size: 12px;
    transition: all 0.2s ease;
}

.filter-group .size-box:hover {
    border-color: #000;
}

.filter-group .size-box.active {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

/* ============================================
   SUBCATEGORY SECTIONS
   ============================================ */
.subcategory-section h2 {
    font-family: 'MADE TOMMY', sans-serif;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.subcategory-section .divider {
    height: 1px;
    background-color: #E5E7EB;
    margin-top: 8px;
}

/* ============================================
   DROPDOWN TRI
   ============================================ */
.sort-dropdown {
    position: relative;
}

.sort-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #E5E7EB;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    z-index: 30;
    display: none;
    margin-top: 4px;
}

.sort-dropdown-menu.show {
    display: block;
}

.sort-dropdown-menu a {
    display: block;
    padding: 12px 16px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #F3F4F6;
}

.sort-dropdown-menu a:last-child {
    border-bottom: none;
}

.sort-dropdown-menu a:hover {
    background-color: #F9FAFB;
    color: #000;
}

.sort-dropdown-menu a.active {
    font-weight: 600;
    background-color: #F3F4F6;
    color: #000;
}

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

/* Grille produits - 2 colonnes mobile, 3 colonnes desktop */
.products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 640px) {
    /* Mobile : 2 colonnes avec espacement réduit */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Cartes produits plus compactes sur mobile */
    .product-card {
        font-size: 0.875rem;
    }

    /* Titre produit - specs: 11px, line-height 30px, letter-spacing 13% */
    .product-card h3 {
        font-size: 11px !important;
        line-height: 30px !important;
        letter-spacing: 0.13em !important;
        margin-bottom: 0;
    }

    .product-card .text-xs {
        font-size: 11px !important;
        line-height: 30px !important;
        letter-spacing: 0.13em !important;
    }

    /* Image produit - ajustement mobile */
    .product-card .aspect-square {
        margin-bottom: 0.5rem;
    }

    /* Prix - specs: 11px, line-height 30px, letter-spacing 13% */
    .product-card .price-main,
    .product-card .text-sm.font-semibold,
    .product-card p {
        font-size: 11px !important;
        line-height: 30px !important;
        letter-spacing: 0.13em !important;
    }

    /* Panel filtres full width sur mobile */
    #filterPanel {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Empêcher la fermeture du panneau au clic */
    #filterPanel * {
        pointer-events: auto;
    }

    /* Breadcrumb plus petit */
    .breadcrumb-section nav {
        font-size: 11px;
    }

    /* Prix - afficher seulement FCFA sur mobile */
    .product-card .price-secondary {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    /* Tablette : 3 colonnes avec espacement moyen */
    .products-grid {
        gap: 1.25rem !important;
    }
}

@media (min-width: 1025px) {
    /* Desktop : 3 colonnes avec espacement confortable */
    .products-grid {
        gap: 1.5rem !important;
    }
    
    /* Cartes produits plus grandes sur desktop */
    .product-card h3 {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    /* Très petits écrans : garder 2 colonnes mais espacement minimal */
    .products-grid {
        gap: 8px !important;
    }

    /* Titre produit - specs: 11px, line-height 30px, letter-spacing 13% */
    .product-card h3 {
        font-size: 11px !important;
        line-height: 30px !important;
        letter-spacing: 0.13em !important;
    }

    /* Prix - specs: 11px, line-height 30px, letter-spacing 13% */
    .product-card .text-xs,
    .product-card p {
        font-size: 11px !important;
        line-height: 30px !important;
        letter-spacing: 0.13em !important;
    }
}

/* ============================================
   LOADING STATE
   ============================================ */
.products-loading {
    opacity: 0.5;
    pointer-events: none;
}

.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

.loading-spinner::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.product-card {
    animation: fadeIn 0.4s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   BARRE DE TRI ET FILTRES
   ============================================ */
section.border-b {
    background: #fff !important;
    border-bottom: 1px solid #E5E7EB !important;
}

section.border-b h1 {
    font-family: 'MADE TOMMY', sans-serif !important;
    font-weight: 400 !important;
    letter-spacing: 0.1em !important;
    color: #000 !important;
    font-size: 1.5rem !important;
    text-transform: uppercase !important;
}

/* Responsive barre de tri et filtres */
@media (max-width: 640px) {
    section.border-b {
        padding: 0.75rem 1rem !important;
    }
    
    section.border-b h1 {
        font-size: 1.125rem !important;
        letter-spacing: 0.08em !important;
    }
    
    section.border-b .flex.items-center.gap-4 {
        gap: 0.75rem !important;
        flex-wrap: wrap;
    }
    
    section.border-b .text-sm {
        font-size: 0.75rem !important;
    }
    
    /* Masquer le compteur de produits sur très petits écrans */
    @media (max-width: 360px) {
        section.border-b .text-sm.text-gray-600 {
            display: none;
        }
    }
}

/* Boutons TRIER et FILTRER */
#filterToggle,
[data-sort-toggle] {
    cursor: pointer !important;
    user-select: none !important;
    font-family: 'MADE TOMMY', sans-serif !important;
    font-weight: 400 !important;
    letter-spacing: 0.05em !important;
    color: #374151 !important;
    transition: color 0.2s !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
}

#filterToggle:hover,
[data-sort-toggle]:hover {
    color: #000 !important;
}

/* Compteur de produits */
section.border-b .text-sm.text-gray-600 {
    font-family: 'MADE TOMMY', sans-serif !important;
    font-weight: 400 !important;
    letter-spacing: 0.05em !important;
}

/* ============================================
   UTILITIES
   ============================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Overlay pour le panneau de filtres */
#filterOverlay {
    transition: opacity 0.3s ease-in-out;
}

/* Animation pour le panneau de filtres */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

#filterPanel:not(.translate-x-full) {
    animation: slideInRight 0.3s ease-in-out;
}

