/**
 * WP Product Pro - 前端样式
 * 现代简洁中国风 UI 设计
 *
 * @package WP_Product_Pro
 */

/* ========================================
   CSS 变量 - 设计系统
   ======================================== */
:root {
    /* 主色调 */
    --wpp-primary-color: #2563eb;
    --wpp-primary-hover: #1d4ed8;
    --wpp-primary-light: #dbeafe;
    --wpp-primary-dark: #1e40af;
    
    /* 中性色 */
    --wpp-gray-50: #f9fafb;
    --wpp-gray-100: #f3f4f6;
    --wpp-gray-200: #e5e7eb;
    --wpp-gray-300: #d1d5db;
    --wpp-gray-400: #9ca3af;
    --wpp-gray-500: #6b7280;
    --wpp-gray-600: #4b5563;
    --wpp-gray-700: #374151;
    --wpp-gray-800: #1f2937;
    --wpp-gray-900: #111827;
    
    /* 功能色 */
    --wpp-success: #10b981;
    --wpp-warning: #f59e0b;
    --wpp-error: #ef4444;
    --wpp-info: #3b82f6;
    
    /* 圆角 */
    --wpp-radius-sm: 4px;
    --wpp-radius-md: 8px;
    --wpp-radius-lg: 12px;
    --wpp-radius-xl: 16px;
    --wpp-radius-full: 9999px;
    
    /* 阴影 */
    --wpp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --wpp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --wpp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --wpp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 字体 */
    --wpp-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --wpp-font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    
    /* 字号 - 中英文兼容 */
    --wpp-text-xs: 12px;
    --wpp-text-sm: 14px;
    --wpp-text-base: 16px;
    --wpp-text-lg: 18px;
    --wpp-text-xl: 20px;
    --wpp-text-2xl: 24px;
    --wpp-text-3xl: 30px;
    --wpp-text-4xl: 36px;
    
    /* 行高 */
    --wpp-leading-tight: 1.25;
    --wpp-leading-normal: 1.5;
    --wpp-leading-relaxed: 1.75;
    
    /* 间距 */
    --wpp-spacing-xs: 4px;
    --wpp-spacing-sm: 8px;
    --wpp-spacing-md: 16px;
    --wpp-spacing-lg: 24px;
    --wpp-spacing-xl: 32px;
    --wpp-spacing-2xl: 48px;
    
    /* 过渡 */
    --wpp-transition-fast: 150ms ease;
    --wpp-transition-normal: 250ms ease;
    --wpp-transition-slow: 350ms ease;
}

/* ========================================
   基础重置
   ======================================== */
.wpp-container *,
.wpp-container *::before,
.wpp-container *::after {
    box-sizing: border-box;
}

.wpp-container {
    font-family: var(--wpp-font-sans);
    font-size: var(--wpp-text-base);
    line-height: var(--wpp-leading-normal);
    color: var(--wpp-gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   容器
   ======================================== */
.wpp-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--wpp-spacing-lg);
}

@media (max-width: 768px) {
    .wpp-container {
        padding: 0 var(--wpp-spacing-md);
    }
}

/* ========================================
   按钮系统
   ======================================== */
.wpp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--wpp-spacing-sm);
    padding: 12px 24px;
    font-family: var(--wpp-font-sans);
    font-size: var(--wpp-text-sm);
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    text-align: center;
    border: none;
    border-radius: var(--wpp-radius-md);
    cursor: pointer;
    transition: all var(--wpp-transition-fast);
    white-space: nowrap;
}

.wpp-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--wpp-primary-light);
}

.wpp-btn-primary {
    background: linear-gradient(135deg, var(--wpp-primary-color), var(--wpp-primary-dark));
    color: #fff;
    box-shadow: var(--wpp-shadow-md), 0 2px 4px rgba(37, 99, 235, 0.2);
}

.wpp-btn-primary:hover {
    background: linear-gradient(135deg, var(--wpp-primary-hover), var(--wpp-primary-dark));
    transform: translateY(-1px);
    box-shadow: var(--wpp-shadow-lg), 0 4px 8px rgba(37, 99, 235, 0.3);
    color: #fff;
}

.wpp-btn-secondary {
    background: #fff;
    color: var(--wpp-primary-color);
    border: 1.5px solid var(--wpp-primary-color);
}

.wpp-btn-secondary:hover {
    background: var(--wpp-primary-light);
    color: var(--wpp-primary-dark);
}

.wpp-btn-ghost {
    background: transparent;
    color: var(--wpp-gray-600);
    border: 1.5px solid var(--wpp-gray-300);
}

.wpp-btn-ghost:hover {
    background: var(--wpp-gray-100);
    border-color: var(--wpp-gray-400);
    color: var(--wpp-gray-800);
}

