/**
 * Location Search Autocomplete Styles
 */

/* Container */
.location-search {
    position: relative;
    width: 100%;
}

.location-search-wrapper {
    position: relative;
}

/* Input field - matches existing .search-form .form-control */
.location-search-input {
    height: 2.75rem !important;
    padding: 1rem 4rem 1rem 1.5rem;
    border-radius: 2.625rem !important;
    border: 1px solid #949494;
    box-shadow: none;
    display: inline-block;
    width: 100%;
    font-size: 1rem;
}

.location-search-input:focus {
    border-color: #232F84;
    outline: none;
    box-shadow: 0 0 0 2px rgba(35, 47, 132, 0.2);
}

/* Search button - matches existing .search-form .search-btn */
.location-search .search-btn {
    color: #232F84;
    text-align: center;
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.125rem;
    padding: 0.625rem;
    box-shadow: none;
    margin: 0 0.5rem 0 0;
    display: inline-block;
    align-items: center;
    border-radius: 0.75rem;
    position: absolute;
    z-index: 990;
    top: 0;
    right: 0;
    cursor: pointer;
}

.location-search .search-btn:focus-visible {
    outline: 2px solid #E6A300;
    outline-offset: 3px;
    box-shadow: none;
}

.location-search .search-btn svg {
    height: 1.125rem;
    width: 1.125rem;
    vertical-align: initial;
    fill: #232F84;
}

/* Dropdown container */
.location-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: #fff;
    border-radius: 0.75rem !important;
    border: 1px solid #232F84;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow: hidden;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-left: 0;
}

.location-search-dropdown.open {
    display: block;
}

/* Result items */
.location-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.location-search-item:hover {
    background-color: #f0f4f8;
}

.location-search-item.selected {
    background-color: #e8ebf4;
}

/* Result item text */
.location-name {
    font-weight: 400;
    color: #666;
}

.location-name mark {
    background-color: transparent;
    color: #232F84;
    font-weight: 700;
    padding: 0;
    margin: 0;
    letter-spacing: normal;
}

.location-count {
    font-size: 0.875rem;
    color: #666;
    white-space: nowrap;
    margin-left: 0.5rem;
}

/* Empty state */
.location-search-empty {
    padding: 1.5rem;
    text-align: center;
    color: #666;
    font-size: 0.9375rem;
}

/* ==========================================
   Front Page Hero Variant
   ========================================== */

/* Allow dropdown to overflow hero container */
body.home #page-header,
body.home #page-header .page-header,
body.home #page-header .content,
body.home #page-header .search {
    overflow: visible !important;
}

body.home #page-header .location-search .location-search-input {
    height: 56px !important;
}

body.home #page-header .location-search .search-btn {
    margin: 0.375rem;
    background: #232F84;
    border-radius: 50%;
    height: 2.75rem;
    width: 2.75rem;
}

body.home #page-header .location-search .search-btn svg {
    fill: #fff;
    vertical-align: top;
}

body.home #page-header .location-search .location-search-dropdown {
    margin-top: 0.75rem;
}

/* ==========================================
   Header Variant
   ========================================== */
#header .location-search {
    max-width: 280px;
}

#header .location-search .location-search-dropdown {
    min-width: 100%;
}

/* Hide header search on smaller screens */
@media (max-width: 1199.98px) {
    #header .location-search {
        display: none;
    }
}

/* ==========================================
   Mobile Optimizations
   ========================================== */
@media (max-width: 767.98px) {
    .location-search-dropdown {
        max-height: 60vh;
    }

    .location-search-item {
        padding: 1rem 1.25rem;
    }
}
