﻿body {
    background: #ededed;
}

.img_logo {
    height: 3rem;
    width: auto;
}

/* ===== HERO ===== */
.home-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 1;
    min-height: 0;
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% auto;
    background-attachment: fixed;
    background-color: #f5f7fb;
    overflow: hidden;
    z-index: 1;
}

    .home-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.30);
        z-index: 2;
        pointer-events: none;
    }

    .home-hero::before {
        content: none;
    }

.home-hero-shell {
    position: relative;
    z-index: 3;
    width: 90%;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 28px 12px 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.home-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.home-header-left-box {
    display: flex;
    align-items: center;
    gap: .2rem;
    min-width: 0;
    flex: 1 1 auto;
}

.home-header-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.home-header-left-top {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6) !important;
}

.home-header-left-tagline {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: .75rem !important;
    opacity: .9;
    margin-top: .15rem;
    line-height: 1.25;
    color: #fff;
}

    .home-header-left-tagline span {
        display: inline-block;
    }

.home-header-right-box {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    text-align: right;
}

.home-header-right-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    font-size: clamp(.82rem, 1vw, .94rem);
}

    .home-header-right-top > * {
        flex: 0 0 auto;
    }

    .home-header-right-top > a,
    .home-header-right-top .account-trigger,
    .home-header-right-top .nav-post,
    .home-header-right-top .header-favorite-link,
    .home-header-right-top .favorite-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: clamp(33px, 3vw, 38px);
        padding: 0 clamp(12px, 1.4vw, 16px);
        border-radius: 999px;
        background: rgba(255,255,255,.96);
        border: 1px solid rgba(46, 144, 250, .16);
        color: black !important;
        text-decoration: none !important;
        text-shadow: none !important;
        font-size: clamp(.82rem, 1vw, .94rem);
        font-weight: 700;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
        transition: .2s ease;
        white-space: nowrap;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

        .home-header-right-top > a:hover,
        .home-header-right-top .account-trigger:hover,
        .home-header-right-top .nav-post:hover,
        .home-header-right-top .header-favorite-link:hover,
        .home-header-right-top .favorite-link:hover {
            transform: translateY(-1px);
            border-color: rgba(46, 144, 250, .35);
            text-decoration: none !important;
        }

    .home-header-right-top .nav-post {
        background: linear-gradient(135deg, #3ba4ff 0%, #2563eb 100%);
        color: #fff !important;
        border-color: transparent;
        box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
    }

        .home-header-right-top .nav-post:hover {
            background: linear-gradient(135deg, #50b1ff 0%, #1d4ed8 100%);
        }

.account-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 0 clamp(12px, 1.4vw, 16px);
    border-radius: 999px;
    white-space: nowrap;
}

    .account-trigger i {
        text-shadow: none !important;
    }

.home-header-right-bottom {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(15,23,42,.10);
    color: #64748b;
    font-size: clamp(.78rem, .95vw, .86rem);
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

    .home-header-right-bottom a {
        color: #64748b !important;
        text-decoration: none !important;
        margin: 0;
        text-shadow: none !important;
    }

        .home-header-right-bottom a:hover {
            color: #1e40af !important;
            text-decoration: none !important;
        }

        .lang-active,
        .home-header-right-bottom a.lang-active {
            color: #2563eb !important;
            font-weight: 800;
            text-decoration: none !important;
        }

.home-hero-main {
    width: 100%;
    max-width: 900px;
    margin: auto auto 0;
}

.home-main-text {
    margin-bottom: 14px;
}

.home-main-title {
    margin: 0 auto;
    font-size: clamp(1.8rem, 2.5vw, 3rem);
    font-weight: 700;
    line-height: 1.18;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6) !important;
}

.home-sub-title {
    width: min(92%, 900px);
    margin: 8px auto 0;
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    line-height: 1.35;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6) !important;
}

.home-main-search {
    margin-top: 18px;
    position: relative;
    padding-top: 0;
}

