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

:root {
    --primary: #0A4D8C;
    --primary-light: #1565C0;
    --primary-dark: #063A6B;
    --accent: #FF6B35;
    --accent-light: #FF8C42;
    --dark: #1a1a2e;
    --gray-dark: #333;
    --gray: #666;
    --gray-light: #f5f5f5;
    --gray-border: #e0e0e0;
    --white: #ffffff;
    --text: #2c2c2c;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --radius: 8px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Top Bar ========== */
.top-bar {
    background: var(--dark);
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.top-bar-left span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-bar-right {
    display: flex;
    gap: 12px;
}

.top-bar-right a {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: var(--transition);
    font-size: 14px;
}

.top-bar-right a:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

/* ========== Header / Navigation ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: var(--transition);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 800;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text .en {
    font-size: 11px;
    color: var(--gray);
    font-weight: 400;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-menu > li > a {
    padding: 10px  10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-dark);
    border-radius: 6px;
    transition: var(--transition);
    display: block;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    color: var(--primary);
    background: rgba(10,77,140,0.06);
}

.nav-menu > li {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    border-radius: var(--radius);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.nav-menu > li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li a {
    padding: 10px 20px;
    font-size: 14px;
    color: var(--gray-dark);
    transition: var(--transition);
    display: block;
}

.dropdown li a:hover {
    background: var(--gray-light);
    color: var(--primary);
    padding-left: 26px;
}

.dropdown .dropdown-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
    padding: 10px 20px 4px;
    border-bottom: 1px solid var(--gray-border);
    margin-bottom: 4px;
}

.mobile-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
}

/* ========== Page Banner ========== */
.page-banner {
    height: 280px;
    background: linear-gradient(135deg, #0a2a4a 0%, #0A4D8C 50%, #1565C0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,107,53,0.15), transparent);
    border-radius: 50%;
}

.page-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.05), transparent);
    border-radius: 50%;
}

.page-banner-content {
    position: relative;
    z-index: 2;
}

.page-banner h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.page-banner p {
    font-size: 16px;
    opacity: 0.85;
}

/* ========== Breadcrumb ========== */
.breadcrumb {
    background: var(--gray-light);
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-border);
}

.breadcrumb ul {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    color: var(--gray);
}

.breadcrumb ul li a {
    color: var(--gray);
    transition: var(--transition);
}

.breadcrumb ul li a:hover {
    color: var(--primary);
}

.breadcrumb ul li:last-child {
    color: var(--primary);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--gray-border);
}

/* ========== Products Layout ========== */
.products-page {
    padding: 40px 0 80px;
}

.products-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
}

