/*==================== BANNER ====================*/
#banner1 {
    width: 100%;
    padding: 0;
}

#banner1 .carousel-inner {
    aspect-ratio: 1440 / 673;
}

#banner1 .carousel-item {
    position: relative;
    height: 100%;
}

#banner1 .banner-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* Giữ khung banner cố định; ảnh tự cắt nhẹ để vừa khung khi đổi slide. */
#banner1 .carousel-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

#banner1 .carousel-item .primarybutton {
    position: absolute;
    z-index: 10;
    bottom: 60px;
    left: 50%;
    width: 160px;
    transform: translateX(-50%);
}

#banner1 .carousel-indicators button {
    width: 50px;
    height: 5px;
    border: 0;
    border-radius: 5px;
    background-color: #000;
    opacity: 1;
}

#banner1 .carousel-indicators .active { background-color: var(--brand-gold); }

/*==================== DỰ ÁN NỔI BẬT ====================*/
#bgproject .tieude,
#bgapartment .tieude { margin-top: 42px; }

#project .projectcard {
    margin-bottom: 30px;
    text-align: center;
}

/* Đổi height nếu muốn ảnh thẻ dự án cao hoặc thấp hơn */
#project .projectcard img {
    display: block;
    width: 100%;
    height: 380px;
    border-radius: 0;
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#project .projectcard img:hover,
#apartmentcarousel .apartmentcard img:hover {
    transform: translateY(-3px);
    box-shadow: 2px 6px 10px rgba(0, 0, 0, 0.25);
}

#project .projectcard h4,
#apartmentcarousel .apartmentcard h4 {
    margin: 16px 0 7px;
    color: var(--brand-black);
    font-size: 17px;
}

#project .projectcard h4 a,
#apartmentcarousel .apartmentcard h4 a {
    color: inherit;
    text-decoration: none;
}

#project .projectcard h4 a:hover,
#apartmentcarousel .apartmentcard h4 a:hover { color: var(--brand-olive); }

#project .projectcard p,
#apartmentcarousel .apartmentcard p {
    margin: 0;
    color: #777;
    font-size: 13px;
}

/* Căn giữa nút Xem thêm */
#bgproject .secondarybutton,
#bgapartment .secondarybutton {
    display: flex;
    margin: 8px auto 0;
}

/*==================== DANH SÁCH CĂN HỘ ====================*/
#apartmentcarousel { position: relative; }

#apartmentcarousel .apartmentcard {
    padding: 0 8px 12px;
    text-align: center;
}

#apartmentcarousel .apartmentcard img {
    display: block;
    width: 100%;
    height: 380px;
    border-radius: 0;
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#apartmentcarousel .owl-nav {
    position: absolute;
    top: 42%;
    right: -36px;
    left: -36px;
    display: flex;
    justify-content: space-between;
    margin: 0;
    pointer-events: none;
}

#apartmentcarousel .owl-nav button.owl-prev,
#apartmentcarousel .owl-nav button.owl-next {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: transparent !important;
    color: var(--brand-black) !important;
    font-size: 34px;
    line-height: 30px;
    pointer-events: auto;
}

#apartmentcarousel .owl-dots { margin-top: 12px; }

/*==================== NHÀ PHỐ BIỆT THỰ ====================*/
#bgvilla { padding: 0; }
#bgvilla .tieude { margin-bottom: 0; }

.villa-feature {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1440 / 673;
    background-image: url("../imgs/bcons\ valley HD.jpg");
    background-position: center;
    background-size: cover;
    text-decoration: none;
}

.villa-more {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/*==================== TIN TỨC ====================*/
#bgnews { padding-bottom: 5px; }
.news-list { margin: 0 -8px; }
.news-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding: 0 8px;
}

.news-image {
    display: block;
    flex: 0 0 auto;
    height: 220px;
    background-color: var(--brand-gold);
}

.news-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 12px 16px 10px;
    background-color: var(--brand-black);
    color: #fff;
}

