/* Home search: use the shared brand palette. */
.search-panel-wrap {
    margin-top: -40px;
}

.search-panel {
    --search-tint: #edf5f5;
    --search-muted: #526b77;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgb(6 75 97 / 9%);
    overflow: visible;
}

.search-panel-heading {
    display: flex;
    margin-bottom: 10px;
}

.search-panel .search-tabs {
    display: flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid #dfebec;
    border-radius: 9999999px;
    background: var(--search-tint);
}

.search-panel .search-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 14px;
    border: 0;
    border-radius: 9999999px;
    background: transparent;
    color: var(--search-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    transition: background .18s, color .18s;
}

.search-panel .search-tab i {
    font-size: 15px;
}

.search-panel .search-tab:hover {
    background: #dcebed;
    color: var(--navy);
}

.search-panel .search-tab.is-active {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 3px 8px rgb(6 75 97 / 14%);
}

.search-panel .search-form {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.25fr) minmax(0, .75fr) 150px;
    align-items: stretch;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.search-panel .search-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 60px;
    padding: 9px 12px;
    border: 1px solid #d7e3e7;
    border-radius: 9999999px;
    background: #fafcfc;
    transition: border-color .18s, box-shadow .18s;
}

.search-panel .search-field:hover {
    border-color: #8eafb7;
}

.search-panel .search-field:focus-within {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgb(6 75 97 / 10%);
    background: var(--white);
}

.search-panel .search-field[hidden] {
    display: none !important;
}

.search-panel .search-field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    height: 24px;
    background: transparent;
    color: var(--navy);
    font-size: 17px;
}

.search-panel .search-field-content {
    flex: 1;
    min-width: 0;
}

.search-panel .search-field-content label {
    display: block;
    margin: 0 0 3px;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.search-panel .search-field-content input[type="text"],
.search-panel .duration-trigger,
.search-panel .guest-summary {
    display: block;
    width: 100%;
    min-width: 0;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    line-height: 22px;
    text-align: left;
    box-shadow: none;
}

.search-panel .search-field-content input::placeholder {
    color: var(--search-muted);
    opacity: 1;
}

.search-panel .search-field-content input:focus {
    outline: none;
}

.search-panel .search-field-content input[readonly], .search-panel .duration-trigger {
    cursor: pointer;
}

.search-panel .search-field-arrow {
    position: absolute;
    top: 50%;
    right: 16px;
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    color: #7b929b;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-panel .search-field-arrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .18s ease;
}

.search-panel .search-field:has([aria-expanded="true"]) > .search-field-arrow::before,
.search-panel [aria-expanded="true"] .search-field-arrow::before {
    transform: translateY(2px) rotate(225deg);
}

.search-panel .location-field .search-field-content,
.search-panel .duration-field .search-field-content,
.search-panel .guest-field .search-field-content {
    padding-right: 22px;
}

.search-panel .guest-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.search-panel .search-field span {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    display: flex;
}

.search-panel .search-field span i {
    color: #a84908;
}

.search-panel .search-submit {
    grid-column: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    min-height: 52px;
    padding: 12px;
    border: 0;
    border-radius: 9999999px;
    background: var(--orange);
    color: var(--white);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgb(200 90 11 / 16%);
    transition: background .18s, transform .18s;
}

.search-panel .search-submit:hover {
    background: #a84908;
}

.search-panel .search-submit:active {
    transform: translateY(1px);
}

.search-panel button:focus-visible, .search-panel #shortTermDate:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 3px;
}

.search-panel .location-suggestions-message {
    margin: 0;
    padding: 12px 10px;
    color: var(--search-muted);
    font-size: 13px;
    line-height: 1.6;
}

.search-panel .search-error {
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fff2eb;
    color: #963d06;
    font-size: 13px;
}

.search-panel .search-field:has([aria-invalid="true"]) {
    border-color: var(--orange);
}

