/* 상품 목록 페이지 스타일 */
.products-section {
    padding: 60px 0;
    background-color: #f9fafb;
    min-height: calc(100vh - 400px);
}

.products-header {
    margin-bottom: 40px;
    text-align: center;
}

.products-header h1 {
    font-size: 2.5rem;
    color: #1f2937;
    margin-bottom: 15px;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 10px;
    color: #6b7280;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #3b82f6;
}

.breadcrumb span {
    color: #9ca3af;
}

/* 상품 컨테이너 */
.products-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 사이드바 필터 */
.products-sidebar {
    background: white;
    border-radius: 10px;
    padding: 25px;
    height: fit-content;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 30px;
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 1.1rem;
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list > li {
    margin-bottom: 12px;
    position: relative;
}

.category-list a {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    padding: 6px 0;
}

.category-list > li > a {
    font-weight: 500;
}

.category-list a:hover,
.category-list li.active > a {
    color: #3b82f6;
    padding-left: 5px;
}

/* Subcategory styles */
.subcategory-list {
    list-style: none;
    padding: 5px 0 0 20px;
    margin: 5px 0 0 0;
    border-left: 1px solid #e5e7eb;
    display: none; /* Hidden by default */
}

.subcategory-list li {
    margin-bottom: 6px;
    position: relative;
}

.subcategory-list a {
    font-size: 0.9rem;
    color: #6b7280;
    position: relative;
    padding-left: 15px;
}

.subcategory-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: #9ca3af;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.subcategory-list a:hover,
.subcategory-list li.active a {
    color: #3b82f6;
    padding-left: 20px;
}

.subcategory-list a:hover::before,
.subcategory-list li.active a::before {
    background-color: #3b82f6;
    width: 8px;
    height: 8px;
}

/* Loading state */
.loading-categories {
    color: #6b7280;
    font-size: 0.9rem;
    padding: 10px 0;
    font-style: italic;
}

/* 가격 범위 */
.price-range {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.range-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.range-inputs input {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.range-inputs input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9rem;
}

/* 정렬 셀렉트 */
.sort-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #4b5563;
    background-color: white;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 상품 그리드 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* 상품 카드 */
.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.product-badge[data-badge="인기"] { background: #ef4444; }
.product-badge[data-badge="신규"] { background: #10b981; }
.product-badge[data-badge="특가"] { background: #f59e0b; }
.product-badge[data-badge="무료 체험"] { background: #8b5cf6; }

.product-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-details {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.product-card h3 {
    font-size: 1.2rem;
    color: #1f2937;
    margin: 0 0 10px;
    line-height: 1.3;
}

.product-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0 0 15px;
    flex: 1;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.9rem;
}

.review-count {
    color: #9ca3af;
    font-weight: normal;
    font-size: 0.85rem;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.product-actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
    margin-top: 10px;
}

.product-actions .btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
}

.page-nav,
.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s;
}

.page-nav {
    background: #f3f4f6;
}

.page-num:hover {
    background: #f3f4f6;
}

.page-num.active {
    background: #3b82f6;
    color: white;
}

.page-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .products-container {
        grid-template-columns: 1fr;
        max-width: 800px;
    }
    
    .products-sidebar {
        position: static;
        margin-bottom: 30px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .products-section {
        padding: 40px 0;
    }
    
    .products-header h1 {
        font-size: 2rem;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .products-header {
        margin-bottom: 30px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-section h3 {
        font-size: 1rem;
    }
    
    .product-card h3 {
        font-size: 1.1rem;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .page-nav,
    .page-num {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}
