﻿/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box !important;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: #f5f7fb;
    overflow-x: hidden;
    color: #333;
}

/* =========================
   HEADER
========================= */

#site-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 10px 0;
}

.navbar-brand img {
    max-width: 80px;
    height: auto;
}

.navbar-nav .nav-link {
    color: #003366 !important;
    font-weight: 600;
    padding: 12px 16px !important;
    transition: 0.3s;
}

    .navbar-nav .nav-link:hover {
        color: #0d6efd !important;
    }

.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.dropdown-item {
    padding: 10px 18px;
}

    .dropdown-item:hover {
        background: #f1f5ff;
        color: #0d6efd;
    }

/* =========================
   MOBILE MENU
========================= */

.navbar-toggler {
    border: none;
}

    .navbar-toggler:focus {
        box-shadow: none;
    }

@media(max-width:991px) {
    .navbar-collapse {
        background: #fff;
        padding: 15px;
        border-radius: 12px;
        margin-top: 10px;
    }

    .navbar-nav .nav-link {
        border-bottom: 1px solid #eee;
    }
}

/* =========================
   BANNER
========================= */

.banner {
    margin-top: 110px;
}

.carousel-item img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 12px;
}

@media(max-width:768px) {
    .carousel-item img {
        height: 220px;
        border-radius: 0;
    }
}

/* =========================
   MAIN CONTENT
========================= */

.main-content {
    padding: 40px 0;
}

.content-box {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

    .content-box img {
        max-width: 100%;
        height: auto;
    }

/* =========================
   SIDEBAR
========================= */

.left-sidebar {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
}

    .left-sidebar h2 {
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 20px;
        color: #0d6efd;
        border-left: 5px solid #0d6efd;
        padding-left: 10px;
    }

    .left-sidebar img {
        width: 100%;
        height: auto;
        border-radius: 10px;
    }

/* =========================
   NEWS LIST
========================= */

.brands-name ul {
    padding-left: 0;
}

.brands-name li {
    list-style: none;
    margin-bottom: 10px;
}

    .brands-name li a {
        display: block;
        padding: 10px;
        border-radius: 10px;
        background: #f5f7fb;
        color: #333;
        transition: 0.3s;
        text-decoration: none;
    }

        .brands-name li a:hover {
            background: #0d6efd;
            color: #fff;
        }

/* =========================
   FOOTER
========================= */

.w3l-footers-20 {
    background: #003366;
    color: #fff;
    padding: 50px 0 20px;
    margin-top: 50px;
}

    .w3l-footers-20 a {
        color: #fff;
        text-decoration: none;
    }

    .w3l-footers-20 iframe {
        width: 100%;
        border-radius: 12px;
    }

/* =========================
   RESPONSIVE GRID
========================= */

@media(max-width:991px) {
    .col-sm-9,
    .col-sm-3 {
        width: 100%;
    }

    .left-sidebar {
        margin-top: 30px;
    }
}

@media(max-width:768px) {
    body {
        font-size: 15px;
    }

    .navbar-brand img {
        max-width: 60px;
    }

    .content-box {
        padding: 15px;
    }
}

/* =========================
   FIX IMAGE & TABLE GLOBAL
========================= */

img {
    max-width: 100%;
    height: auto;
}

table {
    width: 100% !important;
    display: block;
    overflow-x: auto;
}

/* =========================
   FIX ASP.NET & BOOTSTRAP DATALIST GRID HORIZONTAL
========================= */

asp\\:Image,
asp\\:DataList {
    width: 100%;
}

/* Triệt tiêu thẻ span bọc mặc định của ASP.NET làm lỗi dàn ngang */
.WebGridHorizontal > span {
    display: contents !important;
}

/* Ép các ô nội dung bên trong hàng ngang có chiều cao bằng nhau, thẳng hàng chân */
.WebGridHorizontal .col-sm-4 {
    display: flex !important;
    flex-direction: column;
    margin-bottom: 30px;
}

.WebGridHorizontal .productinfo {
    display: flex !important;
    flex-direction: column;
    height: 100% !important;
    width: 100% !important;
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 8px;
    overflow: hidden;
}

.WebGridHorizontal .blog-info {
    display: flex !important;
    flex-direction: column;
    height: 100% !important;
    width: 100% !important;
}

/* SỬA LỖI KÍCH THƯỚC ẢNH: Tự động co giãn 100% ô chứa và cắt cúp thông minh chống méo hình */
.WebGridHorizontal .img-fluid,
img.custom-news-img {
    width: 100% !important;
    height: 230px !important; /* Chiều cao chuẩn hiển thị rất đẹp */
    max-height: 230px !important;
    min-height: 230px !important;
    object-fit: cover !important; /* Giữ đúng tỷ lệ ảnh gốc, tự động cắt viền thừa giống Facebook */
    object-position: center !important; /* Lấy tâm điểm bức ảnh ở giữa */
    display: block !important;
}

/* Khung chứa hiệu ứng nếu có */
.box16 {
    width: 100% !important;
    height: 230px !important;
    overflow: hidden !important;
    position: relative;
}

/* Căn chỉnh lại khoảng cách chữ tiêu đề bên dưới ảnh */
.box-content {
    padding: 15px !important;
    flex-grow: 1; /* Tự động đẩy phần nội dung chữ chiếm trọn không gian còn lại để bằng hàng */
    display: flex;
    align-items: center;
    justify-content: center;
}

    .box-content h4 {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.4;
        margin: 0;
    }

/* ======================
CARD TIN TỨC (Dùng riêng)
====================== */

.news-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: 0.3s;
    height: 100%;
}

    .news-card:hover {
        transform: translateY(-5px);
    }

    .news-card img {
        width: 100%;
        height: 220px;
        object-fit: cover;
    }

