/* ===== RESET VÀ BASE STYLES ===== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
}

body { 
    font-family: 'Montserrat', 'Roboto', sans-serif;
    background-color: #f8f9fa; 
    color: #333333; 
    line-height: 1.6; 
    overflow-x: hidden;
}

/* ===== BIẾN CSS TOÀN CỤC ===== */
:root {
    --primary-color: #d70018; /* MSI red */
    --secondary-color: #000000;
    --text-color: #333333;
    --light-text: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #666666;
    --border-color: #eeeeee;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-shadow: rgba(0, 0, 0, 0.15);
    --container-width: 1200px;
    --header-height: 70px;
    --header-height-scrolled: 60px;
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== HEADER STYLES ===== */
header {
    position: absolute; /* Thay đổi từ relative sang absolute */
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95); /* Nền trắng trong suốt nhẹ */
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: height var(--transition-speed) ease, 
                box-shadow var(--transition-speed) ease;
}

header.scrolled {
    height: var(--header-height-scrolled);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
}

/* Loại bỏ các class scroll-down/scroll-up vì navbar không còn fixed */

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
}

.msi-logo {
    height: 38px;
    max-height: 38px;
    width: auto;
    object-fit: contain;
    transition: all var(--transition-speed) ease;
    /* Loại bỏ filter để hiển thị logo màu đen trên nền trắng */
}

.mygear-logo {
    height: 22px;
    max-height: 22px;
    width: auto;
    object-fit: contain;
    transition: all var(--transition-speed) ease;
    /* Loại bỏ filter để hiển thị logo màu đen trên nền trắng */
}

.logo-divider {
    font-size: 20px;
    color: rgb(0, 0, 0);
    margin: 0 15px;
    opacity: 0.7;
    font-weight: 300;
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: var(--header-height); /* Tạo khoảng cách bằng đúng chiều cao của header */
    box-sizing: border-box; /* Đảm bảo padding không làm tăng tổng chiều cao */
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    margin-top: 0; /* Đảm bảo không có margin */
}

.hero-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    animation: fadeIn 1s ease-out forwards;
}

.hero-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.hero-msi-logo {
    width: auto;
    height: 75px;
    margin-bottom: 15px;
    filter: brightness(0) invert(1); /* Chuyển logo sang màu trắng */
    animation: fadeInUp 1.2s ease-out forwards;
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--light-text);
    text-transform: uppercase;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--light-text);
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: var(--light-text);
    padding: 15px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(215, 0, 24, 0.2);
    background-color: #c20016;
}

/* ===== PRODUCTS SECTION ===== */
.products {
    padding: 80px 0 60px;
    background-color: var(--light-gray);
}

.section-header {
    display: block; /* Đổi từ flex sang block để phần tiêu đề canh giữa hoàn toàn */
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.header-content {
    text-align: center; /* Canh giữa nội dung */
    width: 100%;
    max-width: 800px; /* Giới hạn độ rộng để nội dung không quá dài */
    margin: 0 auto; /* Canh giữa */
}

.header-image {
    position: absolute; /* Định vị tuyệt đối */
    right: 0; /* Căn phải */
    top: 0;
    width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Đảm bảo rồng hiển thị trên các phần tử khác */
}

.msi-dragon {
    max-width: 100%;
    height: auto;
    max-height: 110px;
    transition: transform 0.3s ease;
    margin-top: -10px; /* Kéo lên trên một chút */
}

.msi-dragon:hover {
    transform: scale(1.05); /* Giảm độ phóng đại khi hover */
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--dark-gray);
    max-width: 700px;
    margin: 0 auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Hiển thị cố định 4 cột */
    gap: 20px; /* Giảm khoảng cách giữa các sản phẩm */
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all var(--transition-speed) ease;
    position: relative;
    height: 400px; /* Tăng chiều cao để phù hợp với hình ảnh lớn hơn */
    perspective: 1000px;
}

/* Hover chung cho product-card ở trang chủ */
.product-card:hover:not(.category-products-container .product-card) {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--hover-shadow);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.product-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-back {
    transform: rotateY(180deg);
    background: #1a1a1a;
    color: var(--light-text);
    padding: 15px;
}

