/*
 * 세 스토어(앱·에셋·강의) 공통 틀 — resources/views/store/layout.blade.php 와 <x-store::…> 조각이 쓴다.
 * 값은 승인된 시안(판결 2026-mr322 §2)의 인라인 스타일을 그대로 옮겼다. 시안에 없는 값을 더하지 않는다.
 * 클래스는 모두 ss- 로 시작한다. 강조색은 --ss-accent 하나다.
 * 좁은 화면으로 접히는 폭은 860px 이다 — 아래 @media (max-width: 860px) 를 함께 바꾼다.
 */

:root {
    --ss-accent: #0071e3;
    --ss-text: #1d1d1f;
    --ss-text-2: #424245;
    --ss-muted: #6e6e73;
    --ss-faint: #86868b;
    --ss-line: #e5e5ea;
    --ss-line-soft: #f0f0f3;
    --ss-surface: #f5f5f7;
    --ss-search-bg: #e8e8ed;
    --ss-current-bg: #e3e3e8;
    --ss-avatar: #d2d2d7;
    --ss-bg: #ffffff;
    --ss-link-hover: #0066cc;
}

.ss-body {
    margin: 0;
    background: var(--ss-bg);
}

:where(.ss-body a) {
    color: var(--ss-text);
    text-decoration: none;
}

:where(.ss-body a:hover) {
    color: var(--ss-link-hover);
}

:where(.ss-body button) {
    font: inherit;
    cursor: pointer;
}

:where(.ss-body input) {
    font: inherit;
}

.ss-skip {
    position: absolute;
    left: -9999px;
}

.ss-skip:focus {
    left: 8px;
    top: 8px;
    z-index: 10;
    padding: 8px 14px;
    background: var(--ss-bg);
}

.ss-visually-hidden,
.ss-search-toggle,
.ss-menu-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* 틀 ------------------------------------------------------------------ */

.ss-shell {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    background: var(--ss-bg);
    color: var(--ss-text);
    font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR', sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

.ss-main {
    flex: 1 1 640px;
    min-width: 0;
    box-sizing: border-box;
    padding: 36px 44px 0;
    display: flex;
    flex-direction: column;
}

.ss-content {
    flex: 1;
}

/* 사이드바 -------------------------------------------------------------- */

.ss-sidebar {
    flex: 0 0 248px;
    min-width: 248px;
    box-sizing: border-box;
    padding: 20px 14px;
    background: var(--ss-surface);
    border-right: 1px solid var(--ss-line);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ss-logo {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--ss-text);
}

/* 개편 전 스토어 헤더의 gujo 로고 이미지(82×24) — 사용자가 시안의 강조색 마크 대신 고른 값. */
.ss-logo-img {
    flex: none;
    display: block;
    width: 82px;
    height: 24px;
}

.ss-logo-store {
    font-size: 13px;
    font-weight: 600;
    color: var(--ss-muted);
}

.ss-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    border-radius: 9px;
    background: var(--ss-search-bg);
}

.ss-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 15px;
    color: var(--ss-text);
}

/* 목록 화면 본문의 검색칸(<x-store::search-field class="ss-search--page">) — 사이드바 검색과 같은 모양, 본문 폭에 맞춘다. */
.ss-search--page {
    max-width: 420px;
    margin: 0 0 20px;
}

