/* ==========================================================
 * MS 카테고리 아이콘 그리드 (Class101형)
 * 좌: 배너 카드 / 우: 카테고리 썸네일 그리드 (더보기 확장)
 * ========================================================== */

.mscg-wrap {
    display: flex;
    align-items: center;
    gap: 40px;
}

/* ── 왼쪽 배너 ─────────────────────────────────────────── */
.mscg-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #f4f4f5;
    border-radius: 16px;
    padding: 26px 32px;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: background 0.15s ease;
}

a.mscg-banner:hover {
    background: #ececee;
}

.mscg-banner-text {
    min-width: 0;
}

.mscg-banner-title {
    font-size: 20px;
    font-weight: 700;
    color: #1b1c1d;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin-bottom: 8px;
    word-break: keep-all;
}

.mscg-banner-sub {
    font-size: 15px;
    font-weight: 400;
    color: #5f6265;
    letter-spacing: -0.01em;
    line-height: 1.4;
    word-break: keep-all;
}

.mscg-banner-img {
    flex: 0 0 auto;
}

.mscg-banner-img img {
    display: block;
    width: 120px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.3s ease;
    will-change: transform;
}

.mscg-banner:hover .mscg-banner-img img {
    transform: translateY(-4px) scale(1.06);
    filter: drop-shadow(0 12px 20px rgba(15, 23, 42, 0.18));
}

@media (prefers-reduced-motion: reduce) {
    .mscg-banner-img img,
    .mscg-banner:hover .mscg-banner-img img {
        transition: none;
        transform: none;
        filter: none;
    }
}

/* ── 카테고리 그리드 ───────────────────────────────────── */
.mscg-grid-area {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.mscg-grid {
    display: grid;
    grid-template-columns: repeat(var(--mscg-cols, 8), 1fr);
    gap: 22px 12px;
}

.mscg-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-family: inherit;
}

.mscg-thumb {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 16px;
    transition: transform 0.18s ease;
}

.mscg-item:hover .mscg-thumb {
    transform: translateY(-3px);
}

.mscg-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f5;
    color: #c3c4c8;
}

.mscg-thumb--empty svg {
    width: 55%;
    height: 55%;
}

.mscg-label {
    font-size: 13px;
    font-weight: 500;
    color: #1b1c1d;
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-align: center;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 더보기/접기 토글 */
.mscg-toggle {
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.mscg-more-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #ebebed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: #1b1c1d;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mscg-toggle:hover .mscg-more-circle {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mscg-more-circle svg {
    width: 22px;
    height: 22px;
}

/* ── 확장 패널 (더보기) ────────────────────────────────── */
.mscg-panel {
    position: absolute;
    top: -28px;
    left: -28px;
    right: -28px;
    z-index: 900;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    padding: 28px;
    box-sizing: border-box;
}

.mscg-panel[hidden] {
    display: none;
}

.mscg-empty {
    padding: 24px;
    font-size: 14px;
    color: #94969b;
    text-align: center;
}

/* ── 반응형 ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .mscg-wrap {
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .mscg-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .mscg-banner {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        padding: 20px 22px;
    }

    .mscg-banner-title {
        font-size: 17px;
    }

    .mscg-banner-sub {
        font-size: 13px;
    }

    .mscg-banner-img img {
        width: 80px;
    }

    .mscg-panel {
        top: -16px;
        left: -12px;
        right: -12px;
        padding: 18px 14px;
        border-radius: 16px;
    }

    .mscg-grid {
        gap: 18px 8px;
    }
}
