/*
Theme Name: Icdcbarzal
Author: Qoder
Description: Giao diện商城展示 sản phẩm phong cách tím hoàng gia, MegaMenu + bảng so sánh + lưới thẻ.
Version: 1.0.0
Text Domain: moban-8-2-62
License: GNU General Public License v2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: shop, product, mall, vietnamese, responsive
*/

/* CSS Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #6A1B9A;
    --secondary: #CE93D8;
    --bg: #F3E5F5;
    --text: #333333;
    --card-bg: #FFFFFF;
    --header-bg: #6A1B9A;
    --radius: 0px;
    --shadow: none;
}

body {
    font-family: 'Lato', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--secondary); }
img { max-width: 100%; height: auto; }

/* Header */
.site-header {
    background: var(--header-bg);
    padding: 8px 0;
    position: sticky; top: 0; z-index: 100;
    
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
}
.site-logo img { height: 36px; }
.header-top-bar {
    background: var(--primary);
    color: #fff; font-size: 12px; padding: 4px 0;
    text-align: center;
}
.header-top-bar a { color: var(--secondary); margin: 0 10px; }

/* Navigation */
.main-nav ul, .nav-menu {
    display: flex; list-style: none; gap: 12px;
    align-items: center; flex-wrap: wrap;
}
.nav-menu li a {
    color: #fff;
    padding: 6px 12px; border-radius: var(--radius);
    font-weight: 600; font-size: 13px;
    transition: all 0.3s;
}
.nav-menu li a:hover {
    background: var(--secondary); color: #fff;
}

/* MegaMenu */
.megamenu-wrapper { position: relative; }
.megamenu-trigger { cursor: pointer; }
.megamenu-panel {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    padding: 20px; min-width: 600px; z-index: 200;
    grid-template-columns: repeat(3, 1fr); gap: 15px;
}
.megamenu-wrapper:hover .megamenu-panel { display: grid; }
.megamenu-panel .mega-col h4 {
    color: var(--primary); margin-bottom: 10px;
    padding-bottom: 5px; border-bottom: 2px solid var(--secondary);
}
.megamenu-panel .mega-col a {
    display: block; padding: 5px 0; color: var(--text); font-size: 14px;
}
.megamenu-panel .mega-col a:hover { color: var(--secondary); }

/* Icon Navigation */
.icon-nav { display: flex; gap: 10px; }
.icon-nav a {
    display: flex; align-items: center; gap: 6px;
    color: #fff;
    padding: 6px 14px; border-radius: var(--radius);
    font-size: 13px; font-weight: 600;
}
.icon-nav a:hover { background: var(--secondary); color: #fff; }

.header-actions { display: flex; gap: 8px; }
.btn {
    display: inline-block; padding: 6px 16px;
    border-radius: var(--radius); font-weight: 600; cursor: pointer;
    border: none; text-align: center; transition: all 0.3s;
    font-size: 13px;
}
.btn-primary {
    background: var(--secondary); color: #fff;
}
.btn-primary:hover { background: var(--primary); color: #fff; }
.btn-outline {
    border: 2px solid var(--secondary); color: var(--secondary); background: transparent;
}
.btn-outline:hover { background: var(--secondary); color: #fff; }
.btn-download {
    background: var(--primary); color: #fff;
    padding: 10px 30px; font-size: 16px;
}
.btn-download:hover { background: var(--secondary); }

.nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px;
}
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
    display: block; width: 24px; height: 2px;
    background: var(--primary);
    position: relative; transition: 0.3s;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
    content: ''; position: absolute; left: 0;
}
.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after { top: 7px; }

/* Layout */
.site-content {
    display: flex;
    grid-template-columns: 1fr 300px;
    gap: 20px; max-width: 1200px; margin: 0 auto; padding: 20px 15px;
}
.site-main { min-width: 0; }
.sidebar-right {
    display: block;
}
.sidebar-right .sidebar-widget {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 12px;
    margin-bottom: 15px;
}
.sidebar-right .widget-title {
    color: var(--primary); font-size: 16px; margin-bottom: 10px;
    padding-bottom: 8px; border-bottom: 2px solid var(--secondary);
}

/* Category Icons Matrix */
.category-icons {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 15px 0;
}
.category-icon-item {
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 8px;
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); cursor: pointer; transition: all 0.3s;
    text-align: center;
}
.category-icon-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.category-icon-item .cat-emoji {
    font-size: 28px;
    margin-bottom: 6px;
}
.category-icon-item .cat-name {
    font-size: 11px;
    font-weight: 600; color: var(--text);
}

/* Search Filter */
.search-filter-bar {
    display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}