.wpp-btn-sm {
    padding: 8px 16px;
    font-size: var(--wpp-text-xs);
}

.wpp-btn-lg {
    padding: 16px 32px;
    font-size: var(--wpp-text-base);
}

.wpp-btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--wpp-radius-full);
}

/* ========================================
   面包屑导航
   ======================================== */
.wpp-breadcrumb {
    padding: var(--wpp-spacing-md) 0;
    font-size: var(--wpp-text-sm);
}

.wpp-breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wpp-spacing-xs);
}

.wpp-breadcrumb li {
    display: flex;
    align-items: center;
    gap: var(--wpp-spacing-xs);
}

.wpp-breadcrumb li:not(:last-child)::after {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0.6;
}

.wpp-breadcrumb a {
    color: var(--wpp-gray-500);
    text-decoration: none;
    transition: color var(--wpp-transition-fast);
}

.wpp-breadcrumb a:hover {
    color: var(--wpp-primary-color);
}

.wpp-breadcrumb li:last-child span {
    color: var(--wpp-gray-800);
    font-weight: 500;
}

/* ========================================
   归档页 Banner
   ======================================== */
.wpp-archive-banner {
    background: linear-gradient(135deg, var(--wpp-primary-color) 0%, var(--wpp-primary-dark) 100%);
    color: #fff;
    padding: var(--wpp-spacing-2xl) 0;
    margin-bottom: var(--wpp-spacing-xl);
    position: relative;
    overflow: hidden;
}

.wpp-archive-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.wpp-archive-banner .wpp-container {
    position: relative;
    z-index: 1;
}

.wpp-archive-banner .wpp-breadcrumb a,
.wpp-archive-banner .wpp-breadcrumb li:not(:last-child)::after {
    color: rgba(255, 255, 255, 0.7);
}

.wpp-archive-banner .wpp-breadcrumb a:hover {
    color: #fff;
}

.wpp-archive-banner .wpp-breadcrumb li:last-child span {
    color: #fff;
}

.wpp-archive-banner .wpp-breadcrumb li:not(:last-child)::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0.5;
}

.wpp-archive-title {
    font-size: var(--wpp-text-4xl);
    font-weight: 700;
    margin: 0 0 var(--wpp-spacing-sm);
    letter-spacing: -0.02em;
}

.wpp-archive-subtitle {
    font-size: var(--wpp-text-lg);
    opacity: 0.9;
    margin: 0;
    font-weight: 400;
}

/* ========================================
   归档页布局
   ======================================== */
.wpp-archive-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--wpp-spacing-xl);
    align-items: start;
}

.wpp-category-description {
    background: linear-gradient(135deg, var(--wpp-gray-50), #fff);
    padding: var(--wpp-spacing-lg);
    border-radius: var(--wpp-radius-lg);
    margin-bottom: var(--wpp-spacing-xl);
    border: 1px solid var(--wpp-gray-200);
    font-size: var(--wpp-text-sm);
    line-height: var(--wpp-leading-relaxed);
    color: var(--wpp-gray-600);
}

/* ========================================
   侧边栏
   ======================================== */
.wpp-sidebar {
    position: sticky;
    top: var(--wpp-spacing-lg);
}

.wpp-widget {
    background: #fff;
    border: 1px solid var(--wpp-gray-200);
    border-radius: var(--wpp-radius-lg);
    padding: var(--wpp-spacing-lg);
    margin-bottom: var(--wpp-spacing-md);
    box-shadow: var(--wpp-shadow-sm);
}

.wpp-widget-title {
    font-size: var(--wpp-text-base);
    font-weight: 600;
    margin: 0 0 var(--wpp-spacing-md);
    padding-bottom: var(--wpp-spacing-sm);
    border-bottom: 2px solid var(--wpp-primary-color);
    color: var(--wpp-gray-800);
}

/* 分类列表 */
.wpp-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wpp-category-list li {
    margin-bottom: 2px;
}

.wpp-category-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    color: var(--wpp-gray-700);
    text-decoration: none;
    border-radius: var(--wpp-radius-md);
    font-size: var(--wpp-text-sm);
    transition: all var(--wpp-transition-fast);
}

.wpp-category-list li a:hover {
    background: var(--wpp-primary-light);
    color: var(--wpp-primary-dark);
}

.wpp-category-list li.current > a,
.wpp-category-list li.current-ancestor > a {
    background: var(--wpp-primary-color);
    color: #fff;
}

.wpp-category-list li a .count {
    font-size: var(--wpp-text-xs);
    background: var(--wpp-gray-100);
    padding: 2px 8px;
    border-radius: var(--wpp-radius-full);
    color: var(--wpp-gray-500);
}