.product-image {
    height: 230px; /* Tăng chiều cao hình ảnh */
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    padding: 5px; /* Giảm padding để hình ảnh lớn hơn */
}

.product-info {
    padding: 8px 10px; /* Tiếp tục giảm padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 45px;
}

.product-name {
    font-size: 0.9rem; /* Tiếp tục giảm kích thước font */
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 3px; /* Giảm margin */
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-tag {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px 8px; /* Tiếp tục giảm padding */
}

.current-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 3px;
}

.original-price {
    font-size: 0.85rem;
    color: var(--dark-gray);
    text-decoration: line-through;
    margin-bottom: 3px;
}

.discount {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
}

/* Card back styles */
.specs-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.product-specs {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.product-specs ul {
    list-style: none;
}

.product-specs li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    padding-left: 15px;
}

.product-specs li::before {
    content: '';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.product-ksp ul {
    list-style-type: none;
    padding: 0;
    margin: 0 0 10px 0;
}

.product-ksp li {
    font-size: 0.8rem;
    padding: 3px 0;
    color: #f1f1f1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.btn-buy {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-buy:hover {
    background: #c20016;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(215, 0, 24, 0.3);
}

/* ===== PRODUCT CATEGORIES SECTION ===== */
.categories {
    padding: 50px 0 70px;
    background-color: var(--light-gray-bg);
}

/* Tab danh mục */
.category-tabs {
    display: flex;
    justify-content: center;
    margin: 40px 0 30px;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    padding-bottom: 10px;
}

.category-tabs::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(150, 150, 150, 0.3), transparent);
}

.tab {
    position: relative;
    padding: 15px 25px;
    cursor: pointer;
    margin-right: 10px;
    border-radius: 0;
    border: 2px solid transparent;
    background-color: #111111;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
    /* Góc cắt kiểu gaming */
    clip-path: polygon(0 0, 92% 0, 100% 30%, 100% 100%, 8% 100%, 0 70%);
}

.tab i {
    font-size: 1.5rem;
    opacity: 0.9;
    transition: all 0.25s ease;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.25);
}

