/* Top Search Styling - Header Search Component */
/* Self-contained CSS that works across all pages */
/* Only overrides bundle CSS, does not depend on page-specific stylesheets */

/* === CORE LAYOUT === */
.top-search {
    width: auto !important;
    max-width: 900px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
}

.top-search .d-flex {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.top-search form {
    width: 100% !important;
    max-width: 900px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
}

.top-search .search-form {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 900px !important;
    background: none !important;
    gap: 16px !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    padding: 0 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border: none !important;
}

.top-search .wrapper {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    min-width: 0 !important;
    position: relative !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

.top-search .wrapper:first-child {
    flex: 0 0 auto !important;
    min-width: 200px !important;
}

.top-search .wrapper:last-child {
    flex: 1 1 auto !important;
    min-width: 280px !important;
}

/* === SEARCH INPUT CONTAINER === */
.top-search .search-input {
    background: #ffffff !important;
    width: 100% !important;
    border-radius: 5px !important;
    position: relative !important;
    box-shadow: 0px 1px 5px 3px rgba(0, 0, 0, 0.12) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    height: 40px !important;
}

/* === SEARCH INPUT FIELD === */
.top-search .search-input input {
    height: 40px !important;
    width: 100% !important;
    outline: none !important;
    border: none !important;
    border-radius: 5px !important;
    padding: 0 30px 0 12px !important;
    font-size: 15px !important;
    font-family: QuickSand, sans-serif !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #111827 !important;
    box-sizing: border-box !important;
    display: block !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.top-search .city-search input[type='text'] {
    color: #00132c !important;
}

.top-search .city-search input[type='text']::placeholder {
    color: #00132c !important;
}

.top-search .search-input input::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
    font-family: QuickSand, sans-serif !important;
    font-size: 15px !important;
    font-weight: 500 !important;
}

.top-search .search-input input:focus {
    outline: none !important;
    background: #ffffff !important;
    color: #111827 !important;
}

.top-search .search-input input::-webkit-outer-spin-button,
.top-search .search-input input::-webkit-inner-spin-button,
.top-search .search-input input::-webkit-search-decoration,
.top-search .search-input input::-webkit-search-cancel-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.top-search .search-input.active input {
    border-radius: 5px 5px 0 0 !important;
}

.top-search .city-search .icon i {
    display: inline-block;
    transition: transform 0.3s ease;
}

.top-search .city-search.active .icon i {
    transform: rotate(-180deg);
}

/* === DROPDOWN LISTS === */
.top-search .search-suggestions,
.top-search .city-suggestions {
    padding: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    border: none !important;
    position: absolute !important;
    display: none !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;
    background: transparent !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
}

.top-search .search-input.active .search-suggestions,
.top-search .search-input.active .city-suggestions {
    padding: 10px 8px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    display: block !important;
    z-index: 9999 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    max-height: 400px !important;
    border-radius: 0 0 5px 5px !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18) !important;
    overflow-y: auto !important;
}

/* === LIST ITEMS === */
.top-search .search-suggestions li,
.top-search .city-suggestions li {
    list-style: none !important;
    list-style-type: none !important;
    list-style-position: outside !important;
    padding: 0 !important;
    margin: 0 !important;
    display: none !important;
    width: 100% !important;
    cursor: pointer !important;
    border-radius: 3px !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: none !important;
    align-items: unset !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    color: #111827 !important;
}

/* Smart search results are appended without inline styles, so show them when the list is active */
.top-search .search-input.active .search-suggestions li,
.top-search .search-input.active .city-suggestions li[style*="display: block"] {
    display: block !important;
}

.top-search .search-suggestions li:hover,
.top-search .city-suggestions li:hover {
    background: #f1f5f9 !important;
    border-radius: 6px !important;
}

/* === LIST ITEM CONTENT === */
.top-search .search-suggestions li a,
.top-search .city-suggestions li a {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    padding: 8px 12px !important;
    color: #111827 !important;
    font-weight: 500 !important;
    gap: 10px !important;
    line-height: 1.5 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
}

.top-search .city-suggestions li > span {
    display: block !important;
    padding: 8px 12px !important;
    color: #111827 !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* === LIST ITEM DIRECT TEXT (for geolocation) === */
.top-search .search-suggestions li,
.top-search .city-suggestions li {
    padding: 0 !important;
}

.top-search .city-suggestions li {
    font-family: QuickSand, sans-serif !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    padding: 8px 12px !important;
}

/* === ICONS IN RESULTS === */
.top-search .search-suggestions li a i,
.top-search .city-suggestions li a i {
    color: #64748b !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
    width: 16px !important;
    height: 16px !important;
}

.top-search .search-suggestions li a span {
    flex: 1 !important;
    display: block !important;
}

.top-search .search-suggestions li a small {
    opacity: 0.7 !important;
    color: #64748b !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    padding: 0 !important;
}

.top-search .search-suggestions li a mark {
    background: transparent !important;
    color: #111827 !important;
    font-weight: 700 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.top-search .search-suggestions .suggestion-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 8px !important;
    color: #6c757d;
    font-size: 0.95rem;
    cursor: default;
}

.top-search .search-suggestions .suggestion-loader:hover {
    background: none;
}

.top-search .search-suggestions .suggestion-loader-dots {
    display: flex;
    gap: 6px;
}

.top-search .search-suggestions .suggestion-loader-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #7c4dff);
    animation: header-loader-bounce 1s infinite ease-in-out;
}

.top-search .search-suggestions .suggestion-loader-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.top-search .search-suggestions .suggestion-loader-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
    .top-search .search-suggestions .suggestion-loader-dots span {
        animation: none;
    }
}