.wpp-category-list li.current > a .count,
.wpp-category-list li.current-ancestor > a .count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.wpp-category-list .children {
    list-style: none;
    margin: 4px 0 0 0;
    padding: 0 0 0 var(--wpp-spacing-md);
    border-left: 2px solid var(--wpp-gray-200);
}

/* 标签云 */
.wpp-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wpp-spacing-sm);
}

.wpp-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: var(--wpp-text-xs);
    background: var(--wpp-gray-100);
    color: var(--wpp-gray-600);
    text-decoration: none;
    border-radius: var(--wpp-radius-full);
    transition: all var(--wpp-transition-fast);
    border: 1px solid transparent;
}

.wpp-tag:hover {
    background: var(--wpp-primary-light);
    color: var(--wpp-primary-dark);
    border-color: var(--wpp-primary-color);
}

.wpp-tag.current {
    background: var(--wpp-primary-color);
    color: #fff;
}


/* ========================================
   产品网格
   ======================================== */
.wpp-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--wpp-grid-columns, 3), 1fr);
    gap: var(--wpp-spacing-lg);
}

.wpp-product-card {
    background: #fff;
    border: 1px solid var(--wpp-gray-200);
    border-radius: var(--wpp-radius-lg);
    overflow: hidden;
    transition: all var(--wpp-transition-normal);
    display: flex;
    flex-direction: column;
}

.wpp-product-card:hover {
    box-shadow: var(--wpp-shadow-xl);
    transform: translateY(-4px);
    border-color: var(--wpp-gray-300);
}

.wpp-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.wpp-product-image {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--wpp-gray-100), var(--wpp-gray-50));
}

.wpp-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--wpp-transition-slow);
}

.wpp-product-card:hover .wpp-product-image img {
    transform: scale(1.08);
}

.wpp-product-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wpp-gray-400);
    font-size: var(--wpp-text-sm);
}

.wpp-product-info {
    padding: var(--wpp-spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wpp-product-title {
    font-size: var(--wpp-text-base);
    font-weight: 600;
    margin: 0 0 var(--wpp-spacing-sm);
    line-height: var(--wpp-leading-tight);
    color: var(--wpp-gray-800);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wpp-product-categories {
    font-size: var(--wpp-text-xs);
    color: var(--wpp-primary-color);
    margin-bottom: var(--wpp-spacing-sm);
    font-weight: 500;
}

.wpp-product-excerpt {
    font-size: var(--wpp-text-sm);
    color: var(--wpp-gray-500);
    margin: 0;
    line-height: var(--wpp-leading-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.wpp-product-actions {
    padding: 0 var(--wpp-spacing-md) var(--wpp-spacing-md);
}

.wpp-product-actions .wpp-btn {
    width: 100%;
}

/* ========================================
   分页
   ======================================== */
.wpp-pagination {
    margin-top: var(--wpp-spacing-2xl);
    display: flex;
    justify-content: center;
}

.wpp-pagination .nav-links {
    display: flex;
    gap: var(--wpp-spacing-xs);
}

.wpp-pagination a,
.wpp-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--wpp-spacing-sm);
    border: 1px solid var(--wpp-gray-300);
    border-radius: var(--wpp-radius-md);
    text-decoration: none;
    color: var(--wpp-gray-700);
    font-size: var(--wpp-text-sm);
    font-weight: 500;
    transition: all var(--wpp-transition-fast);
}

.wpp-pagination a:hover {
    background: var(--wpp-gray-100);
    border-color: var(--wpp-gray-400);
}

.wpp-pagination .current {
    background: var(--wpp-primary-color);
    border-color: var(--wpp-primary-color);
    color: #fff;
}

/* ========================================
   无产品提示
   ======================================== */
.wpp-no-products {
    text-align: center;
    padding: var(--wpp-spacing-2xl);
    background: var(--wpp-gray-50);
    border-radius: var(--wpp-radius-lg);
    border: 2px dashed var(--wpp-gray-300);
}

.wpp-no-products p {
    color: var(--wpp-gray-500);
    font-size: var(--wpp-text-base);
    margin: 0;
}

/* ========================================
   产品详情页
   ======================================== */
.wpp-single-wrapper {
    padding-bottom: var(--wpp-spacing-2xl);
}

.wpp-single-banner {
    background: var(--wpp-gray-50);
    padding: var(--wpp-spacing-md) 0;
    margin-bottom: var(--wpp-spacing-xl);
    border-bottom: 1px solid var(--wpp-gray-200);
}

.wpp-product-detail {
    background: #fff;
}

.wpp-product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--wpp-spacing-2xl);
    margin-bottom: var(--wpp-spacing-2xl);
}

/* 产品图册 */
.wpp-product-gallery {
    position: sticky;
    top: var(--wpp-spacing-lg);
    align-self: start;
}

.wpp-gallery-main {
    margin-bottom: var(--wpp-spacing-md);
    border: 1px solid var(--wpp-gray-200);
    border-radius: var(--wpp-radius-lg);
    overflow: hidden;
    background: var(--wpp-gray-50);
}

.wpp-gallery-main-image {
    position: relative;
    padding-top: 75%;
}

.wpp-gallery-main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wpp-gallery-main-image a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wpp-gallery-thumbs {
    display: flex;
    gap: var(--wpp-spacing-sm);
    flex-wrap: wrap;
}

.wpp-gallery-thumb {
    width: 72px;
    height: 72px;
    border: 2px solid var(--wpp-gray-200);
    border-radius: var(--wpp-radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--wpp-transition-fast);
    background: var(--wpp-gray-50);
}

.wpp-gallery-thumb:hover {
    border-color: var(--wpp-gray-400);
}

.wpp-gallery-thumb.active {
    border-color: var(--wpp-primary-color);
    box-shadow: 0 0 0 2px var(--wpp-primary-light);
}

.wpp-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wpp-video-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wpp-gray-800);
}

