/*
Theme Name: Ninh Co - Thinh Long Real Estate
Theme URI: https://batdongsanninhco.com
Author: Duc Hao
Author URI: https://batdongsanninhco.com
Description: Theme WordPress thiết kế riêng cho chuyên trang bất động sản và đất nền ven biển khu vực Ninh Cơ - Thịnh Long. Tối ưu hóa tốc độ load và SEO.
Version: 1.0
Text Domain: ninhcotheme
*/

/* Khóa tràn ngang tuyệt đối cho mọi thiết bị di động */
html, body { 
    max-width: 100%; 
    overflow-x: hidden; 
}

/* Hero Section */
.hero-section { 
    display: flex; 
    align-items: center; 
    min-height: 500px; 
    padding: 100px 0;
}
.hero-overlay { 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 30, 60, 0.5); 
}
.hero-box { 
    background: rgba(0, 77, 153, 0.85); 
    border: 1px solid #d4a373; 
    border-radius: 12px; 
}

/* ==========================================================================
   MÀU SẮC & NÚT BẤM CHUNG (UI KIT)
   ========================================================================== */
.text-ninhco { color: #004d99; }
.bg-ninhco { background-color: #004d99; }
.bg-light-blue { background-color: #f4f8fb; }
.bg-dark-ninhco { background-color: #061c3a; }

.btn-warning-custom { 
    background-color: #d4a373; 
    border-color: #d4a373; 
    color: #fff; 
    transition: all 0.3s ease; 
}
.btn-warning-custom:hover { 
    background-color: #b0895f; 
    border-color: #b0895f;
    color: #fff; 
}

/* ==========================================================================
   KHỐI TIỆN ÍCH (FEATURES BAR)
   ========================================================================== */
@media (min-width: 992px) {
    .feature-item:not(:last-child) {
        border-right: 1px solid #dee2e6;
    }
}

/* ==========================================================================
   KHỐI VIDEO SLIDER (ĐÃ TỐI ƯU CHUẨN 100%)
   ========================================================================== */
.video-slider-wrapper { position: relative; padding: 15px 0; }
.video-slider-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.video-slider-track::-webkit-scrollbar { display: none; }

.video-item {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: 100%;
}
@media (min-width: 768px) { .video-item { width: calc((100% - 24px) / 2); } }
@media (min-width: 992px) { .video-item { width: calc((100% - 48px) / 3); } }

.video-card { transition: transform 0.3s ease; }
.video-card:hover { transform: translateY(-5px); }

.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px; display: flex; justify-content: center; align-items: center;
    z-index: 9999 !important; 
    background-color: #ffffff; color: #0b1f38;
    border: 1px solid #e9ecef; border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); transition: all 0.3s ease; cursor: pointer;
}
.slider-nav-btn:hover { background-color: #d4a373; color: #ffffff; border-color: #d4a373; }
.slider-nav-btn.prev-btn { left: -20px; }
.slider-nav-btn.next-btn { right: -20px; }

/* ==========================================================================
   KHỐI VÌ SAO CHỌN NINH CƠ - THỊNH LONG
   ========================================================================== */
.title-accent {
    width: 60px; height: 3px; background-color: #d4a373; margin-bottom: 2rem;
}
.icon-box {
    width: 50px; height: 50px; background-color: #f4f8fb;
    border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-shrink: 0;
}
.icon-box img { width: 24px; height: 24px; }

.large-video-wrapper {
    position: relative; border-radius: 16px; overflow: hidden; cursor: pointer; transition: transform 0.3s ease;
}
.large-video-wrapper:hover { transform: translateY(-5px); }

.play-btn-large {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 70px; height: 70px; background: rgba(0, 0, 0, 0.4);
    border: 2px solid white; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 28px; padding-left: 5px; backdrop-filter: blur(2px); transition: all 0.3s ease;
}
.large-video-wrapper:hover .play-btn-large {
    background: rgba(0, 77, 153, 0.8); transform: translate(-50%, -50%) scale(1.1);
}

/* ==========================================================================
   KHỐI BẢN ĐỒ QUY HOẠCH
   ========================================================================== */
.map-legend { list-style: none; padding-left: 0; margin-bottom: 0; }
.map-legend li { display: flex; align-items: center; margin-bottom: 10px; font-size: 14px; color: #e0e0e0; }
.legend-dot { width: 14px; height: 14px; border-radius: 50%; margin-right: 12px; flex-shrink: 0; }

.dot-o-hien-huu { background-color: #dcb37b; }
.dot-o-quy-hoach { background-color: #fce268; }
.dot-thuong-mai { background-color: #f19eb5; }
.dot-cong-cong { background-color: #e5989b; }
.dot-cay-xanh { background-color: #8ac926; }
.dot-giao-thong { background-color: #ced4da; }
.dot-mat-nuoc { background-color: #48cae4; }

.btn-gold-ninhco { background-color: #c99a5c; color: #fff; border: none; font-weight: 600; transition: all 0.3s ease; }
.btn-gold-ninhco:hover { background-color: #a87e45; color: #fff; }

/* ==========================================================================
   KHỐI TIN TỨC & BÀI VIẾT
   ========================================================================== */
.card-news { transition: transform 0.3s ease, box-shadow 0.3s ease; border-radius: 12px; overflow: hidden; background: #fff; }
.card-news:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important; }
.card-news img { height: 180px; width: 100%; object-fit: cover; }
.badge-category { background-color: #e9f2fb; color: #004d99; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 4px; text-transform: uppercase; }
.news-meta { font-size: 12px; color: #888; }
.news-title { font-size: 16px; font-weight: 700; color: #001e3c !important; text-decoration: none !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; transition: color 0.3s ease; line-height: 1.4; }
.news-title:hover { color: #d4a373 !important; }
.news-excerpt { font-size: 13px; color: #6c757d; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0; line-height: 1.5; }



/* ==========================================================================
   TỐI ƯU VUỐT NGANG TRÊN MOBILE CHO TIN TỨC
   ========================================================================== */
@media (max-width: 767px) {
    .news-row {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Ẩn thanh cuộn Firefox */
        padding-bottom: 20px; /* Chừa không gian cho box-shadow không bị cắt viền */
    }
    .news-row::-webkit-scrollbar { display: none; /* Ẩn thanh cuộn Chrome/Safari */ }
    
    .news-col {
        scroll-snap-align: center; /* Trượt điểm neo dính vào giữa */
        flex: 0 0 85% !important; /* Mỗi thẻ bài viết chiếm 85% màn hình */
        max-width: 85% !important;
        /* Chiếm 85% để lộ ra 15% của bài tiếp theo, mồi cho người dùng vuốt */
    }
}

/* ==========================================================================
   LIÊN HỆ & FORM CHUNG
   ========================================================================== */
/* Bổ sung style form vào đây sau... */

/* ==========================================================================
   TỐI ƯU TRANG CHI TIẾT BÀI VIẾT (SINGLE.PHP)
   ========================================================================== */
.post-content img {
    max-width: 100% !important; /* Ép ảnh không bị tràn ra ngoài điện thoại */
    height: auto !important;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Thêm bóng đổ nhẹ cho ảnh trong bài */
}

.post-content h2, .post-content h3, .post-content h4 {
    color: #004d99; /* Tiêu đề trong bài viết lấy màu xanh Ninh Cơ */
    font-weight: 700;
    margin-top: 35px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-content a {
    color: #d4a373; /* Link trong bài có màu vàng gold */
    text-decoration: none;
    font-weight: 600;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content ul, .post-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.post-content li {
    margin-bottom: 10px;
}

/* Ẩn dấu gạch chân của link trong sidebar khi hover */
.text-decoration-none:hover {
    text-decoration: none !important;
}

/* ==========================================================================
   TỐI ƯU MENU HEADER (Khống chế Logo không cho vỡ khung)
   ========================================================================== */
.navbar-brand {
    max-width: 70%; /* Giới hạn logo chỉ được chiếm tối đa 70% màn hình, 30% còn lại nhường cho nút menu */
    display: flex;
    align-items: center;
}

.navbar-brand img, 
.custom-logo {
    max-height: 55px !important; /* Ép cứng chiều cao tối đa */
    max-width: 100% !important;  /* Ép cứng không cho tràn viền */
    width: auto !important;
    object-fit: contain; /* Đảm bảo logo không bao giờ bị méo */
}

/* Sửa định dạng danh sách menu mặc định của WP */
.navbar-nav li {
    list-style: none;
}
.navbar-nav li a {
    color: #0b1f38;
    text-decoration: none;
    font-size: 15px;
    text-transform: uppercase;
    font-weight: 700;
    transition: all 0.3s ease;
}
.navbar-nav li a:hover {
    color: #d4a373;
}

/* ==========================================================================
   GIAO DIỆN MENU RIÊNG CHO MOBILE (BẢN CAO CẤP)
   ========================================================================== */
@media (max-width: 991px) {
    /* Khung thẻ (Card) Menu nổi bật */
    #mainNavbar {
        position: absolute;
        top: calc(100% + 10px); /* Cách header một khoảng nhỏ */
        left: 15px;
        right: 15px;
        background: #ffffff;
        padding: 20px 25px 25px 25px; /* Căn lề trong cho thoáng */
        border-radius: 16px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.15); /* Bóng đổ sâu tạo cảm giác 3D */
        z-index: 1000;
        border: 1px solid #eaeaea;
    }
    
    /* Ép danh sách mất lề trái mặc định của WordPress */
    .navbar-nav {
        padding-left: 0 !important; 
        margin-bottom: 0;
        width: 100%;
    }

    /* Chiều rộng từng mục menu */
    .navbar-nav li {
        width: 100%;
        display: block;
    }

    /* Biến từng chữ thành một khối dễ bấm */
    .navbar-nav li a {
        display: block; 
        padding: 14px 0 !important;
        border-bottom: 1px solid #f0f4f8; /* Đường kẻ mờ ngăn cách */
        font-size: 15px !important;
        font-weight: 700;
        text-align: center; /* Căn giữa chữ nhìn như App xịn */
        color: #0b1f38;
    }

    /* Ẩn đường kẻ ở mục cuối cùng cho đỡ thừa */
    .navbar-nav li:last-child a {
        border-bottom: none;
    }
    
    /* Tách nút Gọi tư vấn ra xa menu chữ một chút */
    .d-lg-none.mt-3 {
        margin-top: 20px !important;
    }
}

/* ==========================================================================
   TỐI ƯU 2 NÚT BẤM BANNER TRÊN MOBILE (KHÔNG RỚT DÒNG CHỮ)
   ========================================================================== */
@media (max-width: 767px) {
    /* Lệnh này cấm tuyệt đối chữ trong nút bị rớt dòng */
    .btn {
        white-space: nowrap !important; 
    }

    /* Thu hẹp khoảng cách giữa 2 nút (gap) nếu chúng nằm trong thẻ d-flex */
    .d-flex:has(> .btn) {
        gap: 10px !important; 
    }

    /* Ép 2 nút chia đều 50/50 tỷ lệ màn hình và giảm lề để vừa khít */
    .d-flex > .btn {
        padding: 12px 10px !important; /* Giảm lề trái/phải của nút */
        font-size: 13px !important;    /* Thu nhỏ cỡ chữ một chút */
        flex: 1;                       /* Ép 2 nút dàn đều không lấn nhau */
        justify-content: center;       /* Căn giữa chữ */
    }
}

/* Style thanh Breadcrumb chuyên nghiệp */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin-bottom: 1rem;
    list-style: none;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.breadcrumb-item + .breadcrumb-item::before {
    float: left;
    padding-right: 0.5rem;
    color: #999;
    content: "/"; /* Dấu gạch chéo tinh tế */
}

.breadcrumb-item a {
    color: #6c757d !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #004d99 !important; /* Màu xanh thương hiệu khi hover */
}

.breadcrumb-item.active {
    color: #333 !important;
    font-weight: 500;
    max-width: 200px; /* Giới hạn độ dài tiêu đề để không vỡ khung */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   FORM LIÊN HỆ & NÚT GỌI NHANH (HOÀN THIỆN GIAO DIỆN)
   ========================================================================== */

/* Style cho form Contact Form 7 để nó "ton-sur-ton" với website */
.form-ninhco .wpcf7-form-control-wrap input, 
.form-ninhco .wpcf7-form-control-wrap textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: 0.3s;
}
.form-ninhco .wpcf7-form-control-wrap input:focus, 
.form-ninhco .wpcf7-form-control-wrap textarea:focus {
    border-color: #004d99;
    box-shadow: 0 0 0 3px rgba(0,77,153,0.1);
    outline: none;
}
.form-ninhco .wpcf7-submit {
    background-color: #004d99;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 700;
    width: 100%;
    transition: 0.3s;
}
.form-ninhco .wpcf7-submit:hover {
    background-color: #00366b;
}

/* Nút gọi nhanh (Floating Button) hiện góc trái cho mobile */
.floating-call-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    background: #28a745;
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(40,167,69,0.4);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(40,167,69,0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(40,167,69,0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(40,167,69,0); }
}

/* Fix lỗi hiển thị của Breadcrumb trên màn hình cực nhỏ */
@media (max-width: 576px) {
    .breadcrumb { font-size: 11px !important; }
}

/* Style cho các khối Title trong trang */
.text-ninhco-gold { color: #d4a373; }

.ninhco-social-chat {
    position: fixed;
    bottom: 120px !important; 
    right: 30px !important;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-btn {
    width: 50px; height: 50px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

/* Màu thương hiệu */
.call-btn { background-color: #28a745; }
.zalo-btn { background-color: #0068FF; }
.mess-btn { background-color: #0084FF; }

.chat-btn:hover { transform: scale(1.15); }

/* ==========================================================================
   FOOTER & KHỐI THỐNG KÊ CALL-TO-ACTION
   ========================================================================== */
.bg-dark-ninhco { background-color: #0b1f38; } 
.text-ninhco-gold { color: #d4a373; }
.cta-wrapper { margin-top: 100px; }

/* Căn chỉnh khối Thống kê đè lên ranh giới */
.stats-box { 
    background: #0b1f38; 
    border: 1px solid rgba(255,255,255,0.15); 
    border-radius: 12px; 
    transform: translateY(-50%); 
    margin-bottom: -60px; /* Bù trừ khoảng trống bị hụt */
    position: relative; 
    z-index: 10; 
}

@media (min-width: 768px) {
    .stats-item:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.1); }
}

/* TỐI ƯU RIÊNG CHO MOBILE */
@media (max-width: 767px) {
    .cta-wrapper { margin-top: 180px; } 
    .stats-box { margin-bottom: -160px !important; } 
    .stats-item:not(:last-child) { 
        border-bottom: 1px solid rgba(255,255,255,0.1); 
        margin-bottom: 15px; 
        padding-bottom: 15px; 
    }
}

/* Form & Footer Link */
.form-ninhco .form-control, .form-ninhco .form-select {
    background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 12px 15px; font-size: 14px;
}
.form-ninhco .form-control:focus, .form-ninhco .form-select:focus {
    box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.25); border-color: #d4a373;
}
.footer-link { color: #555; text-decoration: none; font-size: 14px; transition: color 0.3s; line-height: 2; }
.footer-link:hover { color: #d4a373; }
.social-icon { width: 32px; height: 32px; display: inline-flex; justify-content: center; align-items: center; border-radius: 50%; color: white; margin-right: 8px; text-decoration: none; transition: 0.3s;}
.social-icon:hover { transform: translateY(-3px); }
.bg-fb { background-color: #1877F2; } .bg-zalo { background-color: #0068FF; }
.bg-yt { background-color: #FF0000; } .bg-tt { background-color: #000000; }

/* Tinh chỉnh trang Tiềm năng */
.post-content p { margin-bottom: 20px; font-size: 17px; line-height: 1.8; color: #444; }
.post-content h2 { font-size: 26px !important; color: #0b1f38 !important; margin-bottom: 25px !important; }

/* Tạo hiệu ứng cho khối số thứ tự */
.badge { padding: 10px 15px !important; border-radius: 8px !important; }

/* Tinh chỉnh ảnh bản đồ để nổi bật */
.map-container { transition: 0.3s; }
.map-container:hover { transform: scale(1.02); box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important; }