/**
 * search.css
 * 상품 검색 페이지 스타일
 * [디자인팀] CSS 변수 제거, 직접값 사용 - 2026-01-04
 */

/* 검색 컨테이너 */
.search-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 검색 박스 */
.search-box {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.xianyu-notice {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

/* 플랫폼 탭 */
.platform-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.platform-tab {
    padding: 12px 30px;
    border: 2px solid #e0e7ff;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
}

.platform-tab:hover {
    border-color: #667eea;
}

.platform-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.platform-tab .icon {
    font-size: 18px;
}

/* 검색 폼 */
.search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    padding: 14px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.search-btn:disabled {
    background: #ccc;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* 최근 검색어 */
.recent-searches {
    margin-top: 20px;
    text-align: center;
}

.recent-label {
    font-size: 13px;
    color: #999;
    margin-right: 10px;
}

.recent-tag {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f0f0;
    border-radius: 15px;
    font-size: 13px;
    color: #666;
    margin: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.recent-tag:hover {
    background: #667eea;
    color: white;
}

/* 검색 결과 */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-count {
    font-size: 15px;
    color: #666;
}

.results-count strong {
    color: #667eea;
}

/* 상품 그리드 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-img-wrap {
    position: relative;
    padding-top: 100%;
    background: #f5f5f5;
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-platform {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}

.platform-taobao {
    background: #ff6b00;
    color: white;
}

.platform-1688 {
    background: #ff4400;
    color: white;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #dc2626;
}

.product-price small {
    font-size: 13px;
    color: #999;
    font-weight: normal;
}

.product-sales {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 로딩 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e7ff;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 빈 결과 */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

/* 에러 */
.error {
    background: #fee2e2;
    color: #dc2626;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    padding: 10px 20px;
    color: #999;
}

/* 반응형 */
@media (max-width: 768px) {
    .search-container {
        margin: 20px auto;
    }

    .search-box {
        padding: 20px;
    }

    .platform-tabs {
        flex-wrap: wrap;
    }

    .platform-tab {
        padding: 10px 20px;
        font-size: 14px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