.news-copy h3 {
    margin: 0 0 5px;
    color: var(--brand-gold);
    font-family: headingsemibold, sans-serif;
    font-size: 16px;
}

.news-copy p {
    flex: 1;
    margin: 5px 0 8px;
    font-size: 13px;
    line-height: 1.45;
}

.news-copy .primarybutton {
    display: flex;
    width: 150px;
    margin: 10px auto 0;
    transition: none;
}

.news-copy .primarybutton:hover {
    border-color: #fff;
    background-color: #fff;
    color: var(--brand-black);
}

/*==================== FORM LIÊN HỆ ====================*/
#contact { padding-bottom: 52px; }

.contact-form {
    display: flex;
    width: 100%;
    max-width: 720px;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 0 auto;
}

.contact-form input {
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #999;
    border-radius: 0;
    font-family: body, sans-serif;
    font-size: 14px;
}

.contact-form input:focus {
    outline: 2px solid var(--brand-olive);
    outline-offset: 1px;
}

.contact-form .primarybutton { width: 160px; }

.form-status {
    max-width: 720px;
    margin: 12px auto 0;
    color: #666;
    font-size: 12px;
    text-align: center;
}

.form-status[hidden] { display: none; }

/*==================== CHÂN TRANG ====================*/
#site-footer {
    padding: 48px 0;
    background-color: var(--brand-black);
    color: #ddd;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 70px;
}

.footer-brand img {
    display: block;
    width: 220px;
}

.footer-info {
    display: flex;
    min-width: 230px;
    flex-direction: column;
    gap: 12px;
}

.footer-info h3 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 17px;
}