.view-count-wrapper span:first-child {
    margin-right: 8px;
}
/* iOS fixed fallback */
.home-hero.ios-fixed {
    background-image: none !important;
}

    .home-hero.ios-fixed::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: var(--hero-bg, url('/Assets/Cities/Banner.jpg'));
        background-position: center center;
        background-repeat: no-repeat;
        background-size: cover;
        z-index: 1;
        pointer-events: none;
    }

/* ===== SEARCH ===== */
.home-search-tabs-strip {
    width: 91%;
    margin: 0 auto .8rem auto;
}

.home-search-tabs {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: transparent;
    border-radius: 4px 4px 0 0;
    padding: 2px 24px;
    z-index: 5;
}

.home-search-tab-btn {
    border: none;
    background: transparent;
    padding: 0 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: .86rem;
    font-weight: 500;
    color: rgba(255,255,255,.7);
    text-shadow: 0 2px 4px rgba(0,0,0,0.6) !important;
}

    .home-search-tab-btn.active {
        color: #fff;
        background: transparent;
        box-shadow: none;
    }

.home-search-tabs-pointer {
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 8px;
    border-color: #fff transparent transparent transparent;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
}

.home-search-wrapper {
    position: relative;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15,23,42,.15);
    padding: 8px 10px 6px;
    width: 90%;
    max-width: 1080px;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-search-top {
    display: flex;
    align-items: center;
    gap: clamp(6px, .9vw, 12px);
    padding: 2px 4px 0;
}

.home-search-input-wrap {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 8px;
}

    .home-search-input-wrap input {
        width: 100%;
        min-width: 0;
        border: none;
        outline: none;
        height: 38px;
        font-size: clamp(13px, .9vw, 14px);
        color: #111827;
        background: transparent;
    }

.home-search-btn-main {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    flex: 0 0 40px;
}

    .home-search-btn-main:hover {
        background: #1d4ed8;
    }

.home-search-bottom {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: clamp(8px, 1vw, 12px);
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    padding: 4px 8px 2px;
    border-top: 1px solid #e5e7eb;
    margin-top: 2px;
}

    .home-search-bottom > .home-search-filter,
    .home-search-bottom .home-search-filter {
        min-width: 0;
    }

        .home-search-bottom > .home-search-filter:first-child {
            flex: 0 0 clamp(110px, 12vw, 150px);
            max-width: clamp(110px, 12vw, 150px);
        }

.home-search-filter {
    flex: 1;
    font-size: .8rem;
    color: #4b5563;
    position: relative;
    min-width: 0;
}

.home-search-filter-city-fixed {
    width: clamp(110px, 12vw, 150px);
    min-width: clamp(110px, 12vw, 150px);
    max-width: clamp(110px, 12vw, 150px);
}

.home-search-city-display {
    width: 100%;
    height: 26px;
    min-height: 26px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 7px;
    font-weight: 700;
    color: #2563eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    font-size: clamp(12px, .85vw, 14px);
}

.home-search-city-icon {
    color: #FF5D90;
    font-style: normal;
    line-height: 1;
    flex: 0 0 auto;
}

.home-search-city-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-search-filter-ward {
    flex: 0 0 clamp(170px, 22vw, 284px);
    max-width: clamp(170px, 22vw, 284px);
}

.home-search-filter-ward-fixed .select2-container {
    width: 100% !important;
}

.home-search-filter-select2 {
    flex: 1 1 clamp(145px, 18vw, 280px);
    min-width: 0;
}