.tab span {
    font-size: 0.9rem;
    transition: all 0.25s ease;
    text-align: center;
    line-height: 1.2;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    transition: all 0.25s ease;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.tab[data-category="vga"]::before {
    background-color: #d70018;
}

.tab[data-category="monitor"]::before {
    background-color: #0066cc;
}

.tab[data-category="main"]::before {
    background-color: #ff6600;
}

.tab[data-category="psu-cooling-case"]::before {
    background-color: #8c52ff;
}

/* Hiệu ứng hover chỉ áp dụng cho tab không active */
.tab:hover:not(.active) {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
}

.tab:hover:not(.active) i {
    transform: scale(1.2);
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.tab:hover:not(.active) span {
    font-weight: 700;
    color: rgba(255, 255, 255, 1);
}

/* Hiệu ứng hover cụ thể cho từng danh mục với độ tương phản cao */
/* Xóa style trùng lặp */

.tab[data-category="vga"]:hover:not(.active) {
    border-color: rgba(215, 0, 24, 0.5);
    background-color: rgba(215, 0, 24, 0.15);
    box-shadow: 0 7px 20px rgba(215, 0, 24, 0.3), inset 0 0 15px rgba(215, 0, 24, 0.2);
}

.tab[data-category="vga"]:hover:not(.active) i,
.tab[data-category="vga"]:hover:not(.active) span {
    color: #d70018;
    text-shadow: 0 0 8px rgba(215, 0, 24, 0.3);
}

.tab[data-category="monitor"]:hover:not(.active) {
    border-color: rgba(0, 102, 204, 0.5);
    background-color: rgba(0, 102, 204, 0.15);
    box-shadow: 0 7px 20px rgba(0, 102, 204, 0.3), inset 0 0 15px rgba(0, 102, 204, 0.2);
}

.tab[data-category="monitor"]:hover:not(.active) i,
.tab[data-category="monitor"]:hover:not(.active) span {
    color: #0066cc;
    text-shadow: 0 0 8px rgba(0, 102, 204, 0.3);
}

.tab[data-category="main"]:hover:not(.active) {
    border-color: rgba(255, 102, 0, 0.5);
    background-color: rgba(255, 102, 0, 0.15);
    box-shadow: 0 7px 20px rgba(255, 102, 0, 0.3), inset 0 0 15px rgba(255, 102, 0, 0.2);
}

.tab[data-category="main"]:hover:not(.active) i,
.tab[data-category="main"]:hover:not(.active) span {
    color: #ff6600;
    text-shadow: 0 0 8px rgba(255, 102, 0, 0.3);
}

.tab[data-category="psu-cooling-case"]:hover:not(.active) {
    border-color: rgba(140, 82, 255, 0.5);
    background-color: rgba(140, 82, 255, 0.15);
    box-shadow: 0 7px 20px rgba(140, 82, 255, 0.3), inset 0 0 15px rgba(140, 82, 255, 0.2);
}

.tab[data-category="psu-cooling-case"]:hover:not(.active) i,
.tab[data-category="psu-cooling-case"]:hover:not(.active) span {
    color: #8c52ff;
    text-shadow: 0 0 8px rgba(140, 82, 255, 0.3);
}

/* Style chung cho tab active - phong cách gaming nổi bật */
.tab.active {
    color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 5;
    /* Cắt góc gaming đậm tính hơn */
    clip-path: polygon(0 0, 90% 0, 100% 35%, 100% 100%, 10% 100%, 0 65%);
    /* Thêm đường viền lót trong để tạo hiệu ứng sáng gaming */
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
}

/* Thêm đường chéo gaming và hiệu ứng nhấp nháy */
.tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.05) 5px, rgba(255, 255, 255, 0.05) 10px),
        linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0) 100%);
    background-size: 20px 20px, 100% 100%;
    animation: pulse 3s infinite;
    clip-path: inherit;
    z-index: -1;
}

/* Hiệu ứng góc nhọn gaming ở 4 góc */
.tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: 
        linear-gradient(45deg, transparent 92%, rgba(255, 255, 255, 0.7) 100%),
        linear-gradient(-45deg, transparent 92%, rgba(255, 255, 255, 0.7) 100%),
        linear-gradient(135deg, transparent 92%, rgba(255, 255, 255, 0.7) 100%),
        linear-gradient(-135deg, transparent 92%, rgba(255, 255, 255, 0.7) 100%);
    clip-path: inherit;
    opacity: 0.5;
}

/* Hiệu ứng nhấp nháy nhẹ cho đường viền */
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { opacity: 0.5; }
}

.tab.active i {
    opacity: 1;
    transform: scale(1.3);
    margin-bottom: 5px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
}

.tab.active span {
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
}

.tab:hover:not(.active)::before {
    opacity: 1;
}

/* Thêm hiệu ứng glow cho tab */
.tab::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: transparent;
    opacity: 0;
    transition: all 0.25s ease;
    filter: blur(5px);
}

.tab:hover::after {
    opacity: 0.7;
}

/* Màu sắc và hiệu ứng đặc trưng gaming cho từng danh mục */
.tab[data-category="vga"].active {
    background: 
        linear-gradient(135deg, rgba(215, 0, 24, 0.9), rgba(170, 0, 18, 0.85)),
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.05) 5px, rgba(255, 255, 255, 0.05) 10px);
    border-color: #ff0022;
    color: white;
    box-shadow: 0 10px 30px rgba(215, 0, 24, 0.4), inset 0 0 20px rgba(215, 0, 24, 0.5);
}

.tab[data-category="vga"].active::before {
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 100, 100, 0.1) 5px, rgba(255, 100, 100, 0.1) 10px),
        linear-gradient(to right, rgba(215, 0, 24, 0) 0%, rgba(255, 50, 50, 0.2) 50%, rgba(215, 0, 24, 0) 100%);
}