.search-panel .location-suggestions, .search-panel .duration-dropdown, .search-panel .guest-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1050;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 12px 32px rgb(6 75 97 / 15%);
}

.search-panel .location-suggestions[hidden], .search-panel .duration-dropdown[hidden] {
    display: none;
}

.search-panel .location-suggestions {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.search-panel .location-suggestions-title, .search-panel .duration-dropdown-title {
    padding: 8px 10px 12px;
    color: var(--search-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .6px;
}

.search-panel .location-suggestion, .search-panel .duration-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    text-align: left;
}

.search-panel .location-suggestion:hover, .search-panel .duration-option:hover, .search-panel .duration-option.is-selected {
    background: var(--dp-primary);
    color: #fff;
}

.search-panel .location-suggestion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--search-tint);
    color: var(--navy);
}

.search-panel .location-suggestion-text {
    flex: 1;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.search-panel .location-highlight {
    display: inline;
    padding: 0;
    border-radius: 2px;
    background: #fff0de;
    color: #a84908;
    font-weight: 700;
}

.search-panel .duration-option i {
    display: none;
    color: var(--navy);
}

.search-panel .duration-option.is-selected i {
    display: inline-block;
}

.search-panel .guest-dropdown {
    display: none;
    left: auto;
    width: 300px;
}

.search-panel .guest-dropdown.show {
    display: block;
}

.search-panel .guest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px 18px;
}

.search-panel .guest-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-panel .guest-info strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
}

.search-panel .guest-info small {
    color: var(--search-muted);
    font-size: 12px;
}

.search-panel .guest-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-panel .guest-counter span {
    min-width: 18px;
    text-align: center;
    font-size: 14px;
}

.search-panel .guest-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #8eafb7;
    border-radius: 50%;
    background: var(--white);
    color: var(--navy);
    font-size: 23px;
    line-height: 1;
}

.search-panel .guest-btn:hover:not(:disabled) {
    background: var(--search-tint);
    border-color: var(--navy);
}

.search-panel .guest-btn:disabled {
    border-color: var(--line);
    color: #a8b7bf;
    cursor: not-allowed;
}

.search-panel .guest-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 4px 2px;
    border-top: 1px solid var(--line);
    color: var(--search-muted);
    font-size: 13px;
}

.search-panel .guest-total strong {
    color: var(--navy);
}

.search-panel .guest-done {
    min-height: 40px;
    padding: 8px 18px;
    border: 0;
    border-radius: 9999999px;
    background: var(--navy);
    color: var(--white);
    font-size: 13px;
    font-weight: 650;
}

@media (max-width: 1100px) {
    .search-panel .search-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .search-panel .search-tab {
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    .search-panel-wrap {
        margin-top: -30px;
    }
    .search-panel {
        padding: 12px;
        border-radius: 14px;
    }
    .search-panel .search-tabs {
        width: 100%;
    }
    .search-panel .search-tab {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .search-panel {
        padding: 12px;
    }
    .search-panel .search-form {
        grid-template-columns: minmax(0, 1fr);
    }
    .search-panel .search-field {
        min-height: 60px;
        padding: 9px 12px;
    }
    .search-panel .search-field-content input[type="text"] {
        font-size: 16px;
    }
    .search-panel .search-tab {
        gap: 8px;
        min-height: 38px;
        padding: 6px 8px;
        font-size: 12px;
    }
    .search-panel .guest-dropdown {
        width: 100%;
    }
    .search-panel .datepicker-calendar {
        min-width: 0;
        width: 100%;
        padding: 12px 8px;
    }
}


#roomLists .collapse:not(.show) {
    display: none !important;
}

#roomLists .collapse.show {
    display: block !important;
}

.area-carousel {
    width: 100%;
    overflow: hidden;
}

.area-section-link {
    display: inline-block;
    text-decoration: none;
}

.area-viewport {
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
}

.area-track {
    display: flex;
    gap: 12px;
    transition: transform 420ms cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
    cursor: grab;
    user-select: none;
}

