/**
 * Sidebar Filters Styles
 */
.al-price-inputs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.al-sidebar-filters,
.al-custom-filters {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.al-filter-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #f1f1f1;
    padding-bottom: 20px;
}

.al-filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.al-filter-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #333;
}

.al-filter-title i {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.al-filter-section.closed .al-filter-title i {
    transform: rotate(-90deg);
}

.al-filter-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.al-filter-section.closed .al-filter-content {
    max-height: 0;
    opacity: 0;
}

/* Checkboxes */
.al-checkbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
}

.al-checkbox-list li {
    margin-bottom: 10px;
}

.al-checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #1A1A1A;
    transition: color 0.2s ease;
}

.al-checkbox-item:hover {
    color: #1A1A1A;
}

.al-checkbox-item input {
    margin-right: 12px;
    cursor: pointer;
}

/* Price Range Slider Custom Styling */
.al-price-range-wrap {
    padding: 10px 10px 20px;
}

#al-price-slider {
    height: 6px;
    border: none;
    background: #eee;
    box-shadow: none;
    margin-bottom: 25px;
}

#al-price-slider .noUi-connect {
    background: #ff0000;
}

#al-price-slider .noUi-handle {
    width: 20px !important;
    height: 20px !important;
    right: -10px !important;
    top: -8px !important;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ff0000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
}

#al-price-slider .noUi-handle:hover {
    transform: scale(1.1);
}

#al-price-slider .noUi-handle::before,
#al-price-slider .noUi-handle::after {
    display: none;
}

.al-price-input-group {
    width: 45%;
}

.al-price-input-group label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.al-price-input-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

/* Brands Accordion */
.al-brand-accordion {
    border-left: 2px solid #eee;
    padding-left: 15px;
    margin-bottom: 15px;
}

.al-brand-header {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.al-model-list {
    padding-left: 10px;
    display: none;
}

.al-brand-header.active+.al-model-list {
    display: block;
}

/* Buttons */
.al-filter-buttons {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.al-apply-filters {
    flex: 2;
    background: #333;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.al-apply-filters:hover {
    background: #000;
}

.al-reset-filters {
    flex: 1;
    background: #eee;
    color: #666;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Sticky Sidebar */
@media (min-width: 992px) {
    .al-sidebar-filters-sticky {
        position: sticky;
        top: 100px;
    }
}

/* Mobile Drawer - Scoped to Custom Shortcode only */
.al-custom-container .al-mobile-filter-toggle {
    display: none;
    background: #333;
    color: #fff;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
    cursor: pointer;
}

@media (max-width: 991px) {
    .al-custom-container .al-mobile-filter-toggle {
        display: block;
    }

    .al-custom-container .al-sidebar-filters-wrap {
        position: fixed;
        left: -100%;
        top: 0;
        width: 300px;
        height: 100%;
        background: #fff;
        z-index: 10001;
        transition: left 0.3s ease;
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    .al-custom-container .al-sidebar-filters-wrap.open {
        left: 0;
    }

    .al-custom-container .al-filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10000;
    }

    .al-custom-container .al-filter-overlay.open {
        display: block;
    }
}

/* Custom Combined Layout [auto_custom] */
.al-custom-container {
    max-width: 1280px;
    margin: 40px auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

.al-custom-row {
    display: grid !important;
    grid-template-columns: 28% 1fr !important;
    /* Fixed sidebar width, flexible results */
    gap: 40px;
    width: 100%;
    align-items: start !important;
}

.al-custom-sidebar {
    width: 100% !important;
    /* Takes full width of the 28% grid cell */
    position: sticky !important;
    top: 20px;
}

.al-custom-main {
    width: 100% !important;
    /* Takes full width of the 1fr grid cell */
    min-width: 0;
}

/* Force Grid Layout for Listings */
.al-custom-results-container .auto-listings-items.grid-view {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    row-gap: 24px !important;
    column-gap: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.al-custom-results-container .auto-listings-items.grid-view li {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: block !important;
}

/* Fix "No Results" Alert Layout */
.al-custom-results-container p.auto-listings-no-results,
.al-custom-results-container .alert {
    width: 100% !important;
    margin: 0 0 20px 0 !important;
    display: block !important;
    clear: none !important;
    /* Prevent falling below sidebar */
}

/* Response for Mid-size screens */
@media (max-width: 1100px) {
    .al-custom-results-container .auto-listings-items.grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        row-gap: 24px !important;
        column-gap: 24px !important;
    }
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    .al-custom-row {
        flex-direction: column !important;
        flex-wrap: wrap !important;
    }

    .al-custom-sidebar,
    .al-custom-main {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100%;
    }

    .al-custom-results-container .auto-listings-items.grid-view {
        grid-template-columns: 1fr !important;
        row-gap: 24px !important;
        column-gap: 24px !important;
    }
}