/* ===== DESIGN MOBILE-FIRST POUR FILTRE ===== */

.hader_left {
    position: fixed;
    flex: 1;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    height: auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.fitre_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    position: relative;
}

.fitre_header::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.fitre_header_right {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 8px;
}

.fitre_header_right:hover {
    color: #5a67d8;
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(3px);
}

/* Inputs de plage de prix */
.price-range {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    align-items: center;
}

.price-range input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #f9fafb;
    transition: all 0.3s ease;
    font-weight: 500;
}

.price-range input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.price-range input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.price-range span {
    color: #4a5568;
    font-weight: 600;
    font-size: 16px;
}

/* Sélecteurs */
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #f9fafb;
    color: #2d3748;
    margin-top: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* État de produit */
.filter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #4a5568;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-footer label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.filter-footer label:hover {
    color: #667eea;
}

.filter-footer input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
    cursor: pointer;
}

.Filtrebuttom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 25px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: white;
    transition: all 0.3s ease;
    margin-top: 25px;
    width: 100%;
}

.Filtrebuttom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.Filtrebuttom:active {
    transform: translateY(0);
}

/* Styles pour la grille de catégories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px 0;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.category-item:hover::before {
    left: 100%;
}

.category-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.category-item.selected {
    background: linear-gradient(135deg, #f0f4ff, #e6f3ff);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.category-item img {
    width: 45px;
    height: 45px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.category-item:hover img {
    transform: scale(1.1) rotate(5deg);
}

.category-item span {
    font-size: 13px;
    color: #4a5568;
    text-align: center;
    font-weight: 600;
    transition: color 0.3s ease;
}

.category-item.selected span {
    color: #667eea;
}

/* ===== MEDIA QUERIES MOBILE ===== */

/* Tablettes (768px et moins) */
@media screen and (max-width: 768px) {
    .hader_left {
        position: relative;
        max-width: 100%;
        margin-bottom: 20px;
        padding: 20px;
        gap: 30px;
    }
    
    .fitre_header {
        font-size: 18px;
    }
    
    .price-range {
        flex-direction: column;
        gap: 10px;
    }
    
    .price-range input {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    select {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .filter-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 13px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .category-item {
        padding: 15px 10px;
    }
    
    .category-item img {
        width: 35px;
        height: 35px;
    }
    
    .category-item span {
        font-size: 11px;
    }
}

/* Téléphones portables (480px et moins) */
@media screen and (max-width: 480px) {
    .hader_left {
        padding: 15px;
        gap: 25px;
    }
    
    .fitre_header {
        font-size: 16px;
    }
    
    .fitre_header_right {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .price-range input {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    select {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .filter-footer {
        font-size: 12px;
        gap: 6px;
    }
    
    .filter-footer input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    .Filtrebuttom {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .category-item {
        padding: 12px;
        flex-direction: row;
        text-align: left;
    }
    
    .category-item img {
        width: 30px;
        height: 30px;
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .category-item span {
        font-size: 10px;
    }
}

/* Très petits écrans (320px et moins) */
@media screen and (max-width: 320px) {
    .hader_left {
        padding: 12px;
        gap: 20px;
    }
    
    .fitre_header {
        font-size: 14px;
    }
    
    .price-range input {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    select {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .filter-footer {
        font-size: 11px;
    }
    
    .Filtrebuttom {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .category-item {
        padding: 10px;
    }
    
    .category-item img {
        width: 25px;
        height: 25px;
    }
    
    .category-item span {
        font-size: 9px;
    }
}

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

.hader_left {
    animation: fadeInUp 0.5s ease-out;
}

.category-item {
    animation: fadeInUp 0.3s ease-out;
}

.category-item:nth-child(1) { animation-delay: 0.1s; }
.category-item:nth-child(2) { animation-delay: 0.2s; }
.category-item:nth-child(3) { animation-delay: 0.3s; }
.category-item:nth-child(4) { animation-delay: 0.4s; }
.category-item:nth-child(5) { animation-delay: 0.5s; }
.category-item:nth-child(6) { animation-delay: 0.6s; }

/* ===== TOUCH OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    .category-item:hover {
        transform: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    
    .category-item:active {
        transform: scale(0.98);
    }
    
    .Filtrebuttom:hover {
        transform: none;
    }
    
    .Filtrebuttom:active {
        transform: scale(0.98);
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .hader_left {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        border-color: #4a5568;
    }
    
    .fitre_header {
        color: white;
    }
    
    .price-range input,
    select {
        background: #4a5568;
        border-color: #718096;
        color: white;
    }
    
    .filter-footer {
        color: #a0aec0;
    }
    
    .category-item {
        background: #4a5568;
        border-color: #718096;
    }
    
    .category-item span {
        color: #a0aec0;
    }
}