/* 상품 목록 페이지 스타일 - 럭셔리 디자인 */
.products-section {
    padding: 80px 0;
    background-color: var(--gray-100);
    min-height: calc(100vh - 400px);
}

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

.products-header h1 {
    font-size: 2rem;
    color: var(--gray-900);
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 10px;
    color: var(--gray-600);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.breadcrumb a {
    color: var(--gray-700);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    color: var(--gray-500);
}
.products-content {
    display: flex;
    flex-direction: column; /* 상품 그리드 + 페이지네이션 세로 정렬 */
    gap: 20px; /* 상품과 페이지네이션 간격 */
}
/* 상품 컨테이너 */
.products-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start; /* ✅ 사이드바 높이에 맞춰 상품 영역 늘어나는 문제 방지 */
}

/* 사이드바 필터 */
.products-sidebar {
    background: white;
    border-radius: 0;
    padding: 30px;
    height: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-300);
    position: sticky;
    top: 100px;
}

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

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

.filter-section h3 {
    font-size: 0.9rem;
    color: var(--gray-900);
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-300);
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

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

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

.category-list a {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    padding: 8px 0;
    letter-spacing: 0.3px;
}

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

.category-list a:hover,
.category-list li.active > a {
    color: var(--primary-color);
    padding-left: 5px;
}

/* Subcategory styles */
.subcategory-list {
    list-style: none;
    padding: 2px 0 0 20px;
    margin: 3px 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: var(--primary-color);
    padding-left: 20px;
}

.subcategory-list a:hover::before,
.subcategory-list li.active a::before {
    background-color: var(--primary-color);
    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 var(--gray-300);
    border-radius: 0;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

.range-inputs input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: none;
}

.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: #FF6B35;
    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: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-300);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.product-badge[data-badge="인기"] { background: var(--danger-color); }
.product-badge[data-badge="신규"] { background: var(--success-color); }
.product-badge[data-badge="특가"] { background: var(--accent-gold); }
.product-badge[data-badge="무료 체험"] { background: var(--primary-color); }

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

.product-image img {
    width: 70%;
    height: 250px;
    object-fit: cover;
    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: 1rem;
    color: var(--gray-900);
    margin: 0 0 10px;
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.product-description {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin: 0 0 15px;
    flex: 1;
    letter-spacing: 0.2px;
    line-height: 1.6;
}

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

.product-features {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.feature-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.4);
}

.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: 8px;
    margin: 60px auto 0;
    width: fit-content; /* ✅ 중앙 고정용 */
}

.page-nav,
.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.25s ease;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.page-num:hover,
.page-nav:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.page-num.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.page-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
}

/* 모바일에서 조금 작게 */
@media (max-width: 480px) {
    .page-nav,
    .page-num {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

/* 반응형 디자인 */
@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;
    }
}
