/* ==================== 产品列表页样式 ==================== */
/* 使用统一变量系统 (variables.css) */

/* ==================== 骨架屏 ==================== */
.skeleton-filter {
    height: 50px;
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.1) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer var(--duration-slower) infinite;
    margin: 10px var(--space-4);
    border-radius: var(--radius-sm);
}

.skeleton-product-list {
    padding: 0 var(--space-4);
}

.skeleton-product-card {
    height: 120px;
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.1) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer var(--duration-slower) infinite;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== 下拉刷新 ==================== */
.pull-refresh {
    position: fixed;
    top: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: var(--bg-root);
    z-index: var(--z-above);
    transition: transform var(--duration-normal);
}

.pull-refresh.active {
    transform: translateY(60px);
}

.pull-refresh.refreshing .pull-refresh-icon {
    animation: rotate 1s linear infinite;
}

.pull-refresh-icon {
    color: var(--accent-red);
}

.pull-refresh-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==================== 产品页头部 ==================== */
.products-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.products-header .header-content {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    gap: var(--space-3);
}

.back-btn, .search-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-normal);
}

.back-btn:active, .search-btn:active {
    transform: scale(var(--scale-press));
    background: rgba(255, 255, 255, 0.1);
}

.page-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    text-align: center;
}

/* ==================== 筛选栏 ==================== */
.filter-section {
    position: sticky;
    top: var(--header-height);
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(var(--blur-xl));
    -webkit-backdrop-filter: blur(var(--blur-xl));
    border-bottom: 1px solid var(--border-subtle);
    z-index: var(--z-dropdown);
    padding: var(--space-3) 0;
}

.filter-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 var(--space-4);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
    display: none;
}

.filter-tag {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--duration-normal);
    white-space: nowrap;
}

.filter-tag.active {
    background: linear-gradient(135deg, var(--accent-red) 0%, #ff6b6b 100%);
    border-color: var(--accent-red);
    color: var(--text-primary);
}

.filter-tag:not(.active):active {
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== 产品列表主区域 ==================== */
.products-main {
    padding: var(--space-4);
    padding-bottom: calc(100px + var(--safe-bottom));
    min-height: calc(100vh - 130px);
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* ==================== 产品卡片 ==================== */
.product-card,
.product-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal);
}

.product-card:active,
.product-item:active {
    transform: scale(var(--scale-press));
    background: rgba(255, 255, 255, 0.08);
}

/* ==================== 产品缩略图 ==================== */
.product-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* ==================== 产品内容 ==================== */
.product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-title {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    line-height: var(--leading-snug);
    margin-bottom: 4px;
}

.product-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.product-content .product-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-snug);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-image-wrapper {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-placeholder {
    font-size: 40px;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
}

.product-name {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    line-height: var(--leading-snug);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-tag {
    flex-shrink: 0;
    padding: 4px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
}

.brand-tag.taiye {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold-primary);
}

.brand-tag.suzhong {
    background: rgba(79, 172, 254, 0.2);
    color: #4facfe;
}

.product-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-normal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: var(--space-2) 0;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-category {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: var(--radius-md);
}

.view-detail-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-md);
    color: var(--accent-red);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--duration-normal);
}

.view-detail-btn:active {
    background: var(--accent-red);
    color: var(--text-primary);
}

/* ==================== 加载更多 ==================== */
.load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    gap: var(--space-2);
}

.load-more-spinner {
    display: flex;
    gap: 4px;
}

.spinner-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: var(--radius-full);
    animation: bounce 1.4s ease-in-out infinite both;
}

.spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.spinner-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.load-more-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.no-more {
    text-align: center;
    padding: var(--space-6);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.no-more::before,
.no-more::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--border-subtle);
    vertical-align: middle;
    margin: 0 var(--space-3);
}

/* ==================== 搜索弹窗 ==================== */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-root);
    z-index: var(--z-overlay);
    transform: translateY(100%);
    transition: transform var(--duration-normal);
}

.search-modal.active {
    transform: translateY(0);
}

.search-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(var(--blur-xl));
    -webkit-backdrop-filter: blur(var(--blur-xl));
    border-bottom: 1px solid var(--border-subtle);
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 10px var(--space-4);
}

.search-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--text-base);
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-secondary);
}

.clear-btn {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cancel-btn {
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-base);
    cursor: pointer;
}

.search-results {
    padding: var(--space-4);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    cursor: pointer;
    transition: all var(--duration-normal);
}

.search-result-item:active {
    background: rgba(255, 255, 255, 0.08);
}

.result-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.result-category {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.search-result-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.search-result-info h4 {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin-bottom: 4px;
}

.search-result-info p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px var(--space-5);
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
}

.search-empty p {
    font-size: var(--text-base);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.search-empty span {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}