/* ==========================================================================
   TALEED LUXURY VEHICLE FILTERS & SEARCH SYSTEM (DESKTOP & MOBILE)
   ========================================================================== */

/* ─── Vehicles Header & Breadcrumb ─── */
.vehicles-header {
    background: linear-gradient(135deg, #09121f 0%, #0f1d33 50%, #152642 100%);
    color: #ffffff;
    padding: 3.5rem 1rem 3rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.vehicles-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
    pointer-events: none;
}
.vehicles-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    pointer-events: none;
}
.vehicles-header .header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}
.vehicles-header .header-text h1 {
    color: #ffffff !important;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 900;
    margin: 0 0 0.5rem;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.vehicles-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.84rem;
}
.vehicles-breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}
.vehicles-breadcrumb a:hover {
    color: var(--color-secondary, #D4AF37);
}
.vehicles-breadcrumb .sep {
    font-size: 0.7rem;
    opacity: 0.5;
}
.vehicles-results-badge {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.vehicles-results-badge strong {
    color: var(--color-secondary, #D4AF37);
    font-size: 1.15rem;
}

/* ─── Main Content Container ─── */
.vehicles-main {
    padding: 2.5rem 0 4rem;
    background: #f8fafc;
    min-height: 60vh;
}

/* ─── Desktop Filter & Search Box ─── */
.filter-sort-wrapper {
    background: #ffffff;
    border-radius: var(--radius-xl, 20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--color-gray-200, #e2e8f0);
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

/* Row 1: Unified Primary Search & Filters Grid */
.filter-grid-desktop {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: flex-end;
}

.fg-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fg-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-gray-600, #475569);
    display: flex;
    align-items: center;
    gap: 6px;
}
.fg-label i {
    color: var(--color-secondary-dark, #b8972e);
    font-size: 0.85rem;
}

/* Modern Input and Select controls */
.fg-input-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}
.fg-input-wrap i.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-secondary, #D4AF37);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}
.fg-control {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}
.fg-input-wrap input.fg-control,
.fg-input-wrap input[type="text"] {
    padding-right: 44px !important;
    padding-left: 16px !important;
}
[dir="ltr"] .fg-input-wrap i.search-icon {
    right: auto;
    left: 15px;
}
[dir="ltr"] .fg-input-wrap input.fg-control,
[dir="ltr"] .fg-input-wrap input[type="text"] {
    padding-left: 44px !important;
    padding-right: 16px !important;
}
.fg-control:focus {
    background: #ffffff;
    border-color: var(--color-secondary, #D4AF37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
select.fg-control {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-inline-end: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 14px;
}

/* Secondary Advanced Row (Price Range + Actions) */
.filter-secondary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}
.filter-price-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-price-group .price-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-end: 4px;
}
.filter-price-group input {
    width: 130px;
    height: 40px;
    padding: 0 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
}
.filter-price-group input:focus {
    border-color: var(--color-secondary, #D4AF37);
    background: #fff;
}
.filter-price-sep {
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.85rem;
}

.filter-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-filter-apply {
    height: 42px;
    padding: 0 20px;
    background: linear-gradient(135deg, #101d33 0%, #1a2d4c 100%);
    color: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(16, 29, 51, 0.15);
}
.btn-filter-apply:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #b8972e 100%);
    color: #0f172a;
    border-color: #D4AF37;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
}
.btn-filter-reset {
    height: 42px;
    padding: 0 16px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-filter-reset:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* ─── Quick Brand Pills Carousel ─── */
.quick-brands-wrap {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}
.quick-brands-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #64748b;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.quick-brands-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    flex-grow: 1;
}
.quick-brands-scroll::-webkit-scrollbar {
    height: 4px;
}
.quick-brands-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.quick-brands-scroll::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 10px;
}
.brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}
.brand-pill:hover {
    background: #ffffff;
    border-color: var(--color-secondary, #D4AF37);
    color: var(--color-secondary-dark, #b8972e);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}
.brand-pill.is-active {
    background: linear-gradient(135deg, #101d33 0%, #1e293b 100%);
    color: var(--color-secondary, #D4AF37);
    border-color: var(--color-secondary, #D4AF37);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
}

/* ─── Active Filter Tags Bar ─── */
.active-filters-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: #ffffff;
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}
.active-filters-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-end: 4px;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
    transition: all 0.2s ease;
}
.filter-chip:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}
.filter-chip .chip-remove {
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s ease;
    font-size: 0.75rem;
}
.filter-chip:hover .chip-remove {
    color: #dc2626;
}
.clear-all-chips {
    margin-inline-start: auto;
    font-size: 0.8rem;
    font-weight: 800;
    color: #dc2626;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.clear-all-chips:hover {
    background: #fee2e2;
}

/* ─── Mobile Clean Top Bar ─── */
.mobile-filter-bar {
    display: none;
    margin-bottom: 1.5rem;
}
.mobile-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.mobile-search-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}
.mobile-search-input-wrap form {
    width: 100%;
    margin: 0;
}
.mobile-search-input-wrap i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-secondary, #D4AF37);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}
.mobile-search-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    padding-right: 44px !important;
    padding-left: 16px !important;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    outline: none;
    font-family: inherit;
}
[dir="ltr"] .mobile-search-input-wrap i {
    right: auto;
    left: 15px;
}
[dir="ltr"] .mobile-search-input {
    padding-left: 44px !important;
    padding-right: 16px !important;
}
.mobile-search-input:focus {
    border-color: var(--color-secondary, #D4AF37);
}
.btn-mobile-filter-trigger {
    height: 48px;
    padding: 0 16px;
    background: linear-gradient(135deg, #101d33 0%, #1e293b 100%);
    color: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 29, 51, 0.15);
    white-space: nowrap;
}
.filter-active-count-badge {
    background: var(--color-secondary, #D4AF37);
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ─── Mobile Bottom Sheet / Drawer ─── */
.mobile-filter-drawer {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(10, 18, 32, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-filter-drawer.is-open {
    opacity: 1;
    visibility: visible;
}
.mobile-drawer-card {
    background: #ffffff;
    border-radius: 28px 28px 0 0;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.mobile-filter-drawer.is-open .mobile-drawer-card {
    transform: translateY(0);
}
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}
.mobile-drawer-handle {
    width: 44px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 4px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}
.mobile-drawer-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.btn-close-drawer {
    background: #f1f5f9;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
}
.mobile-drawer-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.mobile-drawer-footer {
    display: flex;
    gap: 12px;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    position: sticky;
    bottom: 0;
}
.btn-drawer-apply {
    flex: 2;
    height: 48px;
    background: linear-gradient(135deg, #101d33 0%, #1e293b 100%);
    color: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 29, 51, 0.2);
}
.btn-drawer-reset {
    flex: 1;
    height: 48px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* ─── Vehicles Grid Enhancement ─── */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.75rem;
    align-items: stretch;
}
.vehicles-grid > div {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.vehicles-grid .car-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ─── Empty State Modern ─── */
.empty-state {
    text-align: center;
    padding: 4.5rem 1.5rem;
    background: #ffffff;
    border-radius: 24px;
    border: 1px dashed #cbd5e1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin: 1rem 0;
}
.empty-icon {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    color: var(--color-secondary-dark, #b8972e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
}
.empty-state h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary-dark, #0f172a);
    margin-bottom: 0.5rem;
}
.empty-state p {
    color: var(--color-gray-500, #64748b);
    font-size: 0.95rem;
    max-width: 440px;
    margin: 0 auto 1.75rem;
    line-height: 1.7;
}

/* ─── Responsive Breakpoints ─── */
@media (max-width: 1024px) {
    .filter-grid-desktop {
        grid-template-columns: repeat(3, 1fr);
    }
    .fg-item-search {
        grid-column: span 3;
    }
}

@media (max-width: 768px) {
    /* Hide Desktop Filter Container */
    .filter-sort-wrapper {
        display: none !important;
    }
    /* Show Mobile Compact Top Bar */
    .mobile-filter-bar {
        display: block !important;
    }
    .vehicles-header {
        padding: 2.5rem 1rem 2rem;
    }
    .vehicles-header .header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .vehicles-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    .vehicles-grid {
        grid-template-columns: 1fr;
    }
    .mobile-search-row {
        flex-direction: row !important;
        gap: 8px;
    }
    .mobile-search-input {
        height: 44px;
        font-size: 0.85rem;
        padding-right: 36px !important;
        border-radius: 12px;
    }
    .mobile-search-input-wrap i {
        right: 12px;
        font-size: 0.9rem;
    }
    [dir="ltr"] .mobile-search-input {
        padding-left: 36px !important;
        padding-right: 12px !important;
    }
    [dir="ltr"] .mobile-search-input-wrap i {
        left: 12px;
        right: auto;
    }
    .btn-mobile-filter-trigger {
        height: 44px;
        padding: 0 12px;
        font-size: 0.82rem;
        gap: 6px;
        border-radius: 12px;
        flex-shrink: 0;
        width: auto;
        justify-content: center;
    }
}

/* ─── Live Filter Wrapper & Loading Visuals ─── */
.vehicles-grid-wrapper-live {
    position: relative;
    min-height: 280px;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s ease;
}

.vehicles-grid-wrapper-live.is-live-loading {
    opacity: 0.5;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.vehicles-grid-wrapper-live.is-live-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: rgba(248, 250, 252, 0.4);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    border-radius: 16px;
}

.vehicles-grid-wrapper-live.is-live-loading::after {
    content: 'جاري تحديث الأسطول...';
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    background: rgba(13, 27, 48, 0.92);
    color: var(--color-secondary, #D4AF37);
    font-size: 0.88rem;
    font-weight: 800;
    padding: 10px 22px;
    border-radius: 30px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: livePillPulse 1s ease-in-out infinite alternate;
}

@keyframes livePillPulse {
    from { transform: translateX(-50%) scale(0.98); opacity: 0.9; }
    to { transform: translateX(-50%) scale(1.02); opacity: 1; }
}

.btn-reset-live-filters {
    cursor: pointer;
    border: none;
    outline: none;
}

