/* ==============================
   GLOBAL LAYOUT TỐI ƯU HIỂN THỊ
================================= */

/* Tổng thể container cho thoáng hơn */
.container,
.max-w-7xl {
    max-width: 1280px !important;
    width: 100%;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Giảm khoảng trắng dọc giữa các phần */
section,
div[class*="section"],
div[class*="container"]:not(.no-spacing) {
    margin-bottom: 2rem !important;
}

/* Lưới các bài viết / dự án / tin tức */
.jobs-grid,
.portfolio-container,
.posts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
}

/* Thẻ bài viết / dự án */
.job-card,
.portfolio-item,
.post-card {
    flex: 1 1 calc(33.333% - 1.5rem);
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Tablet: 2 cột */
@media (max-width: 1024px) {
    .job-card,
    .portfolio-item,
    .post-card {
        flex: 1 1 calc(50% - 1rem);
    }
}

/* Mobile: 1 cột */
@media (max-width: 640px) {
    .job-card,
    .portfolio-item,
    .post-card {
        flex: 1 1 100%;
        padding: 1rem;
        margin-bottom: 1.25rem;
    }

    section,
    div[class*="container"]:not(.no-spacing) {
        margin-bottom: 1.5rem !important;
    }
}

/* Giới hạn chiều cao mô tả bài viết */
.job-desc,
.post-content,
.project-desc {
    line-height: 1.5;
    max-height: 4.5em;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==============================
   CAROUSEL
================================= */
.img-fluid-sl {
    height: 700px;
    object-fit: cover;
    width: 100%;
}

/* ==============================
   PORTFOLIO
================================= */
.portfolio-img {
    position: relative;
}
.portfolio-img::before,
.portfolio-img::after {
    content: none !important;
}

/* Responsive cho portfolio */
@media (max-width: 768px) {
    #portfolio-flters {
        display: none !important;
    }
    .portfolio-container .portfolio-item {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

@media (max-width: 500px) {
    .portfolio-container .portfolio-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ==============================
   BENEFIT SECTION
================================= */
.benefit-section .row.g-3 {
    margin-top: 2.5rem;
}

.benefit-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    transition: all 0.4s ease-in-out; 
    position: relative;
    overflow: hidden;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background-color: #ffffff;
    cursor: pointer;
}

.benefit-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    background-color: #f8f9fa;
}

.benefit-item i {
    margin-bottom: 0.5rem; 
    transition: color 0.4s ease-in-out; 
}

.benefit-item:hover i {
    color: var(--bs-primary) !important;
}

.benefit-description {
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.5em; 
    color: #000000;
}

.benefit-item h5 {
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.benefit-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: var(--default-color, #007bff);
    transition: height 0.3s;
}

.benefit-item:hover::before {
    height: 10px; 
}

.benefit-01::before { --default-color: #28a745; }
.benefit-02::before { --default-color: #17a2b8; }
.benefit-03::before { --default-color: #ffc107; }
.benefit-04::before { --default-color: #dc3545; }
.benefit-05::before { --default-color: #6c757d; }
.benefit-06::before { --default-color: #007bff; }

/* ==============================
   MODAL CUSTOM
================================= */
.modal-backdrop.show {
    opacity: 0.75 !important; 
}
#benefitModal .modal-content {
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}
#benefitModal .modal-header {
    background-color: transparent; 
    color: var(--bs-primary); 
    border-top-left-radius: 19px;
    border-top-right-radius: 19px;
    padding: 1.5rem 2.5rem 1rem; 
    border-bottom: 1px solid rgba(0, 0, 0, 0.1); 
}
#benefitModal .modal-header .modal-title {
    color: var(--bs-primary) !important;
    font-size: 1.8rem;
    font-weight: 700;
}
.modal-icon-header {
    margin-right: 15px;
    font-size: 1.6rem; 
}
.btn-close {
    filter: invert(0.5); 
}
#benefitModal .modal-body {
    font-size: 1.1rem;
    line-height: 1.8;
    padding: 1.5rem 2.5rem;
}
#benefitModal .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1); 
    padding: 1rem 2.5rem;
    background-color: transparent; 
}

/* ==============================
   ABOUT & FEATURE IMAGES
================================= */
.about img,
.feature img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

        /* Điều chỉnh cho main content không bị che bởi header (nếu header là fixed/sticky) */
        main.py-4 { /* Nếu layout.app của bạn dùng <main class="py-4"> */
            padding-top: 90px !important; /* Thay đổi giá trị này (90px) phù hợp với chiều cao header của bạn */
        }
        @media (max-width: 991.98px) {
            /* Điều chỉnh cho mobile/tablet nếu header có chiều cao khác */
            main.py-4 {
                padding-top: 70px !important; 
            }
        }

        /* --- YÊU CẦU 1: CẢI TIẾN ĐỘ NỔI BẬT CỦM TỪ KHÓA --- */
        .highlight-phrase {
            font-size: 1.15em; /* Tăng kích thước chữ để nổi bật hơn */
            font-weight: 700; /* Làm chữ đậm hơn */
            color: var(--bs-primary) !important; /* Sử dụng màu chủ đạo để nhấn mạnh */
        }
        /* -------------------------------------------------------- */

        /* --- Cải tiến độ mượt và hiện đại --- */

        /* Cải tiến cho khối Thống kê (Stats) */
        .stat-item {
            border-radius: 1.25rem !important; /* Tăng độ cong góc */
            transition: all 0.3s ease-in-out;
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05) !important; /* Bóng nhẹ hơn */
        }
        .stat-item:hover {
            transform: translateY(-5px); /* Hiệu ứng lướt nhẹ khi hover */
            box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1) !important;
        }

        /* Cải tiến cho khối Lợi ích (Benefits) */
        .benefit-item {
            border-radius: 1rem !important;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            cursor: pointer;
            border: 1px solid #e9ecef; /* Thêm border nhẹ */
            box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        }
        .benefit-item:hover {
            transform: translateY(-8px) scale(1.02);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); /* Bóng rõ hơn khi hover */
        }
        .benefit-item h5 {
            font-size: 1.1rem; /* Giảm kích thước tiêu đề lợi ích */
        }
        
        /* Cải tiến cho khối Dịch vụ (Services) */
        .service-item {
            border-radius: 1.5rem !important; /* Góc bo lớn hơn */
            transition: all 0.3s ease;
            border: none; /* Bỏ border nếu có */
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08) !important;
            
            /* ✨ THAY ĐỔI: DÙNG FLEXBOX ĐỂ CĂN NÚT XUỐNG ĐÁY CARD */
            display: flex; 
            flex-direction: column;
        }
        .service-item:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
        }
        .service-item a.btn {
            font-weight: 600;
        }
        
        /* ✨ THAY ĐỔI: CSS CHO NÚT CỦA CARD DỊCH VỤ */
        .service-item .btn-bottom {
            margin-top: auto !important; /* Tự động đẩy nút xuống đáy của flex container */
        }

        /* Cải tiến cho khối Tin tức (News) */
        .news-card {
            border-radius: 1rem !important;
        }
        .news-thumb {
            border-radius: 1rem 1rem 0 0 !important;
        }
        /* Đảm bảo tiêu đề tin tức không bị cắt quá nhiều nếu 3 cột quá chật */
        @media (max-width: 767.98px) {
            .home-news-section .news-title {
                /* Cho phép tiêu đề tin tức hiển thị 2 dòng trên mobile để không quá chật */
                max-height: 2.8rem !important; /* Khoảng 2 dòng chữ nhỏ */
                line-height: 1.4;
            }
        }
        

        /* Tiêu đề chung (để cân đối hơn) */
        .section-title {
            font-size: 2.5rem; /* Tùy chỉnh kích thước tiêu đề thay cho display-5 */
            font-weight: 700;
        }
        
        .project-title-truncate {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
            display: block;
        }
        /* Tùy chỉnh thêm cho modal icon header (theo JS của bạn) */
        .modal-icon-header i {
            margin-right: 0.5rem;
        }
        /* ✅ Thu nhỏ chữ “Nguồn” trong thẻ tin tức trên mobile */