.ss-sections {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ss-section-link {
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    color: var(--ss-text);
    background: transparent;
}

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

.ss-section-link[aria-current="page"] {
    font-weight: 700;
    background: var(--ss-current-bg);
}

.ss-section-icon {
    width: 22px;
    display: inline-flex;
    justify-content: center;
    color: var(--ss-muted);
}

.ss-section-link[aria-current="page"] .ss-section-icon {
    color: var(--ss-accent);
}

.ss-section-label {
    flex: 1;
}

.ss-account {
    margin-top: auto;
    border-top: 1px solid var(--ss-line);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ss-account--guest {
    font-size: 14px;
}

.ss-account-user {
    min-height: 40px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.ss-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ss-avatar);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.ss-account-link,
.ss-account-form button {
    min-height: 34px;
    padding: 0 10px 0 46px;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--ss-text-2);
}

.ss-account-link:hover {
    color: var(--ss-text-2);
}

.ss-account-link--admin,
.ss-account-link--admin:hover {
    color: var(--ss-faint);
}

.ss-account-form {
    margin: 0;
}

.ss-account-form button {
    width: 100%;
    border: 0;
    background: none;
    text-align: left;
}

.ss-login {
    min-height: 40px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    color: var(--ss-text);
}

.ss-login:hover {
    color: var(--ss-text);
}

.ss-cloud-apps {
    min-height: 36px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--ss-muted);
}

.ss-cloud-apps:hover {
    color: var(--ss-muted);
}

.ss-account-user ~ .ss-cloud-apps {
    margin-top: 6px;
}

/* 좁은 화면 상단 막대와 메뉴 --------------------------------------------- */

.ss-topbar {
    display: none;
}

/* 본문: 페이지 머리·선택 블록·셸프 ---------------------------------------- */

.ss-page-title {
    margin: 0 0 16px;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.ss-page-title--with-desc {
    margin: 0 0 8px;
    line-height: inherit;
}

.ss-page-desc {
    margin: 0 0 24px;
    color: var(--ss-muted);
}

.ss-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: var(--ss-line-soft);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.ss-seg-item {
    border: 0;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ss-text);
    background: transparent;
    box-shadow: none;
}

.ss-seg-item:hover {
    color: var(--ss-text);
}

.ss-seg-item[aria-current="true"] {
    background: var(--ss-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.ss-shelf {
    margin-bottom: 44px;
}

/* 선택 블록 없이 제목 바로 아래 셸프가 오는 화면(강의 첫 화면)은 선택 블록과 같은 32px 를 띄운다. */
.ss-page-title + .ss-shelf {
    margin-top: 32px;
}

.ss-shelf-head {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ss-line);
    margin-bottom: 4px;
}

.ss-shelf-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ss-shelf-note {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--ss-muted);
}

/* 리스트 행·순위 행 ------------------------------------------------------ */

.ss-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    column-gap: 28px;
}

.ss-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
}

.ss-row--ranked {
    grid-template-columns: 56px 20px minmax(0, 1fr) auto;
}

.ss-rank-number {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}

.ss-row-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 6px 0;
    border-bottom: 1px solid var(--ss-line-soft);
}

.ss-row-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.ss-row-name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-apps-subscription-badge {
    flex: none;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--ss-text);
    color: var(--ss-bg);
}

