﻿/* =========================================================
   DAEDUCK Software Store - 스타일
   ========================================================= */
:root {
    --primary: #1f5fe0;
    --primary-hover: #1649b3;
    --primary-soft: #e8f0fe;
    --brand-dark: #003c96;
    --bg: #f4f6fb;
    --card: #ffffff;
    --border: #e3e8f1;
    --text: #1f2937;
    --text-sub: #4b5563;
    --muted: #8a94a6;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
    --shadow-hover: 0 8px 28px rgba(16, 24, 40, 0.12);
    --radius: 14px;
    --radius-sm: 8px;
    --header-h: 64px;
    --sidebar-w: 232px;
    --content-max: 1240px;

    /* 카테고리 배지 색 */
    --c-biz-bg: #e8f0fe;      --c-biz-fg: #1f5fe0;
    --c-auth-bg: #e6f7f1; --c-auth-fg: #0f8a5f;
    --c-collab-bg: #f1e9ff;   --c-collab-fg: #6d3fd1;
    --c-data-bg: #fff4e0;     --c-data-fg: #c26a00;
    --c-life-bg: #fdeaea;     --c-life-fg: #c62828;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 헤더 ---------- */
.store-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    transition: box-shadow .2s;
}
.store-header.scrolled { box-shadow: 0 2px 12px rgba(16, 24, 40, 0.08); }
.store-header .inner {
    height: 100%;
    display: flex; align-items: center; gap: 24px;
    padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.brand strong { font-size: 18px; font-weight: 800; color: var(--brand-dark); letter-spacing: -0.2px; }
.brand span { font-size: 16px; font-weight: 500; color: var(--text-sub); margin-left: 2px; }

.search {
    flex: 1; max-width: 460px;
    display: flex; align-items: center; gap: 10px;
    height: 40px; padding: 0 14px 0 16px;
    background: #f3f5f9; border: 1px solid transparent; border-radius: 999px;
    transition: .2s;
}
.search:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 95, 224, 0.12); }
.search input { flex: 1; border: 0; background: transparent; outline: 0; font: inherit; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search i { color: var(--muted); }

.header-links { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-links a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--text-sub); font-weight: 500;
}
.header-links a:hover { background: #f3f5f9; color: var(--text); }
.header-links a i { font-size: 15px; }

/* ---------- 레이아웃 ---------- */
.layout { display: flex; padding-top: var(--header-h); min-height: 100vh; }

.sidebar {
    position: sticky; top: var(--header-h);
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    background: #fff; border-right: 1px solid var(--border);
    padding: 16px 12px 24px;
}
.side-nav { list-style: none; margin: 0; padding: 0; }
.side-nav li + li { margin-top: 2px; }
.side-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 10px;
    color: var(--text-sub); font-weight: 500; font-size: 14px;
    transition: .15s;
}
.side-nav a i { width: 18px; text-align: center; font-size: 15px; color: var(--muted); }
.side-nav a:hover { background: #f3f5f9; color: var(--text); }
.side-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.side-nav a.active i { color: var(--primary); }
.side-divider { height: 1px; background: var(--border); margin: 16px 6px; }

.side-section-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 14px 8px; font-size: 14px; font-weight: 700;
}
.side-section-title a { font-size: 12px; font-weight: 500; color: var(--muted); }
.notice-list { list-style: none; margin: 0; padding: 0 6px; }
.notice-list li a {
    display: block; padding: 8px 8px; border-radius: 8px;
    font-size: 13px; color: var(--text-sub); line-height: 1.45;
}
.notice-list li a:hover { background: #f3f5f9; color: var(--text); }
.notice-list .notice-title { display: block; position: relative; padding-left: 12px; }
.notice-list .notice-title::before {
    content: ''; position: absolute; left: 0; top: 8px;
    width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
}
.notice-list .notice-date { display: block; padding-left: 12px; font-size: 11px; color: var(--muted); margin-top: 2px; }

.support-box {
    margin: 16px 6px 0;
    padding: 14px 14px;
    background: var(--primary-soft); border-radius: 12px;
}
.support-box .ico {
    width: 34px; height: 34px; border-radius: 50%;
    background: #fff; color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
    vertical-align: middle; margin-right: 8px;
}
.support-box strong { display: inline-block; font-size: 13px; color: var(--text); vertical-align: middle; }
.support-box .mail { display: block; margin-top: 10px; font-size: 13.5px; font-weight: 800; color: var(--primary); line-height: 1.3; white-space: nowrap; }
.support-box .mail:hover { text-decoration: underline; }
.support-box small { display: block; font-size: 11px; color: var(--text-sub); margin-top: 2px; }

.main { flex: 1; min-width: 0; }
.main-inner { max-width: var(--content-max); margin: 0 auto; padding: 20px 28px 48px; }

/* ---------- 히어로 (배너 이미지 전용 캐러셀) ---------- */
.hero {
    position: relative; border-radius: var(--radius); overflow: hidden;
    background: var(--brand-dark); box-shadow: var(--shadow);
    /* 기존 사이트와 같은 높이(400px). 이미지가 높이에 맞춰 확대되고 좌우는 잘려서
       이미지 안에 박힌 문구가 기존처럼 크게 보임 */
    height: 400px;
}
.hero-slide {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity .8s ease;
}
.hero-slide.active { opacity: 1; }
.hero-dots { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: 14px; display: flex; gap: 8px; }
.hero-dots button {
    width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    background: rgba(255, 255, 255, 0.5); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); transition: .2s;
}
.hero-dots button.active { background: #fff; width: 22px; border-radius: 4px; }
.hero-nav {
    position: absolute; z-index: 3; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(0, 0, 0, 0.28); color: #fff; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: .2s;
}
.hero:hover .hero-nav { opacity: 1; }
.hero-nav:hover { background: rgba(0, 0, 0, 0.5); }
.hero-prev { left: 14px; }
.hero-next { right: 14px; }

/* ---------- 섹션 공통 ---------- */
.section { margin-top: 36px; }
.section-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.section-head h3 { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; letter-spacing: -0.3px; }
.section-head h3 i { color: var(--primary); font-size: 18px; }
.count-pill {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    background: #fff; border: 1px solid var(--border);
    font-size: 12px; font-weight: 700; color: var(--text-sub);
}
.section-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.section-tools .search { height: 36px; min-width: 240px; background: #fff; border-color: var(--border); }
.select {
    height: 36px; padding: 0 32px 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
    font: inherit; color: var(--text); cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 11px center;
}

/* PC / 모바일 구분 토글 */
.segment {
    display: inline-flex; padding: 3px; gap: 2px;
    background: #eef1f6; border: 1px solid var(--border); border-radius: 10px;
}
.segment-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 14px; border: 0; border-radius: 8px; cursor: pointer;
    background: transparent; color: var(--text-sub); font-size: 13px; font-weight: 600;
    transition: .15s; white-space: nowrap;
}
.segment-btn i { font-size: 13px; }
.segment-btn:hover { color: var(--text); }
.segment-btn.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }

