/* Offers-only presentation. */
#page .search-box.offers-search {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto 40px;
    padding: 0 !important;
    background: transparent;
    font-family: var(--portal-font-family);
}

.offers-search > .row { margin: 0; }

.offers-search #offers-search-bar {
    --offers-field-height: 58px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    /* Override the legacy offers padding, including its important bottom rule. */
    padding: 9px !important;
    border: 1px solid #e2e8ed;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(2, 24, 37, .10);
}

.offers-search #offers-search-bar > .select2-container,
.offers-search #offers-search-bar > select:not(.select2-hidden-accessible) {
    flex: 1 1 0;
    width: 100% !important;
    min-width: 0;
    margin: 0;
    float: none;
}

.offers-search #offers-search-bar > select:not(.select2-hidden-accessible) {
    height: var(--offers-field-height);
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #223e4f;
    font-family: var(--portal-font-family) !important;
    font-size: 16px;
}

.offers-search #offers-search-bar .select2-selection--single {
    height: var(--offers-field-height);
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.offers-search #offers-search-bar .select2-selection__rendered {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--offers-field-height);
    padding: 0 30px 0 16px;
    color: #223e4f;
    font-family: var(--portal-font-family);
    font-size: clamp(15px, 1.6vw, 17px);
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.offers-search #offers-search-bar .select2-selection__arrow {
    top: 0;
    right: 7px;
    height: var(--offers-field-height);
    padding: 0;
}

.offers-search #btnSearch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 76px;
    width: 76px !important;
    min-height: var(--offers-field-height);
    height: auto;
    margin: 0;
    padding: 8px 12px;
    float: none;
    border: 0;
    border-radius: 11px;
    background: #003c70;
    color: #fff;
    box-shadow: none;
    font-family: var(--portal-font-family) !important;
    font-size: 21px;
    line-height: 1.4;
    white-space: normal;
    transition: background-color .2s ease;
}

.offers-search #btnSearch svg { flex-shrink: 0; }
.offers-search #btnSearch .offers-search-label { display: none; }

.offers-search #btnSearch:hover,
.offers-search #btnSearch:focus { background: #002b50; }

.offers-search #offers-search-bar .select2-selection:focus-visible,
.offers-search #btnSearch:focus-visible {
    outline: 3px solid #437fa9;
    outline-offset: 2px;
}

/* Select2 appends the list to body. Its results ID limits these rules to offers. */
.select2-dropdown:has(#select2-ContentPlaceHolderMain_DropDownList1-results) {
    border-color: #d6e0e6;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(2, 24, 37, .16);
    font-family: var(--portal-font-family);
}

.select2-dropdown:has(#select2-ContentPlaceHolderMain_DropDownList1-results) .select2-search__field {
    min-height: 44px;
    border: 1px solid #d6e0e6;
    border-radius: 6px;
    font-family: var(--portal-font-family) !important;
    font-size: 16px;
}

.select2-dropdown:has(#select2-ContentPlaceHolderMain_DropDownList1-results) .select2-results {
    max-height: none;
    overflow: visible;
}

#select2-ContentPlaceHolderMain_DropDownList1-results {
    max-height: min(260px, 40vh);
    max-height: min(260px, 40svh);
}

#select2-ContentPlaceHolderMain_DropDownList1-results .select2-results__option {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 16px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
}

#select2-ContentPlaceHolderMain_DropDownList1-results .select2-results__option--highlighted[aria-selected] {
    background: #003c70;
    color: #fff;
}

/* Keep the search and region list reachable in a short landscape viewport. */
.select2-dropdown.offers-search-short-list:has(#select2-ContentPlaceHolderMain_DropDownList1-results) {
    position: fixed;
    top: var(--offers-list-top);
    left: var(--offers-list-left);
    display: flex;
    flex-direction: column;
    width: var(--offers-list-width) !important;
    max-height: var(--offers-list-height);
    border: 1px solid #d6e0e6;
    border-radius: 10px;
}

.select2-dropdown.offers-search-short-list .select2-search {
    flex-shrink: 0;
}

.select2-dropdown.offers-search-short-list:has(#select2-ContentPlaceHolderMain_DropDownList1-results) .select2-results {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.offers-search-short-list #select2-ContentPlaceHolderMain_DropDownList1-results {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

@media (max-width: 599px) and (orientation: portrait) {
    .offers-search #offers-search-bar {
        --offers-field-height: 54px;
        flex-direction: column;
        gap: 4px;
    }

    .offers-search #offers-search-bar > .select2-container,
    .offers-search #offers-search-bar > select:not(.select2-hidden-accessible) {
        flex: none;
    }

    .offers-search #btnSearch {
        flex: none;
        width: 100% !important;
        font-size: 16px;
    }

    .offers-search #btnSearch .offers-search-label {
        display: inline;
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: reduce) {
    .offers-search #btnSearch { transition: none; }
}

/* Category and region compose one server-side search. */
body #page .offers-search #offers-search-bar.offers-category-filter {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) 76px;
    align-items: stretch;
    gap: 8px;
}
.offers-search .offers-category-field {
    position: relative;
    min-width: 0;
    min-height: 78px;
    border: 1px solid #e1e8ed;
    border-radius: 11px;
    background: #f6f8fa;
    text-align: left;
}
body #page .offers-search .offers-category-field .public-search-caption { left: 38px; right: 12px; margin: 0; }
body #page .offers-search .offers-category-field .public-search-icon { top: 9px; left: 12px; font-size: 16px; line-height: 18px; transform: none; }
.offers-search .offers-category-field:focus-within { outline: 3px solid #437fa9; outline-offset: 2px; }
.offers-search .offers-category-field > select {
    width: 100%;
    min-width: 0;
    min-height: 78px;
    padding: 30px 25px 10px 10px;
    border: 0;
    background: transparent;
    color: #223e4f;
    font-family: var(--portal-font-family);
    font-size: 16px;
}
.offers-search .offers-category-field > select.offers-category-native {
    position: absolute;
    inset: 0;
    z-index: 2;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.offers-search .offers-category-value {
    display: block;
    padding: 32px 30px 12px 12px;
    color: #223e4f;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    pointer-events: none;
}
.offers-search .offers-category-field::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 40px;
    border: 4px solid transparent;
    border-top-color: #69808d;
    pointer-events: none;
}
#page .offers-filter-status, #page .offers-filter-empty {
    margin: 0 0 24px;
    text-align: center;
    color: #42657c;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
#page .offers-filter-empty { padding: 24px; background: #f6f8fa; border-radius: 12px; }
#offersPagination .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
#offersPagination .pagination > li > a, #offersPagination .pagination > li > span {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px;
    margin: 0;
    white-space: normal;
}
@media (max-width: 767px) {
    body #page .offers-search #offers-search-bar.offers-category-filter { grid-template-columns: minmax(0, 1fr); }
    body #page .offers-search #btnSearch { width: 100% !important; min-height: 50px; }
    body #page .offers-search #btnSearch .offers-search-label { display: inline; }
}
