/* ChuingCon Store CSS — v2 고도화 */

* { box-sizing: border-box; }

/* ── Nav links ── */
.cc-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    border-radius: 8px;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.cc-nav-link:hover { color: #4f46e5; background: #eef2ff; }
.cc-nav-link.active { color: #4f46e5; background: #eef2ff; font-weight: 700; }
.cc-nav-admin { color: #dc2626; }
.cc-nav-admin:hover { color: #dc2626; background: #fef2f2; }

/* Admin dropdown */
.cc-admin-dropdown { position: relative; }
.cc-admin-menu {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12); min-width: 160px; z-index: 50;
    overflow: hidden;
}
.cc-admin-menu a { display: block; padding: 10px 16px; font-size: 13px; color: #dc2626; text-decoration: none; }
.cc-admin-menu a:hover { background: #fef2f2; }

/* ── 팩 카드 그리드 ── */
.cc-pack-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 960px) { .cc-pack-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (max-width: 640px) { .cc-pack-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* ── 팩 카드 — 이모티콘 스토어 스타일 ── */
.cc-pack-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e8ecf1;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.cc-pack-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.15);
    border-color: #c7d2fe;
}

/* 카드 썸네일 — 4개 미리보기 그리드 */
.cc-pack-preview {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    padding: 16px;
    position: relative;
}
.cc-pack-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.2s;
}
.cc-pack-card:hover .cc-pack-preview img { transform: scale(1.05); }

/* 단일 썸네일 */
.cc-pack-preview.single {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cc-pack-preview.single img {
    max-width: 80%;
    max-height: 80%;
}

/* 팩 정보 영역 */
.cc-pack-info {
    padding: 12px 14px 14px;
    border-top: 1px solid #f1f5f9;
}
.cc-pack-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.cc-pack-author {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.15s;
}
.cc-pack-author:hover { color: #4f46e5; }
.cc-pack-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

/* ── 가격 뱃지 — 디씨콘 스타일 ── */
.cc-price-free {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 10px; font-size: 11px; font-weight: 800;
    color: #10b981; background: #ecfdf5; border-radius: 9999px;
    letter-spacing: -0.02em;
}
.cc-price-paid {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 10px; font-size: 11px; font-weight: 800;
    color: #f59e0b; background: #fffbeb; border-radius: 9999px;
    letter-spacing: -0.02em;
}
.cc-price-premium {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 10px; font-size: 11px; font-weight: 800;
    color: #8b5cf6; background: #f5f3ff; border-radius: 9999px;
    letter-spacing: -0.02em;
}
.cc-pack-count {
    font-size: 11px;
    color: #b0b8c4;
    display: flex; align-items: center; gap: 2px;
}

/* ── 탭 바 — 세그먼트 컨트롤 스타일 ── */
.cc-tabs {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.cc-tabs::-webkit-scrollbar { display: none; }
.cc-tab {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 10px;
    white-space: nowrap;
    transition: all 0.2s ease;
    background: none;
    border: none;
}
.cc-tab:hover { color: #334155; }
.cc-tab.active {
    color: #4f46e5;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── 카테고리 필터 칩 ── */
.cc-cat-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.cc-cat-pill {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: #fff;
    border-radius: 9999px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: all 0.15s;
}
.cc-cat-pill:hover { border-color: #a5b4fc; color: #4f46e5; background: #eef2ff; }
.cc-cat-pill.active {
    background: #4f46e5; color: #fff; border-color: #4f46e5;
    box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}

/* ── 검색 바 ── */
.cc-search {
    position: relative;
    margin-bottom: 20px;
}
.cc-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
}
.cc-search input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(79,70,229,0.08);
}
.cc-search svg {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px; color: #94a3b8;
}

/* ── 모달 — 팩 상세 ── */
.cc-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    animation: ccFadeIn 0.2s ease;
}
@keyframes ccFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ccSlideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.cc-modal {
    background: #fff;
    border-radius: 24px;
    max-width: 580px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    animation: ccSlideUp 0.3s ease;
}
@media (max-width: 640px) {
    .cc-modal {
        max-width: 100%; max-height: 92vh;
        border-radius: 20px 20px 0 0;
        position: fixed; bottom: 0; left: 0; right: 0;
    }
}
.cc-modal::-webkit-scrollbar { width: 4px; }
.cc-modal::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.cc-modal-header {
    position: sticky; top: 0; background: #fff;
    padding: 18px 24px 14px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 24px 24px 0 0;
    z-index: 1;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.cc-modal-body { padding: 16px 24px 24px; }
.cc-modal-close {
    width: 36px; height: 36px;
    border: none; background: #f1f5f9;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #64748b; font-size: 16px;
    transition: all 0.15s; flex-shrink: 0;
}
.cc-modal-close:hover { background: #e2e8f0; color: #1e293b; }

/* ── 모달 아이템 그리드 — LINE 스토어 스타일 ── */
.cc-item-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
@media (max-width: 640px) { .cc-item-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; } }

.cc-item-cell {
    aspect-ratio: 1;
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
    cursor: default;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.cc-item-cell:hover {
    background: #eef2ff;
    transform: scale(1.06);
    z-index: 1;
    box-shadow: 0 4px 12px rgba(79,70,229,0.12);
}
.cc-item-cell img {
    max-width: 88%; max-height: 88%; object-fit: contain;
}

/* ── 구매 버튼 — CTA 그라디언트 ── */
.cc-btn-buy {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 28px; width: 100%;
    background: linear-gradient(135deg, #4a90d9 0%, #4f46e5 100%);
    color: #fff; border: none; border-radius: 14px;
    font-size: 15px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(79,70,229,0.3);
    letter-spacing: -0.01em;
}
.cc-btn-buy:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,70,229,0.4);
}
.cc-btn-buy:active { transform: translateY(0); }
.cc-btn-buy:disabled { background: #d1d5db; box-shadow: none; cursor: default; transform: none; }
.cc-btn-buy.purchased {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(16,185,129,0.3);
    cursor: default;
}

/* 무료 획득 버튼 */
.cc-btn-free {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.cc-btn-free:hover {
    box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

/* ── 신고 버튼 ── */
.cc-btn-report {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 14px;
    background: none; color: #94a3b8;
    border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.cc-btn-report:hover { color: #ef4444; border-color: #fca5a5; background: #fef2f2; }

/* ── 페이지네이션 ── */
.cc-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; margin-top: 32px;
}
.cc-page-btn {
    min-width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #e2e8f0; border-radius: 10px;
    font-size: 13px; color: #64748b; cursor: pointer;
    background: #fff; transition: all 0.15s; font-weight: 500;
}
.cc-page-btn:hover { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
.cc-page-btn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.cc-page-btn:disabled { opacity: 0.3; cursor: default; }

/* ── 내 팩 리스트 아이템 ── */
.cc-mypack-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    background: #fff; border: 1px solid #e8ecf1;
    border-radius: 16px; cursor: pointer;
    transition: all 0.2s;
}
.cc-mypack-item:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 16px rgba(79,70,229,0.08);
    transform: translateX(4px);
}
.cc-mypack-thumb {
    width: 52px; height: 52px;
    border-radius: 12px; object-fit: cover;
    background: #f1f5f9; flex-shrink: 0;
}

/* ── 빈 상태 ── */
.cc-empty {
    text-align: center; padding: 60px 16px; color: #94a3b8;
}
.cc-empty svg { margin: 0 auto 16px; opacity: 0.5; }
.cc-empty p { font-size: 14px; }

/* ── 로딩 ── */
.cc-loading {
    text-align: center; padding: 40px; color: #94a3b8; font-size: 14px;
}

/* ── 모바일 하단 앱바 ── */
.cc-mobile-appbar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid #e5e7eb;
    display: flex; z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}
.cc-appbar-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 8px 0 6px; font-size: 10px; color: #94a3b8;
    text-decoration: none; gap: 3px; transition: color 0.15s;
    font-weight: 500;
}
.cc-appbar-item.active { color: #4f46e5; font-weight: 700; }

/* ── 모바일 더보기 패널 ── */
.cc-more-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.3); z-index: 51;
}
.cc-more-content {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-radius: 20px 20px 0 0; z-index: 52;
    max-height: 60vh; overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.12);
}

@media (max-width: 640px) {
    body { padding-bottom: 64px; }
}

/* ── 제작자 프로필 ── */
.cc-author-header {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px;
    background: #fff; border-radius: 16px;
    border: 1px solid #e8ecf1; margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── 신고 모달 ── */
.cc-report-cats { display: flex; flex-direction: column; gap: 6px; }
.cc-report-cat {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0; border-radius: 12px;
    cursor: pointer; font-size: 13px; color: #374151;
    transition: all 0.15s; font-weight: 500;
}
.cc-report-cat:hover { border-color: #fca5a5; background: #fef2f2; }
.cc-report-cat.selected { border-color: #ef4444; background: #fef2f2; color: #ef4444; }

/* ── 플레이스홀더 ── */
.cc-no-img {
    width: 100%; aspect-ratio: 1;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex; align-items: center; justify-content: center;
    color: #cbd5e1;
}

/* ── 히어로 배너 캐러셀 ── */
.cc-hero-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    margin-bottom: 24px;
}
.cc-hero-slide {
    display: flex;
    align-items: center;
    padding: 24px 28px;
    min-height: 140px;
    cursor: pointer;
    transition: opacity 0.4s ease;
}
@media (max-width: 640px) {
    .cc-hero-slide { padding: 20px; min-height: 120px; }
}
.cc-hero-slide .cc-hero-info { flex: 1; min-width: 0; }
.cc-hero-slide .cc-hero-preview {
    display: flex; gap: 6px; flex-shrink: 0; margin-left: 16px;
}
.cc-hero-slide .cc-hero-preview img {
    width: 64px; height: 64px; object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
@media (max-width: 640px) {
    .cc-hero-slide .cc-hero-preview img { width: 48px; height: 48px; }
}

/* 배너 인디케이터 */
.cc-hero-dots {
    display: flex; justify-content: center; gap: 6px;
    margin-top: 10px;
}
.cc-hero-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #cbd5e1; cursor: pointer; border: none; padding: 0;
    transition: all 0.2s;
}
.cc-hero-dot.active { background: #4f46e5; width: 18px; border-radius: 3px; }

/* ── 섹션 타이틀 ── */
.cc-section-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}
.cc-section-title .cc-badge {
    font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 9999px;
    background: #eef2ff; color: #4f46e5;
}

/* ── 가격 정보 박스 (모달) ── */
.cc-price-box {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fefce8 0%, #fffbeb 100%);
    border: 1px solid #fde68a;
    border-radius: 14px;
    margin-bottom: 14px;
}
.cc-price-box.free {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border-color: #86efac;
}

/* ── 통계 뱃지 ── */
.cc-stat-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; color: #94a3b8;
}
.cc-stat-badge svg { width: 12px; height: 12px; }

/* ── 스켈레톤 로딩 ── */
.cc-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: ccShimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes ccShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── 팩 카드 "NEW" 뱃지 ── */
.cc-new-badge {
    position: absolute;
    top: 10px; right: 10px;
    padding: 2px 8px;
    font-size: 9px; font-weight: 800;
    color: #fff; background: #ef4444;
    border-radius: 6px;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}
