:root {
    --primary-color: #f39c12;
    --dark-color: #2c3e50;
    --light-bg: #f8f9fa;
    --primary-blue: #1565c0;
    --primary-orange: #f39c12;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: #333;
    /* KHÓA CHẶT TRỤC NGANG - CHỐNG VỠ KHUNG */
    overflow-x: hidden;
    width: 100%;
}

.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Header Modern */
.header { background: #fff; padding: 5px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100;}
.nav-menu ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0;}
.nav-menu a { text-decoration: none; color: var(--dark-color); font-weight: 600; text-transform: uppercase; font-size: 14px; transition: 0.3s;}
.nav-menu a:hover, .nav-menu a.active { color: var(--primary-color); }

/* Hero Banner */
.hero-slider{
    height: 60vh;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/banner.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}
.hero h1 { font-size: 3rem; margin-bottom: 10px; }

/* CSS Slider */
.swiper { width: 100%; height: 100%; }
.swiper-slide { position: relative; text-align: center; background: #fff; display: flex; justify-content: center; align-items: center; }
.swiper-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-caption { position: absolute; bottom: 30px; left: 5%; background: rgba(0, 0, 0, 0.4); color: #fff; padding: 15px 25px; border-radius: 8px; font-size: 24px; font-weight: 600; }
.swiper-button-next, .swiper-button-prev { color: #f39c12; }
.swiper-pagination-bullet-active { background: #f39c12; }

/* Tinh chỉnh Tiêu đề Section */
.section-title { text-align: center; margin: 60px 0 10px; font-size: 32px; color: #2c3e50; font-weight: 700; }
.section-subtitle { text-align: center; color: #7f8c8d; margin-bottom: 40px; font-size: 16px; }
.post-meta { font-size: 13px; color: #95a5a6; margin-bottom: 10px; display: block;}

/* Grid Cards (Sản phẩm) */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 50px;}
.card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.08); transition: transform 0.3s ease; }
.card:hover { transform: translateY(-5px); }
.card img { width: 100%; height: 200px; object-fit: cover; }
.card-content { padding: 20px; }
.card-content h3 { margin-top: 0; font-size: 18px; }
.btn { display: inline-block; padding: 10px 20px; background: var(--primary-color); color: #fff; text-decoration: none; border-radius: 5px; font-weight: bold; }

.mobile-menu-btn { display: none; font-size: 28px; background: none; border: none; color: var(--dark-color); cursor: pointer; padding: 5px; }

/* CSS TRANG CHI TIẾT (DETAIL) */
.breadcrumb { padding: 15px 0; font-size: 14px; color: #666; border-bottom: 1px solid #ddd; margin-bottom: 30px; }
.breadcrumb a { color: var(--primary-blue); text-decoration: none; font-weight: 500; }
.page-title { font-size: 28px; color: #2c3e50; margin-top: 0; margin-bottom: 30px; font-weight: 700; line-height: 1.4; }

.detail-layout { display: grid; grid-template-columns: 350px 1fr; gap: 30px; margin-bottom: 60px;  }
.sidebar { display: flex; flex-direction: column; gap: 30px; }

/* Cấu hình Slider chi tiết */
.project-slider { width: 100%; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); overflow: hidden; background: #fff; padding: 5px; }
.swiper-project { width: 100%; height: 250px; }
.swiper-project .swiper-slide { cursor: pointer; }
.swiper-project img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.swiper-button-next::after, .swiper-button-prev::after { font-size: 20px; color: #fff; font-weight: bold;}
.swiper-button-next, .swiper-button-prev { background: rgba(0,0,0,0.5); width: 40px; height: 40px; border-radius: 50%; }

.related-box { background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid #eee; }
.related-header { background-color: var(--primary-blue); color: #fff; padding: 15px; font-size: 16px; font-weight: 600; text-align: center; text-transform: uppercase; }
.related-item { display: flex; gap: 15px; padding: 15px; border-bottom: 1px solid #eee; text-decoration: none; color: var(--text-color); transition: background 0.3s; }
.related-item:hover { background-color: #f4f6f9; }
.related-item img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; }
.related-item h4 { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow:hidden;}

.content-box { background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid #eee; }
.content-header { background-color: var(--primary-blue); color: #fff; padding: 15px 20px; font-size: 18px; font-weight: 600; text-transform: uppercase; }

/* TRỊ TẬN GỐC BỆNH VỠ KHUNG TEXT */
.content-body { 
    padding: 30px; font-size: 16px; line-height: 1.8; color: #444; 
    overflow-x: hidden; 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    word-break: break-word; 
}
.content-body * {
    max-width: 100% !important; /* Không cho ảnh/bảng tràn ra ngoài */
    white-space: normal !important; /* Phá vỡ lệnh cấm xuống dòng của copy/paste Word */
}
.content-body img { height: auto !important; }

.contact-action { margin-top: 40px; padding: 20px; background: #fff3e0; border-left: 5px solid var(--primary-orange); border-radius: 4px; }
.btn-call { display: inline-block; background: var(--dark-color); color: #fff; padding: 12px 25px; text-decoration: none; font-weight: bold; border-radius: 5px; font-size: 16px; margin-top: 10px; transition: 0.3s; }
.btn-call:hover { background: #e67e22; }

/* CSS FOOTER */
.contact-banner { background-color:#c9b14f; padding: 40px 0; color: #fff; margin-top: 50px; }
.contact-banner h3 { font-size: 18px; margin-bottom: 20px; text-transform: uppercase; font-weight: 600; text-align: center;}
.contact-form-inline { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.contact-form-inline input { padding: 12px 15px; border: none; border-radius: 4px; width: 250px; max-width: 100%; outline: none; }
.btn-submit-contact { padding: 12px 30px; border: none; border-radius: 4px; background: #f39c12; color: #fff; font-weight: bold; cursor: pointer; transition: 0.3s; width: 150px; max-width: 100%;}
.btn-submit-contact:hover { background: #d68910; }

.footer-main { background-color: #07234c; color: #ccc; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 30px; padding: 40px 0; align-items: center;}
.footer-col h3 { color: #fff; font-size: 18px; margin-bottom: 15px; font-weight: 500;}
.footer-col p { margin-bottom: 8px; line-height: 1.6; }
.social-icon { display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; border: 1px solid #ccc; border-radius: 50%; color: #ccc; text-decoration: none; font-weight: bold; transition: 0.3s; }
.social-icon:hover { color: #fff; border-color: #fff; }

.footer-bottom { background-color: #222; padding: 15px 0; font-size: 13px; color: #aaa; border-top: 1px solid #444;}
.visitor-counter { background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 20px; display: inline-flex; align-items: center; gap: 10px; }
.scroll-top { background: #f39c12; color: #fff; width: 25px; height: 25px; display: flex; justify-content: center; align-items: center; border-radius: 50%; text-decoration: none; font-weight: bold;}


/* ========================================= */
/* BẢN MOBILE (RESPONSIVE CHUYÊN SÂU)        */
/* ========================================= */
@media (max-width: 768px) {
    .header { position: relative; padding: 10px 0;}
    .mobile-menu-btn { display: block; } 

    .hero-slider {height: 200px;}
    .hero-slider .slide-caption { position: absolute; bottom:0px; left:0; width: 100%; background: rgba(0, 0, 0, 0.3); color: #fff; padding:5px 0px 25px ; border-radius:0; font-size: 14px; text-align:center; }
    .hero-slider .swiper-slide { align-items: normal;}
    
    /* Sửa lỗi cú pháp chia tỉ lệ */
    .swiper-button-next, .swiper-button-prev { top: var(--swiper-navigation-top-offset, 60%);}
    .swiper-button-next:after, .swiper-button-prev:after { font-size: calc(var(--swiper-navigation-size) / 2); }

    /* Menu dọc */
    .nav-menu { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; box-shadow: 0 10px 10px rgba(0,0,0,0.1); z-index: 100; border-top: 1px solid #eee;}
    .nav-menu.active { display: block; }
    .nav-menu ul { flex-direction: column; gap: 0; padding: 0; margin: 0; }
    .nav-menu ul li { border-bottom: 1px solid #f8f9fa; }
    .nav-menu a { display: block; padding: 15px 20px; text-align: left; }
    
    .swiper { height: 40vh; }
    .grid-3 { grid-template-columns: 1fr; gap: 20px; }

    /* XẾP LẠI THỨ TỰ TRANG CHI TIẾT THÔNG MINH CHO MOBILE */
    .container { display: flex; flex-direction: column; }
	 header .container { flex-direction: row;}
    .detail-layout, .sidebar { display: contents; } /* Loại bỏ khung div bọc ngoài */
    .breadcrumb { order: 1; margin-bottom: 10px;}
    .page-title { order: 2; font-size: 22px; margin-bottom: 20px; }
    .project-slider { order: 3; width: 100%; margin-bottom: 20px; } /* Đưa Slider lên trên cùng */
    .content-box { order: 4; width: 100%; margin-bottom: 20px; } /* Đưa Nội dung lên giữa */
    .related-box { order: 5; width: 100%; margin-bottom: 20px; } /* Đẩy SP Liên quan xuống đáy */

    .content-body { padding: 15px; } /* Thu nhỏ padding trên Mobile */
    
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .contact-form-inline { flex-direction: column; align-items: center; }
    .contact-form-inline input, .btn-submit-contact { max-width: 100%; }
    .mobile-col { flex-direction: column; gap: 15px; text-align: center; }
}