* {
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --bg-color: #c0c0c0;
  --text-color: #1e293b;
  --w-main: 880px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
}

/* --- HEADER & MENU SYSTEM --- */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.header-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 60px;
    padding: 0 15px;
}

/* PC Navigation */
.nav-pc { display: flex; list-style: none; margin: 0; padding: 0; gap: 25px; align-items: center; }
.nav-pc li a { 
    text-decoration: none; 
    color: #475569; 
    font-weight: 550; 
    font-size: 15px; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    transition: color 0.2s;
}
.nav-pc li a:hover { color: var(--primary-color); }

/* Mobile Navigation */
.nav-mobile { display: none; width: 100%; justify-content: space-between; align-items: center; }
.nav-mobile .nav-btn { background: none; border: none; padding: 8px; cursor: pointer; color: #334155; display: flex; align-items: center; }
.mobile-search-trigger { font-weight: 700; font-size: 14px; color: var(--primary-color) !important; flex: 1; justify-content: center; }

/* Mobile Drawer */
.mobile-drawer {
    display: none;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    list-style: none;
    padding: 0;
    margin: 0;
    /* Loại bỏ absolute để đẩy nội dung xuống */
    position: relative;
    max-height: 45vh; /* Giảm thêm một chút chiều cao tối đa */
    overflow-y: auto;
}
.mobile-drawer li a { display: block; padding: 10px 15px; text-decoration: none; color: #1e293b; border-bottom: 1px solid #f1f5f9; font-weight: 500; font-size: 14px; }
.mobile-drawer.active { display: block; }

/* Utility classes for Search Toggle */
#search-wrapper-mobile { transition: max-height 0.3s ease-out; overflow: hidden; }

.btn-close-search {
    display: none; /* Mặc định ẩn trên PC */
    width: 100%;
    background: #f8fafc;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Chặn cuộn trang khi mở menu */
.no-scroll { overflow: hidden; }

@media (max-width: 768px) {
    .nav-pc { display: none; }
    .nav-mobile { display: flex; }
    .btn-close-search { display: flex; }
    .header-container { height: 54px; width: 100%; } /* Reset width 100% trên Mobile */
    .nav-mobile .nav-btn { padding: 5px; } /* Thu nhỏ các nút bấm */
    .mobile-search-trigger { font-size: 13px; }
    .search-hidden-mobile { display: none !important; }
    .site-header { height: auto; }
    .search { padding: 0; margin-top: 0; } 
    .search-form { border-top: 1px solid #f1f5f9; }
}

/* --- H1 DYNAMIC SECTION --- */
.h1-container {
    max-width: var(--w-main);
    margin: 20px auto 0;
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.h1-container h1 {
    font-size: 20px;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
    line-height: 1.4;
}

/* Đảm bảo H1 khi nằm trong KB Container vẫn giữ style chuẩn */
.kb-container h1 {
    font-size: 20px;
    color: var(--text-color);
    margin: 0 0 20px;
    font-weight: 600;
    line-height: 1.4;
}

/* --- BREADCRUMB SYSTEM --- */
.breadcrumb {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
}
.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover {
    color: #1d4ed8;
}

/* --- KNOWLEDGE BASE (KB) CONTAINER --- */
.kb-container {
    max-width: var(--w-main);
    margin: 20px auto 0; /* Reset lề dưới về 0 để đồng bộ với Footer */
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.kb-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.kb-item {
    border-bottom: 1px dashed #f1f5f9;
    padding-bottom: 20px;
}
.kb-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.kb-item h2 {
    margin: 0 0 10px;
    font-size: 20px;
}
.kb-item h2 a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s ease;
}
.kb-item h2 a:hover {
    color: #1d4ed8;
}
.kb-item p {
    color: #475569;
    line-height: 1.6;
    margin: 0 0 12px;
    font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search{
    width: 100%;
    padding: 0;
    margin-top: 20px;
}

.search-form {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  max-width: var(--w-main);
  margin: 0 auto;
}

/* Sử dụng Grid để chia 3 cột cố định */
.search-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 20px;
  align-items: end; /* Căn lề dưới cho các ô đều nhau */
}

/* Sử dụng Flexbox cho từng nhóm label/select */
.search-form .field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-color);
}

.search-form .field-group select {
  padding: 10px 12px;
  border: 1px solid #888;
  border-radius: 8px;
  font-size: 15px;
  width: 100%;
}

/* Flexbox cho nhóm button để căn chỉnh linh hoạt */
.search-form .button-actions {
  display: flex;
  gap: 12px;
}

.search-form select, .search-form button {
  height: 42px; 
}

.button-actions button {
  flex: 1; /* Hai nút chia đều không gian trong ô cuối */
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.search-form .btn-submit { background: var(--primary-color); color: white; }
.search-form .btn-submit:hover { background: #1d4ed8; }
.search-form .btn-reset { background: #e2e8f0; color: var(--text-color); }

.products{
  width: 100%;
  background-color: var(--bg-color);
  padding: 0; /* Reset padding để margin của product tự xử lý */
}

.no-results {
  max-width: var(--w-main);
  margin: 20px auto 0;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  padding: 25px 30px;
  border-radius: 12px;
}

.no-results .title {
  color: #555;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 550;
}

.no-results .suggestions {
  color: #333;
  font-size: 17px;
  line-height: 1.6;
}

.no-results .note {
  color: #282525;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 500;
  padding-left: 15px;
}

.no-results .link-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

.no-results .link-item{
  display:flex;
  flex-direction: column;
}

.no-results a, .no-results p {
  color: var(--primary-color);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 500;
  text-decoration: none;
}

.no-results a.province-link {
  font-size: 17px;
  font-weight: 550;
}

.product{
  max-width: var(--w-main);
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: 1fr 1.9fr;
  background-color: #fff;
  border-radius: 12px;
}

.products a{
  text-decoration: none;
}

.product .product-image {
  height: 230px;
  padding: 1px;
}

.product img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px 0 0 12px;
}

.product .product-content{
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}

.product .product-content .title {
  color: var(--primary-color);
  font-size: 18px;
  font-weight: 550;
  margin: 10px 0 10px;
}

.product .product-content .price {
  color: #222;
  font-size: 16px;
  line-height: 1.6;
}

.product .product-content .location {
  color: #222;
  font-size: 16px;
  line-height: 1.6;
}

.product .product-content .description {
  overflow: hidden;
  white-space: pre-line;
  text-overflow: ellipsis;
  color: #333;
  font-size: 15px;
  line-height: 1.6;
  padding: 8px 0;
}

footer {
  margin-top: 20px; /* Đồng bộ khoảng cách 20px với các khối phía trên */
  padding: 40px 0;
  background-color: #fff;
  color: #555;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  max-width: 1080px; /* Căn thẳng hàng tuyệt đối với nội dung chính (880px) */
  margin: 0 auto;
}

.footer-item {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.footer-item .title {
  color: #111;
  font-size: 16px;
  line-height: 1.8;
}

.footer-text {
  white-space: pre-line;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

footer a{
  color: var(--primary-color);
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.8;
  transition: color 0.2s;
}

footer a:hover {
  color: #1d4ed8;
}

/* --- PAGINATION SYSTEM --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px auto 0; /* Đồng bộ lề trên 20px */
    max-width: var(--w-main);
}
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}
.pagination a:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pagination .active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* --- PHẦN BỔ SUNG MỚI --- */
.news-contextual {
  max-width: var(--w-main);
  margin: 20px auto 0; /* Reset lề dưới để không cộng dồn với Footer */
  background: #fff;
  padding: 20px 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.news-contextual .title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-list-inline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-link {
    font-size: 15px;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    border-bottom: 1px dashed #f1f5f9;
    padding-bottom: 8px;
}

.news-link:last-child { border-bottom: none; padding-bottom: 0; }
.news-link:hover { color: #1d4ed8; }

.news-view-more {
    font-weight: bold;
    margin-top: 5px;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 14px;
    display: block;
    transition: color 0.2s;
}
.news-view-more:hover { color: #1d4ed8; }

.faq-page-container { 
    max-width: var(--w-main); 
    margin: 20px auto; 
    background: #fff; 
    padding: 24px; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.faq-page-container h1 {
    font-size: 20px;
    color: var(--primary-color);
    margin: 0 0 24px;
    font-weight: 600;
}

.faq-item {
    margin-bottom: 24px;
    border-bottom: 1px dashed #f1f5f9;
    padding-bottom: 20px;
}
.faq-item:last-of-type { border-bottom: none; margin-bottom: 0; }

.faq-item h2.faq-question { font-size: 17px; color: #1e293b; margin: 0 0 10px; line-height: 1.4; font-weight: 600; }

.faq-item .answer { line-height: 1.6; color: #475569; font-size: 15px; }

/* Nút quay lại đặc thù cho trang nội dung */
.back-link { margin-top: 24px; padding-top: 16px; border-top: 1px solid #f1f5f9; }

/* --- PRODUCT DETAIL PAGE --- */
.detail-container { 
  max-width: var(--w-main); 
  margin: 20px auto; 
  background: #fff; 
  border-radius: 12px; 
}

.detail-container .breadcrumb-nav{
    padding: 15px;
}

.detail-container .breadcrumb-nav a{
    font-size: 16px;
    line-height: 1.6;
    text-decoration: none; 
    color: var(--primary-color);
}

.detail-text-all{
    padding: 0 30px 40px 30px;
}

.info-box { 
    border-top: 1px solid #c0c0c0; 
    border-bottom: 1px solid #c0c0c0; 
}

.info-box h1 { 
    color: var(--primary-color); 
    font-size: 24px; 
}

.meta { 
    font-weight: bold; 
    font-size: 18px; 
    color: #e11d48; 
}

.detail-container .content-body{
    padding: 0;
    white-space: pre-line;
    text-overflow: ellipsis;
    line-height: 1.6;
}

.detail-container .content-body a{
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

/* --- PRODUCT DETAIL SLIDER --- */
.slider-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f1f5f9;
}

.slider-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.slider-container::-webkit-scrollbar { display: none; } /* Ẩn scrollbar */

.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slide img {
  width: 100%;
  height: 450px; /* Chiều cao cố định cho PC */
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.slider-btn {
  padding: 15px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.3);
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  font-size: 18px;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
}
.slider-btn:hover { background: rgba(0,0,0,0.6); }
.slider-btn.prev { left: 15px; }
.slider-btn.next { right: 15px; }

.slider-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
.dot { 
  width: 8px; 
  height: 8px; 
  background: rgba(255,255,255,0.4); 
  border-radius: 50%; 
  cursor: pointer;
  transition: all 0.3s ease;
}
.dot.active { 
  background: #fff; 
  width: 20px; /* Tạo hiệu ứng thanh dài hiện đại */
  border-radius: 10px;
}

/* --- THUMBNAILS (PC) --- */
.slider-thumbnails {
  display: none; /* Ẩn mặc định */
  gap: 10px;
  padding: 15px;
  justify-content: center;
  background: #fff;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}

.thumb-item {
  width: 70px;
  height: 50px;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: 0.2s;
  opacity: 0.6;
}
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-item.active { border-color: var(--primary-color); opacity: 1; }

/* --- FIXED CTA BUTTONS (ZALO & CALL) --- */
.fixed-cta {
  position: fixed;
  bottom: 30px;
  right: 10px; /* Sát viền hơn */
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Nút Zalo sát về phía bên phải */
  gap: 15px;
  z-index: 1000;
}

.cta-button {
  height: 42px; /* Kích thước nhỏ gọn */
  padding: 0 12px;
  border-radius: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.cta-zalo { background-color: #0068ff; }
.cta-call { background-color: #2e7d32; }

/* Nút Zalo nếu chỉ muốn icon tròn thì giữ width/height bằng nhau */
.cta-zalo {
  width: 42px; /* Đồng bộ nhỏ gọn */
  padding: 0;
  border-radius: 50%;
}

.cta-zalo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.cta-button svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.cta-button span {
  margin-left: 8px;
  white-space: nowrap;
}

@media (max-width: 768px) {

    .h1-container {
        margin: 0;
        border-radius: 0;
        padding: 12px 20px;
        border-bottom: 1px solid #e2e8f0;
    }

    .h1-container h1 {
        font-size: 18px;
    }

    .pagination {
        margin: 20px auto 10px;
    }

    .product {
        margin-top: 10px;
    }

    .news-contextual {
        margin: 0;
        border-radius: 0;
        padding: 15px 20px;
        border-top: 10px solid var(--bg-color); 
        border-bottom: 1px solid #e2e8f0;
    }

    .kb-container {
        margin: 0;
        border-radius: 0;
        padding: 20px;
        border-top: 10px solid var(--bg-color);
        border-bottom: 1px solid #e2e8f0;
    }
    .faq-page-container {
        margin: 0;
        border-radius: 0;
        padding: 20px;
        border-top: 10px solid var(--bg-color);
        border-bottom: 1px solid #e2e8f0;
    }
    .faq-page-container h1 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    .faq-item h3 { font-size: 16px; }
    .faq-item .answer { font-size: 14.5px; line-height: 1.6; }
    
    .kb-item h2 { font-size: 18px; }
    
    .kb-container h1 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .search-form {
      border-radius: 0;
    }
    .search-grid {
        grid-template-columns: 1fr; /* Chuyển về 1 cột trên điện thoại */
    }

    .no-results {
      border-radius: 0;
    }

    .no-results .link-container {
      grid-template-columns: 1fr;
    }

    .product {
      grid-template-columns: 1fr; /* Chuyển về 1 cột trên điện thoại */
      border-radius: 0;
    }

    .product .product-image {
      padding: 0;
    }

    .product img{
      border-radius: 0;
    }

    .product .product-content{
      padding: 0 20px 10px 20px;
    }

    footer {
      padding: 30px 20px;
    }

    .footer-grid {
      grid-template-columns: 1fr;
    }
    
    .detail-container { 
      border-radius: 0; 
    }
    
    .detail-text-all{
        padding: 0 20px 30px 20px;
    }
    
    .info-box { 
        border-top: none; 
        border-bottom: 1px solid #c0c0c0; 
    }
    
    .info-box h1 { 
        font-size: 22px; 
    }
    
    .slide img {
      height: 300px; /* Chiều cao cố định cho PC */
    }

    .slider-btn, .slider-thumbnails { display: none !important; } /* Mobile: Ẩn nút và ảnh nhỏ */
    .slider-dots { display: flex !important; } /* Mobile: Hiện dấu chấm */
}

@media (min-width: 769px) {
    .slider-dots { display: none !important; } /* PC: Ẩn dấu chấm */
    .slider-thumbnails { display: flex; } /* PC: Hiện ảnh nhỏ */
}