.news-content {
    padding: 15px;
}

.news-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.5;
}

    .news-title a {
        text-decoration: none;
        color: #003366;
    }

        .news-title a:hover {
            color: #0d6efd;
        }

/* SECTION */

.main-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

    .section-title h2 {
        font-size: 40px;
        font-weight: 700;
        color: #003366;
    }

/* MOBILE RESPONSIVE TIN TỨC */

@media(max-width:768px) {
    .section-title h2 {
        font-size: 28px;
    }

    .news-card img,
    .WebGridHorizontal .img-fluid,
    img.custom-news-img,
    .box16 {
        height: 180px !important;
        max-height: 180px !important;
        min-height: 180px !important;
    }
}
/* ==========================================================================
   CẤU HÌNH KHUNG VÀ CHỐNG MÉO ẢNH CHO TIN TỨC (DÙNG CHO BOOTSTRAP 5)
   ========================================================================== */

/* Ép thẻ span ẩn của ASP.NET không làm vỡ hàng ngang */
/* ==========================================================================
   MÃ LỆNH ÉP THẲNG HÀNG NGANG VÀ CHỐNG MÉO ẢNH TIN TỨC CHUẨN 100%
   ========================================================================== */

/* Ép thẻ span ẩn tự động sinh ra của ASP.NET không làm vỡ cấu trúc Grid */
.w3-news-grid-row > span {
    display: contents !important;
}

/* Đảm bảo các khối cột có thuộc tính Flexbox để tự động bằng chiều cao với nhau */
.w3-news-grid-row .col-md-4 {
    display: flex !important;
    flex-direction: column !important;
}

/* Định dạng cấu trúc Card Tin Tức */
.news-item-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important; /* Ép tất cả các ô cao bằng nhau */
    background: #ffffff !important;
    border: 1px solid #eef2f6 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease;
}

    .news-item-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.1) !important;
    }

.news-item-link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    text-decoration: none !important;
}

/* KHUNG CHỨA ẢNH - ÉP CỐ ĐỊNH CHIỀU CAO KHUNG */
.news-item-box-img {
    width: 100% !important;
    height: 220px !important; /* Chiều cao hiển thị ảnh rất đẹp trên máy tính */
    overflow: hidden !important;
    position: relative !important;
    background-color: #f0f0f0;
}

/* THẺ ẢNH - CHỐNG BỊ BÓP MÉO HÌNH, TỰ ĐỘNG CẮT KHUNG ĐỀU NHAU TĂM TẮP */
img.news-img-thumb {
    width: 100% !important;
    height: 100% !important;
    max-height: 220px !important;
    min-height: 220px !important;
    object-fit: cover !important; /* Thuộc tính cốt lõi: Giữ nguyên tỷ lệ ảnh, tự động cắt cúp giống Facebook */
    object-position: center !important; /* Lấy tâm ảnh làm trung tâm */
    display: block !important;
}

/* KHU VỰC CHỮ TIÊU ĐỀ NẰM DƯỚI ẢNH */
.news-item-body {
    padding: 15px !important;
    flex-grow: 1 !important; /* Tự động kéo giãn vùng chữ để chân các ô luôn bằng nhau */
    display: flex !important;
    align-items: center !important; /* Căn chữ giữa theo chiều dọc */
    justify-content: center !important; /* Căn chữ giữa theo chiều ngang */
    background: #ffffff !important;
}

.news-item-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    color: #003366 !important;
    margin: 0 !important;
    text-align: center !important;
}

/* ĐÁP ỨNG GIAO DIỆN TRÊN ĐIỆN THOẠI DI ĐỘNG */
@media(max-width:768px) {
    .news-item-box-img,
    img.news-img-thumb {
        height: 160px !important;
        max-height: 160px !important;
        min-height: 160px !important;
    }

    .news-item-title {
        font-size: 14px !important;
    }

}