.sidebar-block {
    background: white;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.sidebar-title {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-list {
    padding: 8px 0;
}

.category-item {
    position: relative;
}

.category-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--gray-dark);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.category-item a:hover,
.category-item a.active {
    background: rgba(10,77,140,0.04);
    color: var(--primary);
    border-left-color: var(--accent);
    font-weight: 600;
}

.category-item a .count {
    font-size: 12px;
    color: var(--gray);
    background: var(--gray-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.category-item a.active .count {
    background: var(--primary);
    color: white;
}

/* Sidebar contact */
.sidebar-contact {
    background: linear-gradient(135deg, var(--dark), #16213e);
    border-radius: var(--radius);
    padding: 24px 20px;
    color: white;
    text-align: center;
}

.sidebar-contact h4 {
    font-size: 16px;
    margin-bottom: 12px;
}

.sidebar-contact p {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 16px;
    line-height: 1.7;
}

.sidebar-contact .btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-contact .btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

/* ========== Products Grid ========== */
.products-main {
    min-width: 0;
}

.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.products-count {
    font-size: 14px;
    color: var(--gray);
}

.products-count strong {
    color: var(--primary);
    font-size: 18px;
}

.products-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-sort label {
    font-size: 14px;
    color: var(--gray);
}

.products-sort select {
    padding: 8px 14px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--gray-dark);
    cursor: pointer;
    background: white;
    transition: var(--transition);
}

.products-sort select:hover {
    border-color: var(--primary);
}

.view-toggle {
    display: flex;
    gap: 4px;
}

.view-toggle button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: var(--gray);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle button.active,
.view-toggle button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Product Grid View */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.product-item {
    background: white;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    border-color: transparent;
    box-shadow: var(--shadow-hover);
    transform: translateY(-6px);
}

.product-item-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-item:nth-child(1) .product-item-image,
.product-item:nth-child(8) .product-item-image,
.product-item:nth-child(15) .product-item-image { background: linear-gradient(135deg, #FF6B35, #F7931E); }

.product-item:nth-child(2) .product-item-image,
.product-item:nth-child(9) .product-item-image { background: linear-gradient(135deg, #0A4D8C, #1565C0); }

.product-item:nth-child(3) .product-item-image,
.product-item:nth-child(10) .product-item-image { background: linear-gradient(135deg, #1a1a2e, #16213e); }

.product-item:nth-child(4) .product-item-image,
.product-item:nth-child(11) .product-item-image { background: linear-gradient(135deg, #2c5364, #203a43); }

.product-item:nth-child(5) .product-item-image,
.product-item:nth-child(12) .product-item-image { background: linear-gradient(135deg, #6a3093, #a044ff); }

.product-item:nth-child(6) .product-item-image,
.product-item:nth-child(13) .product-item-image { background: linear-gradient(135deg, #00897B, #00695C); }

.product-item:nth-child(7) .product-item-image,
.product-item:nth-child(14) .product-item-image { background: linear-gradient(135deg, #E65100, #BF360C); }

.product-item-image svg {
    width: 80px;
    height: 80px;
    opacity: 0.9;
    transition: var(--transition);
}

.product-item:hover .product-item-image svg {
    transform: scale(1.15);
}

.product-item-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.product-item-badge.hot {
    background: var(--accent);
    color: white;
}

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

.product-item-category {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
}

.product-item-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-item-info p {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.product-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--gray-border);
}

.product-item-temp {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

.product-item-link {
    font-size: 13px;
    color: var(--gray);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-item:hover .product-item-link {
    color: var(--accent);
}

/* List View */
.product-grid.list-view {
    grid-template-columns: 1fr;
}

.product-grid.list-view .product-item {
    flex-direction: row;
}

.product-grid.list-view .product-item-image {
    width: 240px;
    height: auto;
    min-height: 160px;
    flex-shrink: 0;
}

.product-grid.list-view .product-item-info {
    padding: 24px;
}

.product-grid.list-view .product-item-info p {
    -webkit-line-clamp: 3;
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 50px;
}

.pagination a {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--gray-dark);
    transition: var(--transition);
    padding: 0 12px;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination a.disabled {
    color: var(--gray-border);
    cursor: not-allowed;
}

.pagination a.disabled:hover {
    border-color: var(--gray-border);
    color: var(--gray-border);
}

/* ========== Footer ========== */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 3fr  1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand .logo {
    color: white;
    margin-bottom: 16px;
}

.footer-brand .logo .en {
    color: rgba(255,255,255,0.5);
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 16px;
}

.footer-social a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.footer-col h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 18px;
}

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

.footer-col ul li a {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-col ul li a:hover {
    color: var(--accent);
    padding-left: 4px;
}

.footer-contact li {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 14px;
    align-items: flex-start;
}

.footer-contact li .icon {
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ========== Back to Top ========== */
.back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(10,77,140,0.4);
    transition: var(--transition);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    border: none;
    font-size: 20px;
}

.back-top.show {
    opacity: 1;
    visibility: visible;
}

.back-top:hover {
    background: var(--accent);
    transform: translateY(-4px);
}

/* ========== Animations ========== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }

    .nav-menu.show { display: flex; }
    .nav-menu > li { width: 100%; }
    .nav-menu > li > a { padding: 12px 16px; width: 100%; }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 20px;
        display: none;
    }

    .nav-menu > li:hover .dropdown { display: block; }
    .mobile-toggle { display: block; }
    .top-bar-right { display: none; }
    .top-bar-left { font-size: 12px; }

    .page-banner h1 { font-size: 26px; }

    .products-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-grid.list-view .product-item {
        flex-direction: column;
    }

    .product-grid.list-view .product-item-image {
        width: 100%;
        height: 200px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}