.tab[data-category="vga"].active::after {
    background: 
        linear-gradient(45deg, transparent 92%, rgba(255, 150, 150, 0.8) 100%),
        linear-gradient(-45deg, transparent 92%, rgba(255, 150, 150, 0.8) 100%),
        linear-gradient(135deg, transparent 92%, rgba(255, 150, 150, 0.8) 100%),
        linear-gradient(-135deg, transparent 92%, rgba(255, 150, 150, 0.8) 100%);
}

.tab[data-category="monitor"].active {
    background: 
        linear-gradient(135deg, rgba(0, 102, 204, 0.9), rgba(0, 85, 170, 0.85)),
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.05) 5px, rgba(255, 255, 255, 0.05) 10px);
    border-color: #0088ff;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 102, 204, 0.4), inset 0 0 20px rgba(0, 102, 204, 0.5);
}

.tab[data-category="monitor"].active::before {
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(100, 180, 255, 0.1) 5px, rgba(100, 180, 255, 0.1) 10px),
        linear-gradient(to right, rgba(0, 102, 204, 0) 0%, rgba(50, 150, 255, 0.2) 50%, rgba(0, 102, 204, 0) 100%);
}

.tab[data-category="monitor"].active::after {
    background: 
        linear-gradient(45deg, transparent 92%, rgba(150, 200, 255, 0.8) 100%),
        linear-gradient(-45deg, transparent 92%, rgba(150, 200, 255, 0.8) 100%),
        linear-gradient(135deg, transparent 92%, rgba(150, 200, 255, 0.8) 100%),
        linear-gradient(-135deg, transparent 92%, rgba(150, 200, 255, 0.8) 100%);
}

.tab[data-category="main"].active {
    background: 
        linear-gradient(135deg, rgba(255, 102, 0, 0.9), rgba(204, 85, 0, 0.85)),
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.05) 5px, rgba(255, 255, 255, 0.05) 10px);
    border-color: #ff8800;
    color: white;
    box-shadow: 0 10px 30px rgba(255, 102, 0, 0.4), inset 0 0 20px rgba(255, 102, 0, 0.5);
}

.tab[data-category="main"].active::before {
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 180, 100, 0.1) 5px, rgba(255, 180, 100, 0.1) 10px),
        linear-gradient(to right, rgba(255, 102, 0, 0) 0%, rgba(255, 150, 50, 0.2) 50%, rgba(255, 102, 0, 0) 100%);
}

.tab[data-category="main"].active::after {
    background: 
        linear-gradient(45deg, transparent 92%, rgba(255, 200, 150, 0.8) 100%),
        linear-gradient(-45deg, transparent 92%, rgba(255, 200, 150, 0.8) 100%),
        linear-gradient(135deg, transparent 92%, rgba(255, 200, 150, 0.8) 100%),
        linear-gradient(-135deg, transparent 92%, rgba(255, 200, 150, 0.8) 100%);
}

.tab[data-category="psu-cooling-case"].active {
    background: 
        linear-gradient(135deg, rgba(140, 82, 255, 0.9), rgba(119, 67, 214, 0.85)),
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255, 255, 255, 0.05) 5px, rgba(255, 255, 255, 0.05) 10px);
    border-color: #9966ff;
    color: white;
    box-shadow: 0 10px 30px rgba(140, 82, 255, 0.4), inset 0 0 20px rgba(140, 82, 255, 0.5);
}

.tab[data-category="psu-cooling-case"].active::before {
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(180, 150, 255, 0.1) 5px, rgba(180, 150, 255, 0.1) 10px),
        linear-gradient(to right, rgba(140, 82, 255, 0) 0%, rgba(170, 120, 255, 0.2) 50%, rgba(140, 82, 255, 0) 100%);
}

.tab[data-category="psu-cooling-case"].active::after {
    background: 
        linear-gradient(45deg, transparent 92%, rgba(200, 180, 255, 0.8) 100%),
        linear-gradient(-45deg, transparent 92%, rgba(200, 180, 255, 0.8) 100%),
        linear-gradient(135deg, transparent 92%, rgba(200, 180, 255, 0.8) 100%),
        linear-gradient(-135deg, transparent 92%, rgba(200, 180, 255, 0.8) 100%);
}