/* 카테고리 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
    padding: 7px 16px; border-radius: 999px; cursor: pointer;
    background: #fff; border: 1px solid var(--border); color: var(--text-sub);
    font-size: 13px; font-weight: 500; transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }

/* 배지 */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 700; line-height: 1.5; white-space: nowrap;
    background: #eef1f6; color: var(--text-sub);
}
.badge-biz      { background: var(--c-biz-bg);      color: var(--c-biz-fg); }
.badge-auth     { background: var(--c-auth-bg); color: var(--c-auth-fg); }
.badge-collab   { background: var(--c-collab-bg);   color: var(--c-collab-fg); }
.badge-data     { background: var(--c-data-bg);     color: var(--c-data-fg); }
.badge-life     { background: var(--c-life-bg);     color: var(--c-life-fg); }

/* 버튼 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 700; white-space: nowrap;
    border: 1px solid transparent; transition: .15s; cursor: pointer;
}
.btn i { font-size: 13px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: #fff; color: var(--primary); border-color: #c9d8f5; }
.btn-outline:hover { background: var(--primary-soft); }

/* ---------- 추천 프로그램 ---------- */
.featured-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.fcard {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 18px 18px; text-align: center;
    box-shadow: var(--shadow); transition: .2s;
    display: flex; flex-direction: column; align-items: center;
}
.fcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.fcard-icon {
    width: 76px; height: 76px; border-radius: 20px;
    background: #f3f5f9; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; padding: 10px;
    margin-bottom: 14px;
}
.fcard-icon img { width: 100%; height: 100%; object-fit: contain; }
.fcard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.fcard-head h4 { font-size: 16px; font-weight: 800; }
.fcard-desc { margin-top: 8px; font-size: 13px; color: var(--text-sub); min-height: 20px; }
.fcard-version { margin-top: 6px; font-size: 12px; color: var(--muted); }
.fcard-version b { color: var(--text); font-weight: 700; }
.fcard-actions { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; }
.fcard-actions .btn { flex: 1 1 auto; min-width: 0; }

