/* 产品归档页面样式 */
body.woocommerce-shop,
body.tax-product_cat {
    background: #f5f5f5 !important;
}

/* 搜索页面的product-archive-wrapper增加上边距 */
body.search .product-archive-wrapper,
body.search-results .product-archive-wrapper {
    margin-top: 88px !important;
}

.product-archive-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 30px auto;
    padding: 20px;
    gap: 25px;
    background: transparent;
}

/* 左侧边栏样式 */
.product-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.product-sidebar .sidebar-header {
    background: linear-gradient(135deg, #244995 0%, #1a3670 100%);
    color: #fff;
    padding: 18px 20px;
    text-align: left;
}

.product-sidebar .sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.product-sidebar .sidebar-content {
    padding: 0;
}

/* 产品分类列表样式 */
ul.product-categories {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

ul.product-categories > li {
    border-bottom: 1px solid #f0f0f0;
}

ul.product-categories > li:last-child {
    border-bottom: none;
}

ul.product-categories > li > a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
}

ul.product-categories > li > a:hover {
    background: #f8f8f8;
    color: #244995;
}

ul.product-categories > li > a.active {
    background: #244995;
    color: #fff;
    font-weight: 500;
}

ul.product-categories > li > a .icon {
    margin-right: 8px;
    font-size: 16px;
    font-weight: bold;
    color: #244995;
    cursor: pointer;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

ul.product-categories > li > a.active .icon {
    color: #fff;
}

ul.product-categories > li > a .category-icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    object-fit: contain;
    flex-shrink: 0;
}

ul.product-categories > li.nosubmenu > a {
    padding-left: 44px;
}

/* 子分类样式 */
ul.product-categories > li > ul.children {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fafafa;
}

ul.product-categories > li > ul.children > li {
    border-bottom: 1px solid #efefef;
}

ul.product-categories > li > ul.children > li:last-child {
    border-bottom: none;
}

ul.product-categories > li > ul.children > li > a {
    display: block;
    padding: 10px 18px 10px 52px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 13px;
}

ul.product-categories > li > ul.children > li > a:hover {
    background: #f0f0f0;
    color: #244995;
    padding-left: 54px;
}

ul.product-categories > li > ul.children > li > a.active {
    background: #244995;
    color: #fff;
    font-weight: 500;
}

/* 侧边栏底部联系信息 */
.sidebar-footer {
    padding: 18px;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
    margin-top: 0;
}

.sidebar-footer .contact-info h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #244995;
    font-weight: 600;
}

.sidebar-footer .contact-info p {
    margin: 6px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.8;
}

.sidebar-footer .contact-info p strong {
    color: #333;
    font-size: 13px;
}

/* 右侧主内容区域 */
.product-main-content {
    flex: 1;
    min-width: 0;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 18px;
    border-bottom: 2px solid #244995;
}

.product-header h2 {
    margin: 0;
    font-size: 22px;
    color: #333;
    font-weight: 600;
}

.product-search {
    width: 380px;
}

.product-search form {
    display: flex;
    align-items: stretch;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.product-search input[type="search"],
.product-search .search-field {
    flex: 1;
    padding: 12px 20px;
    border: none;
    font-size: 14px;
    outline: none;
    background: transparent;
    color: #999;
}

.product-search input[type="search"]::placeholder,
.product-search .search-field::placeholder {
    color: #ccc;
}

.product-search input[type="search"]:focus,
.product-search .search-field:focus {
    color: #333;
}

.product-search button {
    padding: 0;
    width: 50px;
    background: #244995;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-search button:hover {
    background: #1a3670;
}

/* 产品网格布局 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

/* 产品卡片样式 */
.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    min-height: 200px;
    height: auto;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-3px);
    border-color: #244995;
}

.product-card .product-image {
    width: 260px;
    flex-shrink: 0;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-right: 1px solid #f0f0f0;
}

.product-card .product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card .product-info {
    flex: 1;
    padding: 15px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

.product-card .product-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.product-card .product-fields {
    flex: 1;
}

.product-card .product-field {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
}

.product-card .product-field .field-label {
    color: #244995;
    font-weight: 600;
    display: inline-block;
    min-width: 75px;
    flex-shrink: 0;
}

.product-card .product-field .field-value {
    color: #333;
    flex: 1;
    word-break: break-word;
}

.product-card .product-detail-btn {
    display: inline-block;
    background: #244995;
    color: #fff;
    padding: 8px 25px;
    border-radius: 20px;
    text-decoration: none;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-end;
    margin-top: 12px;
    flex-shrink: 0;
}

.product-card .product-detail-btn:hover {
    background: #1a3670;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(36, 73, 149, 0.3);
}

/* 分页样式 */
.woocommerce-pagination {
    text-align: center;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
}

.woocommerce-pagination ul {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
}

.woocommerce-pagination ul li {
    display: inline-block;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: block;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 38px;
    text-align: center;
}

.woocommerce-pagination ul li a:hover {
    background: #244995;
    color: #fff;
    border-color: #244995;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(36, 73, 149, 0.3);
}

.woocommerce-pagination ul li span.current {
    background: #244995;
    color: #fff;
    border-color: #244995;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        height: auto;
        min-height: 200px;
    }
    
    .product-archive-wrapper {
        margin: 20px auto;
    }
}

@media (max-width: 768px) {
    .product-archive-wrapper {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
        margin: 15px auto;
    }
    
    .product-sidebar {
        width: 100%;
        position: static;
    }
    
    .product-main-content {
        padding: 20px;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .product-search {
        width: 100%;
    }
    
    .product-card {
        flex-direction: column;
        height: auto;
    }
    
    .product-card .product-image {
        width: 100%;
        height: 180px;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        justify-content: center;
    }
    
    .product-card .product-detail-btn {
        align-self: stretch;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .product-archive-wrapper {
        padding: 10px;
        margin: 10px auto;
    }
    
    .product-main-content {
        padding: 15px;
    }
    
    .product-header h2 {
        font-size: 18px;
    }
    
    .product-card .product-field {
        font-size: 12px;
    }
    
    .product-card .product-field .field-label {
        min-width: 65px;
    }
}
