/* =========================================
   1. CẤU HÌNH CHUNG & RESET
   ========================================= */
:root {
    --primary: #f1c40f; 
    --primary-dark: #f39c12;
    --text-dark: #1a1a1a;
    --gray-bg: #f5f7fb;
    --radius: 12px;
}

body {
    font-family: 'Lexend', sans-serif;
    background: var(--gray-bg);
    color: var(--text-dark);
    padding-bottom: 70px; /* Chừa chỗ cho Mobile Nav */
}

a { text-decoration: none; }
ul { padding-left: 0; list-style: none; }

/* =========================================
   2. NAVBAR (THANH MENU)
   ========================================= */
.navbar {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 10px 0;
    z-index: 1050;
    position: relative; 
}

.brand-text { display: block !important; }
.logo-img { height: 45px; width: auto; }

.nav-link {
    font-weight: 600; color: var(--text-dark); margin: 0 5px; transition: 0.3s;
}
.nav-link:hover, .nav-link.active {
    color: #d35400;
}

/* Icon điện thoại màu vàng trên Navbar */
.navbar .bg-danger {
    background: var(--primary) !important;
    color: #000 !important;
}
.navbar .bg-danger i {
    color: #000 !important;
}

/* =========================================
   3. LOADING SCREEN
   ========================================= */
.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #fff; z-index: 9999;
    display: flex; justify-content: center; align-items: center; flex-direction: column;
}

/* =========================================
   4. CARD (THẺ PHÒNG TRỌ)
   ========================================= */
.room-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    height: 100%;
    display: flex; flex-direction: column;
    border: 1px solid #eee;
}

.room-card .card-body { flex: 1; display: flex; flex-direction: column; }

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    border-color: var(--primary);
}