.area-track.is-dragging {
    transition: none !important;
    cursor: grabbing;
}

.area-item {
    flex: 0 0 calc((100% - 205px) / 3.45);
    min-width: 0;
}

.area-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.area-card {
    width: 100%;
    height: 192px;
    border-radius: 9px;
    background-image: var(--img);
    background-size: cover;
    background-position: center;
}

.area-name {
    margin-top: 12px;
    text-align: center;
    color: #5c5c5c;
    font-size: 15px;
    font-weight: 700;
}

.area-dots {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
}

.area-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: #cfd2d7;
    cursor: pointer;
    transition: width .25s ease, background .25s ease;
}

.area-dot.active {
    width: 20px;
    background: #ff6b1a;
}

@media (max-width: 991.98px) {
    .area-item {
        flex-basis: calc((100% - 12px) / 2.4);
    }

    .area-card {
        height: 180px;
    }
}

@media (max-width: 575.98px) {
    .area-item {
        flex-basis: 82%;
    }

    .area-card {
        height: 190px;
    }

    .area-dots {
        justify-content: center;
    }
}


/* =========================================
   LOCATION AUTOCOMPLETE - ZONSTAY
   ========================================= */

/* Phần tử bao quanh ô nhập địa điểm */
.location-field {
    position: relative;
    overflow: visible;
}

/* Dropdown tổng */
.location-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: -10px;

    width: min(760px, calc(100vw - 32px));
    max-height: 320px;
    box-sizing: border-box;
    z-index: 1050;

    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px;

    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);

    /* Dropdown không tạo thanh cuộn riêng trên desktop */
    overflow: hidden;
}

/* Ẩn dropdown */
.location-suggestions[hidden] {
    display: none !important;
}

/* Chỉ hiển thị một cột khi không có dữ liệu ở cột còn lại */
.location-suggestions.only-areas,
.location-suggestions.only-buildings {
    grid-template-columns: minmax(0, 1fr);
}

/* =========================================
   CỘT KẾT QUẢ
   ========================================= */

.autocomplete-column {
    min-width: 0;
    min-height: 0;
    overflow: visible;
}

.autocomplete-heading {
    margin-bottom: 14px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.5;
}

/* Cột khu vực */
.autocomplete-areas {
    min-width: 0;
    padding-right: 12px;
    border-right: 1px solid #e5e7eb;
}

/* Khi chỉ có khu vực */
.location-suggestions.only-areas .autocomplete-areas {
    padding-right: 0;
    border-right: 0;
}

/* Khi chỉ có tòa nhà */
.location-suggestions.only-buildings .autocomplete-areas {
    display: none;
}

/* Khi chỉ có khu vực thì ẩn cột tòa nhà */
.location-suggestions.only-areas .autocomplete-buildings {
    display: none;
}

/* =========================================
   DANH SÁCH KHU VỰC
   ========================================= */

#areaSuggestions {
    min-width: 0;
    max-height: none;
    overflow: visible;
}

.autocomplete-area {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 50px;
    padding: 8px 10px;

    border: 0;
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font: inherit;

    transition: background-color 0.2s ease;
}

.autocomplete-area:hover {
    background: #f3f6fa;
}

.autocomplete-area-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    border-radius: 50%;
    background: var(--dp-primary, #087f8c);
    color: #e56a12;
}

.autocomplete-area-icon i {
    font-size: 16px;
}

.autocomplete-area-name {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* =========================================
   DANH SÁCH TÒA NHÀ
   Chỉ phần tử này cuộn trên desktop
   ========================================= */

.autocomplete-buildings {
    min-width: 0;
    min-height: 0;
    max-height: 286px;

    overflow-y: auto;
    overflow-x: hidden;

    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #a0a0a0 transparent;
}

/* Nội dung bên trong không tạo thêm thanh cuộn */
#buildingSuggestions {
    min-width: 0;
    max-height: none;
    overflow: visible;
}

