/* Container to hold filter and sort buttons side by side */
.filter-sort-container {
    display: flex !important;
    justify-content: flex-end !important;
    width: 100% !important;
    margin-left: auto !important
}

.sorting-toggle-btn-handler{
    display: flex;
    justify-content: flex-end; /* Aligns buttons to the right */
    align-items: center; /* Ensures vertical alignment */
    width: 100%; /* Ensures the container spans full width */
    gap: 10px; /* Adds space between buttons */
	margin-left:unset!important;
	margin-right:unset!important;
	max-width:none!important;
}




/* Adjust button styles (if necessary, as per previous styles) */
.filter-toggle-button,
.sorting-toggle-button {
    display:block;
    width: 150px;
    background: var(--background-button-1-color);
    color: var(--button-1-color);
    font-size: 16px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease-in-out;
}

.filter-toggle-button:hover,
.sorting-toggle-button:hover {
     background: var(--background-button-2-color);
	color: var(--button-2-color);
}

#car-sort{
	position: relative;
display: inline-block; /* Ensures it doesn't stretch full width */
}

.sorting-options {
    display: none; /* Initially hidden */
    position: absolute;
    top: 100%; /* Adjust as needed */
    left: 100%; /* Adjust as needed */
    z-index: 1000; /* Ensure it appears on top of other elements */
    background-color: white; /* Add a background color */
    border: 1px solid #ccc; /* Add a border */
    padding: 10px; /* Add some padding */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add a shadow for better visibility */
}

/* Show the sorting-options dropdown when active */
.sorting-options.active {
    display: block;
}

/* Optional: Adjust layout for smaller screens */
@media (max-width: 768px) {
    .filter-sort-container {
        flex-direction: column;  /* Stack the buttons vertically on smaller screens */
    }

    .filter-toggle-button,
    .sorting-toggle-button {
        width: 100%;  /* Ensure buttons span full width on smaller screens */
    }
}


/* Style the entire filter container */
.filter-container {
    position: relative;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px;
    max-width: 250px;
    margin-left: auto;
}

/* Style individual filter boxes */
.filter-make-box,
.filter-year-box,
.filter-fuel-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 200px;
    padding: 10px;
}

/* Filter Button Box */
.filter-button-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 10px 10px 10px;
    width: 200px;
}

.filter-button-box button {
    padding: 10px;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 16px;
}

.filter-button-box button:hover {
    background-color: #0056b3; /* Hover effect */
}

/* Label styling */
.filter-make-box label,
.filter-year-box label,
.filter-fuel-box label {
    margin-bottom: 5px;
    color: #787878;
}

/* Style for select dropdowns */
.filter-make-box select,
.filter-year-box select,
.filter-fuel-box select {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 15px;
    background-color: #fff;
    transition: border-color 0.3s ease;
    width: 100%;
}

.filter-make-box select:focus,
.filter-year-box select:focus,
.filter-fuel-box select:focus {
    border-color: #0056b3;
    outline: none;
}



/* Filter Options */
.filter-options {
    display: none;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.filter-options.active {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%); /* Center below the button */
    max-height: 500px;
    opacity: 1;
    z-index: 999;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    padding: 15px;
    display: block;
    background: white; /* Ensure visibility */
    min-width: 200px; /* Adjust as needed */
}

/* Mobile Compatibility */
@media (max-width: 768px) {
    .filter-options {
        display: none;
    }
    .filter-options.active {
        display: block;
    }
}

.filter-toggle-btn-handler {
    margin-left: auto;
}
