/* ==========================================
   搜索页面现代化样式 - 优化版
   ========================================== */

/* 搜索容器 */
.search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 搜索头部 */
.search-header {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.search-header-top {
    margin-bottom: 20px;
}

.search-title-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
}

.search-title i {
    color: #F5C057;
    font-size: 32px;
}

.search-query-text {
    color: #3a8fc7;
    font-weight: 700;
}

.search-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    color: #666;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-item i {
    color: #E99122;
    font-size: 18px;
}

.highlight-number {
    color: #E99122;
    font-size: 18px;
    font-weight: 700;
}

.stat-divider {
    color: #ddd;
    font-weight: 300;
}

/* 工具栏 */
.search-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.toolbar-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.view-mode {
    display: flex;
    gap: 8px;
    background: #f5f5f5;
    padding: 5px;
    border-radius: 10px;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.view-btn i {
    font-size: 16px;
}

.view-btn:hover {
    background: white;
    color: #3a8fc7;
}

.view-btn.active {
    background: white;
    color: #3a8fc7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

/* 搜索结果列表 */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 产品卡片 */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 已禁用卡片悬停效果 */
/* .product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
} */

.product-card-inner {
    display: flex;
    padding: 20px;
    gap: 25px;
}

/* 产品图片 */
.product-image-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

.product-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

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

/* 已禁用图片悬停放大效果 */
/* .product-card:hover .product-image {
    transform: scale(1.05);
} */

.image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(58, 143, 199, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none; /* 禁用遮罩层交互 */
}

/* 已禁用遮罩层悬停显示效果 */
/* .product-image-wrapper:hover .image-overlay {
    opacity: 1;
} */

.view-details {
    color: white;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-quality {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
}

/* 产品信息 */
.product-info-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product-main-info {
    flex: 1;
}

.product-name {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.product-name a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.product-name a:hover {
    color: #3a8fc7;
}

.product-name mark {
    background: linear-gradient(120deg, #FFE66D 0%, #FFE66D 100%);
    background-repeat: no-repeat;
    background-size: 100% 40%;
    background-position: 0 85%;
    padding: 0 4px;
    color: inherit;
    font-weight: 700;
}

/* 产品元数据 */
.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.meta-label {
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-label i {
    font-size: 16px;
    color: #999;
}

.meta-value {
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: none;
}

.meta-value:hover {
    color: #3a8fc7;
}

.meta-value mark {
    background: #FFE66D;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* 产品属性标签 */
.product-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.attribute-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f0f7fb;
    border: 1px solid #d5e8f3;
    border-radius: 8px;
    font-size: 13px;
    color: #3a8fc7;
    font-weight: 500;
}

.attribute-tag i {
    font-size: 14px;
}

.attribute-tag.formula {
    background: #fff5e6;
    border-color: #ffe0b3;
    color: #E99122;
    font-family: 'Courier New', monospace;
}

/* 产品操作区 */
.product-action-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
    min-width: 200px;
}

.product-pricing {
    width: 100%;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
}

.pricing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.pricing-header i {
    font-size: 16px;
}

.pricing-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.size-label {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #d4edda;
    color: #28a745;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.stock-badge i {
    font-size: 14px;
}

.more-sizes {
    text-align: center;
    color: #3a8fc7;
    font-size: 13px;
    font-weight: 600;
    padding-top: 8px;
    border-top: 1px dashed #dee2e6;
}

.btn-view-product {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3a8fc7 0%, #2d7bb8 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(58, 143, 199, 0.2);
}

.btn-view-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 143, 199, 0.3);
    color: white;
}

.btn-view-product i {
    transition: transform 0.3s ease;
}

.btn-view-product:hover i {
    transform: translateX(4px);
}

/* 网格视图 */
.search-results.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.search-results.grid-view .product-card-inner {
    flex-direction: column;
}

.search-results.grid-view .product-image-wrapper {
    width: 100%;
    height: 250px;
}

.search-results.grid-view .product-action-wrapper {
    width: 100%;
    align-items: stretch;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .search-results.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .search-container {
        padding: 15px 10px;
    }
    
    .search-header {
        padding: 20px 15px;
    }
    
    .search-title {
        font-size: 22px;
    }
    
    .search-toolbar {
        padding-top: 15px;
    }
    
    .toolbar-right {
        width: 100%;
        justify-content: center;
    }
    
    .product-card-inner {
        flex-direction: column;
        padding: 15px;
    }
    
    .product-image-wrapper {
        width: 100%;
        height: 250px;
    }
    
    .product-action-wrapper {
        width: 100%;
        align-items: stretch;
    }
    
    .search-results.grid-view {
        grid-template-columns: 1fr;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .search-title {
        font-size: 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .search-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .stat-divider {
        display: none;
    }
    
    .view-mode {
        width: 100%;
    }
    
    .view-btn {
        flex: 1;
        justify-content: center;
    }
    
    .product-name {
        font-size: 16px;
    }
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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