/* Hiệu ứng hover với màu tương ứng */
/* Tab VGA */
.tab[data-category="vga"]:hover:not(.active) {
    color: #d70018;
    border-color: #d70018;
    background-color: rgba(215, 0, 24, 0.05);
    box-shadow: 0 5px 15px rgba(215, 0, 24, 0.1);
    transform: translateY(-2px);
}

/* Tab Monitor */
.tab[data-category="monitor"]:hover:not(.active) {
    color: #0066cc;
    border-color: #0066cc;
    background-color: rgba(0, 102, 204, 0.05);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.1);
    transform: translateY(-2px);
}

/* Tab Main */
.tab[data-category="main"]:hover:not(.active) {
    color: #ff6600;
    border-color: #ff6600;
    background-color: rgba(255, 102, 0, 0.05);
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.1);
    transform: translateY(-2px);
}

/* Tab Linh kiện */
.tab[data-category="psu-cooling-case"]:hover:not(.active) {
    color: #8c52ff;
    border-color: #8c52ff;
    background-color: rgba(140, 82, 255, 0.05);
    box-shadow: 0 5px 15px rgba(140, 82, 255, 0.1);
    transform: translateY(-2px);
}

/* Style cho container sản phẩm theo danh mục */
.category-products {
    margin-top: 30px;
    position: relative;
}

.category-products-container {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-products-container.active {
    display: block;
    opacity: 1;
}

/* ===== STYLES CHO DANH MỤC SẢN PHẨM ===== */
/* TẠO SELECTORS CỤ THỂ HƠN ĐỂ TRÁNH GHI ĐÈ */

/* Ghi đè basic styles cho danh mục sản phẩm để tránh xung đột với sản phẩm nổi bật */
.category-products-container .product-card {
    overflow: hidden;
    position: relative;
    transform: none !important;
    /* Loại bỏ box-shadow mặc định để tránh tình trạng 2 viền khi hover */
    box-shadow: none;
    transition: all 0.3s ease;
    border: none; /* Đảm bảo không có viền */
}

/* Ghi đè hiệu ứng hover card cho danh mục sản phẩm - không sử dụng màu đỏ mặc định nữa */
.category-products-container .product-card:hover {
    transform: translateX(5px) !important;
    /* Loại bỏ box-shadow ở đây để tránh chồng lên với các selector cụ thể */
}

/* Ghi đè hiệu ứng card-inner cho danh mục sản phẩm */
.category-products-container .card-inner {
    transform-style: flat !important;
}

/* Ngăn không cho card-inner lật khi hover trong danh mục sản phẩm */
.category-products-container .product-card:hover .card-inner {
    transform: none !important;
}

/* Chỉ hover không có viền, chỉ để viền được hiển thị ở KSP */
#vga .product-card:hover {
    border: none;
    box-shadow: none !important;
}

#monitor .product-card:hover {
    border: none;
    box-shadow: none !important;
}

#main .product-card:hover {
    border: none;
    box-shadow: none !important;
}

#psu-cooling-case .product-card:hover {
    border: none;
    box-shadow: none !important;
}

/* Style mới cho KSP trong danh mục sản phẩm */
/* Style chung cho KSP - chỉ có 1 viền duy nhất ở trên cùng */
.category-products-container .product-ksp {
    position: absolute;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.97) 100%);
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-radius: 0; 
    box-shadow: none;
    z-index: 5;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.35s ease;
    pointer-events: auto;
    overflow: hidden;
    border: none;
}

/* Chỉ giữ lại duy nhất 1 viền trên cùng của KSP */
#vga .product-ksp {
    border-top: 3px solid #d70018;
    box-shadow: none;
}

#monitor .product-ksp {
    border-top: 3px solid #0066cc;
    box-shadow: none;
}

#main .product-ksp {
    border-top: 3px solid #ff6600;
    box-shadow: none;
}

