/* === RESET & BIẾN MẶC ĐỊNH === */
:root {
    --primary-color: #546ce8; /* #546ce8, #0088ccMàu xanh chủ đạo */
    --text-white: #ffffff;
    --text-dark: #333333;
    --border-color: #e0e0e0;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Roboto', Arial, Helvetica, sans-serif;}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* === HEADER TOP === */
.header {
    background-color: var(--primary-color);
    color: var(--text-white);
    position: relative;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    gap: 20px;
}

/* Logo */
.site-logo {
    flex-shrink: 0;
    line-height: 1;
}

.site-logo__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    transition: opacity 0.2s ease;
}

.site-logo__link:hover {
    opacity: 0.92;
}

.site-logo__img {
    display: block;
    width: auto;
    object-fit: contain;
    object-position: left center;
}

.site-logo__fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    font-size: 20px;
}

.site-logo__text {
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

/* Header logo */
.site-logo--header .site-logo__link {
    min-height: 48px;
}

.site-logo--header .site-logo__img {
    height: 48px;
    max-width: 200px;
    padding: 4px 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.site-logo--header .site-logo__fallback {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.site-logo--header .site-logo__text {
    font-size: 20px;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Legacy alias */
.logo { font-size: 24px; font-weight: bold; font-family: 'Arial Black', sans-serif; white-space: nowrap; }

/* Thanh tìm kiếm */
.search-box {
    flex-grow: 1;
    max-width: 500px;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border-radius: 4px;
    border: none;
    outline: none;
    font-size: 14px;
}
.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

/* Header Right (Giỏ hàng & Links) */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--text-white);
    padding: 8px 15px;
    border-radius: 4px;
    position: relative;
    transition: background 0.3s;
}
.cart-btn:hover { background: rgba(255,255,255,0.1); }
.cart-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: red;
    color: white;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.top-links {
    display: flex;
    gap: 15px;
    font-size: 14px;
}
.top-links a { position: relative; }
.top-links a:not(:last-child)::after {
    content: "|";
    position: absolute;
    right: -10px;
    color: rgba(255,255,255,0.5);
}
.display-mobile{
    display: none;
}
/* === MENU CHÍNH (NAVIGATION) === */
.main-nav {
    border-top: 1px solid rgba(255,255,255,0.2);
    background-color: var(--primary-color);
    position: relative;
}
.nav-list {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
.nav-list > li { position: relative; flex-shrink: 0; }
.nav-list > li.has-mega { position: static; }
.nav-list > li > a {
    display: block;
    padding: 12px 10px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    transition: background 0.3s;
}
.nav-list > li.has-mega
.nav-list > li > a:hover { background: rgba(255,255,255,0.1); }

/* === MEGA MENU (Hiển thị khi hover) === */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    background-color: var(--text-white);
    color: var(--text-dark);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 20px 15px;
    display: flex;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
    border-bottom: 3px solid var(--primary-color);
    box-sizing: border-box;
}
/**/
/* === LAYOUT CHUNG === */
body { background-color: #f4f4f4; } /* Nền xám nhạt để nổi bật các khối màu trắng */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* === CSS CHO SLICK SLIDER === */
.main-slider {
position: relative;
border-radius: 4px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
/* Ẩn overflow để ảnh bo góc đẹp, không bị lồi ra ngoài */
overflow: hidden; 
}

.main-slider .slide img {
width: 100%;
display: block;
object-fit: cover;
max-height: 350px; /* Giới hạn chiều cao */
}

/* Nút Next/Prev tùy chỉnh */
.slider-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.4);
color: white;
border: none;
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
font-size: 18px;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.3s ease, transform 0.2s;
opacity: 0; /* Ẩn mặc định, hover mới hiện */
}

.main-slider:hover .slider-btn {
opacity: 1;
}

.slider-btn:hover {
background: var(--primary-color, #0088cc);
transform: translateY(-50%) scale(1.1);
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

/* Ẩn outline xấu xí khi click vào slick */
.slick-slide:focus, .slick-slide a { outline: none; }

/* Responsive cho mobile */
@media (max-width: 768px) {
.main-slider .slide img { max-height: 200px; }
.slider-btn { width: 30px; height: 30px; font-size: 14px; opacity: 1; }
}

/* Responsive cho banner trên mobile */
@media (max-width: 768px) {
.slide img { max-height: 200px; }
.slider-btn { width: 30px; height: 30px; font-size: 14px; opacity: 1; } /* Mobile thì luôn hiện nút */
}

/* === BLOCK 2: DANH MỤC NỔI BẬT === */
.box-white {
background: #ffffff;
border-radius: 4px;
padding: 20px;
}
.featured-category-box {
    overflow: visible;
}
.box-title {
font-size: 18px;
color: #333;
margin-bottom: 20px;
text-transform: uppercase;
}
.category-list {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.category-list .category-item {
    flex: 1;
    min-width: 0;
}
.category-slider {
    position: relative;
}
.category-slider.slick-initialized {
    display: block;
    margin: 0 -5px;
}
.category-slider .slick-slide {
    padding: 0 5px;
}
.category-slider .slider-btn {
    display: none;
}
@media (max-width: 991px) {
    .featured-category-box {
        padding-left: 28px;
        padding-right: 28px;
    }
    .category-slider .slider-btn {
        display: flex;
        position: absolute;
        top: 35%;
        transform: translateY(-50%);
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.95);
        color: var(--primary-color, #0088cc);
        border: 1px solid #e0e0e0;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        font-size: 16px;
        cursor: pointer;
        z-index: 10;
        opacity: 1;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    .category-slider .slider-btn:hover {
        background: var(--primary-color, #0088cc);
        color: #fff;
        border-color: var(--primary-color, #0088cc);
    }
    .category-slider .prev-btn { left: -8px; }
    .category-slider .next-btn { right: -8px; }
}
.category-item {
display: flex;
flex-direction: column;
align-items: center;
min-width: 100px;
text-align: center;
}
.category-item img {
width: 70px;
height: 70px;
object-fit: contain;
border: 1px solid #eee;
border-radius: 4px;
padding: 5px;
margin-bottom: 10px;
transition: border-color 0.3s;
}
.category-item:hover img { border-color: var(--primary-color, #0088cc); }
.category-item span {
font-size: 14px;
color: #333;
/*white-space: nowrap;*/
}

/* === BLOCK 3: SẢN PHẨM (TIVI GIÁ RẺ) === */
.section-title {
font-size: 18px;
text-transform: uppercase;
margin-bottom: 15px;
}
.section-title a {
color: #333;
transition: color 0.3s;
}
.section-title a:hover { color: var(--primary-color, #0088cc); }

.product-grid {
display: grid;
grid-template-columns: repeat(5, 1fr); /* 5 cột trên PC */
background: #fff;
border-top: 1px solid #efefef;
border-left: 1px solid #efefef;
}
.product-card {
padding: 15px;
background: #fff;
border-right: 1px solid #efefef;
border-bottom: 1px solid #efefef;
transition: box-shadow 0.3s ease;
position: relative;
}
.product-card:hover {
box-shadow: 0 0 15px rgba(0,0,0,0.15);
z-index: 10; /* Nổi lên trên các viền cạnh nhau */
}
.product-img {
text-align: center;
margin-bottom: 15px;
}
.product-img img {
max-width: 100%;
height: auto;
object-fit: contain;
}
.product-name {
font-size: 14px;
font-weight: 500;
line-height: 1.4;
margin-bottom: 10px;
display: -webkit-box;
-webkit-line-clamp: 2; /* Cắt chữ nếu dài quá 2 dòng */
-webkit-box-orient: vertical;
overflow: hidden;
}
.product-name a { color: #333; }
.product-name a:hover { color: var(--primary-color, #0088cc); }

.product-tags {
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-bottom: 10px;
}
.product-tags span {
background: #f1f1f1;
color: #666;
font-size: 11px;
padding: 3px 6px;
border-radius: 2px;
}

.product-price .current {
display: block;
color: #d70018; /* Màu đỏ nổi bật cho giá */
font-size: 16px;
font-weight: bold;
}
.product-price .old-price-group {
display: flex;
align-items: center;
gap: 8px;
margin-top: 5px;
}
.product-price .old {
text-decoration: line-through;
color: #999;
font-size: 13px;
}
.product-price .discount {
color: #d70018;
font-size: 13px;
}
/* === TRANG DANH MỤC === */
.breadcrumb { font-size: 14px; margin-top: 15px; color: #666; }
.breadcrumb a { color: #666; }
.breadcrumb a:hover { color: var(--primary-color); }

.category-banners {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}
.category-banners img {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 4px;
}

.category-title {
    color: #004d99; /* Xanh đậm giống mẫu */
    font-size: 26px;
    margin: 20px 0 10px;
}

.sub-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}
.sub-brands a {
    color: #333;
    font-size: 14px;
    transition: color 0.2s;
}
.sub-brands a:hover { color: var(--primary-color); }

.category-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
    padding: 15px 0;
    margin-bottom: 20px;
}
.product-count { font-size: 15px; color: #333; }
.toolbar-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}
.btn-filter {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-filter i { color: var(--primary-color); }
.btn-filter:hover { border-color: var(--primary-color); color: var(--primary-color); }

.sort-select {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    min-width: 150px;
}

/* === MODAL BỘ LỌC TÌM KIẾM === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
body.modal-open { overflow: hidden; }
.modal-content {
    background: #fff;
    width: 900px; /* Độ rộng popup PC */
    max-width: 95%;
    padding: 30px;
    border-radius: 4px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* Nút Close góc ngoài */
.modal-close {
    position: absolute;
    top: -30px; right: 0;
    background: none; border: none;
    color: #fff; font-size: 24px;
    cursor: pointer;
}

.modal-title {
    color: #004d99;
    font-size: 18px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.filter-group {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.filter-group-title {
    font-size: 15px;
    color: #333;
    margin-bottom: 15px;
}
.filter-options.grid-6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

/* Tùy chỉnh Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
}
.checkbox-container input[type="checkbox"] {
    width: 16px; height: 16px;
    cursor: pointer;
}
.filter-link {
    display: block;
    padding: 6px 0;
    font-size: 14px;
    color: #555;
    transition: color 0.2s, padding-left 0.2s;
}
.filter-link:hover,
.filter-link.is-active {
    color: var(--primary-color, #0088cc);
    padding-left: 4px;
}
.filter-link.is-active {
    font-weight: 600;
}

/* Footer Modal: Các nút bấm */
.modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}
.btn-clear-filter, .btn-submit-filter {
    padding: 10px 30px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-clear-filter {
    background: #fff;
    color: #d70018;
    border: 1px solid #d70018;
}
.btn-clear-filter:hover { background: #fff0f0; }
.btn-submit-filter {
    background: #2a81ce;
    color: #fff;
    border: 1px solid #2a81ce;
}
.btn-submit-filter:hover { background: #1f65a3; }

/* === LAYOUT TRANG CHI TIẾT === */
.detail-title {
    font-size: 24px;
    color: #004d99;
    margin: 15px 0 20px;
    line-height: 1.3;
}

.detail-layout {
    display: grid;
    grid-template-columns: 65% 33%; /* Tỷ lệ Cột trái / Cột phải */
    gap: 2%;
}

/* === GALLERY ẢNH (SLICK) === */
.product-gallery {
    background: #fff;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}
.slider-for img {
    width: 100%;
    height: auto;
    object-fit: contain;
}
.slider-nav .slick-slide {
    margin: 0 5px;
    cursor: pointer;
    border: 1px solid #ddd;
    opacity: 0.6;
    transition: all 0.3s;
}
.slider-nav .slick-current {
    border-color: var(--primary-color);
    opacity: 1;
}
.slider-nav img {
    width: 100%;
    height: 70px;
    object-fit: contain;
}

/* === BÀI VIẾT MÔ TẢ (CÓ NÚT XEM THÊM) === */
.product-article-box {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #eee;
}
.article-collapse {
    position: relative;
}
.article-content {
    max-height: 400px;
    overflow: hidden;
    color: #444;
    font-size: 15px;
    line-height: 1.6;
}
.article-content.expanded {
    max-height: none;
}
.article-content h3 { font-size: 18px; margin: 15px 0 10px; color: #333; }
.article-content p { margin-bottom: 15px; }
.article-content img { max-width: 100%; height: auto; display: block; margin: 15px auto; }

.read-more-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 72px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    z-index: 1;
}
.product-article-box.is-expanded .read-more-gradient { display: none; }
.product-article-box:not(.is-overflowing) .read-more-gradient,
.product-article-box:not(.is-overflowing) .btn-read-more {
    display: none;
}

.btn-read-more {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 15px;
    cursor: pointer;
    padding: 10px 0 0;
    margin-top: 10px;
    font-weight: 500;
    position: relative;
    z-index: 2;
    transform: none !important;
}
.btn-read-more:hover { color: #0056b3; }
.btn-read-more-icon {
    display: inline-block;
    margin-left: 6px;
    transition: transform 0.2s ease;
}
.btn-read-more.is-expanded .btn-read-more-icon {
    transform: rotate(180deg);
}

/* === ĐÁNH GIÁ SẢN PHẨM === */
.review-section {
    background: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
}
.review-section h3 { font-size: 16px; margin-bottom: 15px; }
.star-rating { display: flex; gap: 15px; color: #f39c12; font-size: 14px; cursor: pointer; }
.review-form textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    outline: none;
}
.review-inputs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.review-inputs input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}
.btn-submit-review {
    background: #ff7f50;
    color: #fff;
    border: none;
    padding: 0 30px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* === CỘT PHẢI: GIÁ & MUA HÀNG === */
.price-box {
    margin-bottom: 15px;
}
.price-box .label { font-size: 18px; color: #d70018; font-weight: bold; }
.price-display-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}
.region-price-selector {
    margin-bottom: 12px;
}
.region-price-selector label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}
.region-price-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
}
.stock-region-label {
    color: #666;
    font-size: 14px;
    font-weight: 600;
}
.current-price { font-size: 26px; color: #d70018; font-weight: bold; }
.old-price{text-decoration-line: line-through; color: rgb(139 138 138);font-size: 1.1em;}
.discount-badge{color: rgb(251 109 46 );font-size: 1.1em;}
.policy-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}
.policy-box ul li {
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.policy-box ul li:last-child { margin-bottom: 0; }
.policy-box ul li i { color: var(--primary-color); margin-top: 3px; }
.policy-box ul li a { color: var(--primary-color); text-decoration: underline; }

.stock-status {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.btn-add-cart, .btn-buy-now {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size:14px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}
.btn-add-cart { background: #0088cc; }
.btn-buy-now { background: #ff5722; }
.btn-add-cart:hover, .btn-buy-now:hover { opacity: 0.9; }

.hotline-box {
    font-size: 14px;
    color: #333;
    margin-bottom: 20px;
}
.hotline-box strong { color: #d70018; font-size: 16px; }

/* === BẢNG THÔNG SỐ KỸ THUẬT === */
.specs-box {
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fff;
    padding: 15px;
}
.specs-title { font-size: 16px; margin-bottom: 15px; color: #333; }
.specs-table-wrapper {
    max-height: 250px;
    overflow: hidden;
}
.specs-table-wrapper.expanded { max-height: none; }
.table-specs { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-specs td {
    padding: 10px;
    border-bottom: 1px solid #f1f1f1;
}
.table-specs tr:nth-child(odd) { background-color: #f9f9f9; }
.table-specs td:first-child { width: 45%; color: #666; }
.table-specs td:last-child { font-weight: 500; color: #333; }

/* --- FIX HIỂN THỊ NÚT NEXT/PREV CỦA SLICK --- */
/* --- FIX HIỂN THỊ NÚT NEXT/PREV CỦA SLICK --- */
.slider-for { position: relative; }

.slider-for .slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent; /* Nền trong suốt theo ảnh mẫu */
    color: #3b82f6; /* Màu xanh nước biển sáng */
    border: none;
    cursor: pointer;
    font-size: 40px; /* Kích thước mũi tên to ra */
    z-index: 10;
    opacity: 1; /* Hiển thị luôn không cần hover */
    padding: 0;
    transition: transform 0.2s, color 0.2s;
}

.slider-for .slider-btn:hover { 
    transform: translateY(-50%) scale(1.1); /* Hover to lên một chút */
    color: #2563eb; /* Đậm hơn khi hover */
    background: transparent;
}

.slider-for .prev-btn { left: 0px; }
.slider-for .next-btn { right: 0px; }

/* --- CSS BÀI VIẾT LIÊN QUAN --- */
.section-title-with-border {
    border-left: 4px solid #004d99; /* Vạch xanh lam bên trái */
    padding-left: 10px;
    color: #004d99;
    font-size: 18px;
    margin-bottom: 20px;
    text-transform: uppercase;
}
.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.article-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    margin-bottom: 12px;
}
.article-title {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
}
.article-title a { color: #333; }
.article-title a:hover { color: #004d99; }

/* Responsive Grid */
@media (max-width: 768px) {
    .related-articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .related-articles-grid { grid-template-columns: 1fr; }
}

/* === SIDEBAR WIDGET BÀI VIẾT === */
.sidebar-widget {
    border: 1px solid #eee;
    background: #fff;
}
.widget-header {
    background: #5b9bd5;
    color: #fff;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}
.widget-list { padding: 15px; }
.widget-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-start;
}
.widget-item:last-child { margin-bottom: 0; }
.widget-item img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; }
.widget-item span { font-size: 13px; color: #333; line-height: 1.4; transition: color 0.2s; }
.widget-item:hover span { color: var(--primary-color); }

/* === RESPONSIVE TRANG CHI TIẾT SẢN PHẨM === */
@media (max-width: 991px) {
    .detail-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    /* Gallery → giá/mua → mô tả → sidebar widget */
    .detail-left,
    .detail-right {
        display: contents;
    }
    .detail-gallery-wrap { order: 1; }
    .detail-buy-wrap {
        order: 2;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 4px;
        padding: 15px;
    }
    .detail-content-wrap { order: 3; }
    .detail-sidebar-wrap {
        order: 4;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    .review-inputs { flex-direction: column; }
    .detail-title { font-size: 20px; margin: 12px 0 16px; }
    .product-article-box { padding: 15px; }
    .slider-for .slider-btn { font-size: 28px; }
}
@media (max-width: 576px) {
    .detail-title { font-size: 18px; }
    .current-price { font-size: 22px; }
    .action-buttons {
        flex-direction: column;
    }
    .btn-add-cart,
    .btn-buy-now,
    .btn-installment {
        flex: none;
        width: 100%;
    }
    .product-article-box { padding: 12px; }
    .article-content { font-size: 14px; }
    .section-title-with-border { font-size: 16px; }
}

/* === RESPONSIVE === */
@media (max-width: 991px) {
    .category-banners { grid-template-columns: repeat(2, 1fr); }
    .filter-options.grid-6 { grid-template-columns: repeat(3, 1fr); } /* Tablet 3 cột checkbox */
}
@media (max-width: 576px) {
    .category-banners { grid-template-columns: 1fr; }
    .category-toolbar { flex-direction: column; align-items: flex-start; gap: 15px; }
    .filter-options.grid-6 { grid-template-columns: repeat(2, 1fr); } /* Mobile 2 cột checkbox */
    .modal-content { padding: 20px; }
    .modal-close { top: 10px; right: 10px; color: #333; } /* Đưa nút x vào trong nền trắng trên mobile */
}
/* === RESPONSIVE === */
@media (max-width: 1024px) {
.product-grid { grid-template-columns: repeat(4, 1fr); } /* 4 cột cho Tablet ngang */
}
@media (max-width: 768px) {
    .nav-list  li.display-mobile{
        display: inline-block;
    }
    .banner-grid { grid-template-columns: 1fr; } /* 1 cột Banner */
    .product-grid { grid-template-columns: repeat(3, 1fr); } /* 3 cột Tablet dọc */
    .article-content img{
        max-width: 100% !important;
        height: auto !important;
    }
}
@media (max-width: 576px) {
.product-grid { grid-template-columns: repeat(2, 1fr); } /* 2 cột Mobile */
.product-card { padding: 10px; }
}

/* Kích hoạt Mega Menu */
.has-mega:hover .mega-menu {
    opacity: 1;
    visibility: visible;
}

.mega-col { flex: 1; min-width: 0; }
.mega-col a {
    display: block;
    padding: 8px 0;
    font-size: 14px;
    color: #555;
    transition: color 0.2s;
}
.mega-col a:hover { color: var(--primary-color); padding-left: 5px; }

/* === NÚT TOGGLE MOBILE === */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}


/* Đặt cột phải làm khung giới hạn trượt */
.detail-right {
    position: relative;
}

/* Style cho khối khi bắt đầu trượt (Được JS thêm vào) */
#recent-articles-widget.is-fixed {
    position: fixed;
    top: 20px;
    z-index: 99;
}

/* Style khi khối trạm đáy cột phải */
#recent-articles-widget.is-bottom {
    position: absolute;
    bottom: 0;
    top: auto;
}
/* === BLOCK 4: TIN TỨC MỚI NHẤT === */
/* Sửa lại class này: Thêm position: relative */
    .news-slider {
        margin: 0 -10px; 
        position: relative; /* Bắt buộc để căn nút absolute không bị bay đi chỗ khác */
    }

    /* Sửa lại class này: Thêm opacity: 1 */
    .news-slider .slider-btn {
        position: absolute;
        top: 35%; 
        transform: translateY(-50%);
        background: transparent;
        color: #3b82f6; 
        border: none;
        font-size: 40px;
        cursor: pointer;
        z-index: 10;
        transition: transform 0.2s, color 0.2s;
        opacity: 1; /* Thêm dòng này để đè lại opacity: 0 của banner chính */
    }
.news-card {
    background: #fff;
    margin: 0 10px;
    border-radius: 4px;
    overflow: hidden;
    /* Loại bỏ viền, dùng nền trắng trên nền xám body để phân tách */
}
.news-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.news-content {
    padding: 15px;
}
.news-title {
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 600;
    /* Rút gọn tiêu đề quá 3 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-title a { color: #333; transition: color 0.2s; }
.news-title a:hover { color: var(--primary-color, #0088cc); }
.news-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.news-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    /* Rút gọn mô tả quá 3 dòng */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Nút điều hướng Slick Slider cho Tin tức */
.news-slider .slider-btn {
    position: absolute;
    top: 35%; /* Căn giữa phần ảnh của bài viết */
    transform: translateY(-50%);
    background: transparent;
    color: #3b82f6; /* Màu xanh mũi tên giống ảnh mẫu */
    border: none;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s, color 0.2s;
}
.news-slider .slider-btn:hover {
    color: #2563eb;
    transform: translateY(-50%) scale(1.1);
}
.news-slider .prev-btn { left: -15px; }
.news-slider .next-btn { right: -15px; }

/* === BLOCK 5: MỌI NGƯỜI CŨNG TÌM KIẾM === */
.seo-keywords-box {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
}
.seo-keywords-box .box-title {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
    text-transform: uppercase;
}
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.keyword-tags a {
    display: inline-block;
    background: #f8f9fa; /* Màu nền xám nhạt */
    color: #333;
    padding: 8px 15px;
    border-radius: 20px; /* Thẻ bo tròn hình viên thuốc */
    font-size: 13px;
    border: 1px solid #f1f1f1;
    transition: all 0.2s;
}
.keyword-tags a:hover {
    background: var(--primary-color, #0088cc);
    color: #fff;
    border-color: var(--primary-color, #0088cc);
}

/* === RESPONSIVE TIN TỨC MỚI NHẤT === */
@media (max-width: 991px) {
    .news-slider .slider-btn { font-size: 30px; }
    .news-slider .prev-btn { left: 0; }
    .news-slider .next-btn { right: 0; }
}

/* ================= FOOTER ================= */
.site-footer {
    background-color: #fff;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

/* Dải Đăng ký nhận tin */
.newsletter-bar {
    background-color: #009deb; /* Màu xanh thiên thanh */
    padding: 15px 0;
}
.newsletter-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.newsletter-text {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}
.newsletter-form {
    display: flex;
    width: 450px;
}
.newsletter-form input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-size: 14px;
    /* Loại bỏ bo góc mặc định */
    border-radius: 2px 0 0 2px;
}
.newsletter-form button {
    background-color: #ff8c00; /* Màu cam */
    color: #fff;
    border: none;
    padding: 0 25px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 0 2px 2px 0;
}
.newsletter-form button:hover {
    background-color: #e67e22;
}

/* Khu vực Footer chính */
.main-footer {
    padding: 40px 0;
    border-top: 1px solid #eee;
}
.footer-grid {
    display: grid;
    /* Chia tỷ lệ các cột giống bản thiết kế (Cột giữa to nhất) */
    grid-template-columns: 1fr 1.6fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    font-size: 16px;
    color: #111;
    margin-bottom: 15px;
    font-weight: 700;
}
.footer-col p {
    margin-bottom: 8px;
    color: #222;
}

/* Cột 1: Logo & Liên hệ */
.footer-col-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.site-logo--footer {
    margin-bottom: 18px;
}

.site-logo--footer .site-logo__link {
    min-height: 56px;
}

.site-logo--footer .site-logo__img {
    max-height: 56px;
    max-width: 220px;
    height: auto;
}

.site-logo--footer .site-logo__fallback {
    width: 48px;
    height: 48px;
    background: rgba(84, 108, 232, 0.1);
    color: var(--primary-color);
}

.site-logo--footer .site-logo__text {
    font-size: 22px;
    color: var(--primary-color);
    text-transform: uppercase;
}

.footer-logo img {
    max-width: 200px;
    margin-bottom: 15px;
}
.footer-hotline {
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-hotline i {
    color: #009deb;
    font-size: 20px;
}
.bct-logo img {
    max-width: 140px;
    margin-bottom: 20px;
}

/* Cột 3: Danh sách dịch vụ */
.footer-links ul {
    list-style: none;
}
.footer-links ul li {
    margin-bottom: 10px;
}
.footer-links ul li a {
    color: #333;
    transition: color 0.2s;
}
.footer-links ul li a:hover {
    color: #009deb;
}

/* Mạng xã hội */
.footer-social {
    display: flex;
    gap: 10px;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    transition: opacity 0.2s;
}
.social-btn:hover { opacity: 0.8; color: #fff; }
.fb-btn { background-color: #1877f2; }
.yt-btn { background-color: #ff0000; }
.tk-btn { background-color: #000000; }

/* ================= FLOATING BUTTONS (Zalo / Facebook) ================= */
.floating-buttons {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}
.float-btn {
    padding: 10px 20px;
    border-radius: 20px; /* Bo tròn giống hình viên thuốc */
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.float-btn:hover {
    color: #fff;
    transform: translateY(-2px);
}
.float-zalo { background-color: #50a83e; }
.float-fb { background-color: #0084ff; }

/* === RESPONSIVE FOOTER === */
@media (max-width: 991px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr; /* Đưa về 2 cột trên Tablet */
    }
}
@media (max-width: 768px) {
    .newsletter-inner {
        flex-direction: column;
        text-align: center;
    }
    .newsletter-form {
        width: 100%;
        max-width: 400px;
    }
    .footer-grid {
        grid-template-columns: 1fr; /* 1 cột trên Mobile */
        gap: 30px;
    }
    .footer-col-brand {
        align-items: center;
        text-align: center;
    }
    .site-logo--footer .site-logo__link {
        justify-content: center;
    }
    .site-logo--footer .site-logo__img {
        object-position: center;
    }
    .floating-buttons {
        bottom: 10px;
        left: 10px;
    }
}
/* Style cho danh sách gợi ý */
.ui-autocomplete {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999 !important;
}
.ui-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f1f1f1;
}
.ui-menu-item:hover {
    background-color: #f0f8ff;
    color: var(--primary-color);
}
.ui-autocomplete { z-index: 99999 !important; }

/* ================= TRANG TIN TỨC CHUẨN ================= */
.news-layout-standard {
    display: grid;
    grid-template-columns: calc(100% - 320px) 290px;
    gap: 30px;
    align-items: start;
}
.page-title {
    font-size: 24px;
    color: #004d99;
    margin-bottom: 25px;
    text-transform: uppercase;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Bài nổi bật (Featured Post) */
.post-featured {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.post-featured .post-thumb img {
    width: 100%;
    aspect-ratio: 16/9; /* Cố định tỷ lệ ảnh chuẩn Video/Banner */
    object-fit: cover;
    display: block;
}
.post-featured .post-info {
    padding: 20px;
}
.post-featured h2 {
    font-size: 22px;
    line-height: 1.4;
    margin-bottom: 10px;
}
.post-featured h2 a { color: #222; transition: color 0.2s; }
.post-featured h2 a:hover { color: #0088cc; }
.post-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    display: flex;
    gap: 15px;
}
.post-featured .post-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}
.btn-readmore {
    display: inline-block;
    color: #0088cc;
    font-weight: 600;
    font-size: 14px;
}
.btn-readmore i { margin-left: 5px; transition: transform 0.2s; }
.btn-readmore:hover i { transform: translateX(5px); }

/* Lưới bài viết thường (Grid) */
.post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.post-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.post-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}
.post-item .post-thumb img {
    width: 100%;
    aspect-ratio: 16/10; /* Ảnh bài phụ hơi vuông hơn */
    object-fit: cover;
    display: block;
}
.post-item .post-info {
    padding: 15px;
}
.post-item h3 {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Giới hạn 2 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-item h3 a { color: #222; transition: color 0.2s; }
.post-item h3 a:hover { color: #0088cc; }
.post-item .post-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Giới hạn 3 dòng */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ================= CỘT PHẢI: SIDEBAR ================= */
.widget-box {
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 6px;
}
.widget-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    border-left: 4px solid #0088cc;
    padding-left: 10px;
    text-transform: uppercase;
}

/* Tìm kiếm Sidebar */
.search-widget form {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.search-widget input {
    flex: 1;
    padding: 10px;
    border: none;
    outline: none;
    font-size: 14px;
}
.search-widget button {
    background: #f8f9fa;
    border: none;
    border-left: 1px solid #ddd;
    padding: 0 15px;
    color: #555;
    cursor: pointer;
}
.search-widget button:hover { background: #eee; }

/* List tin Sidebar */
.widget-news-list { list-style: none; }
.widget-news-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}
.widget-news-list li:last-child { margin-bottom: 0; padding-bottom: 0; border: none; }
.widget-news-list a {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #333;
    transition: color 0.2s;
}
.widget-news-list a:hover { color: #0088cc; }
.widget-news-list img {
    width: 80px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
}
.widget-news-list span {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

/* List SP Sidebar */
.widget-prod-list { list-style: none; }
.widget-prod-list li { margin-bottom: 15px; }
.widget-prod-list li:last-child { margin-bottom: 0; }
.widget-prod-list a {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #333;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.widget-prod-list a:hover { background: #f8f9fa; color: #0088cc; }
.widget-prod-list img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}
.w-prod-info h4 { font-size: 13px; font-weight: 500; margin-bottom: 5px; line-height: 1.4; }
.w-prod-info .price { color: #d70018; font-weight: bold; font-size: 14px; }

/* Phân trang (Pagination) */
.custom-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
}
.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid #ddd;
    color: #555;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.page-link:hover:not(.dots) {
    background: #f1f1f1;
    color: #0088cc;
}
.page-link.active {
    background: #0088cc;
    color: #fff;
    border-color: #0088cc;
}
.page-link.dots { border: none; background: transparent; pointer-events: none; }
/* ================= CỘT PHẢI SIDEBAR TIN TỨC ================= */
.news-sidebar .sidebar-widget {
    background: #fff;
    margin-bottom: 20px;
}
.news-sidebar .widget-header {
    background: #4a90e2; /* Màu xanh thiên thanh như ảnh mẫu */
    color: #fff;
    padding: 12px 15px;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    text-align: center;
}
.news-sidebar .widget-list {
    padding: 0; /* Xóa padding mặc định để đồng bộ */
}

/* ================= ITEM SẢN PHẨM ================= */
.sidebar-prod-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.sidebar-prod-item:last-child { border-bottom: none; }

/* Box ảnh sản phẩm có viền */
.sidebar-prod-item .img-wrap {
    width: 85px;
    height: 85px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    flex-shrink: 0; /* Giữ nguyên kích thước vuông */
}
.sidebar-prod-item .img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Thông tin sản phẩm */
.sidebar-prod-info h4 {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    font-weight: 600;
}
.sidebar-prod-info h4 a { color: #222; transition: color 0.2s; }
.sidebar-prod-info h4 a:hover { color: #4a90e2; }

/* Badge Thông số (1 chiều, Inverter) */
.sp-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}
.sp-badge {
    background: #f4f6f8;
    color: #5c6c7c;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 2px;
}

/* Giá sản phẩm */
.sp-price-current {
    color: #d70018; /* Đỏ giá chuẩn */
    font-weight: bold;
    font-size: 16px;
    display: block;
}
.sp-price-old-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}
.sp-price-old { color: #999; text-decoration: line-through; font-size: 13px; }
.sp-discount { color: #ff5722; font-size: 13px; }

/* ================= ITEM BÀI VIẾT ================= */
.sidebar-news-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
}
.sidebar-news-item:last-child { border-bottom: none; }
.sidebar-news-item img {
    width: 90px;
    height: 65px;
    object-fit: cover;
    flex-shrink: 0;
}
.sidebar-news-item h4 {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    color: #333;
    transition: color 0.2s;
}
.sidebar-news-item:hover h4 { color: #4a90e2; }
/*news category*/
/* Layout 3 cột */
.news-category-layout {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    gap: 25px;
    align-items: start;
}
/* Cập nhật lại layout cho trang 2 cột */
.page-category-layout {
    display: grid;
    grid-template-columns: 1fr 300px; /* 1 cột chính (tự co giãn) và 1 cột sidebar cố định 300px */
    gap: 30px;
    align-items: start;
}

/* Mobile responsive cho layout 2 cột */
@media (max-width: 991px) {
    .page-category-layout {
        grid-template-columns: 1fr; /* Mobile dồn hết về 1 cột */
    }
}

/* Left Sidebar Menu */
.sidebar-left { border: 1px solid #eee; padding: 15px; }
.category-nav ul { list-style: none; }
.category-nav li { border-bottom: 1px solid #f9f9f9; padding: 10px 0; }
.category-nav li a { color: #333; font-size: 14px; font-weight: 500; }
.category-nav li a:hover { color: #004d99; }

/* Main Content */
.category-title { color: #004d99; font-size: 24px; margin-bottom: 15px; }
.featured-post-cat { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.featured-post-cat h2 { font-size: 20px; margin-bottom: 5px; }

/* List Row */
.post-item-row {
    display: flex; gap: 20px; margin-bottom: 25px;
}
.post-item-row .thumb { width: 200px; flex-shrink: 0; }
.post-item-row .thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.post-item-row .content h3 { font-size: 16px; margin-bottom: 5px; }
.post-item-row .content p { font-size: 14px; color: #666; margin-top: 5px; }

/* Responsive */
@media (max-width: 991px) {
    .news-category-layout { grid-template-columns: 1fr; }
    .sidebar-left { display: none; } /* Có thể ẩn menu trái trên mobile */
    .sidebar-left.mobile-active {
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        z-index: 9998;
        background: #fff;
        overflow-y: auto;
        padding: 20px;
    }
}

/* ================= CSS TÌM KIẾM AUTOCOMPLETE ================= */
.ui-autocomplete {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999 !important;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0;
}
.ui-menu-item {
    border-bottom: 1px solid #f5f5f5;
}
.ui-menu-item:last-child {
    border-bottom: none;
}
.ui-menu-item-wrapper {
    padding: 10px !important;
    display: block;
    transition: background 0.2s;
}
.ui-state-active, .ui-widget-content .ui-state-active {
    background: #f8f9fa !important;
    border: none !important;
    margin: 0 !important;
}
.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.autocomplete-item .img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border: 1px solid #eee;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.autocomplete-item .img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.autocomplete-item .info {
    flex-grow: 1;
}
.autocomplete-item .name {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.autocomplete-item .price {
    font-size: 14px;
    font-weight: 600;
    color: #e3001b;
}

/* ================= CSS CHI TIẾT TIN TỨC ================= */
.detail-main-title {
    font-size: 1.5rem;
    color: #004d99;
    line-height: 1.3;
    margin-bottom: 15px;
    font-weight: 700;
}

.detail-meta {
    color: #777;
    font-size: 14px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 20px;
}

.detail-lead {
    font-size: 16px;    
    line-height: 1.6;
    color: #333;
    margin-bottom: 25px;
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #004d99;
}

.detail-body h2, .detail-body h3 {
    font-size: 20px;
    color: #222;
    margin: 25px 0 15px 0;
}

.detail-body img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 4px;
    display: block;
}

.detail-body p {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 15px;
    text-align: justify;
}
.alert{
    padding:12px 16px;
    margin:1rem 0;
    border:1px solid transparent;
    border-radius:.375rem;
}

.alert-success{
    color:#0f5132;
    background-color:#d1e7dd;
    border-color:#badbcc;
}

.alert-danger{
    color:#842029;
    background-color:#f8d7da;
    border-color:#f5c2c7;
}

.alert-warning{
    color:#664d03;
    background-color:#fff3cd;
    border-color:#ffecb5;
}

.alert-info{
    color:#055160;
    background-color:#cff4fc;
    border-color:#b6effb;
}
/* ================= RESPONSIVE ================= */
@media (max-width: 991px) {
    .news-layout-standard { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .post-grid { grid-template-columns: 1fr; } /* 1 cột bài viết trên Mobile */
}

/* cart Layout chính */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.section-title { font-size: 18px; margin-bottom: 15px; font-weight: 600; color: #333; }

/* Item giỏ hàng */
.cart-item { display: flex; gap: 15px; padding: 15px 0; border-bottom: 1px solid #eee; }
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 80px; height: 80px; object-fit: contain; flex-shrink: 0; }
.cart-item h3 {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    margin: 0 0 8px;
}
.cart-item h3 a { color: #333; }
.cart-item h3 a:hover { color: var(--primary-color); }
.item-info { flex: 1; min-width: 0; }
.item-actions { display: flex; gap: 15px; align-items: center; margin-top: 10px; }

/* Nút tăng giảm số lượng */
.quantity-box { display: flex; border: 1px solid #ddd; width: fit-content; }
.quantity-box button { border: none; padding: 5px 10px; background: #f8f8f8; cursor: pointer; }
.quantity-box input { width: 40px; border: none; text-align: center; }
.btn-remove{
    color: rgb(102 102 102);
    font-size: 0.9rem;
}
.item-price { font-weight: bold; color: #d70018; }
.cart-total { text-align: right; margin-top: 15px; font-size: 18px; }
.cart-total strong { color: #d70018; margin-left: 10px; }

/* Form */
.form-group { margin-bottom: 15px; }
.form-group label { display: inline-block; margin-bottom: 5px; font-weight: 500; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ddd; }
.form-group .required{
    margin-left: 3px;color: #d70018; text-decoration: none;
}
/* Nút đặt hàng cam nổi bật */
.btn-order { 
    width: 100%; padding: 12px; background: #ff7043; color: #fff; 
    border: none; font-weight: bold; cursor: pointer; font-size: 16px;
}

/* Empty State */
.empty-cart { text-align: center; padding: 50px 0; }
.empty-cart i { font-size: 50px; color: #ccc; margin-bottom: 20px; }
.btn-continue { 
    display: inline-block; padding: 10px 20px; background: #0088cc; 
    color: #fff; margin-top: 20px; border-radius: 4px; 
}
.form-group label s{
    color: red;
}
.payment-method { margin-top: 10px; }
.payment-method label { font-weight: 400; cursor: default; }
.payment-method input { margin-right: 8px; }

@media (max-width: 991px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .cart-left,
    .cart-right {
        background: #fff;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 16px;
    }
    .cart-page .section-title {
        font-size: 16px;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid #f0f0f0;
    }
    .cart-items {
        margin-bottom: 4px;
    }
    .cart-item {
        gap: 12px;
        padding: 14px 0;
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .cart-item img {
        width: 72px;
        height: 72px;
        flex-shrink: 0;
        border: 1px solid #f0f0f0;
        border-radius: 6px;
        padding: 4px;
        background: #fff;
    }
    .cart-item .item-info {
        flex: 1;
        min-width: 0;
    }
    .cart-item h3 {
        font-size: 13px;
        font-weight: 500;
        line-height: 1.45;
        margin: 0 0 10px;
    }
    .cart-item h3 a {
        color: #333;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .cart-item .item-actions {
        margin-top: 0;
        gap: 12px;
        flex-wrap: wrap;
        align-items: center;
    }
    .cart-item .quantity-box {
        border-radius: 4px;
        overflow: hidden;
    }
    .cart-item .quantity-box button {
        min-width: 36px;
        min-height: 36px;
        padding: 0 12px;
        font-size: 16px;
    }
    .cart-item .quantity-box input {
        width: 36px;
        font-size: 14px;
        min-height: 36px;
    }
    .cart-item .btn-remove {
        font-size: 13px;
        padding: 6px 0;
    }
    .cart-item .item-price {
        width: 100%;
        margin-top: 0;
        padding: 10px 0 0 84px;
        border-top: none;
        text-align: right;
        font-size: 15px;
    }
    .cart-total {
        font-size: 16px;
        padding-top: 12px;
        margin-top: 12px;
        border-top: 1px solid #eee;
    }
    .payment-method {
        font-size: 14px;
        padding: 10px 12px;
        background: #f9f9f9;
        border-radius: 6px;
    }
    .cart-right .form-group label {
        font-size: 14px;
    }
    .cart-right .form-group input,
    .cart-right .form-group textarea {
        font-size: 14px;
        border-radius: 6px;
        padding: 10px 12px;
    }
    .cart-right .btn-order {
        padding: 14px;
        font-size: 16px;
        border-radius: 6px;
        margin-top: 4px;
    }
}

@media (max-width: 576px) {
    .cart-page .breadcrumb {
        font-size: 13px;
    }
    .cart-left,
    .cart-right {
        padding: 12px;
        border-radius: 6px;
    }
    .cart-page .section-title {
        font-size: 15px;
    }
    .cart-item img {
        width: 64px;
        height: 64px;
    }
    .cart-item h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }
    .cart-item .item-price {
        padding-left: 76px;
        font-size: 14px;
    }
    .cart-total {
        font-size: 15px;
    }
    .empty-cart {
        padding: 30px 15px;
    }
    .empty-cart i {
        font-size: 40px;
    }
    .empty-cart h2 {
        font-size: 18px;
    }
}

/* Nút Mua Trả Góp */
.btn-installment {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    background: #50a83e; /* Xanh lá cây nổi bật */
    transition: opacity 0.3s;
}
.btn-installment:hover { opacity: 0.9; }

/* Modal Trả góp */
/* Ghi đè lại class installment-content cũ */
.installment-content {
    width: 1000px;
    max-width: 95%; /* Để không bị tràn viền trên màn hình nhỏ */
    background: #f9f9f9;
    padding: 0;
    
    /* 2 Dòng quan trọng nhất để tạo thanh cuộn dọc */
    max-height: 90vh; /* Giới hạn chiều cao tối đa bằng 90% màn hình */
    overflow-y: auto; /* Tự động hiện thanh cuộn khi nội dung dài */
    
    border-radius: 6px;
    position: relative;
}

/* Nút Tắt (X) Popup */
#btn-close-installment {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: #555;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    font-size: 16px;
    transition: all 0.2s;
}
#btn-close-installment:hover {
    background: #d70018;
    color: #fff;
}

/* Header Khu vực chọn */
.installment-header-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
    background: #f9f9f9;
}

.inst-note { font-size: 14px; margin-bottom: 20px; color: #333; }
.inst-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    outline: none;
    cursor: pointer;
}
.inst-select:focus { border-color: var(--primary-color); }

.inst-product {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.inst-product img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background: #fff;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 4px;
}
.inst-prod-info h3 { font-size: 15px; margin-bottom: 10px; line-height: 1.4; }
.inst-prod-info h3 a { color: #0088cc; }
.inst-price { color: #d70018; font-size: 16px; }
.inst-disclaimer { font-size: 12px; color: #666; margin-top: 15px; line-height: 1.5; text-align: justify;}

/* Tùy chỉnh thanh cuộn (Scrollbar) riêng cho Popup Trả góp */
.installment-content::-webkit-scrollbar {
    width: 6px; /* Thanh cuộn mỏng, thanh lịch */
}
.installment-content::-webkit-scrollbar-track {
    background: #f4f4f4; 
    border-radius: 6px;
}
.installment-content::-webkit-scrollbar-thumb {
    background: #c1c1c1; 
    border-radius: 6px;
}
.installment-content::-webkit-scrollbar-thumb:hover {
    background: #999; /* Màu đậm hơn khi di chuột vào thanh cuộn */
}

/* Bảng so sánh trả góp */
.installment-table-wrapper {
    background: #fff;
    padding: 0 30px 30px 30px;
    overflow-x: auto;
}
.installment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border: 1px solid #ddd;
}
.installment-table th {
    background: #e8f0fe;
    padding: 15px;
    border: 1px solid #ddd;
    color: #333;
    font-weight: bold;
}
.installment-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    color: #444;
}
.installment-table tr:nth-child(even) td { background: #fafafa; }
.installment-table .center { text-align: center; }
.installment-table .highlight-row td { font-weight: bold; font-size: 15px; }
.installment-table .section-row td { background: #e8f0fe; color: #333; }

/* Responsive */
@media (max-width: 991px) {
    .installment-header-area { grid-template-columns: 1fr; gap: 20px; }
    .inst-product { margin-top: 20px; border-top: 1px solid #eee; padding-top: 20px; }
    .installment-table-wrapper { padding: 0 15px 15px; }
}
@media (max-width: 576px) {
    .installment-table { font-size: 13px; }
    .installment-table th, .installment-table td { padding: 8px; }
}

/* === RESPONSIVE CHO MOBILE & TABLET === */
@media (max-width: 991px) {
    .header-top { flex-wrap: wrap; }
    .site-logo--header {
        order: 0;
        max-width: calc(100% - 120px);
    }
    .site-logo--header .site-logo__img {
        height: 40px;
        max-width: 160px;
        padding: 3px 8px;
    }
    .site-logo--header .site-logo__text {
        font-size: 16px;
    }
    .site-logo--header .site-logo__fallback {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .search-box { order: 3; max-width: 100%; width: 100%; } /* Search box full width ở mobile */
    .top-links { display: none; } /* Ẩn link phụ cho gọn */
    .mobile-toggle { display: block; order: 2; }
    .header-right { order: 1; margin-left: auto; }

    /* Thiết lập Menu cho Mobile dạng Drawer (Trượt) */
    .main-nav {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        background-color: #fff;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    .main-nav.active { left: 0; }
    
    .nav-list { flex-direction: column; padding: 0; }
    .nav-list > li > a {
        color: var(--text-dark);
        border-bottom: 1px solid var(--border-color);
        padding: 15px;
    }
    .nav-list > li > a:hover { background: #f5f5f5; }

    /* Xử lý Mega Menu trên Mobile (Dạng Accordion) */
    .mega-menu {
        position: static;
        left: auto;
        transform: none;
        width: 100%;
        max-width: none;
        box-shadow: none;
        flex-direction: column;
        padding: 0 15px;
        display: none; /* JS sẽ lo việc show/hide */
        opacity: 1;
        visibility: visible;
        background-color: #f9f9f9;
        border-bottom: none;
    }
    .mega-col a { border-bottom: 1px dashed #e0e0e0; }
    .has-mega > a::after {
        content: '\f107'; /* FontAwesome angle-down */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        float: right;
    }
}

/* Overlay khi mở menu mobile */
.menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}
.menu-overlay.active { display: block; }

/* ===== TRANG DANH MỤC SẢN PHẨM (/danh-muc/slug) ===== */
.category-page { padding: 0 0 30px; }

/* Sub-brands bar */
.sub-brands {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.sub-brands a {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    transition: all 0.2s;
    white-space: nowrap;
}
.sub-brands a:hover,
.sub-brands a.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Category title on listing page */
.category-page .category-title {
    font-size: 24px;
    font-weight: 700;
    color: #004d99;
    margin: 20px 0 10px;
}

/* Empty state */
.empty-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-products i { font-size: 48px; margin-bottom: 15px; display: block; }
.empty-products p { font-size: 16px; }

/* ===== TRANG DANH MỤC (/danh-muc) ===== */
.category-index-page { padding: 20px 0 40px; }
.category-index-page .section-title {
    font-size: 22px;
    color: #004d99;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}
.category-index-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.category-index-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s;
    text-align: center;
    color: #333;
}
.category-index-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 3px 12px rgba(84,108,232,0.15);
    transform: translateY(-2px);
}
.category-index-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #f0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.category-index-icon i {
    font-size: 24px;
    color: var(--primary-color);
}
.category-index-name {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}

@media (max-width: 991px) {
    .category-index-grid { grid-template-columns: repeat(3, 1fr); }
    .sub-brands { gap: 6px; }
}
@media (max-width: 576px) {
    .category-index-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-options.grid-6 { grid-template-columns: repeat(3, 1fr); }
    .modal-content { padding: 20px; }
}

/* ===== RESPONSIVE TỔNG HỢP — MOBILE & TABLET ===== */
@media (max-width: 991px) {
    .container { padding: 0 12px; }
    .breadcrumb {
        font-size: 13px;
        line-height: 1.5;
        word-break: break-word;
    }
    .category-page .category-title,
    .category-title { font-size: 20px; }
    .page-title { font-size: 20px; }
    .detail-main-title { font-size: 1.25rem; }
    .post-item-row { flex-direction: column; gap: 12px; }
    .post-item-row .thumb { width: 100%; }
    .detail-meta { flex-wrap: wrap; gap: 8px; }
    .news-category-layout .sidebar-right,
    .page-category-layout .sidebar-right { margin-top: 24px; }
    .specs-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-specs { min-width: 280px; }
}

@media (max-width: 768px) {
    .category-toolbar { flex-wrap: wrap; gap: 12px; }
    .toolbar-actions { width: 100%; }
    .sort-select { width: 100%; max-width: 100%; }
    .post-featured h2 { font-size: 18px; }
    .post-featured .post-info { padding: 15px; }
    .box-white { padding: 15px; }
}

@media (max-width: 576px) {
    .container { padding: 0 10px; }
    .mt-20 { margin-top: 15px; }
    .mb-20 { margin-bottom: 15px; }
    .category-page .category-title,
    .category-title { font-size: 18px; margin: 15px 0 8px; }
    .sub-brands a { font-size: 12px; padding: 5px 10px; }
    .product-count { font-size: 14px; }
    .btn-filter { font-size: 13px; padding: 8px 14px; }
    .installment-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .installment-header-area { padding: 20px 15px; }
    .detail-body h2,
    .detail-body h3 { font-size: 17px; }
    .detail-lead { font-size: 15px; padding: 12px; }
    .article-content table,
    .detail-body table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .article-card img { height: 140px; }
    .widget-item img { width: 70px; height: 52px; }
    .sidebar-news-item img { width: 72px; height: 54px; }
}