/* ==========================================================================
   [MASTER CODE] TỐI ƯU TOÀN DIỆN SẢN PHẨM & BLOG (LAPTOP THIÊN ÂN)
   Cập nhật: Đã gỡ lỗi SCSS Nesting, chuẩn hóa CSS thuần, gộp Mobile
   ========================================================================== */

/* ==========================================================================
   PHẦN 1: ĐỊNH DẠNG CHỮ, TIÊU ĐỀ, HÌNH ẢNH (DÙNG CHUNG CẢ WEB)
   ========================================================================== */
html { scroll-behavior: smooth; }

/* Ép căn đều 2 bên cho văn bản */
.rte, .product-content, .article-content, .product-description,
.rte p, .rte span, .rte li, .rte div, .rte b, .rte strong, .rte i, .rte em,
.article-content p, .article-content span, .article-content li, .article-content div {
    text-align: justify !important;
    text-justify: inter-word !important; 
}

.rte p, .product-content p, .article-content p, .product-description p { 
    margin-bottom: 15px !important; 
    line-height: 1.7; 
}
   
/* H2 thêm vạch đỏ viền trái, chữ màu tối dễ đọc */
.rte h2, .product-content h2, .article-content h2, .product-description h2 { 
    font-size: 22px; 
    color: #333; 
    font-weight: bold; 
    border-left: 4px solid #ee0033; 
    padding-left: 10px; 
    margin-top: 35px; 
    margin-bottom: 15px; 
    text-transform: uppercase; 
    text-align: left !important; 
}
   
/* H3 đổi sang xanh dương đậm phân cấp với H2 */
.rte h3, .product-content h3, .article-content h3, .product-description h3 { 
    font-size: 18px; 
    color: #0b5394; 
    font-weight: 600; 
    margin-top: 25px; 
    margin-bottom: 10px; 
    text-align: left !important; 
}
   
/* Blockquote (Đoạn trích dẫn) */
.rte blockquote, .product-content blockquote, .article-content blockquote { 
    background-color: #f4f8ff; 
    border-left: 5px solid #ee0033; 
    padding: 15px 20px; 
    border-radius: 0 8px 8px 0; 
    margin: 25px 0; 
    font-style: normal; 
    color: #333; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
}
.rte blockquote p, .product-content blockquote p, .article-content blockquote p { 
    margin-bottom: 0 !important; 
}
   
/* Hình ảnh tự động bo góc, đổ bóng */
.rte img, .product-content img, .article-content img, .ba-text-fpt img { 
    max-width: 100% !important; 
    height: auto !important; 
    border-radius: 8px !important; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important; 
    margin: 25px auto !important; 
    display: block !important; 
}
.img-caption { 
    text-align: center !important; 
    font-size: 14px; 
    color: #666; 
    font-style: italic; 
    margin-top: 0 !important; 
    margin-bottom: 25px !important; 
}
   
/* Danh sách (Tick xanh FPT style) */
.rte ul, .product-content ul, .article-content ul { padding-left: 20px; margin-bottom: 15px; }
.rte li, .product-content li, .article-content li { margin-bottom: 8px !important; line-height: 1.6; }

.ba-text-fpt ul:not(.ta-toc ul), .rte ul:not(.ta-toc ul) { list-style: none !important; padding-left: 0 !important; }
.ba-text-fpt ul:not(.ta-toc ul) li, .rte ul:not(.ta-toc ul) li { position: relative !important; padding-left: 28px !important; margin-bottom: 12px !important; }
.ba-text-fpt ul:not(.ta-toc ul) li::before, .rte ul:not(.ta-toc ul) li::before {
    content: '\f058'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; left: 0; top: 3px; color: #10b981; font-size: 16px;
}