.home-search-filter-select {
    width: 100%;
    border: none;
    background: transparent;
    height: 26px;
    padding-left: 7px;
    font-size: .8rem;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.property-view-count {
    display: inline-flex;
    gap: 5px; /* Điều chỉnh số này để thay đổi độ rộng khoảng trắng */
    align-items: center;
}
/* ===== SELECT2 ===== */
.home-search-filter-ward .select2-container,
.home-search-filter-select2 .select2-container {
    width: 100% !important;
}

.home-search-filter-ward .select2-selection--single,
.home-search-filter-select2 .select2-selection--single {
    height: 26px !important;
    min-height: 26px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 5%;
}

.home-search-filter-ward .select2-selection__rendered,
.home-search-filter-select2 .select2-selection__rendered {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    line-height: 26px !important;
    padding-left: 0 !important;
    padding-right: 22px !important;
    color: #4b5563 !important;
    font-size: .8rem !important;
}

.home-search-filter-ward .select2-selection__arrow,
.home-search-filter-select2 .select2-selection__arrow {
    height: 26px !important;
    right: 0 !important;
}

.home-search-filter-ward .select2-selection--single:has(.select2-selection__clear) .select2-selection__arrow,
.home-search-filter-select2 .select2-selection--single:has(.select2-selection__clear) .select2-selection__arrow {
    display: none !important;
}

.home-search-filter-ward .select2-container--default.select2-container--focus .select2-selection--single,
.home-search-filter-ward .select2-container--open .select2-selection--single,
.home-search-filter-select2 .select2-container--default.select2-container--focus .select2-selection--single,
.home-search-filter-select2 .select2-container--open .select2-selection--single {
    border: none !important;
    box-shadow: none !important;
}

.select2-dropdown {
    border: 1px solid #dbe3ee !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.select2-search--dropdown {
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #eef2f7;
}

    .select2-search--dropdown .select2-search__field {
        border: 1px solid #dbe3ee !important;
        border-radius: 8px !important;
        padding: 8px 10px !important;
        font-size: 14px !important;
    }

.select2-results__option {
    padding: 10px 12px !important;
    font-size: 11px !important;
}

.select2-results__option--highlighted[aria-selected] {
    background: #2563eb !important;
    color: #fff !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: black !important;
}

.home-search-filter-ward .select2-selection--single,
.home-search-filter-select2 .select2-selection--single {
    position: relative !important;
}

.home-search-filter-ward .select2-selection__clear,
.home-search-filter-select2 .select2-selection__clear {
    position: absolute !important;
    right: 1px !important;
    top: 45% !important;
    transform: translateY(-50%) !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #4b5563 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    border-radius: 999px !important;
    z-index: 3 !important;
}

    .home-search-filter-ward .select2-selection__clear:hover,
    .home-search-filter-select2 .select2-selection__clear:hover {
        color: #ef4444 !important;
    }

.select2-container--default .select2-selection--single .select2-selection__rendered {
    width: 100% !important;
}

/* ===== SEARCH RESULT / FEATURED SWITCH ===== */
.search-results-desktop {
    display: block;
}

.search-results-mobile {
    display: none;
}

.home-featured-desktop {
    display: block;
}

.home-featured-mobile {
    display: none;
    margin-top: 16px;
}

/* ===== BODY ===== */
.home-body-container {
    max-width: 1200px;
    margin: 24px auto 15px;
    box-sizing: border-box;
}

.home-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

    .home-section-header h2 {
        position: relative;
        margin: 0;
        padding-left: 18px;
        color: #111827;
        font-size: 30px;
        font-weight: 800;
        line-height: 1.25;
        letter-spacing: -.2px;
    }

        .home-section-header h2::before {
            content: "";
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 6px;
            height: 30px;
            border-radius: 999px;
            background: #ef4444;
            box-shadow: 0 4px 10px rgba(239, 68, 68, .22);
        }

.home-section-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151 !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .06);
    white-space: nowrap;
    transition: all .18s ease;
}

    .home-section-more:hover {
        transform: translateY(-1px);
        border-color: #d1d5db;
        box-shadow: 0 6px 16px rgba(15, 23, 42, .10);
        color: #111827 !important;
    }

    .home-section-more i {
        font-size: 12px;
        opacity: .9;
    }

.property-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

/* ===== FEATURED MOBILE TABS ===== */
.featured-mobile-tabs {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 2px;
    border-radius: 999px;
    background: #e5e7eb;
    margin: 0;
    white-space: nowrap;
}

.fm-tab-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    color: #0f172a;
    font-weight: 500;
}

    .fm-tab-btn.active {
        background: #0f172a;
        color: #fff;
        font-weight: 700;
    }

