/* =========================================================
   1. HERO & FLOATING STATS (Phần đầu trang)
   ========================================================= */
.luxury-hero {
    margin-top: -155px; /* Đè lên Header bo tròn */
    position: relative;
    height: 550px; /* Tăng nhẹ chiều cao để ảnh thoáng hơn */
    z-index: 1;
}

.hero-main-image {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.hero-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 120px 0 80px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
}

.p-status { background: #f37201; padding: 5px 12px; border-radius: 4px; font-weight: 800; font-size: 11px; }
.hero-info-content h1 { font-size: 40px; font-weight: 900; margin: 15px 0; line-height: 1.2; }
.p-address { opacity: 0.9; font-size: 16px; display: flex; align-items: center; gap: 8px; }

/* FLOATING STATS BAR - Nhô lên trên nền ảnh */
.floating-stats-bar {
    background: #fff;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 45px;
    margin-top: -60px; 
    margin-bottom: 40px;
    position: relative;
    z-index: 9;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.price-val { font-size: 36px; font-weight: 900; color: #f37201; }
.price-unit { color: #888; font-size: 16px; margin-left: 5px; }
.stat-features { display: flex; gap: 40px; }
.f-box { font-weight: 600; color: #444; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.f-box i { color: #f37201; font-size: 18px; }

/* =========================================================
   2. LAYOUT CHÍNH (Cột trái & Sidebar)
   ========================================================= */
.luxury-content-wrapper { padding: 40px 0 80px 0; background: #f8f9fa; }
.main-layout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 40px; }

.info-section { 
    background: #fff; 
    padding: 40px; 
    border-radius: 16px;

    margin-top: 35px;  
    margin-bottom: 35px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.04); 
}

.section-title { 
    font-size: 24px; 
    font-weight: 800; 
    border-left: 6px solid #f37201; 
    padding-left: 20px; 
    margin-bottom: 30px; 
    color: #222;
    text-transform: uppercase;
}

/* THÔNG SỐ CHI TIẾT */
.specs-extended-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 60px;
}
.s-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
    font-size: 15px;
}
.s-item span { color: #777; }
.s-item strong { color: #333; font-weight: 700; }

/* MÔ TẢ & TIỆN ÍCH */
.rich-text p { line-height: 1.8; color: #555; font-size: 16px; margin-bottom: 25px; }
.amenities-list { 
    list-style: none; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}
.amenities-list li { font-size: 15px; color: #444; display: flex; align-items: center; }
.amenities-list li i { color: #27ae60; margin-right: 12px; font-size: 18px; }

.location-amenities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.loc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: #555;
    padding: 10px;
    background: #fdfdfd;
    border-radius: 8px;
}
.loc-item i { color: #f37201; font-size: 18px; }

/* =========================================================
   3. PHOTO GALLERY GRID (Phân bổ lại chuyên nghiệp)
   ========================================================= */
.sub-gallery-grid { 
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr; /* Tỉ lệ 1 lớn 2 nhỏ */
    grid-template-rows: 1fr 1fr;
    gap: 12px; 
    height: 450px; /* Tăng chiều cao để Grid cân đối */
    margin-top: 40px; 
/*    margin-bottom: 10px;*/
}

/* GRID GALLERY 3 Ô CHUẨN ĐẲNG CẤP */
.sub-gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Chia 2 cột: Cột trái rộng gấp đôi */
    grid-template-rows: 200px 200px; /* Khóa chiều cao 2 hàng, tổng 400px */
    gap: 15px;
    margin-top: 20px;
}

.g-item-big {
    grid-row: span 2; /* Ảnh lớn chiếm cả 2 hàng bên trái */
}

.g-item-big a, .g-item-small a {
    display: block;
    width: 100%;
    height: 100%;
}

.sub-gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Quan trọng: Giúp ảnh không bị méo */
    border-radius: 12px;
    transition: 0.3s;
}

.sub-gallery-grid img:hover {
    filter: brightness(0.8);
    transform: scale(1.01);
}

/* OVERLAY CHO Ô CUỐI CÙNG */
.g-item-small.more {
    position: relative;
}

.g-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Nền mờ đen */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    border-radius: 12px;
    pointer-events: none; /* Để khi click vào nó xuyên qua thẻ a phía dưới */
}

/* =========================================================
   4. SIDEBAR CONTACT & SEARCH
   ========================================================= */
/* =========================================================
   4. SIDEBAR CONTACT & SEARCH - CHOTHUETOT OPTIMIZED
   ========================================================= */
.sticky-contact-card { 
    position: sticky; 
    top: 20px; 
/*    z-index: 10; */
}

/* KHUNG CHUNG CHO TẤT CẢ CÁC KHỐI SIDEBAR */
.sidebar-box, .sidebar-search-box, .contact-main-group {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #eee;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    overflow: hidden;
}

.sidebar-search-box { padding: 25px; border: 1px solid #f37201; }
.sidebar-search-box h5 { font-size: 16px; color: #f37201; margin-bottom: 20px; font-weight: 800; text-transform: uppercase; }
.sidebar-search-box select { width: 100%; height: 45px; padding: 0 15px; margin-bottom: 12px; border: 1px solid #eee; border-radius: 8px; background: #fafafa; outline: none; }
.btn-sidebar-search { width: 100%; height: 48px; background: #333; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 800; transition: 0.3s; }

/* CỤM LIÊN HỆ GOM NHÓM */
.agent-profile { background: #fdfdfd; padding: 20px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid #eee; }
.agent-profile img { width: 65px; height: 65px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.agent-info strong { display: block; font-size: 17px; color: #222; margin-bottom: 3px; }
.agent-info span { font-size: 13px; color: #27ae60; font-weight: 600; }

.contact-actions { padding: 20px 20px 10px; }
.btn-main-call { display: block; background: #f37201; color: #fff !important; text-align: center; padding: 13px; border-radius: 8px; text-decoration: none; font-weight: 800; margin-bottom: 10px; transition: 0.3s; font-size: 16px; }
.btn-zalo-contact { display: block; background: #0068ff; color: #fff !important; text-align: center; padding: 13px; border-radius: 8px; text-decoration: none; font-weight: 800; font-size: 16px; }

.sidebar-form { padding: 15px 20px 25px; }
.sidebar-form input, .sidebar-form textarea { width: 100%; padding: 12px; margin-bottom: 10px; border: 1px solid #eee; border-radius: 8px; background: #fff; outline: none; font-size: 14px; }
.sidebar-form button { width: 100%; background: #222; color: #fff; border: none; padding: 15px; border-radius: 8px; font-weight: 800; cursor: pointer; transition: 0.3s; }


.ads-fixed-v3 {
    position: relative !important;
    width: 100% !important;
    height: 200px !important;
    margin-top: 30px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    display: block !important;
}

.ads-fixed-v3 img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    z-index: 1 !important; /* Ảnh nằm dưới */
}

.ads-text-v3 {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    padding: 15px !important;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%) !important;
    z-index: 9999 !important; /* ÉP NÓ LÊN LỚP CAO NHẤT */
    display: flex !important;
    flex-direction: column !important;
}

.ads-title-v3 {
    color: #f37201 !important; /* Màu cam CHOTHUETOT */
    font-size: 15px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    display: block !important;
    margin-bottom: 5px !important;
}

.ads-sub-v3 {
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    display: block !important;
}
/* =========================================================
   5. SẢN PHẨM ĐÃ XEM (Dàn ngang 4 cột dưới chân trang)
   ========================================================= */
.viewed-section-full { margin-top: 60px; padding-top: 40px; border-top: 1px solid #eee; }
.viewed-grid-4 { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 25px; 
}
.v-mini-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    transition: 0.3s;
    border: 1px solid #f1f1f1;
}
.v-mini-card:hover { transform: translateY(-8px); }
.v-mini-card img { width: 100%; height: 160px; object-fit: cover; }
.v-mini-info { padding: 15px; }
.v-mini-info h6 { margin: 0 0 8px 0; font-size: 15px; color: #333; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-mini-info span { font-size: 14px; color: #f37201; font-weight: 800; }

/* TIỆN ÍCH THUÊ - DẠNG CARD HIỆN ĐẠI */
.rental-amenities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ami-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fcfcfc;
    border: 1px solid #f1f1f1;
    border-radius: 12px;
    transition: 0.3s;
}

.ami-card:hover {
    background: #fff;
    border-color: #f37201;
    box-shadow: 0 5px 15px rgba(243, 114, 1, 0.1);
}

.ami-card i {
    font-size: 24px;
    color: #f37201;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff5ed;
    border-radius: 10px;
}

.ami-info span {
    display: block;
    font-size: 10px;
    color: #888;
}

.ami-info strong {
    display: block;
    font-size: 14px;
    color: #333;
    font-weight: 700;
}
.ami-info small {
    font-size: 11px;
}

/* HIỆU ỨNG GALLERY CLICK XEM ẢNH */
.sub-gallery-grid a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Đảm bảo ảnh chiếm hết thẻ a */
.sub-gallery-grid img {
    display: block;
}


.fixed-contact-bar {
    display: none;
}
/* =========================================================
   RESPONSIVE DETAIL PAGE: TABLET 1024px | MOBILE 767px
   ========================================================= */

/* --- 1. TABLET (768px - 1024px) --- */
@media (max-width: 1024px) {
    .luxury-hero {
        margin-top: -100px; /* Giảm độ đè lên header */
        height: 400px;
    }

    .hero-info-content h1 { font-size: 30px; }

    /* Chuyển layout sang 1 cột để Sidebar không bị quá hẹp */
    .main-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    .floating-stats-bar {
        padding: 20px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .stat-features { gap: 20px; }

    /* Chỉnh lại Grid ảnh cho Tablet */
    .sub-gallery-grid {
        grid-template-rows: 150px 150px !important;
    }

    /* Viewed Grid hiện 2 cột trên Tablet */
    .viewed-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .right-sidebar {
        margin-top: 40px !important;
    }

    /* 2. Ép khoảng cách cho Banner quảng cáo */
    .ads-fixed-v3 {
        margin-top: 40px !important;
        margin-bottom: 40px !important;
    }

    /* 3. Tạo khoảng cách giữa Sản phẩm tương tự và các phần trên nó */
    .related-products-section {
        margin-top: 50px !important;
        padding-top: 30px !important;
        border-top: 1px solid #eee; /* Thêm gạch ngang cho rõ ràng */
    }

    /* 4. Khoảng cách cho phần Sản phẩm đã xem */
    .viewed-section-full {
        margin-top: 50px !important;
    }
}

/* --- 2. MOBILE (Dưới 767px) --- */
@media (max-width: 767px) {
    .luxury-hero {
        height: 380px; /* Tăng chiều cao Hero trên mobile để không bị kích chữ */
        margin-top: -100px; 
    }

    .hero-overlay {
        /* Tăng padding-top để đẩy chữ xuống dưới vùng header */
        padding: 120px 0 20px 0 !important; 
        /* Làm gradient tối hơn ở phía dưới để đọc chữ trắng dễ hơn */
        background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.85) 100%) !important;
    }

    .hero-info-content {
        text-align: left;
        padding: 0 15px;
    }

    .hero-info-content h1 {
        font-size: 22px !important;
        line-height: 1.4 !important;
        margin: 10px 0 !important;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* Thêm bóng đổ cho chữ sắc nét */
    }

    .p-address { 
        font-size: 13px !important; 
        opacity: 1 !important;
        line-height: 1.4;
    }

    /* Đảm bảo ảnh không bị che khuất quá nhiều */
    .hero-main-image img {
        object-position: center;
    }

    /* Floating Bar trên Mobile: Chuyển thành dạng lưới 2x2 */
   .floating-stats-bar {
        margin: -40px 15px 30px 15px !important; /* Tạo khoảng cách 2 bên mép màn hình */
        padding: 20px !important;
        display: flex !important;
        flex-direction: column !important; /* Xếp dọc các nhóm chính */
        gap: 15px !important;
        align-items: flex-start !important; /* Căn trái toàn bộ */
    }

    .stat-price {
        width: 100%;
        border-bottom: 1px solid #f1f1f1;
        padding-bottom: 12px;
        text-align: center !important; /* Giá tiền căn trái */
    }

    .price-val { 
        font-size: 26px !important; 
        display: inline-block;
    }

    .price-unit {
        font-size: 14px !important;
    }

    .stat-features {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* Chia 2 cột đều nhau */
        gap: 12px 20px !important; /* Khoảng cách giữa các ô */
    }

    .f-box {
        justify-content: flex-start !important; /* Quan trọng: Đẩy icon và chữ sang trái */
        font-size: 14px !important;
        color: #555 !important;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 10px; /* Khoảng cách cố định giữa Icon và Chữ */
    }

    .f-box i {
        width: 20px; /* Khóa chiều rộng icon để các chữ phía sau luôn thẳng hàng dọc */
        text-align: center;
        font-size: 16px;
    }

    /* Grid Gallery trên Mobile: Chuyển sang 1 ảnh to, 2 ảnh nhỏ nằm dưới */
   .sub-gallery-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        /* Bỏ grid-template-rows cố định, dùng auto để không bị dư khoảng trắng */
        grid-template-rows: auto !important; 
        gap: 10px !important;
        height: auto !important; /* Quan trọng: Để chiều cao tự nhảy theo ảnh */
        margin-bottom: 0 !important;
    }

    .g-item-big {
        grid-column: span 2;
        /* Ép tỉ lệ ảnh to là 16:9 để nhìn chuyên nghiệp */
        aspect-ratio: 16 / 9; 
    }

    .g-item-small {
        /* Ép tỉ lệ ảnh nhỏ là 4:3 */
        aspect-ratio: 4 / 3;
    }

    .sub-gallery-grid img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 12px;
    }

    /* Thu nhỏ chữ +1 Ảnh trên mobile cho đỡ thô */
    .g-overlay {
        font-size: 18px !important;
    }
    
    /* Xóa bớt padding dư của info-section chứa gallery */
    .info-section:has(.sub-gallery-grid) {
        padding-bottom: 20px !important;
    }

    /* Thông số chi tiết: Xếp dọc */
    .specs-extended-grid, 
    .amenities-list, 
    .location-amenities {
        grid-template-columns: 1fr !important;
    }

    /* Tiện ích nội thất: 2 cột */
    .rental-amenities-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }

    .info-section { padding: 20px; }

    /* Sidebar: Đưa các nút gọi điện/Zalo lên trên cùng hoặc làm nổi bật */
    .sticky-contact-card {
        position: relative !important;
        top: 0 !important;
    }

    .agent-profile { padding: 15px; }

    /* Sản phẩm đã xem & tương tự: 1 cột hoặc 2 cột nhỏ */
    .viewed-grid-4 {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }
    
    .v-mini-card img { height: 120px; }
    .v-mini-info h6 { font-size: 13px; }

/*    /////////// nut goi, zalo co dinh*/
.fixed-contact-bar {
        display: flex !important; /* Hiện trên Mobile */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: #fff;
        box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
        z-index: 9999; /* Luôn nằm trên cùng */
        padding: 8px 10px;
        gap: 10px;
    }

    .contact-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 800;
        font-size: 14px;
        transition: 0.3s;
    }

    /* Nút Gọi ngay - Màu Cam thương hiệu */
    .call-btn {
        background: #f37201;
        color: #fff;
    }

    /* Nút Zalo - Màu Xanh Zalo */
    .zalo-btn {
        background: #0068ff;
        color: #fff;
    }

    .contact-btn i {
        font-size: 18px;
    }

    .contact-btn img {
        width: 22px;
        height: 22px;
/*        filter: brightness(0) invert(1); /* Chuyển icon Zalo sang màu trắng */
    }

    /* Đẩy Padding của Footer lên để không bị thanh này che mất nội dung cuối trang */
    body {
        padding-bottom: 65px !important;
    }
}