@media (max-width: 575.98px) {
    .home-news-section .card-footer small {
        font-size: 0.75rem;  /* nhỏ hơn mặc định */
        color: #6c757d;      /* màu xám nhẹ */
    }

    /* Có thể thu nhỏ cả phần tiêu đề & ngày tháng nếu muốn cân đối */
    .home-news-section .news-title a {
        font-size: 0.9rem;
    }
    .home-news-section .post-date {
        font-size: 0.75rem;
    }
}
/* ✅ Thu nhỏ chữ "Nguồn bài viết" trên mobile */
@media (max-width: 575.98px) {
    .home-news-section .card-footer small.text-muted {
        font-size: 0.7rem;       /* nhỏ hơn mặc định */
        color: #999 !important;  /* nhạt màu hơn một chút */
    }
    .home-news-section .post-date {
        font-size: 0.75rem;      /* ngày đăng nhỏ lại cho đều */
    }
}
/* ✅ Responsive: 4 ô thống kê hiển thị 2 cột (2x2) trên mobile */
@media (max-width: 767.98px) {
    .about-home-section .row.g-4 > div.col-sm-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .about-home-section .stat-item {
        padding: 1rem !important;
    }

    .about-home-section .stat-item h2 {
        font-size: 1.2rem !important;
    }

    .about-home-section .stat-item p {
        font-size: 0.8rem !important;
        line-height: 1.2;
    }

    .about-home-section .stat-item i {
        font-size: 2rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* ✅ Thêm lớp bảo vệ cho màn cực nhỏ (ví dụ iPhone SE, 320–400px) */
@media (max-width: 480px) {
    .about-home-section .row.g-4 > div.col-sm-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    .about-home-section .stat-item {
        padding: 0.6rem !important;
    }

    .about-home-section .stat-item i {
        font-size: 1.5rem !important;
        margin-bottom: 0.4rem !important;
    }

    .about-home-section .stat-item h2 {
        font-size: 1rem !important;
    }

    .about-home-section .stat-item p {
        font-size: 0.7rem !important;
    }
}
/* ✅ Responsive chỉnh CTA (Call To Action) nhỏ gọn trên mobile */
@media (max-width: 767.98px) {
    .cta-section {
        padding: 2rem 1rem !important; /* Giảm padding tổng thể */
        text-align: center !important;
    }

    .cta-section h1 {
        font-size: 1.4rem !important; /* Giảm kích cỡ tiêu đề */
        line-height: 1.4 !important;
    }

    .cta-section p {
        font-size: 0.9rem !important; /* Thu nhỏ chữ mô tả */
        line-height: 1.5 !important;
        margin-bottom: 1rem !important;
    }

    .cta-section .btn {
        font-size: 0.9rem !important;
        padding: 0.6rem 1.2rem !important; /* Thu nhỏ nút */
        white-space: normal !important; /* Cho phép nút xuống dòng nếu quá dài */
        width: 100% !important; /* Nút full width trên mobile */
    }
}
                 .custom-call-btn {
                        background-color: #e60000; /* đỏ tươi */
                        color: white;
                        border: none;
                    }
                    .custom-call-btn:hover {
                        background-color: #cc0000; /* đỏ đậm khi hover */
                        color: white;
                    }
                    /* --- Responsive cho phần GIẢI PHÁP NĂNG LƯỢNG MẶT TRỜI CỐT LÕI --- */
                    .service-home-section .service-item img {
                        display: block;
                        width: 100%;
                        height: auto;
                        max-width: 280px; /* ✅ Giới hạn chiều ngang tối đa */
                        max-height: 150px;
                        margin: 0 auto 1rem; /* canh giữa ảnh */
                        border-radius: 0.75rem;
                        object-fit: cover;
                    }

                    /* Tablet: dưới 992px */
                    @media (max-width: 991.98px) {
                        .service-home-section .row {
                            row-gap: 1.5rem;
                        }
                        .service-home-section .service-item {
                            padding: 1.25rem 1rem;
                        }
                        .service-home-section .service-item img {
                            max-width: 220px;
                            max-height: 120px;
                        }
                        .service-home-section .service-item h5 {
                            font-size: 1.05rem;
                        }
                        .service-home-section .service-item p {
                            font-size: 0.9rem;
                        }
                        .service-home-section .service-item a.btn {
                            font-size: 0.9rem;
                            padding: 0.55rem 1.3rem;
                        }
                    }

                    /* Mobile nhỏ hơn 576px */
                    @media (max-width: 575.98px) {
                        .service-home-section .section-title {
                            font-size: 1.3rem;
                        }
                        .service-home-section .service-item {
                            border-radius: 1rem;
                            box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.05);
                            padding: 1rem;
                            text-align: center;
                        }
                        .service-home-section .service-item img {
                            max-width: 160px; /* ✅ nhỏ lại cho mobile */
                            max-height: 90px;
                            margin-bottom: 0.75rem;
                        }
                        .service-home-section .service-item h5 {
                            margin-top: 0.25rem;
                            font-size: 0.95rem;
                        }
                        .service-home-section .service-item p {
                            font-size: 0.82rem;
                            line-height: 1.4;
                        }
                        .service-home-section .service-item a.btn {
                            display: inline-block;
                            width: 100%;
                            padding: 0.6rem;
                            font-size: 0.85rem;
                        }
                    }

                    /* Giữ nút luôn nằm sát dưới cùng */
                    .service-home-section .service-item {
                        display: flex;
                        flex-direction: column;
                    }
                    .service-home-section .service-item .btn {
                        margin-top: auto;
                    }
                  