.ss-row-desc {
    font-size: 13px;
    color: var(--ss-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 앱 아이콘 ------------------------------------------------------------- */

.ss-icon {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 13px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    object-fit: cover;
}

.ss-icon--empty {
    background: var(--ss-line);
}

/* 이미지 없는 에셋의 아이콘 — 옅은 바탕 둥근 사각 안의 유형 선 아이콘(asset-store::partials.type-icon). */
.ss-icon--type {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: #f5f5f7;
    color: var(--ss-accent);
}

.ss-icon--type svg {
    width: 46%;
    height: 46%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 알약 버튼 ------------------------------------------------------------- */

.ss-pill {
    height: 30px;
    min-width: 64px;
    padding: 0 14px;
    box-sizing: border-box;
    border: 0;
    border-radius: 999px;
    background: var(--ss-line-soft);
    color: var(--ss-accent);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ss-pill:hover {
    color: var(--ss-accent);
}

.ss-pill--primary,
.ss-pill--primary:hover {
    height: 36px;
    min-width: 88px;
    padding: 0 20px;
    background: var(--ss-accent);
    color: var(--ss-bg);
    font-size: 15px;
}

/* 상세 섹션 공통 --------------------------------------------------------- */

.ss-section {
    padding-bottom: 32px;
    border-bottom: 1px solid var(--ss-line);
    margin-bottom: 32px;
}

.ss-section-title {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
}

/* 푸터 ----------------------------------------------------------------- */

.ss-footer {
    margin-top: 20px;
    padding: 20px 0 40px;
    border-top: 1px solid var(--ss-line);
    font-size: 12px;
    color: var(--ss-muted);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ss-footer-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.ss-footer-links {
    display: flex;
    gap: 6px 16px;
    flex-wrap: wrap;
}

.ss-footer-links a,
.ss-footer-links a:hover {
    color: var(--ss-text-2);
}

.ss-locales {
    display: flex;
    gap: 10px;
}

.ss-locales a,
.ss-locales a:hover {
    color: var(--ss-muted);
}

.ss-locales a[aria-current="true"],
.ss-locales a[aria-current="true"]:hover {
    color: var(--ss-text);
    font-weight: 700;
}

/* 사업자 표기(legal.business-disclosure)를 판결 2026-mr322 §2 의 시안처럼 " · " 로 이은 줄로 그린다(넘치면 줄바꿈). */
.ss-disclosure dl {
    display: inline;
    margin: 0;
}

.ss-disclosure dl div,
.ss-disclosure dt,
.ss-disclosure dd {
    display: inline;
    margin: 0;
}

.ss-disclosure dt::after {
    content: " ";
}

.ss-disclosure dl div + div::before {
    content: " · ";
}

.ss-disclosure a,
.ss-disclosure a:hover {
    color: var(--ss-muted);
}

/* © 줄은 사업자 표기 아래 따로 한 줄이다(계정 화면 푸터와 같은 항목). */
.ss-disclosure .ss-copyright {
    margin: 6px 0 0;
}

/* 항목이 늘어도 좁은 화면에서 긴 주소·메일이 가로로 넘치지 않게 줄 안에서 끊는다. */
.ss-disclosure {
    overflow-wrap: anywhere;
}

/* 좁은 화면(판결 2026-mr322 §2 의 시안 값, 390px) ------------------------------------------ */

@media (max-width: 860px) {
    .ss-sidebar {
        display: none;
    }

    .ss-topbar {
        position: sticky;
        top: 0;
        z-index: 2;
        height: 52px;
        padding: 0 8px 0 16px;
        display: flex;
        align-items: center;
        gap: 4px;
        background: rgba(245, 245, 247, 0.95);
        border-bottom: 1px solid var(--ss-line);
        color: var(--ss-text);
        font-family: 'Pretendard Variable', Pretendard, 'Noto Sans KR', sans-serif;
        font-size: 15px;
        line-height: 1.45;
    }

    .ss-topbar-home {
        display: flex;
        align-items: center;
        flex: 1;
        min-width: 0;
        color: var(--ss-text);
    }

    .ss-topbar-home:hover {
        color: var(--ss-text);
    }

    /* 사이드바와 같은 로고 이미지를 비율대로 줄인다(높이 20px). */
    .ss-topbar-logo {
        flex: none;
        display: block;
        width: auto;
        height: 20px;
    }

    .ss-topbar-store {
        font-size: 12px;
        font-weight: 600;
        color: var(--ss-muted);
        margin-left: 4px;
    }

    .ss-topbar-button {
        border: 0;
        background: none;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--ss-text);
        cursor: pointer;
    }

    .ss-topbar-button:hover {
        color: var(--ss-text);
    }

    .ss-menu-toggle:focus-visible ~ .ss-topbar label[for="ss-menu-toggle"],
    .ss-search-toggle:focus-visible ~ .ss-topbar label[for="ss-search-toggle"] {
        outline: 2px solid var(--ss-accent);
    }

    /* 검색 버튼이 여는 검색칸 — 사이드바가 숨는 폭에서 지금 스토어 안을 검색한다. 메뉴도 열려 있으면 메뉴가 그 아래로 내려간다. */
    .ss-topbar-search {
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        z-index: 2;
        padding: 8px 16px;
        background: var(--ss-surface);
        border-bottom: 1px solid var(--ss-line);
        display: none;
    }

    .ss-search-toggle:checked ~ .ss-topbar .ss-topbar-search {
        display: block;
    }

    .ss-search-toggle:checked ~ .ss-menu-toggle:checked ~ .ss-topbar .ss-mobile-menu {
        top: 105px;
    }

    .ss-mobile-menu {
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        z-index: 2;
        background: var(--ss-surface);
        border-bottom: 1px solid var(--ss-line);
        padding: 8px 16px 16px;
        display: none;
        flex-direction: column;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    }

    .ss-menu-toggle:checked ~ .ss-topbar .ss-mobile-menu {
        display: flex;
    }

    .ss-mobile-link,
    .ss-mobile-form button {
        min-height: 48px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid var(--ss-line);
    }

    .ss-mobile-link[aria-current="page"] {
        font-weight: 700;
    }

    .ss-mobile-form {
        margin: 0;
    }

    .ss-mobile-form button {
        width: 100%;
        padding: 0;
        border-width: 0 0 1px;
        background: none;
        color: var(--ss-text);
        font-size: 15px;
        text-align: left;
    }

    .ss-mobile-cloud,
    .ss-mobile-cloud:hover {
        min-height: 44px;
        display: flex;
        align-items: center;
        font-size: 13px;
        color: var(--ss-muted);
    }

    .ss-main {
        flex-basis: 100%;
        padding: 20px 16px 40px;
    }

    .ss-page-title {
        margin: 0 0 12px;
        font-size: 30px;
    }

    .ss-seg {
        display: flex;
        flex-wrap: nowrap;
        margin-bottom: 28px;
        overflow-x: auto;
    }

    .ss-seg-item {
        flex: none;
        padding: 0 12px;
        font-size: 13px;
    }

    .ss-shelf {
        margin-bottom: 32px;
    }

    .ss-shelf-head {
        padding-bottom: 8px;
        margin-bottom: 0;
    }

    .ss-shelf-title {
        font-size: 20px;
        letter-spacing: normal;
    }

    .ss-row {
        grid-template-columns: 52px minmax(0, 1fr) auto;
        gap: 12px;
    }

    .ss-row--ranked {
        grid-template-columns: 52px 20px minmax(0, 1fr) auto;
    }

    .ss-row .ss-icon {
        width: 52px;
        height: 52px;
        border: 0;
        border-radius: 12px;
    }

    .ss-row-text {
        padding: 4px 0;
    }

    .ss-footer {
        margin-top: 0;
        padding: 16px 0 0;
        gap: 8px;
    }

    .ss-footer-links {
        gap: 6px 12px;
    }
}

/* 가격 옆 "부가세 포함"(<x-store::price>) --------------------------------- */

.ss-price-vat {
    margin-left: 4px;
    font-size: 11px;
    font-weight: 400;
    color: var(--ss-faint);
    white-space: nowrap;
}

/* Inertia 화면의 틀(React StoreShell, .ss-body--inertia) ------------------ */
/* 함께 실리는 Tailwind 기본값(preflight: border-box, 입력칸 padding 0)을 Blade 틀이 쓰는 브라우저 기본값으로 되돌리고,
   본문(.ss-content)의 링크는 위 :where(.ss-body a) 대신 화면의 Tailwind 클래스 색을 쓰게 한다. */

.ss-body--inertia :where(.ss-topbar, .ss-topbar *, .ss-sidebar *, .ss-footer, .ss-footer *) {
    box-sizing: content-box;
}

.ss-body--inertia .ss-search input {
    padding: 1px 2px;
}

.ss-body--inertia :where(.ss-content a) {
    color: revert-layer;
    text-decoration: revert-layer;
}