.room-card .card-img-top {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

/* Style cho căn ĐÃ THUÊ */
.room-card.rented {
    opacity: 0.9; 
    filter: grayscale(30%); 
    cursor: pointer;
}

.rented-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.rented-label {
    background-color: #dc3545;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 8px 15px;
    transform: rotate(-15deg);
    border: 2px solid white;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

/* =========================================
   5. BẢN ĐỒ (MAP SEARCH LAYOUT)
   ========================================= */
.map-layout-grid {
    display: grid;
    grid-template-columns: 450px 1fr; 
    height: calc(100vh - 76px); 
    width: 100%;
    overflow: hidden;
}

.half-map-list {
    height: 100%;
    overflow-y: auto;
    background: #f8f9fa;
    border-right: 1px solid #ddd;
    display: flex; flex-direction: column;
}

.half-map-view {
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Marker trên bản đồ */
.custom-map-marker { display: flex; justify-content: center; align-items: center; }
.marker-pin {
    width: 40px; height: 40px; border-radius: 50% 50% 50% 0;
    background: var(--primary); position: absolute; transform: rotate(-45deg);
    left: 50%; top: 50%; margin: -20px 0 0 -20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3); border: 2px solid #fff;
    display: flex; justify-content: center; align-items: center;
}
.marker-pin i { transform: rotate(45deg); color: #fff; font-size: 18px; }

.btn-popup-custom {
    display: block; width: 100%; background-color: var(--primary) !important; color: #000 !important;
    font-weight: 700; text-align: center; padding: 6px 0; border-radius: 4px; margin-top: 8px;
}

/* =========================================
   6. HEADER & BREADCRUMB
   ========================================= */
.page-header-block {
    background: #ffffff;
    color: #1a1a1a;
    padding: 40px 0;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid #e5e5e5;
}

.page-header-title { 
    color: #1a1a1a;
    font-weight: 800;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.breadcrumb-custom { 
    font-size: 0.9rem; color: #666; font-weight: 500; 
}
.breadcrumb-custom a { 
    color: #1a1a1a !important; font-weight: 600; transition: color 0.2s;
}
.breadcrumb-custom a:hover { color: #f1c40f !important; }
.breadcrumb-custom i { margin: 0 8px; font-size: 0.7rem; opacity: 0.5; color: #999 !important; }

/* Header riêng cho trang Detail */
.property-header { 
    background: #fff; padding: 0 !important; margin: 0 !important; 
    border-bottom: 1px solid #eee; position: relative; z-index: 1; 
}
.property-header .page-header-block { 
    margin-bottom: 20px; box-shadow: none; border: none; padding-bottom: 10px; 
}

/* =========================================
   7. BỘ LỌC (FILTER)
   ========================================= */
.btn-expand-filter { display: none; } 
#main-filter-box { transition: all 0.3s ease; }
.amenities-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.filter-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px;
}
.filter-actions .btn {
    height: 48px; font-weight: 700; font-size: 0.95rem; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.btn-apply-filter {
    background: var(--primary) !important; color: #000 !important; border: 2px solid var(--primary);
}
.btn-apply-filter:hover {
    background: var(--primary-dark) !important; transform: translateY(-2px);
}
.btn-reset-filter {
    background: #fff !important; color: #666 !important; border: 2px solid #ddd;
}
.btn-reset-filter:hover { background: #f8f9fa !important; border-color: #999; }

/* Sticky Filter Bar (Hiện khi cuộn) */
.active-filter-bar {
    position: fixed; top: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1040; padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-bottom: 1px solid #eee;
    display: none;
}
.filter-tags-container { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-tag {
    background: #fff3cd; color: #856404; padding: 3px 10px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600; white-space: nowrap;
    border: 1px solid #ffeeba; cursor: pointer;
}

/* =========================================
   8. CHI TIẾT PHÒNG (DETAIL PAGE ELEMENTS)
   ========================================= */

/* Gallery Ảnh */
.gallery-container { display: flex; flex-direction: column; gap: 10px; }
.gallery-main-frame {
    width: 100%; aspect-ratio: 4/3; max-height: 600px;
    border-radius: 12px; overflow: hidden; position: relative; 
    cursor: zoom-in; background: #f0f0f0;
}
.gallery-thumbs-grid { 
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; 
}
.gallery-sub-frame { 
    aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; 
    cursor: pointer; opacity: 0.8; transition: 0.2s; background: #f0f0f0;
}
.gallery-sub-frame:hover { opacity: 1; transform: scale(1.02); }
.img-smart-fill { width: 100%; height: 100%; object-fit: cover; }

/* Box thông tin nổi bật (Giá, Khuyến mãi) */
.highlight-box { 
    background: #fdfdfd; border: 1px solid #e0e0e0; border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); 
}
.price-tag-large { 
    color: #dc3545; font-size: 1.8rem; font-weight: 800; 
}
.promo-badge-inline { 
    background: #fff3cd; color: #856404; border: 1px dashed #ffeeba; 
    padding: 8px 15px; border-radius: 6px; font-weight: 600; display: inline-block; 
}

/* Keypoints (Tiện ích) */
.keypoint-list { margin-top: 15px; }
.keypoint-list div { margin-bottom: 8px; color: #555; }
.keypoint-list i { color: #28a745; margin-right: 8px; }

/* Tiêu đề section (Mô tả, Vị trí...) */
.section-title { 
    font-weight: 700; font-size: 1.25rem; margin-bottom: 20px; 
    color: var(--text-dark); position: relative; padding-left: 15px; 
}
.section-title::before { 
    content: ''; position: absolute; left: 0; top: 5px; bottom: 5px; 
    width: 4px; background: var(--primary); border-radius: 2px; 
}

/* Video */
.video-container { 
    position: relative; padding-bottom: 56.25%; height: 0; 
    overflow: hidden; border-radius: 12px; background: #000; 
}
.video-container iframe { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; 
}

/* Bản đồ trang Detail */
.map-frame { 
    height: 350px !important; width: 100%; border-radius: 12px; 
    z-index: 1; background: #eee;
}
.parent-of-map { min-height: 400px; }

/* =========================================
   9. SIDEBAR & CONTACT CARD (FIXED - STICKY)
   ========================================= */

/* Class quan trọng để tạo hiệu ứng dính */
.sidebar-sticky-inner {
    position: -webkit-sticky; /* Cho Safari */
    position: sticky;         /* Cho Chrome, Firefox... */
    top: 90px;                /* Cách mép trên màn hình 90px (để không bị Navbar che) */
    z-index: 99; 
    display: flex; 
    flex-direction: column; 
    gap: 15px;                /* Khoảng cách giữa 2 khối Liên hệ và Cam kết */
}

.sidebar-wrapper { 
    height: 100%; 
    /* LƯU Ý: Không được thêm overflow: hidden ở đây, nếu có sẽ mất sticky */
}

/* Card Liên hệ Nhỏ gọn */
.contact-card-compact {
    background: #fff; border: 1px solid #e0e0e0; overflow: hidden; transition: all 0.3s ease;
}
.contact-card-compact:hover { 
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important; border-color: var(--primary); 
}
.contact-compact-body { display: flex; align-items: center; padding: 15px; gap: 15px; }
.contact-compact-img {
    width: 75px; height: 75px; border-radius: 50%; object-fit: cover;
    border: 3px solid #f8f9fa; box-shadow: 0 2px 8px rgba(0,0,0,0.1); flex-shrink: 0;
}
.contact-compact-info { flex: 1; }
.btn-call-compact {
    background: var(--primary); color: #1a1a1a; font-weight: 800; border: none;
    display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.btn-call-compact:hover { background: #f39c12; }
.btn-zalo-compact {
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #ddd; background: #fff; color: #1a1a1a; font-weight: 700;
}
.btn-zalo-compact:hover { border-color: var(--primary); color: #d35400; }

/* Card Cam kết (Khung bao ngoài) */
.commitment-card-modern {
    background: #fff; border: 1px solid #eee; border-radius: 12px; overflow: hidden;
}

/* =========================================
   10. STYLE CHO TRANG CONTACT (GIỮ LẠI ĐỂ KHÔNG MẤT STYLE)
   ========================================= */
.contact-card-modern {
    border-radius: 20px; overflow: hidden; transition: transform 0.3s ease;
}
.contact-card-modern:hover { transform: translateY(-5px); }
.profile-img-modern {
    width: 90px; height: 90px; object-fit: cover; border: 4px solid #fff;
}
.online-badge {
    position: absolute; bottom: 5px; right: 5px; width: 18px; height: 18px;
    background: #28a745; border: 3px solid #fff; border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* =========================================
   11. MOBILE BOTTOM NAV
   ========================================= */
.mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 60px;
    background: #fff; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); 
    z-index: 1090; display: block;
}
.mobile-bottom-nav .btn-danger {
    background: var(--primary) !important; border-color: var(--primary) !important;
    color: #000 !important; font-weight: 800;
}
.mobile-bottom-nav .btn-danger:hover {
    background: var(--primary-dark) !important;
}
.mobile-bottom-nav .btn-danger i { color: #000 !important; }

@media (min-width: 992px) {
    .mobile-bottom-nav { display: none; }
    body { padding-bottom: 0; }
}

/* =========================================
   12. RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 992px) {
    /* Navbar Mobile */
    .navbar-brand img { height: 35px; } 
    .brand-text { font-size: 0.9rem !important; }
    .navbar-toggler { display: none !important; }
    
    .navbar-collapse {
        display: block !important; border-top: none; 
        padding: 5px 0 0 0; background: #fff;
    }

    /* Grid 3 cột cho menu mobile */
    .navbar-nav {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr; 
        gap: 8px; margin-top: 5px; flex-direction: row !important;
    }
    .nav-item { margin: 0; }
    .nav-link {
        font-size: 0.75rem !important; padding: 10px 2px !important;
        border-radius: 8px !important; background: #f8f9fa; 
        color: #1a1a1a; border: 1px solid #eee;
        display: flex; flex-direction: column; align-items: center; 
        justify-content: center; text-align: center; height: 100%;
    }
    .nav-link i { font-size: 1.1rem; color: var(--primary-dark); margin-bottom: 4px; }
    .nav-link.active { 
        background: #fff9db; color: #000; border-color: var(--primary); font-weight: 700; 
    }

    /* Map Page Mobile */
    .map-layout-grid {
        display: flex; flex-direction: column-reverse;
        height: auto !important; overflow: visible;
    }
    .half-map-view { height: 350px; width: 100%; flex-shrink: 0; }
    .half-map-list { height: auto; overflow: visible; background: #fff; padding-top: 0; border-right: none; }

    /* Filter Mobile */
    .btn-expand-filter {
        display: none; width: 100%; margin-bottom: 10px;
        background: #fff; border: 1px solid #ddd; color: #333; font-weight: 600; padding: 10px;
    }
    #main-filter-box.filter-box-collapsed .btn-expand-filter { display: block; }
    #main-filter-box.filter-box-collapsed .filter-content { display: none; }

    /* Others */
    .gallery-main-frame { aspect-ratio: 4/3; max-height: 400px; }
    .room-card .card-img-top { height: 180px; }
    
    /* Reset Sticky Mobile */
    .sidebar-sticky-inner { position: static !important; }
    
    /* Đẩy footer lên tránh bị nút gọi che */
    body { padding-bottom: 70px !important; }
}
/* =========================================================
   13. FIX LAYOUT STICKY
   ========================================================= */

/* Class này trong detail.html: <div class="row g-4 row-sticky-parent"> */
.row-sticky-parent {
    display: flex !important;
    align-items: stretch !important; /* Ép Sidebar cao bằng cột Nội dung */
    flex-wrap: wrap;
}

/* Sidebar nhận chiều cao 100% */
.sidebar-wrapper {
    height: 100% !important;
    position: relative;
    min-height: 1px;
}

/* Sticky Inner: Dính chặt */
.sidebar-sticky-inner {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 100px !important;
    z-index: 1020;
    width: 100%;
}

/* Mobile: Tắt sticky */
@media (max-width: 991px) {
    .sidebar-wrapper { height: auto !important; }
    .sidebar-sticky-inner { position: static !important; }
}