#psu-cooling-case .product-ksp {
    border-top: 3px solid #8c52ff;
    box-shadow: none;
}

/* Hiệu ứng gradient overlay theo màu danh mục */
.category-products-container .product-ksp::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.5) 100%);
    z-index: -1;
    opacity: 0.7;
}

.category-products-container .product-card:hover .product-ksp {
    opacity: 1;
    transform: translateY(0);
}

/* Hiệu ứng hình ảnh khi hover vào sản phẩm trong danh mục */
.category-products-container .product-card:hover .image-wrapper img {
    transform: scale(0.9) !important;
    filter: brightness(0.5);
    transition: all 0.3s ease;
}

/* Style cho KSP li trong danh mục sản phẩm */
.category-products-container .product-ksp ul {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    flex: 1;
}

.category-products-container .product-ksp li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    transition-delay: 0.1s;
    color: #333;
    font-weight: 500;
}

.category-products-container .product-card:hover .product-ksp li {
    opacity: 1;
    transform: translateX(0);
}

/* Trễ hơn mỗi li tiếp theo */
.category-products-container .product-card:hover .product-ksp li:nth-child(2) {
    transition-delay: 0.15s;
}

.category-products-container .product-card:hover .product-ksp li:nth-child(3) {
    transition-delay: 0.2s;
}

.category-products-container .product-card:hover .product-ksp li:nth-child(4) {
    transition-delay: 0.25s;
}

/* Icon cho các mục KSP theo màu danh mục */
.category-products-container .product-ksp li:before {
    content: '\27A4'; /* Unicode arrow point */
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

#vga .product-ksp li:before {
    color: #d70018;
}

#monitor .product-ksp li:before {
    color: #0066cc;
}

#main .product-ksp li:before {
    color: #ff6600;
}

#psu-cooling-case .product-ksp li:before {
    color: #8c52ff;
}

/* ===== HIỆU ỨNG HOVER CHO CÁC PHẦN KHÁC TRONG DANH MỤC SẢN PHẨM ===== */

/* Hiệu ứng cho phần thông tin sản phẩm */
.category-products-container .product-info {
    transition: all 0.3s ease;
}

/* Hiệu ứng cho tên sản phẩm */
.category-products-container .product-name {
    transition: all 0.3s ease;
    position: relative;
}

/* Hiệu ứng hover cho tên sản phẩm */
.category-products-container .product-card:hover .product-name {
    color: var(--primary-color) !important;
    transform: translateX(-10px);
}

/* Tạo gạch chân cho tên sản phẩm */
.category-products-container .product-name:after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

/* Hiệu ứng hover cho gạch chân */
.category-products-container .product-card:hover .product-name:after {
    width: 80%;
}

/* Hiệu ứng cho phần giá */
.category-products-container .price-tag {
    transition: all 0.3s ease;
}

/* Hiệu ứng hover cho phần giá */
.category-products-container .product-card:hover .price-tag {
    transform: translateX(-15px);
}

/* Hiệu ứng cho giá hiện tại */
.category-products-container .current-price {
    transition: all 0.4s ease;
    position: relative;
}

/* Hiệu ứng hover cho giá hiện tại */
.category-products-container .product-card:hover .current-price {
    color: var(--primary-color) !important;
    font-weight: 800;
}

/* Hiệu ứng cho giá gốc và giảm giá */
.category-products-container .original-price,
.category-products-container .discount {
    transition: all 0.3s ease;
}

/* Hiệu ứng hover cho phần giảm giá */
.category-products-container .product-card:hover .discount {
    background-color: var(--primary-color) !important;
    transform: rotate(-3deg) scale(1.1);
}

/* Style cho phần chứa nút Mua ngay trong KSP */
.category-products-container .ksp-actions {
    margin-top: auto;
    width: 100%;
    text-align: center;
    position: relative;
    padding-top: 15px;
}

/* Đường ngang phân cách */
.category-products-container .ksp-actions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#vga .ksp-actions::before {
    background: rgba(215, 0, 24, 0.2);
}