.wpp-video-icon {
    font-size: 24px;
    color: #fff;
}

.wpp-no-image {
    padding-top: 75%;
    background: linear-gradient(135deg, var(--wpp-gray-100), var(--wpp-gray-50));
    border-radius: var(--wpp-radius-lg);
    position: relative;
}

.wpp-no-image span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--wpp-gray-400);
    font-size: var(--wpp-text-sm);
}

/* 产品信息 */
.wpp-product-info .wpp-product-title {
    font-size: var(--wpp-text-3xl);
    font-weight: 700;
    margin-bottom: var(--wpp-spacing-md);
    line-height: var(--wpp-leading-tight);
    letter-spacing: -0.02em;
}

.wpp-product-meta {
    font-size: var(--wpp-text-sm);
    color: var(--wpp-gray-500);
    margin-bottom: var(--wpp-spacing-md);
    display: flex;
    align-items: center;
    gap: var(--wpp-spacing-sm);
}

.wpp-meta-label {
    color: var(--wpp-gray-400);
}

.wpp-product-meta a {
    color: var(--wpp-primary-color);
    text-decoration: none;
    font-weight: 500;
}

.wpp-product-meta a:hover {
    text-decoration: underline;
}

.wpp-product-excerpt {
    font-size: var(--wpp-text-base);
    line-height: var(--wpp-leading-relaxed);
    color: var(--wpp-gray-600);
    margin-bottom: var(--wpp-spacing-lg);
    padding: var(--wpp-spacing-md);
    background: var(--wpp-gray-50);
    border-radius: var(--wpp-radius-md);
    border-left: 4px solid var(--wpp-primary-color);
}

/* 操作按钮 */
.wpp-product-detail .wpp-product-actions {
    display: flex;
    gap: var(--wpp-spacing-md);
    margin-bottom: var(--wpp-spacing-lg);
    padding: 0;
}

.wpp-product-detail .wpp-product-actions .wpp-btn {
    width: auto;
    padding: 14px 32px;
    font-size: var(--wpp-text-base);
}

/* PDF 下载 */
.wpp-product-downloads {
    margin-bottom: var(--wpp-spacing-lg);
    padding: var(--wpp-spacing-md);
    background: var(--wpp-gray-50);
    border-radius: var(--wpp-radius-lg);
    border: 1px solid var(--wpp-gray-200);
}

.wpp-product-downloads h4 {
    font-size: var(--wpp-text-sm);
    font-weight: 600;
    margin: 0 0 var(--wpp-spacing-sm);
    color: var(--wpp-gray-700);
    display: flex;
    align-items: center;
    gap: var(--wpp-spacing-sm);
}

.wpp-product-downloads h4::before {
    content: '📁';
}

.wpp-pdf-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wpp-pdf-list li {
    margin-bottom: var(--wpp-spacing-xs);
}

.wpp-pdf-list li:last-child {
    margin-bottom: 0;
}

.wpp-pdf-list a {
    display: inline-flex;
    align-items: center;
    gap: var(--wpp-spacing-sm);
    color: var(--wpp-primary-color);
    text-decoration: none;
    font-size: var(--wpp-text-sm);
    padding: var(--wpp-spacing-xs) 0;
}

.wpp-pdf-list a:hover {
    text-decoration: underline;
}

.wpp-pdf-icon {
    font-size: 16px;
}