/* Nút Chốt Sale CTA */
.ta-btn-call {
    display: block; width: fit-content; background: #d11c1c; color: #fff !important; font-size: 16px; 
    font-weight: bold; text-align: center !important; padding: 12px 35px; border-radius: 50px; 
    margin: 20px auto; box-shadow: 0 4px 15px rgba(209, 28, 28, 0.3); text-decoration: none; 
    text-transform: uppercase; transition: all 0.3s;
}
.ta-btn-call:hover { background: #a81515; transform: translateY(-2px); }


/* ==========================================================================
   PHẦN 2: TỐI ƯU DÀNH RIÊNG CHO TRANG BLOG TIN TỨC (MỤC LỤC, BẢNG)
   ========================================================================== */

/* Đảo vị trí "Bài viết liên quan" xuống đáy */
.article-main .col-md-12 { display: flex; flex-direction: column; }
.article-main .title-head { order: 1; } 
.article-main .postby { order: 2; margin-bottom: 20px; } 
.article-main .article-details { order: 3; } 
.article-main .blog_related { order: 4; margin-top: 40px !important; padding-top: 20px; border-top: 2px dashed #eee; }
.article-main .blog_related::before { content: "BÀI VIẾT LIÊN QUAN:"; font-size: 18px; font-weight: bold; display: block; margin-bottom: 15px; color: #d11c1c; }

/* Bảng giá chuẩn Landing Page cho Blog */
.article-content table { width: 100% !important; border-collapse: collapse; margin: 25px 0; box-shadow: 0 4px 8px rgba(0,0,0,0.05); border-radius: 8px; overflow: hidden; }
.article-content table th { background-color: #ee0033 !important; color: #ffffff !important; padding: 15px; text-align: center; font-size: 16px; font-weight: bold; border: 1px solid #ee0033; }
.article-content table td { padding: 12px 15px; border: 1px solid #eaeaea; color: #333; font-size: 15px; vertical-align: middle; }
.article-content table tr:nth-child(even) { background-color: #fdfdfd; }

/* Mục lục tự động (TOC PRO) */
.toc-pro-container { background: #ffffff !important; border: 1px solid #eaeaea !important; border-radius: 10px !important; box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important; margin-bottom: 30px !important; width: 100% !important; overflow: hidden !important; font-family: inherit !important; }
.toc-header { display: flex !important; justify-content: space-between !important; align-items: center !important; padding: 12px 20px !important; background: #fdf2f2 !important; border-bottom: 1px solid #f9e3e3 !important; cursor: pointer !important; user-select: none !important; }
.toc-title-text { font-weight: 700 !important; font-size: 16px !important; color: #d11c1c !important; margin: 0 !important; padding: 0 !important; display: flex !important; align-items: center !important; }
.toc-title-text i { margin-right: 10px !important; font-size: 16px !important; }
.toc-icon { font-size: 14px !important; color: #d11c1c !important; transition: transform 0.3s ease !important; }
.toc-icon.rotate { transform: rotate(180deg) !important; }
.toc-body { padding: 10px 20px 5px 20px !important; }
#toc-list { list-style: none !important; padding: 0 !important; margin: 0 !important; }
#toc-list li { list-style: none !important; margin: 0 !important; padding: 0 !important; background: none !important; border-bottom: 1px dashed #eee !important; }
#toc-list li::before, #toc-list li::after { display: none !important; }
#toc-list li:last-child { border-bottom: none !important; }
#toc-list li.toc-h2 a { padding: 8px 0 !important; font-weight: 600 !important; color: #333 !important; }
#toc-list li.toc-h3 a { padding: 5px 0 5px 15px !important; font-weight: 400 !important; color: #555 !important; font-size: 14px !important; position: relative !important; }
#toc-list li.toc-h3 a::before { content: "•" !important; position: absolute !important; left: 0 !important; color: #ccc !important; }
#toc-list a { text-decoration: none !important; display: block !important; transition: all 0.2s ease !important; line-height: 1.5 !important; }
#toc-list a:hover { color: #d11c1c !important; padding-left: 5px !important; }

/* Tối ưu nút Xem Thêm (Lớp phủ Gradient) */
.bg-article, .wrapper-view-more, .view-more-action { position: absolute !important; bottom: 0 !important; left: 0 !important; width: 100% !important; z-index: 9998 !important; background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, #ffffff 85%, #ffffff 100%) !important; padding-top: 80px !important; padding-bottom: 10px !important; display: flex !important; justify-content: center !important; align-items: flex-end !important; }
.bg-article a, .bg-article button, .btn-view-more, .read-more, .js-viewmore, .view-more-btn, a[title="Xem thêm"], a[title="Thu gọn"] { position: relative !important; z-index: 9999}
/* =======================================================
   ĐÃ SỬA: Tự động bo góc Hình ảnh và ép sát dòng chú thích 
   ======================================================= */
.ta-pro-desc img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    /* Đã ép lề dưới của ảnh từ 20px xuống chỉ còn 8px để sát với chữ */
    margin: 25px auto 8px auto !important; 
    display: block !important;
}

/* Tự động làm đẹp dòng chữ chú thích in nghiêng dưới ảnh */
.ta-pro-desc p i {
    display: block !important;
    font-size: 13.5px !important; /* Chữ nhỏ lại một xíu cho tinh tế */
    color: #6b7280 !important; /* Màu xám nhạt chuyên nghiệp */
    margin-top: 0 !important;
    line-height: 1.5 !important;
}

@media (max-width: 768px) {
    /* 1. BÓP DÁNG NÚT BẤM THON GỌN, SANG TRỌNG HƠN */
    .ta-btn-call { 
        width: fit-content !important; /* Không ép tràn viền 100% nữa */
        min-width: 80% !important; /* Độ rộng vừa phải, cách lề 2 bên */
        margin: 0 auto 10px auto !important; /* Tự động căn giữa hoàn hảo */
        padding: 10px 15px !important; /* Ép mỏng chiều cao của nút lại */
        font-size: 14px !important; /* Cỡ chữ vừa vặn, không bị la hét */
        line-height: 1.4 !important;
        border-radius: 30px !important; /* Độ bo góc nhẹ nhàng hơn */
        box-shadow: 0 4px 10px rgba(238,0,51,0.15) !important; /* Bóng đổ mờ và tinh tế hơn */
        white-space: normal !important; /* Chống lỗi tràn chữ nếu màn hình quá nhỏ */
    }

    /* 2. THU NHỎ KHUNG ĐỨT NÉT BÊN NGOÀI CHO HÀI HÒA */
    .ta-pro-desc div[style*="dashed"] { 
        padding: 15px 12px !important; /* Ép mỏng khoảng trống thừa của cái hộp */
        margin-top: 25px !important; 
    }
    .ta-pro-desc div[style*="dashed"] h3 { 
        font-size: 16px !important; /* Hạ size chữ tiêu đề hộp xuống 1 chút */
        margin-bottom: 8px !important; 
        line-height: 1.4 !important; 
    }
}