/* Từng kết quả tòa nhà */
.autocomplete-building {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-width: 0;
    min-height: 74px;
    padding: 8px 10px;

    border: 0;
    border-radius: 10px;
    background: #fff;
    color: inherit;
    text-align: left;
    text-decoration: none;

    transition: background-color 0.2s ease;
}

.autocomplete-building:hover {
    background: #f3f6fa;
}

/* Ảnh tòa nhà */
.autocomplete-building img {
    display: block;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;

    border-radius: 10px;
    object-fit: cover;
    background: #f3f4f6;
}

/* Thông tin tòa nhà */
.autocomplete-building-info {
    flex: 1;
    min-width: 0;
}

.autocomplete-building-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: #173c4a;
}

.autocomplete-building-address {
    display: block;
    margin-top: 5px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #778093;
    font-size: 12px;
    line-height: 1.5;
}

/* Không tìm thấy kết quả */
.autocomplete-empty {
    padding: 12px 8px;
    color: #89909c;
    font-size: 13px;
    line-height: 1.6;
}

/* =========================================
   SCROLLBAR - CHROME / EDGE
   Chỉ áp dụng cho danh sách tòa nhà
   ========================================= */

.autocomplete-buildings::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-buildings::-webkit-scrollbar-track {
    background: transparent;
}

.autocomplete-buildings::-webkit-scrollbar-thumb {
    background: #b6bdc5;
    border-radius: 10px;
}

.autocomplete-buildings::-webkit-scrollbar-thumb:hover {
    background: #89929c;
}

/* =========================================
   MOBILE
   Một thanh cuộn duy nhất cho cả dropdown
   ========================================= */

@media (max-width: 767px) {
    .location-suggestions {
        left: -10px;
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);

        grid-template-columns: minmax(0, 1fr);
        gap: 14px;

        max-height: 65vh;
        overflow-y: auto;
        overflow-x: hidden;

        padding: 14px;
        overscroll-behavior: contain;
    }

    /* Cột khu vực không có đường phân cách dọc */
    .autocomplete-areas {
        padding-right: 0;
        border-right: 0;
    }

    /* Trên mobile, dropdown tổng chịu trách nhiệm cuộn */
    .autocomplete-buildings {
        max-height: none;
        overflow: visible;

        padding-top: 12px;
        border-top: 1px solid #e5e7eb;
    }

    .autocomplete-heading {
        margin-bottom: 10px;
    }

    .autocomplete-area,
    .autocomplete-building {
        padding: 8px;
    }
}


/* Khi có cả khu vực và tòa nhà: chỉ dropdown cuộn */
.location-suggestions:not(.only-areas):not(.only-buildings) {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: start;
}

/* Hai cột không tự tạo thanh cuộn riêng */
.location-suggestions:not(.only-areas):not(.only-buildings) .autocomplete-column,
.location-suggestions:not(.only-areas):not(.only-buildings) .autocomplete-areas,
.location-suggestions:not(.only-areas):not(.only-buildings) .autocomplete-buildings {
    max-height: none;
    min-height: 0;
    overflow: visible;
}

/* Chỉ có tòa nhà: giữ một vùng cuộn danh sách tòa nhà */
.location-suggestions.only-buildings {
    overflow: hidden;
}

.location-suggestions.only-buildings .autocomplete-buildings {
    max-height: 286px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Chỉ có khu vực: dropdown cuộn chung nếu danh sách dài */
.location-suggestions.only-areas {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}

.location-suggestions.only-areas .autocomplete-areas {
    max-height: none;
    overflow: visible;
}

/* Mobile: luôn chỉ cuộn dropdown */
@media (max-width: 767px) {
    .location-suggestions {
        max-height: 65vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .location-suggestions .autocomplete-column,
    .location-suggestions .autocomplete-areas,
    .location-suggestions .autocomplete-buildings {
        max-height: none;
        overflow: visible;
    }
}

