/* 搜索页面商品网格专用样式 */
/* 基于 categories-grid.css 但使用 search- 前缀 */

/* 搜索页面商品网格布局 */
#product-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--desktop-cols, 4), 1fr);
    gap: 1rem;
    min-height: 400px;
}

/* 响应式断点 - 支持后台设置控制 */
@media (max-width: 1200px) {
    #product-grid { 
        grid-template-columns: repeat(var(--tablet-cols, 3), 1fr); 
    }
}

@media (max-width: 768px) {
    #product-grid { 
        grid-template-columns: repeat(var(--mobile-cols, 2), 1fr); 
    }
}

@media (max-width: 576px) {
    #product-grid { 
        grid-template-columns: repeat(var(--xs-cols, 2), 1fr); 
    }
}

/* 搜索页面商品卡片样式 - 继承设计稿样式但使用search-前缀 */
.search-card {
    background: white;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    margin-bottom: 1rem;
}

.search-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.search-card:hover .search-info {
    background-color: white;
}

.search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.search-card:hover::before {
    opacity: 1;
}

/* 图片和信息区域 */
.search-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: white;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.search-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-info {
    padding: 0.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    z-index: 2;
}

/* 文本样式 - 统一处理 */
.search-brand, .search-colors {
    font-size: clamp(0.6rem, 2vw, 0.8rem);
    color: #a6a6a6;
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
}

.search-title {
    font-size: clamp(0.7rem, 2.2vw, 0.9rem);
    color: #333;
    margin-bottom: 0.3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.search-price {
    font-size: clamp(0.8rem, 2.5vw, 1.1rem);
    font-weight: 700;
    color: #000;
    margin-top: auto;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
}

.search-brand {
    margin-bottom: 0.2rem;
}

.search-colors {
    margin-top: 0.5rem;
}

/* 搜索页面分页样式 */
.search-load-more-btn {
    background: white !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    padding: 0.75rem 2rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.search-load-more-btn:hover {
    background: #007bff !important;
    color: white !important;
}

.search-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 搜索页面空状态样式 */
.search-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.search-empty-state h3 {
    margin-bottom: 1rem;
    color: #333;
}

.search-empty-state p {
    margin-bottom: 1.5rem;
}

/* 搜索页面面包屑样式 */
.search-breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0 0 1rem 0;
}

.search-breadcrumb-item a {
    color: #2a292f !important;
    text-decoration: none !important;
}

.search-breadcrumb-item a:hover {
    color: #007bff !important;
}

.search-breadcrumb-item.active {
    color: #2a292f !important;
}

/* 兼容性：保持对原有类名的支持 */
.categories-card {
    background: white;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    margin-bottom: 1rem;
}

.categories-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.categories-card:hover .categories-info {
    background-color: white;
}

.categories-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.categories-card:hover::before {
    opacity: 1;
}

.categories-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: white;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.categories-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.categories-info {
    padding: 0.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    z-index: 2;
}

.categories-brand, .categories-colors {
    font-size: clamp(0.6rem, 2vw, 0.8rem);
    color: #a6a6a6;
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
}

.categories-title {
    font-size: clamp(0.7rem, 2.2vw, 0.9rem);
    color: #333;
    margin-bottom: 0.3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.categories-price {
    font-size: clamp(0.8rem, 2.5vw, 1.1rem);
    font-weight: 700;
    color: #000;
    margin-top: auto;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
}

.categories-brand {
    margin-bottom: 0.2rem;
}

.categories-colors {
    margin-top: 0.5rem;
}

.load-more-btn {
    background: white !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    padding: 0.75rem 2rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.load-more-btn:hover {
    background: #007bff !important;
    color: white !important;
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0 0 1rem 0;
}

.breadcrumb-item a {
    color: #2a292f !important;
    text-decoration: none !important;
}

.breadcrumb-item a:hover {
    color: #007bff !important;
}

.breadcrumb-item.active {
    color: #2a292f !important;
}

@media (max-width: 768px) {
    .categories-info { 
        padding: 0.4rem; 
    }
}

@media (max-width: 576px) {
    .categories-info { 
        padding: 0.3rem; 
    }
}
