/* Main Search Header Container */
.section-header-page-search {
    padding: 20px 0;
    background-color: #1a2150;
}

.search-header-container {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Desktop & Mobile Buttons */
.search-header-buttons-desktop,
.search-header-buttons-mobile {
    display: flex;
    width: 100%;
    gap: 10px;
    max-width: 1140px;
    padding: 0 15px;
}

.search-header-btn,
.search-header-btn-main {
    padding: 10px;
    background-color: #f9f9f9;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    font-size: 14px;
    flex-grow: 1;
    text-align: center;
    color: #1A2150;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-header-btn .filter-label {
    margin-right: 2px;
}

.search-header-btn .filter-value {
    color: #d7af3b;
    margin-left: 2px;
}

.search-header-btn:hover .filter-value {
    color: #1A2150;
}

.search-header-btn:hover,
.search-header-btn-main:hover {
    background-color: #d7af3b;
    color: #fff;
}

.search-header-btn.active {}

.search-header-btn-main {
    flex-grow: 0;
    min-width: 120px;
}

.search-header-buttons-mobile {
    display: none;
}

/* Full Filters Modal */
.search-filters-modal {
    display: none;
    position: fixed;
    z-index: 10010;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.search-filters-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    position: relative;
}

.search-filters-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.close-filters-modal,
.close-radius-modal {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

.close-filters-modal:hover,
.close-radius-modal:hover {
    color: #333;
}

.search-filters-modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

#ulisting-search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #1A2150;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #fff;
}

.form-group input[type="text"]:hover,
.form-group input[type="text"]:focus,
.form-group input[type="text"]:active,
.form-group input[type="number"]:hover,
.form-group input[type="number"]:active,
.form-group input[type="number"]:focus {
    border: 1px solid #ccc;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfie ld;
}

.range-inputs .select2-container {
    width: 50% !important;
}

.select2-selection {
    height: 50px !important;
    padding: 10px !important;
    border: 1px solid #f0f0f0 !important;
}

.select2-selection:hover {
    border: 1px solid #ccc !important;
}

.select2-selection .range-inputs {
    height: 50px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
}

.range-inputs {
    display: flex;
    gap: 10px;
}

.select2-selection__arrow {
    width: 50px !important;
    height: 50px !important;
}

.range-inputs .input-with-icon {
    position: relative;
    align-items: center;
    display: flex;
    flex: 1;
    width: 50%;
}

.range-inputs.input-with-icon:last-child {
    margin: 0;
}

.range-inputs .input-with-icon input {
    padding-right: 30px;
}

.range-inputs .input-with-icon span {
    position: absolute;
    right: 10px;
    color: #777;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

.checkbox-group>div {
    display: flex;
}

.checkbox-group label {
    font-size: 13px;
    font-weight: normal;
    margin: 0 0 0 5px;
}

.search-filters-modal-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

#reset-search-filters {
    background-color: #eee;
    color: #1A2150;
    border: none;
    font-size: 18px;
    padding: 10px 20px;
    text-transform: uppercase;
    cursor: pointer;
}

#reset-search-filters:hover {
    background-color: #ccc;
}

#open-radius-modal {
    color: #1A2150;
    font-size: 12px;
}

#submit-search-filters,
#validate-radius-search {
    background-color: rgba(215, 175, 59, 1);
    outline: navajowhite;
    color: #FFF;
    border: none;
    font-size: 18px;
    padding: 10px 20px;
    text-transform: uppercase;
    cursor: pointer;
}

#submit-search-filters:hover,
#validate-radius-search:hover {
    background-color: #1A2150;
}

.radius-inputs {
    display: flex;
    align-items: center;
}

#validate-radius-search {
    width: 100%;
}

#validate-radius-search:disabled {
    background-color: #eee;
    cursor: not-allowed;
}

.radius-inputs #radius-slider {
    width: 70%;
    padding: 0;
    accent-color: #1A2150;
}

.radius-inputs .input-with-icon {
    width: 25%;
    margin-left: 5%;
}

.radius-inputs span {
    position: absolute;
    right: 10px;
    color: #777;
    top: 11px;
}

/* Radius Search Modal */
.radius-search-modal {
    display: none;
    position: fixed;
    z-index: 10020;
    /* Higher than the main modal */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.radius-search-modal-content {
    background-color: #fff;
    margin: 5% auto;
    width: 90%;
    max-width: 1200px;
}

.radius-search-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.radius-search-modal-body {
    display: flex;
}

.radius-controls {
    width: 30%;
    padding: 20px;
    border-right: 1px solid #eee;
}

.radius-map-container {
    width: 70%;
}

#radius-map {
    height: 60vh;
    width: 100%;
}

#clear-radius-city,
#clear-search-ville,
#clear-search-q {
    position: absolute;
    right: 10px;
    border: none;
    font-size: 20px;
    top: 10px;
    color: #888888;
}

.input-with-icon {
    position: relative;
    width: 100%;
}

/* Autocomplete styles */
#ville-autocomplete-results,
#radius-ville-autocomplete-results {
    position: absolute;
    background-color: white;
    z-index: 9999;
    width: calc(100% - 2px);
    box-shadow: 1px 2px 8px 2px rgba(0, 0, 0, 0.1) !important;
    top: 90px;
    left: 1px;
    display: none;
}

.autocomplete-results.visible {
    display: block !important;
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
}

.autocomplete-item:hover {
    background-color: rgba(215, 175, 59, 1);
}

/* Spinner for results area */
.autocomplete-results-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.autocomplete-results-loader::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #d7af3b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    float: left;
    color: #888888;
    background-color: transparent;
    font-size: 24px;
    margin-right: 5px;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #444444;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .search-header-buttons-desktop {
        display: none;
    }

    .search-header-buttons-mobile {
        display: flex;
    }

    .search-filters-modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .search-filters-modal-body {
        max-height: calc(100vh - 110px);
    }

    .radius-search-modal-body {
        flex-direction: column;
    }

    .radius-controls,
    .radius-map-container {
        width: 100%;
    }

    #ulisting-search-form {
        grid-template-columns: 1fr;
    }

    .radius-search-modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
    }

    .search-filters-modal,
    .radius-search-modal {
        overflow: hidden;
    }
}

@media (max-width: 1100px) {
    .search-header-buttons-desktop .search-header-btn .filter-value {
        display: none;
    }
}