/* ==========================================================================
   MINIMAL DESIGN SYSTEM TOKENS (CSS Variables)
   ========================================================================== */
:root {
    /* Colors - Corporate Blue & Neutral Greys */
    --color-primary: #1952C5;
    --color-primary-hover: #123B8F;
    --color-secondary: #0A1B40;
    --color-text-main: #333333;
    --color-text-muted: #6c757d;
    --color-bg-light: #f8f9fa;
    --color-border: #e2e8f0;
    --color-white: #ffffff;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Montserrat', var(--font-sans);

    /* Spacing & Layout */
    --container-width: 1640px;
    /* 控制整个网站的红色矩形内容宽度，你可以修改这个数值 */
    --spacing-xs: 0.5rem;
    /* 8px */
    --spacing-sm: 1rem;
    /* 16px */
    --spacing-md: 2rem;
    /* 32px */
    --spacing-lg: 4rem;
    /* 64px */
    --spacing-xl: 6rem;
    /* 96px */

    /* Utilities */
    --radius-sm: 4px;
    --radius-md: 8px;
    --transition-fast: 0.2s ease-in-out;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text-main);
    line-height: 1.6;
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    width: 100%;
}

.section {
    padding: var(--spacing-lg) 0;
}

.bg-light {
    background-color: var(--color-bg-light);
}

.bg-dark {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark p {
    color: var(--color-white);
}

.text-center {
    text-align: center;
}

.text-white {
    color: var(--color-white) !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    font-family: var(--font-heading);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: var(--color-white);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(25, 82, 197, 0.1);
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--color-secondary);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.top-bar {
    background: var(--color-secondary);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-contact span {
    margin-right: 1.5rem;
}

.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    position: relative;
}

.site-branding {
    position: absolute;
    left: 0;
}

.custom-logo {
    max-height: 80px;
    width: auto;
    display: block;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}

.site-title a {
    color: var(--color-secondary);
}

/* Navigation */
.main-navigation ul {
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    color: var(--color-secondary);
    font-weight: 600;
    font-family: var(--font-heading);
}

.main-navigation a:hover {
    color: var(--color-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-secondary);
}

/* ==========================================================================
   FRONT PAGE
   ========================================================================== */
/* Hero Section */
.hero-section {
    position: relative;
    padding: 120px 0;
    background-color: var(--color-secondary);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: var(--color-white);
    text-align: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 27, 64, 0.7);
    /* Overlay */
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Section Headers */
.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.section-header .section-title {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.category-card {
    display: block;
    text-align: center;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-fast);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.category-image {
    position: relative;
    padding-top: 66.66%;
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
}

.category-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2rem;
}

.category-card h3 {
    padding: 1.5rem;
    margin: 0;
    font-size: 1.25rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.product-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.product-card-link:hover {
    color: inherit;
}

.product-card-image {
    position: relative;
    padding-top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
}

.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.product-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.product-excerpt {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Factory Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.check-list li {
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.check-list strong {
    color: var(--color-secondary);
}

.about-image img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   ARCHIVE / CATEGORY LAYOUT
   ========================================================================== */
.page-header {
    padding: 4rem 0;
    text-align: center;
}

.page-header .page-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.archive-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

.archive-sidebar .widget {
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.archive-sidebar .widget-title {
    font-size: 1.125rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
}

.widget_product_categories ul li {
    margin-bottom: 0.5rem;
    position: relative;
}

.widget_product_categories ul li a {
    color: var(--color-text-main);
    font-weight: 500;
    display: inline-block;
}

/* Style for children / subcategories */
.widget_product_categories ul.children {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px dashed var(--color-border);
}

.widget_product_categories ul.children li {
    margin-bottom: 0.5rem;
    font-size: 0.9em;
}

.widget_product_categories ul.children li::before {
    content: '-';
    position: absolute;
    left: -1rem;
    color: var(--color-border);
}

.widget_product_categories ul.children li a {
    color: var(--color-text-muted);
    font-weight: 400;
}

.widget_product_categories ul li.current-cat>a,
.widget_product_categories ul li a:hover {
    color: var(--color-primary);
    font-weight: 600;
}

.pagination {
    margin-top: 3rem;
    text-align: center;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 0.5rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-secondary);
    font-weight: 600;
}

.pagination span.current {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

/* ==========================================================================
   SINGLE PRODUCT
   ========================================================================== */
.breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 2rem;
    color: var(--color-text-muted);
}

.breadcrumb a {
    color: var(--color-secondary);
    font-weight: 500;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.product-gallery {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
}

.product-main-image img {
    max-height: 500px;
    margin: 0 auto;
    object-fit: contain;
}

.product-info-summary .product-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.product-short-description {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.product-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.product-specs-table th,
.product-specs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.product-specs-table th {
    width: 35%;
    color: var(--color-secondary);
    background: var(--color-bg-light);
    font-weight: 600;
}

.entry-content {
    max-width: 800px;
    margin: 0 auto;
}

/* ==========================================================================
   INQUIRY FORM
   ========================================================================== */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.col-half {
    flex: 1;
    margin-bottom: 0;
}

.form-feedback {
    padding: 1rem;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.form-feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background: var(--color-secondary);
    color: rgba(255, 255, 255, 0.7);
}

.footer-widgets {
    padding: 4rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.footer-widgets .widget-title {
    color: var(--color-white);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.footer-widget ul li {
    margin-bottom: 0.75rem;
}

.footer-widget ul li a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-widget ul li a:hover {
    color: var(--color-white);
}

.site-info {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.social-links a {
    margin-left: 1rem;
    color: var(--color-white);
    font-weight: 600;
}

/* ==========================================================================
   HOME CATEGORY GRID
   ========================================================================== */
.home-category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.home-category-card {
    position: relative;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 2.5rem 1rem;
    text-align: center;
    transition: all var(--transition-fast);
    z-index: 1;
    /* relative to dropdown */
}

.home-category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
    z-index: 10;
    /* Bring above others when hovering dropdown */
}

.cat-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.cat-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
}

.cat-subtitle {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.home-category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-primary);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    padding: 1rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.home-category-card:hover .home-category-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.home-category-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
}

.home-category-dropdown li {
    padding: 0;
}

.home-category-dropdown a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--color-text-main);
    font-size: 0.875rem;
    transition: background var(--transition-fast);
    text-align: center;
}

.home-category-dropdown a:hover {
    background: var(--color-bg-light);
    color: var(--color-primary);
    font-weight: bold;
}


/* ==========================================================================
   RESPONSIVE (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 991px) {
    .header-inner {
        display: flex;
        justify-content: space-between;
        height: auto;
        padding: 0;
        flex-wrap: wrap;
    }

    .site-branding {
        flex-grow: 1;
    }

    .menu-toggle {
        display: block;
    }

    .main-navigation,
    .main-navigation ul {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
    }

    .main-navigation.toggled ul {
        display: flex;
    }

    .main-navigation ul li {
        border-top: 1px solid var(--color-border);
    }

    .main-navigation ul li a {
        display: block;
        padding: 1rem 0;
    }

    .header-cta {
        display: none;
    }

    /* Hide on mobile for space */

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .about-grid,
    .archive-layout,
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    .home-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

}

@media (max-width: 576px) {
    .home-category-grid {
        grid-template-columns: 1fr;
    }
}