.search-filter-bar input {
    flex: 1; min-width: 200px; padding: 8px 16px;
    border: 2px solid var(--secondary); border-radius: var(--radius);
    background: var(--card-bg); color: var(--text); font-size: 14px;
}
.search-filter-bar input:focus {
    outline: none; border-color: var(--primary);
}
.search-filter-bar select {
    padding: 8px 16px;
    border: 2px solid var(--secondary); border-radius: var(--radius);
    background: var(--card-bg); color: var(--text); font-size: 14px;
}

/* Product Card Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.product-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    transition: all 0.3s; cursor: pointer; position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.product-card .product-img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
}
.product-card .product-info {
    padding: 8px;
}
.product-card .product-name {
    font-size: 13px;
    font-weight: 700; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-card .product-rating {
    color: #FFB74D; font-size: 12px; margin-bottom: 4px;
}
.product-card .product-rating span {
    color: var(--text); margin-left: 4px;
}
.product-card .product-price {
    display: inline-block; padding: 2px 8px;
    background: var(--secondary); color: #fff;
    border-radius: var(--radius);
    font-size: 11px; font-weight: 700;
}
.product-card .product-download {
    display: block; text-align: center; padding: 6px;
    background: var(--primary); color: #fff; font-weight: 600;
    font-size: 12px;
    margin-top: 8px; border-radius: var(--radius);
}
.product-card .product-download:hover { background: var(--secondary); color: #fff; }

/* Hover Overlay (C11) */
.product-card .hover-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7); display: flex;
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
}
.product-card:hover .hover-overlay { opacity: 1; }
.hover-overlay .btn { color: #fff; }

/* Bento Grid (L06) */
x {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 12px;
}
.bento-item-large { grid-column: span 2; grid-row: span 2; }
.bento-item-wide { grid-column: span 2; }
.bento-item-tall { grid-row: span 2; }
.bento-item { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.bento-item img { width: 100%; height: 100%; object-fit: cover; }
.bento-item .bento-content { padding: 12px; }

/* Horizontal Scroll (C02) */
.h-scroll-section { margin: 20px 0; }
.h-scroll-section h2 { margin-bottom: 15px; }
.h-scroll-container {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 10px; -webkit-overflow-scrolling: touch;
}
.h-scroll-container::-webkit-scrollbar { height: 6px; }
.h-scroll-container::-webkit-scrollbar-thumb {
    background: var(--secondary); border-radius: 3px;
}
.h-scroll-item {
    flex: 0 0 160px;
    scroll-snap-align: start;
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.h-scroll-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.h-scroll-item .scroll-info { padding: 6px 8px; }
.h-scroll-item .scroll-info h4 {
    font-size: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Large Card (C05) */
.large-card {
    display: flex;
    grid-template-columns: 1fr 1fr;
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    margin-bottom: 20px;
}
.large-card img { width: 100%; height: 100%; object-fit: cover; min-height: 200px; }
.large-card .lc-info {
    padding: 15px;
    display: flex; flex-direction: column; justify-content: center;
}
.large-card .lc-info h3 { font-size: 22px; margin-bottom: 8px; }
.large-card .lc-info .lc-desc { font-size: 14px; color: var(--text); opacity: 0.8; margin-bottom: 12px; }

/* Text-Image List (C03) */
.ti-list { display: flex; flex-direction: column; gap: 10px; }
.ti-list-item {
    display: flex; gap: 12px; background: var(--card-bg);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 10px;
    align-items: center;
}
.ti-list-item img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }
.ti-list-item .ti-info h4 { font-size: 14px; margin-bottom: 4px; }
.ti-list-item .ti-info p { font-size: 12px; opacity: 0.7; }

/* Table Compare (C09) */
.compare-table {
    width: 100%; border-collapse: collapse;
    background: var(--card-bg); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    margin: 20px 0;
}
.compare-table th {
    background: var(--primary); color: #fff;
    padding: 8px;
    font-size: 12px;
    text-align: left;
}
.compare-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}
.compare-table tr:hover td { background: rgba(0,0,0,0.02); }

/* Tab Switch */
.tab-nav {
    display: flex; gap: 0; margin-bottom: 20px;
    border-bottom: 2px solid var(--secondary);
}
.tab-nav button {
    padding: 8px 20px;
    background: transparent; border: none; color: var(--text);
    font-weight: 600; cursor: pointer; font-size: 13px;
    border-bottom: 3px solid transparent; transition: all 0.3s;
    font-family: 'Oswald', sans-serif;
}
.tab-nav button.active, .tab-nav button:hover {
    color: var(--primary); border-bottom-color: var(--primary);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Modal Preview */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7); z-index: 9999;
    align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: var(--card-bg); border-radius: var(--radius);
    max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
    padding: 25px; position: relative;
}
.modal-close {
    position: absolute; top: 10px; right: 15px; font-size: 24px;
    cursor: pointer; color: var(--text); background: none; border: none;
}
.modal-box img { width: 100%; border-radius: var(--radius); margin-bottom: 15px; }
.modal-box h3 { margin-bottom: 8px; }
.modal-box .modal-rating { color: #FFB74D; margin-bottom: 8px; }
.modal-box .modal-desc { font-size: 14px; line-height: 1.7; margin-bottom: 15px; }

/* Dark/Light Toggle */
.theme-toggle {
    background: none; border: 2px solid var(--secondary);
    color: var(--secondary); padding: 4px 10px; border-radius: var(--radius);
    cursor: pointer; font-size: 16px;
}

/* Section Styles */
.section-title {
    font-size: 20px;
    color: var(--primary); margin-bottom: 15px;
    position: relative; padding-bottom: 10px;
}
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 50px; height: 3px; background: var(--secondary);
    border-radius: 2px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 30px 0;
    text-align: center; color: #fff;
}
.hero h1 { font-size: 28px; margin-bottom: 10px; }
.hero p { font-size: 14px; opacity: 0.9; margin-bottom: 20px; }

/* Recent Posts */
.posts-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.post-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; transition: 0.3s;
}
.post-card:hover { transform: translateY(-3px); }
.post-card .post-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.post-card .post-title {
    font-size: 14px;
    padding: 8px 12px 0;
}
.post-card .post-meta {
    padding: 0 12px 8px;
    font-size: 12px; opacity: 0.6;
}
.post-card .post-link { color: var(--text); }
.post-card .post-excerpt {
    padding: 0 12px 8px;
    font-size: 13px; opacity: 0.7;
}