/* 社交分享 */
.wpp-social-share {
    display: flex;
    align-items: center;
    gap: var(--wpp-spacing-md);
    padding-top: var(--wpp-spacing-lg);
    border-top: 1px solid var(--wpp-gray-200);
}

.wpp-share-label {
    font-size: var(--wpp-text-sm);
    color: var(--wpp-gray-500);
    font-weight: 500;
}

.wpp-share-buttons {
    display: flex;
    gap: var(--wpp-spacing-sm);
}

.wpp-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--wpp-radius-full);
    text-decoration: none;
    font-size: var(--wpp-text-sm);
    font-weight: 600;
    transition: all var(--wpp-transition-fast);
    color: #fff;
}

.wpp-share-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--wpp-shadow-md);
}

.wpp-share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.wpp-share-facebook { background: #1877f2; }
.wpp-share-twitter { background: #000; }
.wpp-share-linkedin { background: #0a66c2; }
.wpp-share-wechat { background: #07c160; }
.wpp-share-weibo { background: #e6162d; }
.wpp-share-whatsapp { background: #25d366; }
.wpp-share-email { background: var(--wpp-gray-600); }

/* ========================================
   Tab 区域
   ======================================== */
.wpp-product-tabs {
    margin-bottom: var(--wpp-spacing-2xl);
}

.wpp-tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--wpp-gray-200);
    margin-bottom: var(--wpp-spacing-lg);
    gap: var(--wpp-spacing-xs);
    overflow-x: auto;
}

.wpp-tab-btn {
    padding: var(--wpp-spacing-md) var(--wpp-spacing-lg);
    font-size: var(--wpp-text-sm);
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    color: var(--wpp-gray-500);
    transition: all var(--wpp-transition-fast);
    white-space: nowrap;
    font-family: var(--wpp-font-sans);
}

.wpp-tab-btn:hover {
    color: var(--wpp-primary-color);
    background: var(--wpp-gray-50);
}

.wpp-tab-btn.active {
    color: var(--wpp-primary-color);
    border-bottom-color: var(--wpp-primary-color);
    background: var(--wpp-primary-light);
}

.wpp-tab-panel {
    display: none;
    animation: wppFadeIn 0.3s ease;
}

.wpp-tab-panel.active {
    display: block;
}

@keyframes wppFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wpp-product-content {
    font-size: var(--wpp-text-base);
    line-height: var(--wpp-leading-relaxed);
    color: var(--wpp-gray-700);
}

.wpp-product-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--wpp-radius-md);
}

.wpp-product-content h2,
.wpp-product-content h3,
.wpp-product-content h4 {
    color: var(--wpp-gray-800);
    margin-top: var(--wpp-spacing-lg);
    margin-bottom: var(--wpp-spacing-md);
}

.wpp-product-content p {
    margin-bottom: var(--wpp-spacing-md);
}

.wpp-product-content ul,
.wpp-product-content ol {
    margin-bottom: var(--wpp-spacing-md);
    padding-left: var(--wpp-spacing-lg);
}

/* 规格表格 */
.wpp-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--wpp-text-sm);
}

.wpp-specs-table th,
.wpp-specs-table td {
    padding: var(--wpp-spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--wpp-gray-200);
}

.wpp-specs-table th {
    width: 35%;
    background: var(--wpp-gray-50);
    font-weight: 600;
    color: var(--wpp-gray-700);
}

.wpp-specs-table td {
    color: var(--wpp-gray-600);
}

.wpp-specs-table tr:hover {
    background: var(--wpp-gray-50);
}

.wpp-spec-unit {
    color: var(--wpp-gray-400);
    margin-left: var(--wpp-spacing-xs);
    font-size: var(--wpp-text-xs);
}

/* 产品标签 */
.wpp-product-tags {
    display: flex;
    align-items: center;
    gap: var(--wpp-spacing-sm);
    flex-wrap: wrap;
    padding: var(--wpp-spacing-lg) 0;
    border-top: 1px solid var(--wpp-gray-200);
}

.wpp-tags-label {
    font-size: var(--wpp-text-sm);
    color: var(--wpp-gray-500);
    font-weight: 500;
}

/* ========================================
   相关产品
   ======================================== */
.wpp-related-products {
    margin-top: var(--wpp-spacing-2xl);
    padding-top: var(--wpp-spacing-2xl);
    border-top: 1px solid var(--wpp-gray-200);
}

.wpp-section-title {
    font-size: var(--wpp-text-2xl);
    font-weight: 700;
    margin: 0 0 var(--wpp-spacing-lg);
    text-align: center;
    color: var(--wpp-gray-800);
}

.wpp-section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--wpp-primary-color);
    margin: var(--wpp-spacing-sm) auto 0;
    border-radius: var(--wpp-radius-full);
}