@keyframes header-loader-bounce {
    0%, 80%, 100% { transform: translateY(0) scale(0.8); opacity: 0.5; }
    40% { transform: translateY(-10px) scale(1.1); opacity: 1; }
}

.top-search .search-suggestions li.focused,
.top-search .city-suggestions li.focused {
    background: #f1f5f9 !important;
    border-radius: 6px !important;
}

.top-search .search-suggestions li.no-results,
.top-search .city-suggestions li.no-results {
    padding: 10px 12px !important;
    color: #64748b !important;
    opacity: 0.8 !important;
}

/* === GEOLOCATION ITEM === */
.top-search li[data-geolocation="true"] {
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    padding: 8px 12px !important;
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.top-search li[data-geolocation="true"] i {
    margin-right: 8px !important;
    color: #38ACDA !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
}

/* === ICON BUTTON === */
.top-search .search-input .icon {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 30px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #64748b !important;
    cursor: pointer !important;
    font-size: 16px !important;
    pointer-events: auto !important;
    z-index: 100 !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.top-search .search-input .icon i {
    font-size: 16px !important;
}

/* === SCROLLBAR === */
.top-search .search-suggestions::-webkit-scrollbar,
.top-search .city-suggestions::-webkit-scrollbar {
    width: 7px !important;
}

.top-search .search-suggestions::-webkit-scrollbar-track,
.top-search .city-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 25px !important;
}

.top-search .search-suggestions::-webkit-scrollbar-thumb,
.top-search .city-suggestions::-webkit-scrollbar-thumb {
    background: #ccc !important;
    border-radius: 25px !important;
}

.top-search .search-suggestions::-webkit-scrollbar-thumb:hover,
.top-search .city-suggestions::-webkit-scrollbar-thumb:hover {
    background: #00132c !important;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1200px) {
    .top-search .search-form {
        gap: 12px !important;
    }

    .top-search .wrapper:first-child {
        flex: 0 0 180px !important;
        min-width: 180px !important;
    }

    .top-search .wrapper:last-child {
        flex: 1 1 auto !important;
        min-width: 240px !important;
    }
}

/* Tablets / small devices: tighten up further so both fields keep fitting side-by-side */
@media (max-width: 768px) {
    .top-search {
        max-width: 100% !important;
    }

    .top-search .search-form {
        gap: 8px !important;
        padding: 0 8px !important;
    }

    .top-search .wrapper:first-child {
        flex: 0 0 110px !important;
        min-width: 110px !important;
    }

    .top-search .wrapper:last-child {
        min-width: 0 !important;
    }

    .top-search .search-input input {
        font-size: 14px !important;
        padding: 0 26px 0 10px !important;
    }
}

/* Phones: the city picker label gets too tight to read, so stack it above the smart search */
@media (max-width: 480px) {
    .top-search .search-form {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .top-search .wrapper:first-child,
    .top-search .wrapper:last-child {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }

    /* The header is a fixed-height flex row; once the search inputs wrap onto two lines
       it needs room to grow, otherwise the second row gets clipped by the viewport. */
    .page-header {
        height: auto !important;
        min-height: 4.125rem !important;
        flex-wrap: wrap !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    .top-search {
        order: 3;
        flex: 1 1 100% !important;
        margin-top: 0.5rem !important;
    }
}