/* Single Post */
.single-post { padding: 20px 0; }
.single-post .post-title { font-size: 28px; margin-bottom: 10px; }
.single-post .post-meta { font-size: 13px; opacity: 0.6; margin-bottom: 15px; }
.single-post .post-thumb { margin-bottom: 20px; }
.single-post .post-thumb img { width: 100%; border-radius: var(--radius); }
.single-post .post-content { line-height: 1.8; }

/* Page */
.page-content { padding: 20px 0; }
.page-content .page-title { font-size: 28px; margin-bottom: 15px; }

/* Archive */
.archive-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 30px 0; color: #fff; text-align: center;
}

/* Pagination */
.pagination, .nav-links {
    display: flex; justify-content: center; gap: 8px;
    margin-top: 25px; flex-wrap: wrap;
}
.pagination a, .nav-links a, .pagination span, .nav-links span {
    padding: 6px 14px; border-radius: var(--radius);
    background: var(--card-bg); color: var(--text);
    box-shadow: var(--shadow); font-size: 14px;
}
.pagination .current, .nav-links .current {
    background: var(--primary); color: #fff;
}

/* Footer */
.site-footer {
    background: var(--primary);
    color: #fff; padding: 30px 0 15px; margin-top: 30px;
}
.footer-widgets {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
    margin-bottom: 20px;
}
.footer-widget .widget-title {
    font-size: 16px; margin-bottom: 10px; color: var(--secondary);
}
.footer-bottom {
    text-align: center; padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-bottom .disclaimer-text {
    font-size: 12px; opacity: 0.8; margin-top: 10px; line-height: 1.6;
}

/* Widget */
.widget { margin-bottom: 15px; }
.widget-title { font-size: 16px; margin-bottom: 10px; color: var(--primary); }

/* Scroll Animation */
.scroll-reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

/* Download Priority Section (IA01) */
.download-priority {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 25px;
    border-radius: var(--radius); text-align: center;
    color: #fff; margin-bottom: 25px;
}
.download-priority h2 { font-size: 22px; margin-bottom: 10px; }
.download-priority p { margin-bottom: 15px; opacity: 0.9; }

/* Responsive */
@media (max-width: 768px) {
    .site-content { grid-template-columns: 1fr; flex-direction: column; }
    .sidebar-right { display: none; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-item-large { grid-column: span 2; grid-row: span 1; }
    .footer-widgets { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .main-nav { display: none; width: 100%; }
    .main-nav.active { display: block; }
    .nav-menu { flex-direction: column; }
    .header-actions { display: none; }
    .megamenu-panel { min-width: 100%; grid-template-columns: 1fr; }
    .large-card { grid-template-columns: 1fr; }
    .category-icons { grid-template-columns: repeat(4, 1fr); }
}