.featured-mobile-list {
    display: none;
}

    .featured-mobile-list.active {
        display: block;
    }

.home-section-header-mobile-featured {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

    .home-section-header-mobile-featured h2 {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }

    .home-section-header-mobile-featured .featured-mobile-tabs {
        flex: 0 0 auto;
        margin-left: auto;
    }

/* ===== ACCOUNT POPUP ===== */
.account-hover {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 9999;
}



/* ===== SCROLL TOP ===== */
.scroll-top-btn {
    position: fixed;
    right: 40px;
    bottom: 198px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(15,23,42,.85);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease;
}

    .scroll-top-btn.show {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

.select2-container.select2-container--default.select2-container--open {
    margin-right: 2%;
}
/* ===== TABLET ===== */
@media (max-width: 1025px) {
    .home-hero {
        background-image: url('/Assets/Cities/ninhbinh_pad2_1.JPG') !important;
        background-position: center top;
        background-repeat: no-repeat;
        background-size: 100% auto;
        background-attachment: fixed;
        aspect-ratio: 2 / 1;
    }


    .home-featured-desktop {
        display: none;
    }

    .home-featured-mobile {
        display: block;
        margin: auto;
        width: 95%;
    }

    .search-results-desktop {
        display: none;
    }

    .search-results-mobile {
        display: block;
    }

    .home-main-search {
        padding-top: 0;
    }

    .home-hero-header {
        margin-bottom: 1%;
    }

    .home-body-container {
        width: 100%;
    }

    .home-hero-shell {
        width: 100%
    }
}

@media (max-width: 991px) {
    .property-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }



    .home-header-right-box {
        max-width: 56%;
        gap: 6px;
    }

    .home-header-right-top {
        gap: 6px;
    }

        .home-header-right-top > a,
        .home-header-right-top .account-trigger,
        .home-header-right-top .nav-post,
        .home-header-right-top .header-favorite-link,
        .home-header-right-top .favorite-link {
            min-height: 34px;
            padding: 0 10px;
            font-size: .76rem;
        }

    .home-header-right-bottom {
        gap: 6px;
        padding: 4px 10px;
        font-size: .72rem;
    }

    .home-search-bottom {
        gap: 8px;
        flex-wrap: nowrap;
    }

        .home-search-bottom > .home-search-filter:first-child {
            flex: 0 0 108px;
            max-width: 108px;
        }

    .home-search-filter-ward {
        flex: 0 0 190px;
        max-width: 190px;
    }

    .home-search-filter-select2 {
        flex: 1 1 150px;
    }

    .home-body-container {
        width: 100%;
    }
}

/* ===== MOBILE ===== */
@media (max-width: 770px) {
    .home-hero {
        aspect-ratio: 4 / 2;
        min-height: 300px;
        background-attachment: scroll;
    }



    .home-hero-shell {
        position: relative;
        z-index: 3;
        width: 95%;
        height: 100%;
        margin: 0 auto;
        padding: 9px 0px 37px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        box-sizing: border-box;
    }
    /*    .home-body-container {
        margin: 24px 15px;
    }*/

    .home-hero-header {
        gap: 10px;
    }

    .home-header-left-top {
        font-size: 18px;
    }

    .home-header-right-box {
        max-width: 58%;
        gap: 6px;
    }

    .home-header-right-top {
        gap: 6px;
        font-size: .74rem;
    }

        .home-header-right-top > a,
        .home-header-right-top .account-trigger,
        .home-header-right-top .nav-post,
        .home-header-right-top .header-favorite-link,
        .home-header-right-top .favorite-link {
            min-height: 32px;
            padding: 0 9px;
            font-size: .72rem;
            border-radius: 999px;
        }

    .account-trigger {
        gap: 6px;
        padding: 0 9px;
    }

    .home-header-right-bottom {
        gap: 5px;
        padding: 4px 9px;
        font-size: .68rem;
    }

    .home-main-title {
        font-size: 25px;
        line-height: 1.25;
        width: 75%;
        margin: 3% auto 0;
        text-align: center;
    }

    .home-sub-title {
        font-size: 13px;
        padding: 1%;
        text-align: center;
    }

    .home-search-wrapper {
        width: 95%;
        padding: 8px 10px 6px;
    }

    .home-search-top {
        gap: 6px;
        padding-right: 2px;
    }

    .home-search-bottom {
        display: grid !important;
        grid-template-columns: 1.02fr 1.18fr 0.9fr 0.9fr;
        gap: 0 !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        padding: 6px 0 0 !important;
        border-top: 1px solid #e5e7eb;
        margin-top: 6px;
    }

        .home-search-bottom::-webkit-scrollbar {
            display: none !important;
        }

        .home-search-bottom > .home-search-filter:first-child,
        .home-search-filter-ward,
        .home-search-filter-select2,
        .home-search-filter-city-fixed {
            flex: initial !important;
            width: auto !important;
            min-width: 0 !important;
            max-width: none !important;
        }

    .home-search-filter {
        min-width: 0;
    }

        .home-search-filter + .home-search-filter {
            border-left: 1px solid #eef2f7;
        }

    .home-search-city-display {
        height: 34px;
        min-height: 34px;
        padding: 0 6px;
        font-size: 11px;
    }

    .home-search-filter-select {
        font-size: .78rem;
    }

    .home-search-filter-ward .select2-selection--single,
    .home-search-filter-select2 .select2-selection--single {
        height: 34px !important;
        min-height: 34px !important;
    }

    .home-search-filter-ward .select2-selection__rendered,
    .home-search-filter-select2 .select2-selection__rendered {
        line-height: 34px !important;
        font-size: 11px !important;
    }

    .home-search-btn-main {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }

    .home-search-input-wrap input {
        font-size: .85rem;
    }

    .home-section-header {
        margin-bottom: 14px;
    }

        .home-section-header h2 {
            font-size: 28px;
            padding-left: 16px;
        }

            .home-section-header h2::before {
                width: 5px;
                height: 24px;
            }

    .home-section-more {
        padding: 9px 13px;
        font-size: 13px;
    }
}

@media (max-width: 700px) {
    .home-hero {
        background-image: url('/Assets/Cities/ninhbinh_mobile.JPG') !important;
        background-position: center center;
        background-repeat: no-repeat;
        background-size: cover;
        background-attachment: scroll;
        aspect-ratio: 750 / 500;
    }

        .home-hero.ios-fixed {
            background-image: none !important;
        }

            .home-hero.ios-fixed::before {
                content: "";
                position: absolute;
                inset: 0;
                background-image: url('/Assets/Cities/ninhbinh_mobile.JPG') !important;
                background-position: center center;
                background-repeat: no-repeat;
                background-size: cover;
                z-index: 1;
                pointer-events: none;
            }

    .home-featured-mobile {
        display: block;
        margin: auto;
        width: 100% !important;
    }
}

@media (max-width: 575px) {
    .property-grid {
        grid-template-columns: 1fr;
    }

    .home-section-header h2 {
        font-size: 20px;
    }

    .home-search-city-display {
        padding: 0 5px;
    }

    .fm-tab-btn {
        font-size: 11px;
    }

    .home-body-container {
        width: 95%;
    }
}

@media (max-width: 500px) {
    .home-hero {
        min-height: 280px;
    }

    .home-main-search {
        padding-top: 0;
    }

    .home-hero-header {
        align-items: flex-start;
        margin-bottom: 0;
    }

    .home-header-right-box {
        max-width: 60%;
        gap: 5px;
    }

    .home-header-right-top {
        gap: 5px;
    }

        .home-header-right-top > a,
        .home-header-right-top .account-trigger,
        .home-header-right-top .nav-post,
        .home-header-right-top .header-favorite-link,
        .home-header-right-top .favorite-link {
            min-height: 30px;
            padding: 0 8px;
            font-size: .68rem;
        }

    .home-header-right-bottom {
        gap: 4px;
        padding: 3px 8px;
        font-size: .64rem;
    }

    .scroll-top-btn {
        right: 12px;
        bottom: 154px;
    }

    .home-search-tabs-strip {
        width: 100%;
        margin: 0 auto .6rem auto;
    }

    .home-search-tabs {
        padding: 0;
    }

    .home-search-tab-btn {
        padding: 6px 9px;
        font-size: .76rem;
    }

    .home-search-tabs-pointer {
        bottom: -7px;
    }



    .img_logo_header {
        height: 40px !important;
        width: auto;
    }

    .home-header-left-tagline {
        font-size: .6rem !important;
    }

    .home-main-title {
        font-size: 14px;
        line-height: 1;
        width: 90%;
        margin: 2% auto 0;
        text-align: center;
    }

    .home-sub-title {
        font-size: 11px;
        padding: 1%;
        text-align: center;
    }

    .home-search-wrapper {
        padding: 0;
        gap: 0;
    }
}

@media (max-width: 430px) {
    .home-hero {
        background-image: url('/Assets/Cities/ninhbinh_mobile.JPG') !important;
        background-position: center center;
        background-repeat: no-repeat;
        background-size: cover;
        background-attachment: scroll;
    }

        .home-hero.ios-fixed {
            background-image: none !important;
        }

            .home-hero.ios-fixed::before {
                content: "";
                position: absolute;
                inset: 0;
                background-image: url('/Assets/Cities/ninhbinh_mobile.JPG') !important;
                background-position: center center;
                background-repeat: no-repeat;
                background-size: cover;
                z-index: 1;
                pointer-events: none;
            }
}

@media (max-width: 391px) {
    .home-search-bottom {
        grid-template-columns: 1fr 1.15fr 0.9fr 0.9fr !important;
    }

    .home-search-city-display {
        font-size: 10px;
    }


    .home-section-header h2 {
        font-size: 19px;
    }

    .home-search-filter-ward .select2-selection__rendered,
    .home-search-filter-select2 .select2-selection__rendered {
        font-size: 10px !important;
    }
}


@media (max-width: 345px) {
    .home-body-container {
        width: min(1200px, 100%) !important;
    }
}



/* =========================================
   HOME FINAL FLOW SAFETY PATCH
   Chống footer chen giữa danh sách nhà trên mobile/tablet
========================================= */
.body-content {
    display: flow-root;
}

.home-body-container {
    margin: 24px auto 20px;
    display: flow-root;
    clear: both;
    position: relative;
    z-index: 1;
}

.search-results-desktop,
.search-results-mobile,
.home-featured-desktop,
.home-featured-mobile,
.featured-mobile-list,
.property-row-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    position: relative;
}

    .search-results-mobile::after,
    .home-featured-mobile::after,
    .featured-mobile-list::after,
    .property-row-list::after,
    .home-body-container::after {
        content: "";
        display: block;
        clear: both;
    }