.wpp-related-grid {
    grid-template-columns: repeat(4, 1fr);
}


/* ========================================
   轮播组件
   ======================================== */
.wpp-carousel-wrapper {
    position: relative;
    overflow: hidden;
    padding: 0 var(--wpp-spacing-2xl);
}

.wpp-carousel {
    display: flex;
    gap: var(--wpp-spacing-lg);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.wpp-carousel::-webkit-scrollbar {
    display: none;
}

.wpp-carousel .wpp-product-card {
    flex: 0 0 calc((100% - var(--wpp-spacing-lg) * 3) / var(--wpp-columns-pc, 4));
    scroll-snap-align: start;
}

.wpp-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid var(--wpp-gray-200);
    border-radius: var(--wpp-radius-full);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--wpp-transition-fast);
    z-index: 10;
    box-shadow: var(--wpp-shadow-md);
    color: var(--wpp-gray-600);
}

.wpp-carousel-arrow:hover {
    background: var(--wpp-primary-color);
    border-color: var(--wpp-primary-color);
    color: #fff;
    box-shadow: var(--wpp-shadow-lg);
}

.wpp-carousel-prev {
    left: 0;
}

.wpp-carousel-next {
    right: 0;
}

/* ========================================
   询价表单
   ======================================== */
.wpp-inquiry-form-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--wpp-spacing-xl);
    background: #fff;
    border: 1px solid var(--wpp-gray-200);
    border-radius: var(--wpp-radius-xl);
    box-shadow: var(--wpp-shadow-lg);
}

.wpp-form-title {
    font-size: var(--wpp-text-2xl);
    font-weight: 700;
    margin: 0 0 var(--wpp-spacing-lg);
    text-align: center;
    color: var(--wpp-gray-800);
}

.wpp-message {
    padding: var(--wpp-spacing-md);
    border-radius: var(--wpp-radius-md);
    margin-bottom: var(--wpp-spacing-lg);
    font-size: var(--wpp-text-sm);
    display: flex;
    align-items: center;
    gap: var(--wpp-spacing-sm);
}

.wpp-message::before {
    font-size: 18px;
}

.wpp-message-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.wpp-message-success::before {
    content: '✓';
}

.wpp-message-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.wpp-message-error::before {
    content: '✕';
}

/* 询价产品列表 */
.wpp-inquiry-products-list {
    background: var(--wpp-gray-50);
    padding: var(--wpp-spacing-md);
    border-radius: var(--wpp-radius-lg);
    margin-bottom: var(--wpp-spacing-lg);
    border: 1px solid var(--wpp-gray-200);
}

.wpp-inquiry-products-list h4 {
    font-size: var(--wpp-text-sm);
    font-weight: 600;
    margin: 0 0 var(--wpp-spacing-sm);
    color: var(--wpp-gray-700);
}

.wpp-inquiry-products-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wpp-inquiry-products-list li {
    display: flex;
    align-items: center;
    gap: var(--wpp-spacing-sm);
    padding: var(--wpp-spacing-sm) 0;
    border-bottom: 1px solid var(--wpp-gray-200);
    font-size: var(--wpp-text-sm);
}

.wpp-inquiry-products-list li:last-child {
    border-bottom: none;
}

.wpp-inquiry-products-list img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--wpp-radius-md);
    border: 1px solid var(--wpp-gray-200);
}

.wpp-inquiry-products-list .wpp-remove-item {
    margin-left: auto;
    color: var(--wpp-gray-400);
    cursor: pointer;
    padding: var(--wpp-spacing-xs);
    border-radius: var(--wpp-radius-sm);
    transition: all var(--wpp-transition-fast);
}

.wpp-inquiry-products-list .wpp-remove-item:hover {
    color: var(--wpp-error);
    background: #fef2f2;
}

/* 表单样式 */
.wpp-inquiry-form .wpp-form-row {
    margin-bottom: var(--wpp-spacing-md);
}

.wpp-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--wpp-spacing-md);
}

.wpp-form-field label {
    display: block;
    font-size: var(--wpp-text-sm);
    font-weight: 500;
    margin-bottom: var(--wpp-spacing-xs);
    color: var(--wpp-gray-700);
}

.wpp-form-field .required {
    color: var(--wpp-error);
    margin-left: 2px;
}

.wpp-form-field input[type="text"],
.wpp-form-field input[type="email"],
.wpp-form-field input[type="tel"],
.wpp-form-field input[type="url"],
.wpp-form-field textarea,
.wpp-form-field select {
    width: 100%;
    padding: 12px var(--wpp-spacing-md);
    font-size: var(--wpp-text-sm);
    font-family: var(--wpp-font-sans);
    border: 1.5px solid var(--wpp-gray-300);
    border-radius: var(--wpp-radius-md);
    transition: all var(--wpp-transition-fast);
    background: #fff;
    color: var(--wpp-gray-800);
}

