/*
Theme Name: Yaopin Theme
Theme URI: http://yaopin.local:6648
Author: Cascade
Description: Custom theme for Yaopin project
Version: 1.0.0
Text Domain: yaopin
*/

:root {
    --primary-color: #e65100; /* Orange from the image */
    --text-color: #333;
    --gray-light: #f5f5f5;
    --border-color: #ddd;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* Header Styles */
.site-header {
    background-color: #000; /* Black background */
    color: #fff;
    padding: 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.site-branding h1 a {
    text-decoration: none;
    color: #fff; /* White logo text */
}

/* Navigation Menu */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.main-navigation ul li {
    display: inline-block;
}

.main-navigation ul li a {
    color: #fff; /* White menu links */
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    transition: color 0.3s;
}

.main-navigation ul li a:hover {
    color: var(--primary-color); /* Orange hover effect */
}

/* Main Layout */
.main-wrapper {
    display: flex;
    max-width: 95%; /* Increased from 1400px to use more screen real estate */
    margin: 0 auto;
    padding: 40px;
    gap: 50px; /* Increased gap */
}

/* Sidebar */
.sidebar {
    width: 300px; /* Increased from 250px */
    flex-shrink: 0;
    font-size: 16px; /* Increased from 14px */
}

.widget-title {
    font-size: 20px; /* Increased from 16px */
    font-weight: bold;
    margin-bottom: 20px;
    color: #444;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    display: block; /* Changed from flex to block to allow vertical stacking of submenu */
    padding: 10px 0; /* Increased padding */
    color: #666;
    cursor: pointer;
}

.radio-icon {
    width: 18px; /* Larger icon */
    height: 18px;
    border: 1px solid #ccc;
    border-radius: 50%;
    margin-right: 12px;
    display: inline-block;
    flex-shrink: 0; /* Prevent shrinking */
}

.category-list li.active {
    color: var(--text-color);
    font-weight: 500;
}

.category-list li.active .radio-icon {
    border-color: var(--primary-color);
    border-width: 4px;
}

/* Removed old .category-list li.has-children styles as structure changed */

/* Re-structuring for the arrow */
.category-list li .arrow {
    margin-left: auto;
    font-size: 24px; /* Increased from 18px */
    font-weight: bold; /* Added bold */
    line-height: 1;
    color: #999;
}

/* Stock Widget */
.stock-widget {
    margin-top: 40px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 16px; /* Increased from 14px */
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 10px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
}

/* Search Bar */
.search-container {
    display: flex;
    background: #f9f9f9;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 30px;
    align-items: center;
}

.search-input {
    border: none;
    background: transparent;
    flex-grow: 1;
    font-size: 14px;
    outline: none;
    color: #666;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 16px;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.product-card {
    display: flex;
    flex-direction: column;
}

.product-image {
    aspect-ratio: 3/4;
    background: transparent; /* Changed from #f0f0f0 */
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    transition: transform 0.3s ease;
}

.product-image:hover img {
    transform: scale(1.1);
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

.product-title {
    font-size: 18px; /* Increased from 16px */
    color: var(--primary-color);
    text-transform: uppercase;
    margin: 10px 0 5px 0;
    font-weight: 700;
    line-height: 1.4;
}

.product-meta {
    font-size: 16px; /* Increased from 14px */
    color: #666;
    margin: 0;
}

/* Single Product Styles */
.product-variations-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.variant-card {
    display: flex;
    background: #f9f9f9; /* Changed from #fff to light gray */
    border: 1px solid #eee;
    padding: 20px;
    width: 100%; /* Full width per row, or adjust for side-by-side */
    max-width: 600px; /* Limit width like the screenshot */
    gap: 30px;
}

.variant-image {
    width: 40%;
    flex-shrink: 0;
}

.variant-image img {
    width: 100%;
    height: auto;
    display: block;
}

.variant-details {
    flex-grow: 1;
}

.attributes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px; /* Increased from 14px */
}

.attributes-table th {
    text-align: left;
    padding: 10px 0; /* Increased padding */
    color: #333;
    font-weight: 600;
    width: 40%;
    vertical-align: top;
}

.attributes-table td {
    text-align: left;
    padding: 10px 0; /* Increased padding */
    color: #666;
    vertical-align: top;
}

.attributes-table .highlight {
    color: var(--primary-color);
    font-weight: bold;
}

.attributes-table .in-stock {
    color: #28a745; /* Green */
    font-weight: bold;
}

.attributes-table .out-of-stock {
    color: #dc3545; /* Red */
    font-weight: bold;
}

/* Responsive */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .main-wrapper {
        gap: 30px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    /* Stack Layout */
    .main-wrapper {
        flex-direction: column;
        padding: 15px;
        gap: 30px;
        width: 100%;
        max-width: 100%;
    }

    /* Sidebar Full Width */
    .sidebar {
        width: 100%;
        max-width: 100%;
        flex-basis: auto;
        margin-bottom: 20px;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
    }

    /* Product Grid - 1 Column on Mobile */
    .product-grid {
        grid-template-columns: 1fr; /* 1 Column */
        gap: 20px;
    }

    /* Single Product - Stack Variation Card */
    .variant-card {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .variant-image {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Adjust Fonts for Mobile */
    .product-title {
        font-size: 16px; /* Slightly smaller on mobile */
    }
    
    .site-branding h1 {
        font-size: 20px;
    }

    .header-container {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .main-navigation ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
}