.featured-mobile-list {
    display: none !important;
}

    .featured-mobile-list.active {
        display: block !important;
    }

        .featured-mobile-list.active > .property-row-list {
            display: flex !important;
            flex-direction: column;
            gap: 16px;
        }

.home-search-wrapper,
.home-search-top,
.home-search-bottom,
.home-search-filter,
.home-search-city-display,
.home-search-city-text,
.home-search-filter-ward,
.home-search-filter-select2 {
    min-width: 0;
    max-width: 100%;
}

.home-search-city-icon {
    width: 14px;
    min-width: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
}

.home-search-filter-ward .select2-selection__rendered,
.home-search-filter-select2 .select2-selection__rendered {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

@media (max-width: 1025px) {
    .home-featured-desktop,
    .search-results-desktop {
        display: none !important;
    }

    .home-featured-mobile,
    .search-results-mobile {
        display: block !important;
    }

    .home-featured-mobile {
        width: min(100%, 95%);
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1026px) {
    .home-featured-desktop,
    .search-results-desktop {
        display: block !important;
    }

    .home-featured-mobile,
    .search-results-mobile {
        display: none !important;
    }
}

.footer-section {
    clear: both;
    position: relative;
    z-index: 5;
}

/* =========================================
   MOBILE FEATURED MORE BUTTON POSITION
   Mục tiêu:
   - Trên mobile/tablet, nút "Xem thêm" của mục nhà nổi bật nằm dưới danh sách.
   - Không ảnh hưởng logic JS: vẫn dùng id/link hiện có trong view.
========================================= */
.home-featured-more-mobile-wrap {
    display: none;
}

@media (max-width: 1025px) {
    .home-featured-mobile .home-section-header-mobile-featured {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px;
        margin-bottom: 12px;
    }

        .home-featured-mobile .home-section-header-mobile-featured h2 {
            flex: 1 1 auto;
            min-width: 0;
            margin: 0;
            padding-left: 14px;
            font-size: 20px;
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

            .home-featured-mobile .home-section-header-mobile-featured h2::before {
                width: 5px;
                height: 22px;
            }

        .home-featured-mobile .home-section-header-mobile-featured .featured-mobile-tabs {
            margin: 0 0 0 auto;
        }

    .home-featured-more-mobile-wrap {
        display: flex !important;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin: 2px auto 2px;
        padding: 0;
        clear: both;
    }

        .home-featured-more-mobile-wrap .home-section-more,
        .home-section-more-mobile-bottom {
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-width: 150px;
            min-height: 42px;
            padding: 0 24px;
            border-radius: 0;
            background: #fff;
            color: #ef4444 !important;
            border: 1px solid #f1f5f9;
            box-shadow: none;
            font-size: 14px;
            font-weight: 500;
            text-decoration: none !important;
            line-height: 1;
            white-space: nowrap;
        }

            .home-featured-more-mobile-wrap .home-section-more:hover,
            .home-section-more-mobile-bottom:hover {
                transform: none;
                color: #dc2626 !important;
                border-color: #e5e7eb;
                text-decoration: none !important;
            }
}


@media (max-width: 575px) {
    .home-featured-mobile .home-section-header-mobile-featured {
        gap: 8px;
    }

        .home-featured-mobile .home-section-header-mobile-featured h2 {
            font-size: 18px;
            padding-left: 12px;
        }

        .home-featured-mobile .home-section-header-mobile-featured .featured-mobile-tabs {
            padding: 2px;
        }

        .home-featured-mobile .home-section-header-mobile-featured .fm-tab-btn {
            padding: 8px 15px;
            font-size: 12px;
        }
}

@media (max-width: 391px) {
    .home-featured-mobile .home-section-header-mobile-featured {
        gap: 6px;
    }

        .home-featured-mobile .home-section-header-mobile-featured h2 {
            font-size: 17px;
            padding-left: 11px;
        }

        .home-featured-mobile .home-section-header-mobile-featured .fm-tab-btn {
            padding: 6px 10px;
            font-size: 10px;
        }
}

/* =========================================
   MOBILE ROW TITLE SUPPORT
   Chỉ hỗ trợ layout mới của _PropertyRowList.cshtml nếu bạn đã dùng bản title mobile.
   Không ảnh hưởng nếu view chưa có các class này.
========================================= */
.p-title-mobile {
    display: none;
}

@media (max-width: 767px), (hover: none), (pointer: coarse) {
    .p-title-desktop {
        display: none !important;
    }

    .p-title-mobile {
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        width: 100%;
        margin: 0 0 0px;
        color: #0f172a;
        text-decoration: none !important;
        font-weight: 800;
        font-size: clamp(12px, 3.3vw, 15px);
        line-height: 1.28;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .p-row > .p-title-mobile {
        grid-column: 1 / -1;
        order: -1;
    }
}


/* =========================================
   MOBILE/TABLET NO RADIUS PATCH
   Yêu cầu: bỏ bo góc search trên màn mobile/ngang
   Không ảnh hưởng logic
========================================= */
@media (max-width: 1025px) {
    .home-search-wrapper,
    .home-main-search .home-search-wrapper {
        border-radius: 0 !important;
    }
}