/* ---------- 프로그램 카드 ---------- */
.program-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px;
}
.pcard {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); transition: .2s;
    display: flex; flex-direction: column;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #d3ddf0; }
.pcard { cursor: pointer; }
.pcard:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pcard .pcard-actions .btn { cursor: pointer; }
.pcard-top { display: flex; align-items: center; gap: 14px; }
.pcard-icon {
    width: 60px; height: 60px; flex: 0 0 60px; border-radius: 16px;
    background: #f3f5f9; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; padding: 8px;
}
.pcard-icon img { width: 100%; height: 100%; object-fit: contain; }
.pcard-title { min-width: 0; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.pcard-title h4 { font-size: 15.5px; font-weight: 800; letter-spacing: -0.2px; overflow-wrap: anywhere; }
.pcard-desc { margin-top: 12px; font-size: 13px; color: var(--text-sub); min-height: 20px; }
.pcard-meta {
    margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    font-size: 12px; color: var(--muted);
}
.pcard-meta i { margin-right: 5px; }
.pcard-meta b { color: var(--text); font-weight: 700; }
.meta-os { display: flex; gap: 10px; }
.os-item { display: inline-flex; align-items: center; }
.pcard-actions { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.pcard-actions .btn { flex: 1 1 auto; padding: 0 10px; }

.empty {
    grid-column: 1 / -1; text-align: center; padding: 48px 0; color: var(--muted);
    background: #fff; border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty i { font-size: 28px; margin-bottom: 10px; }

/* ---------- 상세 팝업 ---------- */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55);
    opacity: 0; transition: opacity .18s;
}
.modal-dialog {
    position: relative; width: 100%; max-width: 720px; max-height: calc(100vh - 48px);
    background: #fff; border-radius: 18px; box-shadow: 0 24px 64px rgba(16, 24, 40, 0.28);
    overflow: hidden; display: flex; flex-direction: column;
    opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .18s, transform .18s;
}
.modal.show .modal-backdrop { opacity: 1; }
.modal.show .modal-dialog { opacity: 1; transform: none; }
.modal-close {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
    background: #f3f5f9; color: var(--text-sub); font-size: 16px;
    display: flex; align-items: center; justify-content: center; transition: .15s;
}
.modal-close:hover { background: #e6eaf2; color: var(--text); }
.modal-body { overflow-y: auto; padding: 28px 28px 24px; }

.detail-head { display: flex; gap: 18px; align-items: flex-start; padding-right: 36px; }
.detail-icon {
    width: 84px; height: 84px; flex: 0 0 84px; border-radius: 22px;
    background: #f3f5f9; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; padding: 12px;
}
.detail-icon img { width: 100%; height: 100%; object-fit: contain; }
.detail-title { flex: 1; min-width: 0; padding-top: 6px; }
.detail-title h3 { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-title h3 .badge { font-size: 11px; }
.detail-title p { margin-top: 6px; font-size: 13.5px; color: var(--text-sub); }
.detail-actions { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; min-width: 150px; }
.detail-actions .btn { height: 38px; width: 100%; }

.detail-meta {
    margin-top: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #f9fafc;
}
.detail-meta-item { padding: 12px 14px; }
.detail-meta-item + .detail-meta-item { border-left: 1px solid var(--border); }
.detail-meta-item span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.detail-meta-item b { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.detail-meta-item b.meta-os { display: flex; flex-wrap: wrap; gap: 8px; font-weight: 600; font-size: 13px; }
.detail-meta-item b.meta-os i { margin-right: 5px; color: var(--text-sub); }

.detail-tabs { margin-top: 22px; display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.detail-tab {
    padding: 10px 14px; border: 0; background: transparent; cursor: pointer;
    white-space: nowrap; flex: 0 0 auto;
    font-size: 13.5px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s;
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.detail-panels { padding: 18px 2px 4px; min-height: 96px; }
.detail-panel { display: none; }
.detail-panel.active { display: block; }
.detail-text { font-size: 14px; line-height: 1.75; color: var(--text); }
.detail-list { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--text); }
.detail-list li + li { margin-top: 4px; }
.detail-list-install li::marker { color: var(--primary); font-weight: 700; }

.detail-tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--primary-soft); color: var(--primary);
}

@media (max-width: 640px) {
    .modal { padding: 12px; }
    .modal-body { padding: 22px 18px 18px; }
    .detail-head { flex-wrap: wrap; }
    .detail-actions { flex-direction: row; flex-wrap: wrap; width: 100%; min-width: 0; }
    .detail-actions .btn { width: auto; flex: 1 1 auto; }
    .detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-meta-item:nth-child(3) { border-left: 0; }
    .detail-meta-item:nth-child(n+3) { border-top: 1px solid var(--border); }
    .detail-tabs { overflow-x: auto; }
}

/* ---------- 푸터 ---------- */
.store-footer { background: #fff; border-top: 1px solid var(--border); margin-top: 24px; }
.footer-inner { max-width: var(--content-max); margin: 0 auto; padding: 28px 28px 0; }
.footer-top { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 12px; padding-right: 24px; border-right: 1px solid var(--border); }
.footer-brand img { width: 40px; height: 40px; border-radius: 10px; }
.footer-brand strong { display: block; font-size: 17px; font-weight: 800; color: var(--brand-dark); }
.footer-brand small { display: block; font-size: 12px; color: var(--muted); }
.value-props { display: flex; gap: 28px; flex: 1; flex-wrap: wrap; }
.value-prop { display: flex; align-items: center; gap: 12px; }
.value-prop .ico {
    width: 44px; height: 44px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 44px;
}
.value-prop strong { display: block; font-size: 13.5px; }
.value-prop span { display: block; font-size: 12px; color: var(--muted); }
.footer-support {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px; border: 1px solid var(--border); border-radius: 12px; background: #f9fafc;
}
.footer-support .ico { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 17px; border: 1px solid var(--border); }
.footer-support strong { display: block; font-size: 13px; }
.footer-support .mail { display: block; font-size: 15px; font-weight: 800; color: var(--primary); line-height: 1.3; }
.footer-support .mail:hover { text-decoration: underline; }
.footer-support small { display: block; font-size: 11px; color: var(--muted); }
.footer-bottom {
    margin-top: 22px; padding: 16px 0 20px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    font-size: 12px; color: var(--muted);
}

/* ---------- 반응형 ---------- */
@media (max-width: 1280px) {
    .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .hero { height: 300px; }
    .sidebar { display: none; }
    .main-inner { padding: 16px 16px 40px; }
    .brand span { display: none; }
    .header-links a span { display: none; }
    .footer-brand { border-right: 0; }
}
@media (max-width: 640px) {
    .store-header .inner { gap: 12px; padding: 0 14px; }
    .featured-grid { grid-template-columns: 1fr; }
    .section-tools { width: 100%; margin-left: 0; flex-wrap: wrap; }
    .section-tools .search { flex: 1; min-width: 0; }
    .segment { width: 100%; }
    .segment-btn { flex: 1; justify-content: center; }
    .hero { height: 200px; }
    .hero-nav { display: none; }
}
