/* ==========================================================================
   SERVICES LISTING PAGE STYLES
   ========================================================================== */

/* Page Container */
.services-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

/* Filters Sidebar */
.filters-sidebar {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 90px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E5E7EB;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-title i {
    color: #5B6EF5;
    font-size: 14px;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-option:hover {
    padding-left: 4px;
}

.filter-option input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #5B6EF5;
}

.filter-option label {
    cursor: pointer;
    font-size: 14px;
    color: #4B5563;
    flex: 1;
    margin: 0;
}

/* Sort Options Styling */
.sort-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sort-options .filter-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.sort-options .filter-option:hover {
    background: #F3F4F6;
}

.sort-options .filter-option input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #5B6EF5;
}

.sort-options .filter-option input[type="radio"]:checked+span {
    color: #5B6EF5;
    font-weight: 600;
}

.sort-options .filter-option span {
    cursor: pointer;
    font-size: 14px;
    color: #4B5563;
    transition: all 0.2s;
}

/* View Toggle Buttons */
.view-toggle-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid #E5E7EB;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    border-color: #5B6EF5;
    color: #5B6EF5;
}

.view-btn.active {
    border-color: #5B6EF5;
    background: #5B6EF5;
    color: white;
}

.view-btn i {
    font-size: 16px;
}

/* Collapsible Car Rental Subcategories */
.car-rental-filter-group {
    margin-left: 28px;
    margin-top: 8px;
}

.car-rental-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
}

.car-rental-toggle i {
    font-size: 12px;
    transition: transform 0.2s;
    color: #6B7280;
}

.car-rental-toggle.expanded i {
    transform: rotate(90deg);
}

/* Price Range Inputs */
.price-range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-range-inputs input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
}

.price-range-inputs span {
    color: #6B7280;
}

/* Filter Actions Container */
.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Primary Action - Apply Filters */
.btn-apply-filters {
    flex: 1;
    padding: 11px 20px;

    font-size: 14px;
    font-weight: 600;
    font-family: inherit;

    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;

    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Subtle depth */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-apply-filters:hover {
    background: #1e40af;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-apply-filters:active {
    transform: scale(0.98);
}

/* Secondary Action - Clear Filters */
.btn-clear-filters {
    flex: 1;
    padding: 11px 20px;

    font-size: 14px;
    font-weight: 600;
    font-family: inherit;

    background: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 6px;

    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-clear-filters:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #1f2937;
}

.btn-clear-filters:active {
    transform: scale(0.98);
}

/* Services Main Content */
.services-main {
    min-width: 0;
}

/* Services Header with Sort Dropdown */
.services-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.services-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #059669;
    font-weight: 500;
}

.services-count i {
    color: #059669;
    font-size: 16px;
}

.sort-dropdown-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #4B5563;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.sort-label i {
    color: #6B7280;
    font-size: 14px;
}

.sort-dropdown {
    min-width: 180px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #1F2937;
    background: #FFFFFF;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    border: 1.5px solid #D1D5DB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.sort-dropdown:hover {
    border-color: #2563EB;
    background-color: #F9FAFB;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Services Grid - 4 columns */
.services-page-container .services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 24px;
    align-items: start;
    /* Start at same top position */
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #9CA3AF;
}

.empty-state-icon i {
    font-size: 64px;
}

.empty-state h2 {
    color: #1F2937;
    margin-bottom: 10px;
}

.empty-state-text {
    color: #6B7280;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.page-link {
    padding: 8px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    text-decoration: none;
    color: #4B5563;
    font-size: 14px;
    transition: all 0.2s;
}

.page-link:hover {
    background: #F3F4F6;
    border-color: #5B6EF5;
}

.page-link.active {
    background: #5B6EF5;
    color: white;
    border-color: #5B6EF5;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet and below - Stack sidebar */
@media (max-width: 1199px) {
    .services-page-container {
        grid-template-columns: 1fr;
        padding: 24px 16px;
    }

    .filters-sidebar {
        position: static;
        margin-bottom: 24px;
        max-height: none;
    }

    .services-page-container .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Large Mobile */
@media (max-width: 899px) {
    .services-page-container .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Mobile Adjustments for Filter Buttons */
@media (max-width: 640px) {
    .filter-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-apply-filters,
    .btn-clear-filters {
        width: 100%;
    }
}

/* Loading Indicator */
#filter-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    background: white;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: #2563eb;
    font-weight: 500;
}

.loading-spinner i {
    font-size: 20px;
    color: #2563eb;
}

/* Responsive header layout */
@media (max-width: 768px) {
    .services-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .sort-dropdown-container {
        width: 100%;
    }

    .sort-dropdown {
        width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 575px) {
    .services-page-container .services-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .services-page-container {
        padding: 16px;
    }

    .filters-sidebar {
        padding: 16px;
    }
}