.wpp-form-field input::placeholder,
.wpp-form-field textarea::placeholder {
    color: var(--wpp-gray-400);
}

.wpp-form-field input:focus,
.wpp-form-field textarea:focus,
.wpp-form-field select:focus {
    outline: none;
    border-color: var(--wpp-primary-color);
    box-shadow: 0 0 0 3px var(--wpp-primary-light);
}

.wpp-form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.wpp-form-field .description {
    font-size: var(--wpp-text-xs);
    color: var(--wpp-gray-500);
    margin-top: var(--wpp-spacing-xs);
}

.wpp-form-field input[type="file"] {
    padding: var(--wpp-spacing-sm);
    background: var(--wpp-gray-50);
    cursor: pointer;
}

.wpp-btn-submit {
    width: 100%;
    padding: var(--wpp-spacing-md) var(--wpp-spacing-xl);
    font-size: var(--wpp-text-base);
    margin-top: var(--wpp-spacing-sm);
}

/* ========================================
   询价车浮动按钮
   ======================================== */
.wpp-inquiry-cart-float {
    position: fixed;
    bottom: var(--wpp-spacing-xl);
    right: var(--wpp-spacing-xl);
    z-index: 9999;
}

.wpp-cart-btn {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--wpp-primary-color), var(--wpp-primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--wpp-radius-full);
    cursor: pointer;
    box-shadow: var(--wpp-shadow-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--wpp-transition-fast);
    position: relative;
}

.wpp-cart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.4);
}

.wpp-cart-btn svg {
    width: 24px;
    height: 24px;
}

.wpp-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: var(--wpp-error);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--wpp-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.wpp-cart-count:empty,
.wpp-cart-count[data-count="0"] {
    display: none;
}

/* 询价车侧边栏 */
.wpp-cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    box-shadow: var(--wpp-shadow-xl);
    z-index: 99999;
    transition: right var(--wpp-transition-normal);
    display: flex;
    flex-direction: column;
}

.wpp-cart-sidebar.open {
    right: 0;
}

.wpp-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--wpp-transition-normal);
}

.wpp-cart-overlay.open {
    opacity: 1;
    visibility: visible;
}

.wpp-cart-header {
    padding: var(--wpp-spacing-md) var(--wpp-spacing-lg);
    border-bottom: 1px solid var(--wpp-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wpp-cart-header h3 {
    font-size: var(--wpp-text-lg);
    font-weight: 600;
    margin: 0;
    color: var(--wpp-gray-800);
}

.wpp-cart-close {
    width: 32px;
    height: 32px;
    background: var(--wpp-gray-100);
    border: none;
    border-radius: var(--wpp-radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wpp-gray-500);
    transition: all var(--wpp-transition-fast);
}

.wpp-cart-close:hover {
    background: var(--wpp-gray-200);
    color: var(--wpp-gray-700);
}

.wpp-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--wpp-spacing-md);
}

.wpp-cart-item {
    display: flex;
    gap: var(--wpp-spacing-sm);
    padding: var(--wpp-spacing-sm);
    border: 1px solid var(--wpp-gray-200);
    border-radius: var(--wpp-radius-md);
    margin-bottom: var(--wpp-spacing-sm);
}

.wpp-cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: var(--wpp-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.wpp-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wpp-cart-item-info {
    flex: 1;
    min-width: 0;
}

.wpp-cart-item-title {
    font-size: var(--wpp-text-sm);
    font-weight: 500;
    color: var(--wpp-gray-800);
    margin: 0 0 var(--wpp-spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wpp-cart-item-remove {
    color: var(--wpp-gray-400);
    cursor: pointer;
    font-size: var(--wpp-text-xs);
}

.wpp-cart-item-remove:hover {
    color: var(--wpp-error);
}

.wpp-cart-empty {
    text-align: center;
    padding: var(--wpp-spacing-2xl);
    color: var(--wpp-gray-500);
}

.wpp-cart-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--wpp-spacing-md);
    opacity: 0.5;
}

.wpp-cart-footer {
    padding: var(--wpp-spacing-md) var(--wpp-spacing-lg);
    border-top: 1px solid var(--wpp-gray-200);
}

.wpp-cart-footer .wpp-btn {
    width: 100%;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1024px) {
    .wpp-archive-content {
        grid-template-columns: 240px 1fr;
        gap: var(--wpp-spacing-lg);
    }

    .wpp-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wpp-related-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .wpp-carousel .wpp-product-card {
        flex: 0 0 calc((100% - var(--wpp-spacing-lg) * 2) / var(--wpp-columns-tablet, 3));
    }
}

@media (max-width: 768px) {
    :root {
        --wpp-text-4xl: 28px;
        --wpp-text-3xl: 24px;
        --wpp-text-2xl: 20px;
    }

    .wpp-archive-content {
        grid-template-columns: 1fr;
    }

    .wpp-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--wpp-spacing-md);
    }

    .wpp-product-main {
        grid-template-columns: 1fr;
        gap: var(--wpp-spacing-lg);
    }

    .wpp-product-gallery {
        position: static;
    }

    .wpp-products-grid,
    .wpp-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--wpp-spacing-md);
    }

    .wpp-form-row-2 {
        grid-template-columns: 1fr;
    }

    .wpp-tabs-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wpp-tab-btn {
        padding: var(--wpp-spacing-sm) var(--wpp-spacing-md);
    }

    .wpp-carousel .wpp-product-card {
        flex: 0 0 calc(100% / var(--wpp-columns-mobile, 1));
    }

    .wpp-carousel-wrapper {
        padding: 0;
    }

    .wpp-carousel-arrow {
        display: none;
    }

    .wpp-cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .wpp-inquiry-cart-float {
        bottom: var(--wpp-spacing-md);
        right: var(--wpp-spacing-md);
    }
}