#monitor .ksp-actions::before {
    background: rgba(0, 102, 204, 0.2);
}

#main .ksp-actions::before {
    background: rgba(255, 102, 0, 0.2);
}

#psu-cooling-case .ksp-actions::before {
    background: rgba(140, 82, 255, 0.2);
}

.category-products-container .product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

/* Style cho nút Mua ngay theo màu danh mục */
.category-products-container .ksp-actions .btn-buy {
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    width: 100%;
    letter-spacing: 1px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    outline: none;
}

#vga .ksp-actions .btn-buy {
    background-color: #d70018;
    box-shadow: 0 3px 8px rgba(215, 0, 24, 0.3);
}

#monitor .ksp-actions .btn-buy {
    background-color: #0066cc;
    box-shadow: 0 3px 8px rgba(0, 102, 204, 0.3);
}

#main .ksp-actions .btn-buy {
    background-color: #ff6600;
    box-shadow: 0 3px 8px rgba(255, 102, 0, 0.3);
}

#psu-cooling-case .ksp-actions .btn-buy {
    background-color: #8c52ff;
    box-shadow: 0 3px 8px rgba(140, 82, 255, 0.3);
}

/* Hiệu ứng hover cho nút Mua ngay theo màu danh mục */
#vga .ksp-actions .btn-buy:hover {
    background-color: #b30014;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(215, 0, 24, 0.4);
}

#monitor .ksp-actions .btn-buy:hover {
    background-color: #0055aa;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 102, 204, 0.4);
}

#main .ksp-actions .btn-buy:hover {
    background-color: #e55b00;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(255, 102, 0, 0.4);
}

#psu-cooling-case .ksp-actions .btn-buy:hover {
    background-color: #7a45e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(140, 82, 255, 0.4);
}

.category-products-container .ksp-actions .btn-buy:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.6s ease;
}

.category-products-container .ksp-actions .btn-buy:hover:before {
    left: 100%;
}

/* Style cho categories-grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.category-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all var(--transition-speed) ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--hover-shadow);
}

.category-image {
    height: 200px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-info {
    padding: 20px;
    text-align: center;
}

.category-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.category-desc {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 15px;
    line-height: 1.4;
}

.category-link {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s;
}

.category-link:hover {
    color: var(--primary-hover);
}

.category-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all var(--transition-speed) ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--hover-shadow);
}

.category-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.05);
}

.category-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.category-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    position: relative;
    padding-bottom: 10px;
}

.category-name::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
}

.category-desc {
    font-size: 0.95rem;
    color: var(--dark-gray);
    margin-bottom: 20px;
    line-height: 1.5;
}

.category-link {
    margin-top: auto;
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.category-link:hover {
    color: #a50014;
}

.category-link i {
    margin-left: 5px;
    transition: transform 0.3s;
}

.category-link:hover i {
    transform: translateX(5px);
}

/* ===== FOOTER ===== */
footer {
    background-color: #0D0D0D;
    color: var(--light-text);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    color: var(--light-text);
}

.footer-column h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 10px;
}

