/* ============================================
   BARRE D'ACTIONS MOBILE - FILTRES + TRIER
   Style Liquid Glass Moderne
   ============================================ */

/* Conteneur pour les deux boutons */
.mobile-actions-bar {
    display: none;
    width: 100% !important;
    gap: 12px !important;
    margin-bottom: 24px;
    padding: 0;
    align-items: stretch !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    .mobile-actions-bar {
        display: flex !important;
        flex-direction: row !important;
    }
}

/* Force les deux boutons à avoir la même largeur */
.mobile-filters-btn,
.mobile-sort-btn {
    flex: 1 1 0 !important;
    max-width: calc(50% - 6px) !important;
    min-width: 0 !important;
    width: calc(50% - 6px) !important;
}

/* Bouton Filtres */
.mobile-filters-btn {
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-filters-btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #B8461F 0%, #8B2F0F 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(184, 70, 31, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

.mobile-filters-btn-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filters-btn:active .mobile-filters-btn-inner::before {
    opacity: 1;
}

.mobile-filters-btn-icon {
    font-size: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.mobile-filters-btn-text {
    font-size: 14px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.mobile-filters-btn:active .mobile-filters-btn-inner {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(184, 70, 31, 0.4);
}

.mobile-filters-btn:active .mobile-filters-btn-icon {
    transform: rotate(180deg);
}

/* Bouton Trier */
.mobile-sort-btn {
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-sort-btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #B8461F 0%, #8B2F0F 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(184, 70, 31, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

.mobile-sort-btn-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sort-btn:active .mobile-sort-btn-inner::before {
    opacity: 1;
}

.mobile-sort-btn-icon {
    font-size: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.mobile-sort-btn-text {
    font-size: 14px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.mobile-sort-btn:active .mobile-sort-btn-inner {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(184, 70, 31, 0.4);
}

.mobile-sort-btn:active .mobile-sort-btn-icon {
    transform: translateY(2px);
}

/* Badge de compteur (optionnel) */
.mobile-btn-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, #B8461F 0%, #8B2F0F 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(184, 70, 31, 0.4);
    animation: badgePop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive - Petits écrans */
@media (max-width: 480px) {
    .mobile-actions-bar {
        gap: 10px;
    }
    
    .mobile-filters-btn-inner,
    .mobile-sort-btn-inner {
        padding: 13px 16px;
        border-radius: 11px;
    }
    
    .mobile-filters-btn-icon,
    .mobile-sort-btn-icon {
        font-size: 15px;
    }
    
    .mobile-filters-btn-text,
    .mobile-sort-btn-text {
        font-size: 13px;
    }
}

/* Très petits écrans */
@media (max-width: 360px) {
    .mobile-actions-bar {
        gap: 8px;
    }
    
    .mobile-filters-btn-inner,
    .mobile-sort-btn-inner {
        padding: 12px 14px;
        gap: 6px;
    }
    
    .mobile-filters-btn-text,
    .mobile-sort-btn-text {
        font-size: 12px;
    }
}


/* ============================================
   MODALE TRI MOBILE (BOTTOM SHEET)
   ============================================ */

/* Overlay */
.mobile-sort-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-sort-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modale Bottom Sheet */
.mobile-sort-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px;
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh;
    overflow-y: auto;
}

.mobile-sort-modal.active {
    transform: translateY(0);
}

/* Header de la modale */
.mobile-sort-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(184, 70, 31, 0.1);
}

.mobile-sort-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.mobile-sort-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(184, 70, 31, 0.08);
    border: none;
    border-radius: 8px;
    color: #B8461F;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-sort-modal-close:active {
    transform: scale(0.95);
    background: rgba(184, 70, 31, 0.15);
}

/* Options de tri */
.mobile-sort-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-sort-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(248, 249, 250, 0.5);
    border: 1.5px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.mobile-sort-option:active {
    transform: scale(0.98);
}

.mobile-sort-option.active {
    background: rgba(255, 245, 242, 0.9);
    border-color: rgba(184, 70, 31, 0.3);
    box-shadow: 0 2px 8px rgba(184, 70, 31, 0.1);
}

.mobile-sort-option-label {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    transition: color 0.2s ease;
}

.mobile-sort-option.active .mobile-sort-option-label {
    font-weight: 600;
    color: #B8461F;
}

/* Checkmark */
.mobile-sort-option-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(184, 70, 31, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: white;
}

.mobile-sort-option.active .mobile-sort-option-check {
    background: linear-gradient(135deg, #B8461F 0%, #8B2F0F 100%);
    border-color: #B8461F;
}

.mobile-sort-option-check::after {
    content: '✓';
    color: white;
    font-size: 13px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sort-option.active .mobile-sort-option-check::after {
    opacity: 1;
    transform: scale(1);
}

/* Responsive */
@media (max-width: 480px) {
    .mobile-sort-modal {
        padding: 20px 16px;
    }
    
    .mobile-sort-modal-title {
        font-size: 17px;
    }
    
    .mobile-sort-option {
        padding: 14px;
    }
    
    .mobile-sort-option-label {
        font-size: 14px;
    }
}