@media (max-width: 480px) {
    .wpp-sidebar {
        grid-template-columns: 1fr;
    }

    .wpp-products-grid {
        grid-template-columns: 1fr;
    }

    .wpp-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wpp-product-info .wpp-product-title {
        font-size: var(--wpp-text-xl);
    }

    .wpp-product-detail .wpp-product-actions {
        flex-direction: column;
    }

    .wpp-product-detail .wpp-product-actions .wpp-btn {
        width: 100%;
    }

    .wpp-inquiry-form-wrapper {
        padding: var(--wpp-spacing-md);
    }

    .wpp-social-share {
        flex-wrap: wrap;
    }
}

/* ========================================
   弹窗样式
   ======================================== */
.wpp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--wpp-transition-normal);
}

.wpp-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.wpp-modal {
    background: #fff;
    border-radius: var(--wpp-radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: transform var(--wpp-transition-normal);
}

.wpp-modal-overlay.open .wpp-modal {
    transform: scale(1);
}

.wpp-modal-header {
    padding: var(--wpp-spacing-md) var(--wpp-spacing-lg);
    border-bottom: 1px solid var(--wpp-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wpp-modal-header h3 {
    font-size: var(--wpp-text-lg);
    font-weight: 600;
    margin: 0;
}

.wpp-modal-close {
    width: 32px;
    height: 32px;
    background: var(--wpp-gray-100);
    border: none;
    border-radius: var(--wpp-radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wpp-gray-500);
}

.wpp-modal-close:hover {
    background: var(--wpp-gray-200);
}

.wpp-modal-body {
    padding: var(--wpp-spacing-lg);
}

.wpp-modal-footer {
    padding: var(--wpp-spacing-md) var(--wpp-spacing-lg);
    border-top: 1px solid var(--wpp-gray-200);
    display: flex;
    gap: var(--wpp-spacing-sm);
    justify-content: flex-end;
}

/* 微信二维码弹窗 */
.wpp-qr-modal .wpp-modal-body {
    text-align: center;
}

.wpp-qr-modal .wpp-modal-body p {
    margin: 0 0 var(--wpp-spacing-md);
    color: var(--wpp-gray-600);
}

.wpp-qr-modal .wpp-modal-body img {
    max-width: 200px;
    border-radius: var(--wpp-radius-md);
}

/* ========================================
   Toast 提示
   ======================================== */
.wpp-toast {
    position: fixed;
    bottom: var(--wpp-spacing-xl);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--wpp-gray-800);
    color: #fff;
    padding: var(--wpp-spacing-sm) var(--wpp-spacing-lg);
    border-radius: var(--wpp-radius-full);
    font-size: var(--wpp-text-sm);
    box-shadow: var(--wpp-shadow-xl);
    z-index: 99999;
    opacity: 0;
    transition: all var(--wpp-transition-normal);
}

.wpp-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.wpp-toast.success {
    background: var(--wpp-success);
}

.wpp-toast.error {
    background: var(--wpp-error);
}

/* ========================================
   加载动画
   ======================================== */
.wpp-loading {
    display: inline-flex;
    align-items: center;
    gap: var(--wpp-spacing-sm);
}

.wpp-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--wpp-gray-200);
    border-top-color: var(--wpp-primary-color);
    border-radius: 50%;
    animation: wppSpin 0.8s linear infinite;
}

@keyframes wppSpin {
    to { transform: rotate(360deg); }
}