.footer-column a {
    color: #cccccc;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    margin-top: 40px;
    border-top: 1px solid #333;
    font-size: 0.9rem;
    color: #888;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 sản phẩm trên 1 hàng ở màn hình dưới 1200px */
    }
    
    .product-card {
        height: 390px; /* Tăng chiều cao ở breakpoint này */
    }
    
    .product-image {
        height: 220px; /* Điều chỉnh chiều cao hình ảnh ở breakpoint này */
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 sản phẩm trên 1 hàng ở màn hình tablet */
        gap: 15px; /* Giảm khoảng cách */
    }
    
    .product-card {
        height: 380px; /* Điều chỉnh chiều cao product-card ở breakpoint này */
    }
    
    .product-image {
        height: 200px; /* Điều chỉnh chiều cao hình ảnh ở breakpoint này */
    }
    
    /* Responsive cho danh mục sản phẩm */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .category-image {
        height: 180px;
    }
    
    .category-info {
        padding: 15px;
    }
    
    .category-name {
        font-size: 1.4rem;
    }
    
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .hero-msi-logo {
        height: 65px;
        margin-bottom: 10px;
    }
    
    /* Điều chỉnh logo cho màn hình tablet */
    .logo-container {
        justify-content: center;
    }
    
    .msi-logo {
        height: 37px;
        max-height: 37px;
    }
    
    .mygear-logo {
        height: 20px;
        max-height: 20px;
    }
    
    /* Điều chỉnh vị trí rồng MSI trên tablet */
    .section-header {
        margin-bottom: 40px;
    }
    
    .header-content {
        margin-bottom: 20px;
    }
    
    .header-image {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        margin-top: 20px;
        display: flex;
        justify-content: center;
    }
    
    .msi-dragon {
        max-height: 100px;
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    /* Responsive cho danh mục sản phẩm */
    .category-name {
        font-size: 1.3rem;
    }
    
    .category-desc {
        font-size: 0.9rem;
    }
    
    .category-link {
        font-size: 0.9rem;
    }
    
    .hero-msi-logo {
        height: 55px;
        margin-bottom: 10px;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Điều chỉnh logo cho màn hình tablet nhỏ và mobile lớn */
    .logo-container {
        justify-content: center;
    }
    
    .msi-logo {
        height: 36px;
        max-height: 36px;
    }
    
    .mygear-logo {
        height: 19px;
        max-height: 19px;
    }
    
    .logo-divider {
        margin: 0 12px;
    }
    
    /* Điều chỉnh vị trí rồng MSI trên màn hình nhỏ hơn */
    .header-content {
        margin-bottom: 15px;
    }
    
    .header-image {
        margin-top: 10px;
    }
    
    .msi-dragon {
        max-height: 90px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .product-card {
        height: 380px;
    }
    
    .product-image {
        height: 190px; /* Điều chỉnh chiều cao hình ảnh trên màn hình nhỏ */
    }
    
    .product-name {
        font-size: 0.9rem;
        height: 2.4em;
    }
    
    .current-price {
        font-size: 1.1rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    /* Điều chỉnh hình rồng MSI trên mobile */
    .section-header {
        margin-bottom: 30px;
    }
    
    /* Responsive cho danh mục sản phẩm */
    .categories {
        padding: 60px 0 40px;
    }
    
    .categories-grid {
        margin-top: 30px;
        gap: 20px;
    }
    
    .category-image {
        height: 160px;
    }
    
    .category-info {
        padding: 12px;
    }
    
    .category-name {
        font-size: 1.2rem;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    
    .category-desc {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    .header-content {
        margin-bottom: 10px;
    }
    
    .msi-dragon {
        max-height: 80px;
    }
    
    .hero-msi-logo {
        height: 50px;
        margin-bottom: 8px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
        margin: 0 auto;
    }
    
    .hero {
        min-height: 500px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-column h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .product-card {
        height: 360px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .card-back {
        padding: 15px;
    }
    
    .specs-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .product-specs li {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
}

/* Thiết bị di động nhỏ */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    /* Responsive cho danh mục sản phẩm */
    .category-image {
        height: 150px;
    }
    
    .category-name {
        font-size: 1.1rem;
    }
    
    .category-desc {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .hero-msi-logo {
        height: 45px;
        margin-bottom: 5px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    header {
        height: 60px;
    }
    
    header.scrolled {
        height: 50px;
    }
    
    .logo-container {
        max-width: 100%;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .msi-logo {
        height: 36px;
        max-height: 36px;
    }
    
    .mygear-logo {
        height: 20px;
        max-height: 18px;
    }
    
    .logo-divider {
        font-size: 16px;
        margin: 0 10px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem;
    }
    
    .products {
        padding: 60px 0 40px;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .product-card {
        height: 350px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-info {
        padding: 8px 10px;
        min-height: 50px;
    }
    
    .price-tag {
        padding: 8px 10px 12px;
    }
    
    .current-price {
        font-size: 1rem;
    }
    
    .original-price {
        font-size: 0.8rem;
    }
    
    .discount {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
}
