/* ── 전체 카테고리 페이지 ── */
.category-list-page {
    padding: 24px 0 56px;
}

.category-list-intro {
    color: #555;
    font-size: .95rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* ── 분할 뷰 컨테이너 (모바일 기본) ── */
.category-container {
    display: flex;
    height: min(72vh, 640px);
    min-height: 420px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

/* ── 좌측 대분류 내비게이션 (모바일) ── */
.main-category-nav {
    width: 96px;
    flex-shrink: 0;
    background-color: #fafafa;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.main-category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 14px 8px;
    border: none;
    border-left: 3px solid transparent;
    background: none;
    color: #666;
    font-size: .8rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.main-category-btn:hover {
    background-color: #f0f0f0;
}

.main-category-btn:focus-visible {
    outline: 2px solid #e6007e;
    outline-offset: -2px;
}

.main-category-btn.active {
    background-color: #fff;
    border-left-color: #e6007e;
    color: #1a1a1a;
    font-weight: 700;
}

.thumb-circle {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background-color: #fff0f7;
    color: #e6007e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.main-category-btn.active .thumb-circle {
    background-color: #e6007e;
    color: #fff;
}

/* ── 우측 중분류 콘텐츠 (모바일) ── */
.sub-category-content {
    flex-grow: 1;
    min-width: 0;
    padding: 16px;
    overflow-y: auto;
    background-color: #fff;
}

.category-section {
    margin-bottom: 28px;
}

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

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -.3px;
    margin-bottom: 14px;
}

.sub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.sub-item {
    display: flex;
    text-decoration: none;
}

.sub-item:focus-visible {
    outline: 2px solid #e6007e;
    outline-offset: 2px;
}

.sub-item-label {
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 6px;
    background-color: #fafafa;
    color: #555;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: keep-all;
    overflow-wrap: break-word;
    transition: background-color .2s, color .2s;
}

.sub-item:hover .sub-item-label,
.sub-item:focus-visible .sub-item-label {
    background-color: #e6007e;
    color: #fff;
}

/* ── 데스크톱: 상단 가로 탭 + 6열 그리드 ── */
@media (min-width: 768px) {
    .category-container {
        height: auto;
        min-height: 0;
        overflow: visible;
        display: block;
        border: none;
        border-radius: 0;
    }

    .main-category-nav {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        background: none;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 32px;
        overflow: visible;
    }

    .main-category-btn {
        width: auto;
        flex-direction: row;
        gap: 10px;
        padding: 12px 24px;
        border-left: none;
        border-bottom: 2px solid transparent;
        font-size: 1rem;
    }

    .main-category-btn.active {
        border-bottom-color: #e6007e;
    }

    .sub-category-content {
        padding: 0;
        overflow: visible;
    }

    .sub-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 20px;
    }

    .sub-item-label {
        min-height: 72px;
        padding: 12px 10px;
        border-radius: 12px;
        font-size: .9rem;
    }
}