.footer-info a,
.footer-info span { color: #bbb; font-size: 14px; }
.footer-info a:hover { color: var(--brand-gold); text-decoration: none; }
.footer-facebook-icon { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }

/*==================== TÌM KIẾM ====================*/
#bgnav .search-panel[hidden] { display: none !important; }

.search-panel {
    position: absolute;
    z-index: 100;
    top: 100%;
    right: max(15px, calc((100% - 1140px) / 2));
    width: min(440px, calc(100% - 30px));
    padding: 14px;
    border: 1px solid #eee;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 12px 28px #0002;
}

.search-form { display: flex; gap: 8px; }
.search-form input {
    min-width: 0;
    min-height: 44px;
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font: 14px body, sans-serif;
}
.search-form input:focus { border-color: var(--brand-olive); outline: 2px solid #806a1633; }
.search-submit,
.search-close {
    width: 44px;
    min-width: 44px;
    border: 1px solid var(--brand-gold);
    border-radius: 4px;
    background: var(--brand-gold);
    color: var(--brand-black);
    cursor: pointer;
}
.search-close { border-color: #ddd; background: #fff; }
.search-submit:hover { background: var(--brand-black); color: var(--brand-gold); }
.search-close:hover { border-color: var(--brand-black); }
.search-status { margin: 8px 2px 0; color: #555; font-size: 13px; }
.search-status:empty { display: none; }
.search-highlight { outline: 3px solid var(--brand-gold); outline-offset: 4px; scroll-margin-top: 120px; }

/*==================== RESPONSIVE ====================*/
@media (max-width: 991px) {
    #apartmentcarousel .owl-nav { right: -22px; left: -22px; }

    #banner1 .banner-image-link {
        position: absolute;
        z-index: 1;
        inset: 0;
    }
    #banner1 .carousel-item .primarybutton { display: none; }
    #banner1 .carousel-control-prev,
    #banner1 .carousel-control-next { z-index: 2; }
    #banner1 .carousel-indicators { z-index: 3; }

    #bgnav > .container { max-width: 100%; }
    #bgnav { --nav-header-height: 78px; z-index: 1001; }
    #bgnav > .container > .row { min-height: 76px; }
    #logo, #nav { flex: 0 0 100%; width: 100%; justify-content: center; }
    #logo { position: relative; padding: 8px 0; }
    #logo img { width: 68px; height: auto; }

    #nav-toggle {
        position: absolute;
        top: 50%;
        left: 8px;
        display: inline-flex;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        padding: 0;
        transform: translateY(-50%);
        border: 0;
        border-radius: 4px;
        background: transparent;
        color: var(--brand-black);
        font-size: 22px;
        cursor: pointer;
    }
    .nav-toggle:hover,
    .nav-toggle:focus-visible { color: var(--brand-olive); }
    #bgnav.menu-open .nav-toggle { color: var(--brand-olive); }

    #nav {
        position: fixed;
        z-index: 100;
        top: var(--nav-header-height);
        left: 0;
        display: block;
        width: min(380px, 88vw);
        height: calc(100vh - var(--nav-header-height));
        overflow-y: auto;
        padding: 0 16px 20px;
        background: #fff;
        box-shadow: 10px 0 30px #0002;
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform 0.28s ease, visibility 0.28s;
    }
    #bgnav.menu-open #nav {
        transform: translateX(0);
        visibility: visible;
    }

    .nav-backdrop {
        position: fixed;
        z-index: 1000;
        inset: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.48);
        cursor: pointer;
    }
    .nav-backdrop[hidden] { display: none !important; }
    body.nav-open { overflow: hidden; }

    #nav ul { display: block; margin: 0; }
    #nav ul li {
        display: block;
        border-top: 1px solid #eee9d8;
    }
    #nav ul li a {
        display: flex;
        min-height: 50px;
        justify-content: space-between;
        padding: 0 8px;
        color: var(--brand-black);
        font-size: 18px;
    }
    #nav ul li a:hover { color: var(--brand-olive); }
    #nav ul li.account-item,
    #nav ul li.search-item { display: none; }

    #nav .dropdown { width: 100%; }
    #nav .dropbtn {
        display: flex;
        width: 100%;
        min-height: 50px;
        justify-content: space-between;
        padding: 0 8px;
        color: var(--brand-black);
        font-size: 18px;
        text-align: left;
    }
    #nav .dropbtn:hover,
    #nav .dropbtn:focus-visible { color: var(--brand-olive); }
    #nav .dropcontent {
        position: static;
        width: auto;
        padding: 0 8px 8px 16px;
        border: 0;
        background: #faf8f1;
        box-shadow: none;
    }
    #nav ul li .dropcontent a {
        min-height: 42px;
        padding: 10px 12px;
        color: var(--brand-black);
        font-size: 17px;
    }

    #bgnav .search-panel {
        position: static;
        width: auto;
        max-width: none;
        margin: 0 0 8px;
        padding: 12px 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    #bgnav .search-panel[hidden] { display: none !important; }
    #bgnav.menu-open .search-panel { display: block; }
    #bgnav .search-form input {
        border-radius: 22px;
        background: #fff;
    }
    #bgnav .search-submit {
        border-color: var(--brand-black);
        border-radius: 50%;
        background: var(--brand-black);
        color: var(--brand-gold);
    }
    #bgnav .search-close { display: none; }

    #project .projectcard img,
    #apartmentcarousel .apartmentcard img { height: 300px; }

    .news-image { height: 240px; }
    .news-copy { min-height: 0; }
    #contact { padding-bottom: 38px; }
    .footer-inner { flex-direction: column; gap: 30px; text-align: center; }
    .footer-brand img { width: 175px; }
}

@media (max-width: 575px) {
    #bgnav { --nav-header-height: 72px; }
    #bgnav > .container > .row { min-height: 70px; }
    #logo img { width: 62px; height: auto; }
    #nav { padding-right: 10px; padding-left: 10px; }
    #nav ul li a,
    #nav .dropbtn { font-size: 17px; }
    .search-form { gap: 6px; }
    .search-submit,
    .search-close { width: 40px; min-width: 40px; }

    #project .projectcard img,
    #apartmentcarousel .apartmentcard img { height: 280px; }

    #apartmentcarousel .owl-nav { right: -12px; left: -12px; }
}
