:root {
    --bg: #f7f8fa;
    --bg-subtle: #f0f1f4;
    --panel: #ffffff;
    --border: #e5e7eb;
    --border-light: #f0f1f4;
    --text: #111827;
    --text-secondary: #374151;
    --muted: #6b7280;
    --accent: #111827;
    --accent-hover: #374151;
    --accent-light: #f3f4f6;
    --accent-subtle: #f9fafb;
    --success: #10b981;
    --radius: 12px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg);
}

/* ==================== 페이지 레이아웃 ==================== */
.page-container .page-wrap.category-page-wrap {
    padding: 0 !important;
    max-width: 100%;
}

.category-page {
    padding: 0;
    min-height: 100vh;
    background: var(--bg);
}

/* ==================== 페이지 헤더 ==================== */
.page-header {
    padding: 32px 40px 24px;
}

.page-header-content {
    max-width: 100%;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    color: var(--text);
}

/* 브레드크럼 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.breadcrumb-link {
    color: var(--muted);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-link:hover {
    color: var(--text);
}

.breadcrumb-separator {
    color: var(--border);
    display: flex;
    align-items: center;
}

.breadcrumb-current {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== 메인 콘텐츠 ==================== */
.category-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    padding: 0 40px 60px;
}

/* ==================== 사이드바 ==================== */
.category-sidebar {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: sticky;
    top: 24px;
    border: 1px solid var(--border-light);
}

.sidebar-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.category-item {
    margin: 0;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    text-decoration: none;
    color: var(--muted);
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.category-link:hover {
    background: var(--accent-light);
    color: var(--text);
    border-left-color: var(--border);
}

.category-item.active .category-link {
    background: var(--accent-light);
    color: var(--text);
    border-left-color: var(--text);
    font-weight: 600;
}

.category-name {
    font-size: 14px;
}

.product-count {
    font-size: 12px;
    color: var(--muted);
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.category-item.active .product-count {
    background: var(--accent);
    color: #fff;
}

/* ==================== 상품 영역 ==================== */
.products-area {
    min-height: 500px;
}

/* 툴바 */
.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.total-count {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.total-count strong {
    color: var(--text);
    font-weight: 700;
}

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

.view-options {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.view-btn:hover {
    color: var(--accent);
    background: var(--panel);
}

.view-btn.active {
    background: var(--panel);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* ==================== 상품 그리드 ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* ==================== 상품 카드 ==================== */
.product-card {
    display: block;
    background: var(--panel);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-slow);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.product-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: linear-gradient(145deg, #f8f9fc 0%, #edf0f7 100%);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--border);
}

/* 퀵 액션 버튼 */
.quick-actions {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(12px);
    transition: var(--transition-slow);
}

.product-card:hover .quick-actions {
    opacity: 1;
    transform: translateY(0);
}

.quick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--panel);
    border: none;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.quick-btn:hover {
    background: var(--text);
    color: #fff;
    transform: scale(1.05);
}

/* 상품 정보 */
.product-info {
    padding: 18px 20px 20px;
}

.product-category {
    display: inline-flex;
    width: fit-content;
    font-size: 11px;
    color: var(--muted);
    background: var(--accent-light);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 500;
}

.product-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover .product-name {
    color: var(--text);
}

.product-desc {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 14px 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.product-price small {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.product-price.contact {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

/* 2열 보기 모드 */
.products-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.products-grid.cols-2 .product-card {
    display: grid;
    grid-template-columns: 220px 1fr;
}

.products-grid.cols-2 .product-image-wrap {
    padding-top: 0;
    height: 220px;
    border-radius: var(--radius) 0 0 var(--radius);
}

.products-grid.cols-2 .product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 28px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ==================== 상품 없음 ==================== */
.empty-products {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 40px;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border-light);
}

.empty-icon {
    color: var(--border);
    margin-bottom: 28px;
    padding: 24px;
    background: var(--bg);
    border-radius: 50%;
}

.empty-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
}

.empty-desc {
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 28px 0;
}

.empty-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: var(--text);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.empty-btn:hover {
    background: var(--text-secondary);
}

/* ==================== 반응형 ==================== */
@media screen and (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-content {
        gap: 24px;
    }
}

@media screen and (max-width: 900px) {
    .category-content {
        grid-template-columns: 1fr;
        padding: 0 16px 48px;
    }

    .page-header {
        padding: 24px 16px 20px;
    }

    .category-sidebar {
        position: static;
    }

    .sidebar-header {
        display: none;
    }

    .category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 16px;
    }

    .category-item {
        flex: 0 0 auto;
    }

    .category-link {
        padding: 10px 18px;
        border-radius: var(--radius-sm);
        border-left: none;
        background: var(--bg);
        border: 1px solid var(--border-light);
    }

    .category-link:hover,
    .category-item.active .category-link {
        border-left: none;
        background: var(--accent-light);
        border-color: var(--text);
    }

    .product-count {
        display: none;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .page-header {
        padding: 36px 20px;
    }

    .page-title {
        font-size: 28px;
    }
}

@media screen and (max-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .products-grid.cols-2 {
        grid-template-columns: 1fr;
    }

    .products-grid.cols-2 .product-card {
        display: block;
    }

    .products-grid.cols-2 .product-image-wrap {
        padding-top: 100%;
        height: auto;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .products-grid.cols-2 .product-info {
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .product-info {
        padding: 16px;
    }

    .product-category {
        font-size: 10px;
        padding: 4px 10px;
        margin-bottom: 10px;
    }

    .product-name {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .product-desc {
        display: none;
    }

    .product-price {
        font-size: 17px;
    }

    .product-price-wrap {
        padding-top: 12px;
    }

    .products-toolbar {
        padding: 14px 16px;
    }

    .page-header {
        padding: 20px 16px 16px;
    }

    .page-title {
        font-size: 22px;
    }

    .breadcrumb {
        font-size: 12px;
    }

    .quick-actions {
        display: none;
    }

    .view-options {
        display: none;
    }

    .category-content {
        padding: 0 16px 40px;
    }
}

/* ==================== 애니메이션 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(9) { animation-delay: 0.45s; }
.product-card:nth-child(10) { animation-delay: 0.5s; }
.product-card:nth-child(11) { animation-delay: 0.55s; }
.product-card:nth-child(12) { animation-delay: 0.6s; }
