/* =========================================
   1. 기본 설정 및 변수 (Variables & Reset)
   ========================================= */
:root { 
    --primary: #6366f1; 
    --primary-dark: #4f46e5;
    --text-main: #111827; 
    --text-sub: #4b5563;
    --bg-sidebar: #ffffff; 
    --bg-stage: #2b2b2b; /* 포토샵 스타일 진한 회색 배경 */
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* { 
    box-sizing: border-box; 
    outline: none; 
    user-select: none; 
    -webkit-tap-highlight-color: transparent; 
}

/* 입력창 및 콘텐츠 텍스트 선택 허용 */
input, textarea, select {
    user-select: text !important;
    -webkit-user-select: text !important;
    touch-action: manipulation !important;
    font-family: inherit;
}
p, span, h1, h2, h3, h4, h5, h6, li, td, th, label, a, .view-wrap, .msg-text {
    user-select: text;
    -webkit-user-select: text;
}

body { 
    margin: 0; 
    height: 100vh; 
    height: 100dvh; 
    overflow: hidden; 
    background: var(--bg-sidebar); 
    font-family: -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    color: var(--text-main);
}

button, input, textarea, select { font-family: inherit; }
.canvas-container { margin: auto !important; }

/* =========================================
   2. 로딩 화면 & 우클릭 메뉴
   ========================================= */
#loading { 
    position: fixed; inset: 0; 
    background: rgba(255,255,255,0.95); 
    z-index: 20000; 
    display: none; 
    justify-content: center; align-items: center; flex-direction: column; 
    backdrop-filter: blur(5px); 
}
.loading-spin { 
    width: 50px; height: 50px; 
    border: 5px solid #e5e7eb; border-top: 5px solid var(--primary); 
    border-radius: 50%; 
    animation: spin 1s infinite; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#contextMenu {
    display: none;
    position: fixed;
    z-index: 99999;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    padding: 6px 0;
    width: 160px;
    font-size: 13px;
    color: #333;
}
.ctx-item {
    padding: 8px 15px;
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: background 0.1s;
}
.ctx-item:hover { background: #f3f4f6; color: var(--primary); }
.ctx-divider { height: 1px; background: #e5e7eb; margin: 5px 0; }

/* =========================================
   3. 시작 화면 (Start Screen)
   ========================================= */
#startScreen { 
    position: fixed; inset: 0; 
    background: #fff; 
    z-index: 9999; 
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; 
    overflow-y: auto; 
    padding-bottom: 80px;
}

/* 이벤트 프로모션 박스 (인스타 그라데이션) */
.hero-promo-box {
    width: 98%; max-width: 1200px; margin: 0 auto 20px; padding: 36px 40px 32px;
    background: linear-gradient(135deg, #00b950 0%, #03C75A 40%, #00d68f 70%, #02a84c 100%);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(3,199,90,0.3);
    box-sizing: border-box;
}
.hero-promo-box .hero-desc {
    background: #fff !important; color: #333 !important;
}
/* 히어로 섹션 */
.hero-section {
    width: 100%; padding: 50px 20px 30px;
    text-align: center; background: #fff; margin-bottom: 0px;
}
.hero-title {
    font-size: 64px; font-weight: 900; color: #111;
    letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 8px;
}
.hero-title span {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    font-size: 42px;
}
.hero-cta-row {
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.hero-desc {
    font-size: 18px; color: #fff; font-weight: 600;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); padding: 12px 28px; border-radius: 30px; display: inline-block; margin: 0;
}
.hero-signup-btn {
    border: none; border-radius: 30px; background: linear-gradient(135deg,#7c3aed,#6366f1); color: #fff;
    font-size: 17px; font-weight: 800; cursor: pointer; padding: 14px 36px;
    box-shadow: 0 4px 15px rgba(99,102,241,0.4); transition: all 0.3s; letter-spacing: 0.5px; white-space: nowrap;
}
.hero-signup-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.5); }
.hero-signup-desc { font-size: 13px; color: #888; margin-top: 8px; font-weight: 500; }

/* 퀵 메뉴 (제품 선택) */
.quick-menu-wrapper {
    width: 98%; max-width: 1200px;
    margin-bottom: 40px; padding: 0 10px;
}
.quick-menu-label {
    font-size: 15px; font-weight: 800; color: #374151;
    margin-bottom: 15px; text-align: center; text-transform: uppercase; letter-spacing: 0.05em;
}
/* 기존 .quick-menu-track 부분을 아래 코드로 교체하세요 */
.quick-menu-track {
    display: flex;             /* grid에서 flex로 변경 */
    flex-wrap: wrap;           /* 줄바꿈 허용 */
    justify-content: center;   /* 가로축 완전 중앙 정렬 */
    gap: 15px;                 /* 간격 조정 */
    width: 100%;
}

.quick-item {
    display: flex; 
    flex-direction: column; 
    align-items: center;
    width: 110px;              /* 아이템 너비를 고정하여 균일하게 배치 */
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 5px; 
    background: #f9fafb;
    border-radius: 16px; 
    padding: 12px 5px; 
    border: 1px solid transparent;
}
.quick-item:hover { 
    transform: translateY(-5px); background: #fff; 
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.quick-icon {
    width: 60px; height: 60px; 
    background: #1f2937; border-radius: 18px; 
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-size: 26px; color: white;
    margin-bottom: 8px; transition: all 0.2s;
}
.quick-item:hover .quick-icon {
    background: var(--primary);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.4);
}
.quick-text {
    font-size: 13px; color: #374151; font-weight: 700;
    text-align: center; letter-spacing: -0.02em; white-space: nowrap;
}

/* 템플릿 갤러리 (시작화면) */
.gallery-section { width: 96%; max-width: 1600px; margin-top: 10px; }
.gallery-header { 
    text-align: center; margin-bottom: 30px; 
    font-size: 16px; font-weight: 800; color: #474747; 
    display: flex; align-items: center; justify-content: center; gap: 15px;
}
.gallery-header::before, .gallery-header::after { content: ''; height: 2px; width: 40px; background: #e5e7eb; }

.template-grid-start {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* [수정] 정사각 프레임 적용 */
.tpl-card-start {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1; /* 정사각형 비율 강제 */
    background: #f8fafc; /* 이미지 로딩 전 배경색 */
    border-radius: 16px; overflow: hidden;
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    position: relative; /* 뱃지 위치 기준 */
}

/* [수정] 이미지가 정사각형 영역을 꽉 채우도록 설정 */
.tpl-card-img { 
    width: 100%; 
    height: 100%;       /* 높이도 100% */
    object-fit: cover;  /* 비율 유지하며 꽉 채우기 (잘림 발생) */
    display: block; 
    transition: transform 0.3s; 
}
.tpl-card-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.05); opacity: 0; transition: 0.2s;
    pointer-events: none;
}
.tpl-card-start:hover .tpl-card-overlay { opacity: 1; }

/* =========================================
   4. 메인 에디터 레이아웃 (Editor UI)
   ========================================= */
#mainEditor { display: none; width: 100vw; height: 100vh; height: 100dvh; flex-direction: column; }

/* 상단바 (Topbar) */
.topbar { 
    height: 60px; display: flex; align-items: center; 
    padding: 0 25px; background: #fff; border-bottom: 1px solid var(--border);
    gap: 10px; z-index: 100; justify-content: space-between;
    overflow-x: auto; white-space: nowrap;
}
.topbar::-webkit-scrollbar { display: none; }
.brand { font-weight: 800; font-size: 22px; color: var(--primary); cursor: pointer; flex-shrink: 0; }

/* 국가 플래그 링크 */
.flag-link {
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%; font-size: 16px;
    background: rgba(255,255,255,0.85); border: 1.5px solid rgba(226,232,240,0.5); transition: all .2s; cursor: pointer;
    pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.flag-link:hover { background: rgba(226,232,240,0.85); border-color: #6366f1; transform: scale(1.15); box-shadow: 0 2px 8px rgba(99,102,241,0.25); }

.template-tabs { display: flex; gap: 5px; }
.tpl-tab { 
    padding: 8px 16px; border-radius: 8px; background: #f8fafc; 
    color: var(--text-sub); font-size: 13px; font-weight: 600; 
    cursor: pointer; border: 1px solid transparent; transition: 0.2s; white-space: nowrap; 
}
.tpl-tab:hover { background: #eff6ff; color: var(--primary); }
#btnMobileTemplateOpen { 
    display: none; padding: 8px 12px; border-radius: 8px; 
    background: #eff6ff; color: var(--primary); font-size: 13px; font-weight: 700; 
    border: 1px solid var(--primary); cursor: pointer; 
}

/* 버튼 스타일 공통 */
.btn { 
    padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; 
    cursor: pointer; transition: 0.2s; border: 1px solid transparent; 
    white-space: nowrap; flex-shrink: 0; 
}
.btn.primary { background: var(--primary); color: white; box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2); }
.btn:hover:not(.primary) { background: #f1f5f9; }
.btn-save-top { background: #741e9c; color: white; display: flex; align-items: center; gap: 6px; }
#btnOpenSaveModal { 
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); color: white; 
    border: none; font-weight: 800; box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3); 
}

/* 에디터 메인 영역 */
.editor-wrap { 
    display: grid; grid-template-columns: 280px 1fr; 
    height: calc(100vh - 60px); width: 100vw; overflow: hidden; 
}
.side { 
    background: #fff; border-right: 1px solid var(--border); 
    padding: 20px; overflow-y: auto; z-index: 20; 
    display: flex; flex-direction: column; gap: 15px; 
}
.stage { 
    background: var(--bg-stage); width: 100%; height: 100%; 
    position: relative; overflow: hidden; 
    display: flex; justify-content: center; align-items: center; touch-action: none; 
}

/* 툴 패널 요소들 */
.section-title { 
    font-size: 13px; font-weight: 700; color: #b6b6b6; 
    margin-top: 10px; text-transform: uppercase; letter-spacing: 0.05em; 
}
.btn-round { 
    width: 100%; padding: 12px; border-radius: 10px; 
    border: 1px solid var(--border); background: #fff; 
    font-weight: 600; cursor: pointer; font-size: 13px; transition: 0.2s; 
    display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-main); 
}
.btn-round.primary { background: var(--primary); color: #fff; border: none; }
.btn-round.ai-red { background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%); color: white; border: none; }
.btn-round.btn-secondary { background: white; border: 1px solid #ddd; color: #333; }

/* 모양 도구 */
.shape-panel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shape-btn { 
    height: 40px; border: 1px solid var(--border); border-radius: 8px; 
    cursor: pointer; background: #fff; font-size: 16px; color: #64748b; 
    display: flex; align-items: center; justify-content: center; transition: 0.2s; 
}
.shape-btn:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }

/* 업로드 박스 */
.upload-box { 
    border: 2px dashed #cbd5e1; border-radius: 12px; padding: 20px; 
    text-align: center; cursor: pointer; background: #f8fafc; color: #64748b; 
    font-size: 13px; display: flex; flex-direction: column; align-items: center; transition: 0.2s; 
}
.upload-box:hover { border-color: var(--primary); background: #eff6ff; color: var(--primary); }

/* 우측 레이어/속성 패널 (좌측으로 통합됨 — 숨김) */
.right-stack {
    display: none !important;
}
.right-stack::-webkit-scrollbar { width: 6px; }
.right-stack::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }
.panel-box { 
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); 
    border-radius: 16px; padding: 15px; box-shadow: var(--shadow); 
    border: 2px solid transparent; flex-shrink: 0; 
}

/* 속성 툴 버튼 */
.tool-btn { 
    flex: 1; min-width: 0; padding: 8px; margin-top: 5px; 
    border-radius: 8px; border: 1px solid #eee; background: #fff; 
    color: #333; font-size: 12px; font-weight: 600; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; gap: 6px; 
}
.tool-btn:hover { border-color: var(--primary); color: var(--primary); background: #f8fafc; }
.ai-tool-stack { display: flex; flex-direction: column; gap: 5px; width: 100%; }
#btnCutout { background: #fff9c4; color: #5d4037; border: 1px solid #fbc02d; }
#btnCutout:hover { background: #fff59d; transform: translateY(-1px); }

/* 정렬 그리드 */
.align-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 10px; }
.align-btn { 
    padding: 8px 0; border: 1px solid #eee; border-radius: 8px; background: #fff; 
    cursor: pointer; color: #555; display: flex; align-items: center; justify-content: center; 
    transition: 0.2s; font-size: 14px; 
}
.align-btn:hover { background: #f8fafc; color: var(--primary); border-color: var(--primary); }

/* 색상 선택기 */
.color-group { 
    display: flex; align-items: center; justify-content: space-between; 
    margin-top: 5px; border: 1px solid #e2e8f0; padding: 5px 10px; 
    border-radius: 8px; font-size: 12px; color: #666; 
}
.color-picker { 
    -webkit-appearance: none; appearance: none; width: 32px; height: 32px; 
    border: 1px solid #e2e8f0; background: none; cursor: pointer; padding: 0; 
    border-radius: 50%; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    transition: transform 0.2s; box-sizing: border-box; 
}
.color-picker::-webkit-color-swatch-wrapper { padding: 0; border: none; }
.color-picker::-webkit-color-swatch { border: none; border-radius: 50%; padding: 0; }
.color-picker:hover { transform: scale(1.1); }

/* 하단 독 (Zoom) */
.bottom-dock { 
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); 
    background: #fff; padding: 8px 20px; border-radius: 50px; 
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 15px; 
    z-index: 100; white-space: nowrap; 
}
.zoom-btn { 
    width: 32px; height: 32px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 16px; cursor: pointer; color: #555; background: #f1f5f9; border:none; 
}
.zoom-btn:hover { background: #e2e8f0; color: #000; }
.divider { width: 1px; height: 16px; background: #ddd; }
#guideToggle.active { background: var(--primary); color: white; }
.help-text { font-size: 12px; color: #666; margin-left: 10px; font-weight: 500; white-space: nowrap; }

/* ===== 가벽 설정 모달 ===== */
#wallConfigOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
    z-index: 90000; display: flex; align-items: center; justify-content: center;
}
#wallConfigModal {
    background: #fff; border-radius: 20px;
    padding: 28px 32px; min-width: 500px; max-width: 640px; width: 90%;
    max-height: 80vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 4px 16px rgba(99,102,241,0.12);
    display: flex; flex-direction: column; gap: 16px;
    animation: wcmFadeIn 0.2s ease;
}
@keyframes wcmFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
/* 헤더 */
.wcm-header {
    display: flex; align-items: center; justify-content: space-between;
}
.wcm-title {
    font-size: 20px; font-weight: 900; color: #1e293b;
    display: flex; align-items: center; gap: 8px;
}
.wcm-title i { color: #6366f1; font-size: 18px; }
.wcm-close {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: #f1f5f9; color: #64748b; font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.wcm-close:hover { background: #fee2e2; color: #ef4444; }
/* 타입 행 */
.wcm-type-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px; background: #f8fafc; border-radius: 14px;
}
.wcm-label { font-size: 15px; font-weight: 700; color: #475569; white-space: nowrap; }
.wcm-type-btns { display: flex; gap: 8px; }
/* 버튼 공통 */
.wcm-btn {
    padding: 10px 20px; border-radius: 12px; border: 2px solid #e2e8f0;
    background: #fff; color: #475569; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
}
.wcm-btn:hover { background: #f1f5f9; border-color: #a5b4fc; }
.wcm-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 3px 12px rgba(99,102,241,0.3); }
.wcm-btn.wcm-add {
    padding: 8px 16px; font-size: 14px; color: #6366f1; border-color: #c7d2fe; border-style: dashed;
}
.wcm-btn.wcm-add:hover { background: #eef2ff; }
/* 벽 목록 */
#wallListContainer { display: flex; flex-direction: column; gap: 6px; }
/* 벽 행 */
.wl-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: 14px; border: 2px solid transparent;
    cursor: pointer; transition: all 0.12s; background: #fafafa;
}
.wl-row:hover { background: #f1f5f9; }
.wl-row.active { background: #eef2ff; border-color: #6366f1; }
.wl-num {
    width: 32px; height: 32px; border-radius: 50%; background: #e2e8f0; color: #475569;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; flex-shrink: 0;
}
.wl-row.active .wl-num { background: #6366f1; color: #fff; }
.wl-sel {
    padding: 8px 12px; border-radius: 10px; border: 1.5px solid #e2e8f0;
    font-size: 16px; font-weight: 700; color: #334155; background: #fff;
    cursor: pointer; min-width: 72px;
}
.wl-sel:focus { border-color: #6366f1; outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.wl-x { color: #94a3b8; font-size: 16px; font-weight: 700; }
.wl-price { font-size: 15px; font-weight: 800; color: #4f46e5; margin-left: auto; white-space: nowrap; }
.wl-del {
    width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent;
    color: #94a3b8; font-size: 18px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: all 0.12s;
}
.wl-del:hover { background: #fee2e2; color: #ef4444; }
/* 푸터: 추가 + 합계 */
.wcm-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding-top: 12px; border-top: 1.5px solid #e2e8f0;
}
.wcm-total {
    display: flex; align-items: center; gap: 10px; font-size: 15px; color: #64748b; font-weight: 600;
}
.wcm-total-price { font-size: 24px; font-weight: 900; color: #4f46e5; }
/* 확인 버튼 */
.wcm-confirm {
    width: 100%; padding: 14px; border-radius: 14px; border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff; font-size: 16px; font-weight: 800; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3); transition: all 0.15s;
}
.wcm-confirm:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }

/* 가벽 설정 모바일 반응형 */
@media (max-width: 768px) {
    #wallConfigModal {
        min-width: unset;
        width: 95%;
        max-width: 95%;
        padding: 16px;
        border-radius: 16px;
    }
    .wcm-title { font-size: 16px; }
    .wcm-type-row {
        gap: 8px;
        padding: 10px 12px;
    }
    .wcm-label { font-size: 13px; }
    .wcm-btn { padding: 8px 14px; font-size: 13px; }
    .wl-row {
        gap: 6px;
        padding: 10px 8px;
        flex-wrap: wrap;
    }
    .wl-num { width: 26px; height: 26px; font-size: 12px; }
    .wl-sel { min-width: 60px; padding: 6px 8px; font-size: 14px; }
    .wl-x { font-size: 14px; }
    .wl-price { font-size: 13px; }
    .wl-del { width: 26px; height: 26px; font-size: 16px; }
    .wcm-footer { gap: 8px; flex-wrap: wrap; }
    .wcm-total-price { font-size: 20px; }
    .wcm-confirm { padding: 12px; font-size: 15px; }
}

/* Box Face Tabs */
.box-face-tab {
    padding: 6px 14px; border: none; border-radius: 6px;
    background: rgba(255,255,255,0.1); color: #94a3b8;
    font-size: 11px; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
}
.box-face-tab:hover { background: rgba(99,102,241,0.3); color: #c7d2fe; }
.box-face-tab.active { background: #6366f1; color: #fff; }

/* Wall Face Tabs */
.wall-face-tab {
    padding: 8px 16px; border: none; border-radius: 8px;
    background: rgba(255,255,255,0.15); color: #c7d2fe;
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: all 0.15s; pointer-events: auto; position: relative; z-index: 1;
}
.wall-face-tab:hover { background: rgba(99,102,241,0.4); color: #fff; }
.wall-face-tab.active { background: #6366f1; color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.4); }

/* Paper Display Face Tabs */
.pd-face-tabs { display: flex; gap: 2px; }
.pd-face-tab {
    padding: 7px 16px; border: none; border-radius: 7px;
    background: rgba(255,255,255,0.12); color: #94a3b8;
    font-size: 12px; font-weight: 700; cursor: pointer;
    transition: all 0.15s;
}
.pd-face-tab:hover { background: rgba(99,102,241,0.3); color: #c7d2fe; }
.pd-face-tab.active { background: #6366f1; color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.4); }

/* 3D Wall Sidebar */
.wall3d-preset-btn {
    padding: 8px 4px; background: rgba(255,255,255,0.06); color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    cursor: pointer; font-size: 12px; text-align: center; line-height: 1.2;
    transition: all 0.2s;
}
.wall3d-preset-btn:hover { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); }
.wall3d-preset-btn.active { background: #6366f1; color: #fff; border-color: #6366f1; }

.wall3d-wall-item {
    padding: 8px 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; color: #e2e8f0; font-size: 11px; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: all 0.15s;
}
.wall3d-wall-item:hover { background: rgba(99,102,241,0.15); }
.wall3d-wall-item.selected { background: rgba(99,102,241,0.25); border-color: #6366f1; }
.wall3d-wall-item .wall-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* 3D 모달 모바일 반응형 */
@media (max-width: 768px) {
    #wall3DInner {
        height: 100vh !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    #wall3DHeader {
        padding: 8px 12px !important;
    }
    #wall3DHeader span { font-size: 13px !important; }
    #wall3DCloseX { display: none !important; }
    #wall3DContentArea {
        flex-direction: column !important;
        overflow-y: auto !important;
    }
    #threeDContainer {
        min-height: 45vh;
        max-height: 45vh;
        flex: none !important;
    }
    #wall3DSidebar {
        width: 100% !important;
        border-right: none !important;
        border-top: 1px solid rgba(99,102,241,0.2);
        flex-shrink: 0 !important;
        overflow-y: visible !important;
        padding: 10px !important;
    }
    #wall3DHint { display: none !important; }
    #wall3DCloseBtn {
        display: block !important;
        border-radius: 0;
        font-size: 18px !important;
        padding: 18px !important;
    }
    .wall3d-preset-btn { padding: 10px 6px; font-size: 13px; }
}

/* 칼선 도구 */
.tool-box-group {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; 
    padding: 12px; margin-bottom: 20px;
}
.tool-box-group button:hover {
    background: #fff; border-color: var(--primary); color: var(--primary); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* =========================================
   5. 장바구니 페이지 (Cart) - PC/Mobile 반응형
   ========================================= */
#cartPage { z-index: 120000; padding-top: 40px; }
#cartListArea { overflow-y: auto; max-height: 70vh; }

/* 장바구니 아이템 그리드 */
.cart-item {
    display: grid;
    /* 좌측(정보), 우측(옵션 340px) */
    grid-template-columns: 1fr 340px; 
    gap: 30px; 
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; 
    padding: 20px; margin-bottom: 20px; align-items: start;
}
.cart-left-col { display: flex; gap: 20px; }
.cart-thumb {
    width: 100px; height: 100px; object-fit: cover;
    border-radius: 10px; border: 1px solid #f1f5f9; flex-shrink: 0;
}
/* 이미지 강제 축소 (필수) */
.cart-item img {
    width: 80px !important; height: 80px !important;
    object-fit: contain !important;
    background-color: #f8fafc; border: 1px solid #e2e8f0;
}

.cart-info-box {
    flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between;
}
.cart-badges { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.cart-badge { font-size: 11px; padding: 3px 6px; border-radius: 4px; font-weight: 600; }
.badge-design { background: #e0e7ff; color: #4338ca; }
.badge-file { background: #f1f5f9; color: #475569; }

.cart-title { font-size: 17px; font-weight: 700; color: #1e293b; margin: 0 0 5px 0; line-height: 1.35; word-break: keep-all; }
.cart-filename { font-size: 13px; color: #64748b; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;}
.cart-price { font-size: 16px; font-weight: 800; color: #6366f1; margin-bottom: 12px; }

/* 수량/삭제 버튼 */
.cart-ctrl-row { display: flex; align-items: center; gap: 10px; }
.qty-wrapper { display: flex; align-items: center; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; overflow: hidden; }
.qty-btn { width: 32px; height: 32px; border: none; background: #fff; cursor: pointer; color: #64748b; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { background: #f8fafc; color: #333; }
.qty-val { width: 40px; text-align: center; font-size: 14px; font-weight: 700; border-left: 1px solid #f1f5f9; border-right: 1px solid #f1f5f9; line-height: 32px; }
.del-btn { width: 34px; height: 34px; border-radius: 6px; border: 1px solid #fee2e2; background: #fff; color: #ef4444; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.del-btn:hover { background: #fee2e2; }

/* 장바구니 우측 옵션 */
.cart-right-col {
    background: #f9fafb; border: 1px solid #eee; border-radius: 10px; 
    padding: 15px; min-height: 100px;
}
.cart-opt-box {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; 
    padding: 15px; margin-top: 10px; position: relative;
}
.cart-opt-box.required { border-left: 4px solid #6366f1; }
.cart-opt-box.optional { border-left: 4px solid #94a3b8; }

.cart-opt-group {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; 
    padding: 15px; margin-top: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.cart-opt-group.required-group { border-left: 4px solid #6366f1; }
.cart-opt-group.optional-group { border-left: 4px solid #94a3b8; }

.opt-box-title, .opt-group-header {
    font-size: 13px; font-weight: 800; color: #334155;
    margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
}
.badge-req { font-size: 10px; background: #fee2e2; color: #ef4444; padding: 2px 6px; border-radius: 4px; font-weight: normal; }
.badge-opt, .badge-sel { font-size: 10px; background: #f1f5f9; color: #64748b; padding: 2px 6px; border-radius: 4px; }

.opt-select-box { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; background-color: #fff; }
.opt-checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt-checkbox-label {
    display: flex; align-items: center; font-size: 12px; cursor: pointer;
    padding: 8px; border: 1px solid #eee; border-radius: 6px; background: #fff;
}
.opt-checkbox-label:hover { border-color: #6366f1; }
.opt-checkbox-label input { accent-color: #6366f1; width: 16px; height: 16px; margin-right: 10px; flex-shrink: 0; }
.opt-name { flex: 1; font-size: 13px; color: #334155; font-weight: 500; word-break: keep-all; line-height: 1.3;}
.opt-price { font-size: 13px; font-weight: 700; color: #6366f1; white-space: nowrap; margin-left: 5px; }

/* =========================================
   6. 모달 및 팝업 (Modals)
   ========================================= */
.modal-bg { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); 
    backdrop-filter: blur(4px); display: none; 
    justify-content: center; align-items: center; z-index: 10000; 
}
.modal-box { 
    background: #fff; padding: 30px; border-radius: 20px; 
    width: 400px; text-align: center; 
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); 
    max-height: 90vh; overflow-y: auto; 
}
.ai-input-pretty { 
    width: 100%; padding: 12px 15px; border: 2px solid #e2e8f0; 
    border-radius: 10px; font-size: 14px; background: #f9f9f9; 
    margin-bottom: 10px; outline: none; 
}
.ai-input-pretty:focus { border-color: var(--primary); background: #fff; }

/* AI 드로어 */
.ai-drawer { 
    position: fixed; top: 60px; right: 0; width: 360px; height: calc(100vh - 60px); 
    background: #fff; border-left: 1px solid #e2e8f0; padding: 25px; 
    z-index: 9000; transform: translateX(100%); transition: 0.3s; 
    box-shadow: -5px 0 15px rgba(0,0,0,0.05); overflow-y: auto; 
}
.ai-drawer.open { transform: translateX(0); }

/* 템플릿 오버레이 */
#templateOverlay { 
    position: fixed; inset: 0; background: rgba(255,255,255,0.6); 
    backdrop-filter: blur(15px); z-index: 9999; display: none; 
    justify-content: center; align-items: center; 
}
.tpl-modal-box { 
    width: 90%; max-width: 1200px; height: 85%; 
    background: #fff; border-radius: 24px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.15); 
    border: 1px solid rgba(255,255,255,0.5); display: flex; overflow: hidden; 
}
.tpl-sidebar { 
    width: 240px; background: #f8fafc; border-right: 1px solid #e2e8f0; 
    padding: 30px 20px; display: flex; flex-direction: column; gap: 10px; 
}
.tpl-cate-btn { 
    text-align: left; padding: 12px 16px; border-radius: 12px; 
    font-size: 14px; font-weight: 600; color: #64748b; 
    cursor: pointer; transition: 0.2s; border: none; background: transparent; 
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; 
}
.tpl-cate-btn:hover { background: #e2e8f0; color: var(--text-main); }
.tpl-cate-btn.active { background: #fff; color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.tpl-content { flex: 1; display: flex; flex-direction: column; background: #fff; }
.tpl-grid { 
    /* [수정] block/column-count 대신 grid 사용으로 레이아웃 안정화 */
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important; 
    gap: 20px; 
    padding: 20px; 
    width: 100%; 
    height: 100%; /* 부모 높이 채우기 */
    overflow-y: auto !important; /* 스크롤 활성화 */
    background-color: #f1f5f9; 
    box-sizing: border-box;
    align-content: start;
}
.tpl-item { 
    position: relative; background-color: #ffffff; border-radius: 16px; 
    overflow: hidden; cursor: pointer; border: none !important; 
    padding: 0 !important; margin-bottom: 20px; break-inside: avoid; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
}
.tpl-item-img { width: 100%; height: auto !important; object-fit: contain; display: block; background-color: #fff; margin: 0 !important; padding: 0 !important; }
.tpl-item.selected { box-shadow: 0 0 0 3px var(--primary); }
.tpl-item div:not(:has(img)) { display: none !important; }



/* 로고 업로드 모달 */
.upload-drop-zone {
    width: 100%; height: 150px; border: 2px dashed #cbd5e1; border-radius: 12px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: #f8fafc; color: #64748b; cursor: pointer; transition: all 0.2s;
    margin-bottom: 20px; position: relative; overflow: hidden;
}
.upload-drop-zone:hover, .upload-drop-zone.dragover {
    border-color: #6366f1; background: #eff6ff; color: #6366f1;
}
.upload-icon { font-size: 32px; margin-bottom: 10px; }
.upload-text { font-size: 14px; font-weight: 600; }
.upload-sub { font-size: 12px; opacity: 0.7; margin-top: 4px; }
#previewImage {
    display: none; max-height: 100%; max-width: 100%; object-fit: contain;
    position: absolute; inset: 0; margin: auto; padding: 10px; background: #fff; z-index: 10;
}
#removeFileBtn {
    display: none; position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.6); color: white; border-radius: 50%;
    width: 24px; height: 24px; align-items: center; justify-content: center;
    cursor: pointer; z-index: 20; font-size: 12px;
}

/* 달력 모달 */
.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px;
}
.cal-day-header { text-align: center; font-weight: bold; font-size: 12px; color: #64748b; padding-bottom: 5px; }
.cal-day {
    aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer; font-size: 13px; transition: 0.2s;
}
.cal-day:hover:not(.disabled) { background: #eff6ff; color: #6366f1; }
.cal-day.selected { background: #6366f1; color: white !important; font-weight: bold; box-shadow: 0 2px 5px rgba(99,102,241,0.4); }
.cal-day.disabled { color: #cbd5e1; cursor: not-allowed; }

/* 설치 시간 슬롯 */
.time-slot {
    padding: 14px 10px; border: 2px solid #e2e8f0; border-radius: 10px;
    text-align: center; cursor: pointer; transition: 0.2s; font-weight: 600; font-size: 14px;
}
.time-slot:hover:not(.slot-full) { border-color: #6366f1; background: #eff6ff; }
.time-slot.slot-selected { background: #6366f1; color: white !important; border-color: #6366f1; box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.time-slot.slot-selected .slot-count { color: rgba(255,255,255,0.8); }
.time-slot.slot-available { border-color: #86efac; }
.time-slot.slot-full { border-color: #e2e8f0; color: #cbd5e1; cursor: not-allowed; background: #f8fafc; }

/* 심플 제품 카드 & 팝업 */
.simple-prod-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 20px; cursor: pointer; transition: all 0.2s; position: relative;
    min-height: 160px;
}
.simple-prod-card:hover {
    border-color: #6366f1; box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
    transform: translateY(-3px);
}
.prod-icon-box {
    width: 50px; height: 50px; background: #f1f5f9; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #475569; margin-bottom: 10px;
}
.prod-title { font-size: 15px; font-weight: bold; color: #333; margin-bottom: 5px; text-align: center; }
.prod-desc { font-size: 12px; color: #888; margin-bottom: 12px; text-align: center; }
.prod-price { font-size: 14px; font-weight: 800; color: #6366f1; margin-bottom: 10px; }
.btn-detail-green {
    padding: 6px 14px; background: #22c55e; color: white;
    font-size: 12px; font-weight: bold; border-radius: 20px; border: none;
    cursor: help; transition: 0.2s; display: flex; align-items: center; gap: 5px;
}
.btn-detail-green:hover { background: #16a34a; }

.hover-img-popup {
    display: none; position: absolute; bottom: 80%; left: 50%;
    transform: translateX(-50%); width: 220px; height: 220px;
    background: white; border: 2px solid #6366f1;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3); border-radius: 12px; z-index: 9999; padding: 5px;
}
.hover-img-popup img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; background: #f8fafc; }

/* =========================================
   7. 푸터 (Footer)
   ========================================= */
.footer-wrap {
    width: 100%; background: #f9fafb; border-top: 1px solid #e5e7eb;
    padding: 40px 20px; margin-top: 50px; color: #4b5563; font-size: 13px;
}
.footer-inner {
    max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap;
    gap: 30px; justify-content: space-between;
}
.foot-menu ul { list-style: none; padding: 0; margin: 0 0 20px 0; display: flex; gap: 20px; }
.foot-menu a { text-decoration: none; color: #374151; font-weight: 600; }
.foot-menu a:hover { color: var(--primary); }
.foot-info dl { display: flex; flex-wrap: wrap; margin: 5px 0; gap: 5px; }
.foot-info dt { font-weight: 700; color: #111; }
.foot-info dd { color: #666; margin: 0; margin-right: 10px; }
.copyright { margin-top: 15px; color: #9ca3af; font-size: 12px; }
.cs-center h3 { margin: 0 0 10px 0; font-size: 16px; color: #111; }
.cs-center strong { font-size: 24px; color: var(--primary); display: block; margin-bottom: 5px; }
.cs-center p { margin: 0; line-height: 1.5; color: #666; }

/* =========================================
   8. 모바일 반응형 (Mobile, max-width: 768px)
   ========================================= */
#mobileControlDock { display: none; } /* PC에선 숨김 */

@media (max-width: 768px) {
    /* [1] 상단 메뉴바 (Topbar) - 버튼 복구 및 가로 스크롤 */
    .topbar {
        display: flex !important; align-items: center !important; justify-content: flex-start !important;
        gap: 8px !important; padding: 0 10px !important; height: 50px !important;
        overflow-x: auto !important; white-space: nowrap !important; background: #fff !important;
    }
    .topbar::-webkit-scrollbar { display: none; }
    #siteNavBar { gap: 1px !important; margin-left: 0 !important; flex-shrink: 0 !important; order: 4 !important; }
    #siteNavBar .flag-link { width: 22px !important; height: 22px !important; font-size: 13px !important; padding: 0 !important; }
    #startScreen { top: 50px !important; height: calc(100vh - 50px) !important; }
    .brand { display: none !important; } /* 로고 숨김 */

    /* 모바일 헤더 순서: HOME > 로그인 > 구매 > 국기 > 주문조회 > 마이페이지 */
    #btnHomeTop       { order: 1 !important; flex-shrink: 0 !important; }
    #btnLoginBtn      { order: 2 !important; flex-shrink: 0 !important; padding: 8px 12px !important; }
    #btnOrderTop      { order: 3 !important; flex-shrink: 0 !important; }
    /* #siteNavBar      order: 4 — 위에서 설정 */
    #btnOrderTracking { order: 5 !important; flex-shrink: 0 !important; }
    #btnMyLibrary     { order: 6 !important; flex-shrink: 0 !important; }
    .btn-save-top     { order: 7 !important; flex-shrink: 0 !important; }

    .template-tabs { display: none !important; } /* 템플릿 버튼 숨김 (사이드바에 있음) */
    .topbar > div[style*="flex:1"] { display: none !important; }

    /* [2] 에디터 화면 (좌우 패널 정리) */
    .editor-wrap {
        display: flex !important; flex-direction: column !important;
        width: 100vw !important; height: calc(100vh - 50px) !important;
        overflow: hidden !important; position: relative !important;
    }
    .stage {
        order: 1 !important; width: 100% !important; height: 100% !important;
        position: absolute !important; top: 0; left: 0; z-index: 1;
        background: #e5e5e5; border-bottom: 2px solid #ddd;
    }

    /* 사이드바 & 우측 스택 -> 모바일 슬라이드 패널로 변환 */
    .side {
        order: 2 !important; position: fixed !important;
        top: 50px; bottom: 0; left: 0;
        width: 85% !important; max-width: 320px;
        background: #fff !important; z-index: 10000 !important;
        border-right: none !important; box-shadow: 5px 0 15px rgba(0,0,0,0.1);
        transform: translateX(-120%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important; flex-direction: column; padding: 15px !important;
    }
    .side.open { transform: translateX(0); }

    .right-stack {
        display: none !important;
    }
    .right-stack.open { display: none !important; }

    /* [수정] 모바일 컨트롤 독 (좌측 세로 배치로 변경) */
    #mobileControlDock {
        display: block; /* flex 제거 */
        position: fixed; 
        top: 0; left: 0; bottom: 0; width: 0; /* 공간 차지 안함 */
        z-index: 9000; 
        pointer-events: none;
    }

    .mobile-fab {
        pointer-events: auto; 
        position: fixed; /* 화면 기준 고정 */
        left: 15px; /* 화면 왼쪽에서 15px 떨어짐 */
        width: 55px; height: 55px;
        border-radius: 50%; border: none; color: white; font-size: 18px;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3); cursor: pointer; transition: transform 0.1s;
        z-index: 9100;
    }
    .mobile-fab:active { transform: scale(0.95); }
    .mobile-fab span { font-size: 9px; margin-top: 2px; font-weight: bold; letter-spacing: -0.5px; }

    
    .mobile-fab.left { 
        top: 130px; /* 70px -> 130px */
        background: #6366f1; 
    }

  
    .mobile-fab.right { 
        bottom: 90px; /* 160px -> 90px */
        background: #1e293b; 
    }

    /* [추가] 템플릿 버튼도 좌측으로 이동 (탑바에서 숨기고 FAB로 추가 가능하지만, 일단 기존 탑바 유지 추천) */

    /* [3] 템플릿 모달 (카테고리 잘림 해결) */
    .tpl-modal-box {
        /* [수정] 모바일 화면 꽉 채우기 및 밀림 방지 */
        position: fixed !important; 
        top: 0 !important; 
        left: 0 !important;
        width: 100% !important; 
        height: 100dvh !important; /* ★ 핵심: 주소창 크기 변화에 대응하는 동적 높이 */
        border-radius: 0 !important; 
        flex-direction: column !important;
        display: flex !important; 
        overflow: hidden !important;
        z-index: 20000 !important;
    }

    /* [추가] 모바일 상단 안전 영역 확보 (노치/상태바 때문에 닫기 버튼 가림 방지) */
    .tpl-content > div:first-child {
        padding-top: max(20px, env(safe-area-inset-top)) !important; 
        min-height: 70px !important; /* 헤더 높이를 충분히 확보 */
    }
    .tpl-sidebar {
        flex-direction: row !important; height: auto !important;
        padding: 10px 10px 10px 15px !important; padding-right: 40px !important;
        overflow-x: auto !important; white-space: nowrap !important;
        border-right: none !important; border-bottom: 1px solid #eee;
        flex-shrink: 0 !important; width: 100% !important; box-sizing: border-box !important;
    }
    .tpl-cate-btn {
        margin-right: 10px !important; flex: 0 0 auto !important;
        background: #f1f5f9; padding: 8px 15px !important; border-radius: 20px !important;
    }
    .tpl-content { display: flex !important; flex-direction: column !important; height: 100% !important; overflow: hidden !important; }
    .tpl-content > div:first-child { display: flex !important; align-items: center !important; padding: 10px 15px !important; flex-shrink: 0 !important; }
    #tplSearchInput { width: auto !important; flex: 1 !important; margin-bottom: 0 !important; }
    .tpl-grid { 
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important; /* ★ 한 줄에 4개 배치 */
        gap: 6px !important; /* 간격을 좁게 조정 */
        padding: 10px 5px !important;
        overflow-y: auto !important;
        flex: 1 !important;
    }
    #btnUseTpl { width: 100% !important; height: 50px !important; font-size: 16px !important; font-weight: bold !important; }

    /* [4] 장바구니 화면 모바일 최적화 */
    #cartPage { padding-top: 50px !important; background: #f1f5f9 !important; }
    #cartPage > div { display: flex !important; flex-direction: column !important; padding: 0 !important; height: 100% !important; }
    #cartListArea { height: auto !important; max-height: none !important; padding: 15px 15px 280px 15px !important; overflow-y: auto !important; }

    .cart-item {
        display: flex !important; flex-direction: column !important;
        padding: 20px !important; background: #fff !important;
        border-radius: 16px !important; margin-bottom: 20px !important;
        position: relative !important;
    }
    .cart-item > div:nth-child(2) { order: 1 !important; margin-bottom: 20px !important; width: 100% !important; }
    .cart-item > div:nth-child(2) > div:first-child { display: block !important; width: 100% !important; margin-bottom: 10px !important; text-align: left !important; }
    
    .cart-item > div:first-child {
        order: 2 !important; margin-bottom: 15px !important;
        padding-top: 15px !important; border-top: 1px solid #f3f4f6;
        display: flex !important; align-items: flex-start !important;
    }
    .cart-item > div:first-child > div { display: flex !important; flex-direction: column !important; justify-content: flex-start !important; padding-left: 5px !important; }
    .cart-item > div:first-child > div > div:last-child { margin-top: 15px !important; font-size: 16px !important; display: block !important; }
    
    .cart-item > div:last-child { order: 3 !important; width: 100% !important; }
    #cartPage > div > div > div:last-child { 
        position: fixed !important; bottom: 0 !important; left: 0 !important; 
        width: 100% !important; background: #fff !important; padding: 20px !important; 
        z-index: 12500 !important; border-radius: 20px 20px 0 0 !important; 
        box-shadow: 0 -5px 10px rgba(0,0,0,0.05) !important; 
    }
    /* 푸터 모바일 */
    .footer-inner { flex-direction: column; gap: 20px; }
    .foot-menu ul { flex-wrap: wrap; gap: 10px; }

    
    .hero-promo-box { margin: 0 12px 12px; padding: 24px 16px 20px; border-radius: 16px; }
    .hero-section { display: block !important; padding: 20px 15px 15px !important; margin-bottom: 0 !important; }
    .hero-title { font-size: 28px !important; word-break: keep-all; }
    .hero-title span { font-size: 20px !important; }
    .hero-cta-row { flex-direction: column; gap: 8px; }
    .hero-desc { font-size: 13px !important; padding: 8px 16px !important; }
    .hero-signup-btn { font-size: 14px !important; padding: 10px 24px !important; }
    .hero-signup-desc { font-size: 11px !important; }
    .quick-menu-track { grid-template-columns: repeat(2, 1fr) !important; }
    
    /* [수정됨] 템플릿 그리드: 모바일에서 2칸으로 고정 */
    .template-grid-start { 
        display: grid !important; 
        grid-template-columns: repeat(2, 1fr) !important; /* 1줄에 2개 */
        gap: 15px !important; /* 사이 간격 적당히 */
        column-count: auto !important; /* 기존 컬럼 설정 초기화 */
    }

    #startScreen { padding-top: 20px !important; }
    
    /* [강력 수정] 하단 독바: 화면 기준 고정 및 최상위 노출 */
    .bottom-dock { 
        display: flex !important;
        position: fixed !important;   /* absolute -> fixed로 변경하여 스크롤 무시하고 고정 */
        bottom: 30px !important;     /* 하단 FAB 버튼(60px)보다 더 위에 배치 */
        left: 50% !important;
        transform: translateX(-50%) !important;
        
        z-index: 999999 !important;   /* 모든 팝업/레이어보다 위에 오도록 설정 */
        
        background: rgba(255, 255, 255, 0.95) !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 5px 20px rgba(0,0,0,0.15) !important;
        border-radius: 50px !important;
        padding: 8px 20px !important;
        gap: 12px !important;
        width: auto !important;
        white-space: nowrap !important;
    }

    /* 버튼 크기 및 아이콘 조정 */
    .bottom-dock .zoom-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
        background: #fff !important;
        border: 1px solid #cbd5e1 !important;
        color: #334155 !important;
    }

    /* 모바일에서는 도움말 텍스트 숨김 */
    .bottom-dock .help-text { display: none !important; }
}

/* 모바일 텍스트 에디터 (항상 최상위) */
#mobileTextEditor {
    position: fixed; top: 0; left: 0; width: 100%; height: 170px;
    background: #fff; z-index: 999999; padding: 10px 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: none; flex-direction: column; gap: 6px;
}
.m-text-header {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: bold; color: #333;
}
.m-align-btn {
    width: 32px; height: 32px; border: 1.5px solid #ddd; border-radius: 6px;
    background: #f8f8f8; color: #888; font-size: 13px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.m-align-btn.m-align-active {
    background: #6366f1; color: #fff; border-color: #6366f1;
}
.m-color-dot {
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    display: inline-block; box-sizing: border-box; border: 2px solid transparent;
    flex-shrink: 0; transition: transform 0.15s;
}
.m-color-dot.m-color-active {
    border-color: #6366f1; transform: scale(1.2);
}
#mobileTextInput {
    width: 100%; flex: 1; border: 1px solid #ddd; border-radius: 8px;
    padding: 8px 10px; font-size: 16px; outline: none; resize: none; font-family: inherit;
}
#mobileTextInput:focus { border-color: #6366f1; }

/* =========================================
   [추가] 결제 모달 계좌정보 스타일
   ========================================= */
.bank-transfer-container {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.bank-title {
    font-size: 13px;
    font-weight: 800;
    color: #475569;
    margin-bottom: 8px;
}

.bank-info {
    font-size: 16px;
    font-weight: 800;
    color: #333;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.bank-name {
    color: #f59e0b; /* 국민은행 느낌의 노란/주황 계열 포인트 */
}

.bank-num {
    color: #1e293b;
    letter-spacing: 0.5px;
}

.bank-owner {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 600;
}

.bank-note {
    font-size: 11px;
    color: #6366f1; /* 브랜드 컬러(Primary) 사용 */
    background: #eff6ff;
    padding: 5px 8px;
    border-radius: 4px;
    display: inline-block;
    line-height: 1.4;
}
/* [추가] 입금 확인 버튼 스타일 */
.btn-bank-confirm {
    margin-top: 15px;
    background-color: #10b981; /* 신뢰감을 주는 초록색 */
    color: white;
    border: none;
    font-weight: bold;
    font-size: 14px;
    height: 45px;
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
    transition: all 0.2s;
}

.btn-bank-confirm:hover {
    background-color: #059669;
    transform: translateY(-2px);
}
/* =========================================
   [추가] 메인 검색창 디자인 (크고 예쁘게)
   ========================================= */
.hero-search-wrap {
    width: 100%;
    max-width: 600px; /* 검색창 전체 너비 */
    margin: 10px auto 40px; /* 위아래 여백 */
    position: relative;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15); /* 부드러운 보라색 그림자 */
    border-radius: 50px;
    background: #fff;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

/* 마우스 올리거나 클릭했을 때 강조 */
.hero-search-wrap:hover,
.hero-search-wrap:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.25);
    border-color: var(--primary); /* 보라색 테두리 */
}

.hero-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 18px 25px; /* 내부 여백을 키워서 통통하게 */
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-radius: 50px 0 0 50px;
    outline: none !important;
}

.hero-search-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.hero-search-btn {
    background: var(--primary); /* 보라색 배경 */
    color: white;
    border: none;
    padding: 12px 25px;
    margin: 5px; /* 입력창 안쪽으로 살짝 들어온 느낌 */
    border-radius: 40px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    /* 오류가 있던 부분 */
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-search-btn:hover {
    background: var(--primary-dark);
}

/* ── AI 어드바이저 버튼 ── */
.hero-ai-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.hero-ai-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}
.hero-ai-btn i { font-size: 16px; }

/* ══════ AI 어드바이저 인라인 채팅 패널 ══════ */
.advisor-panel {
    max-width: 900px;
    width: 100%;
    margin: 20px auto 0;
    padding: 0 15px;
    box-sizing: border-box;
    animation: advSlideIn 0.35s ease-out;
}
.advisor-panel * { box-sizing: border-box; }
@keyframes advSlideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 헤더 */
.adv-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    border-radius: 16px 16px 0 0;
    color: white;
}
.adv-panel-title {
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.adv-panel-title i { font-size: 18px; }
.adv-panel-sub {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 4px;
}
.adv-header-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}
.adv-header-btn:hover { background: rgba(255,255,255,0.3); }
.adv-panel-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}
.adv-panel-close:hover { background: rgba(255,255,255,0.3); }

/* 채팅 영역 */
.adv-chat-area {
    background: #f8fafc;
    min-height: 420px;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    scroll-behavior: smooth;
}

/* 메시지 행 */
.adv-row { display: flex; margin-bottom: 12px; gap: 8px; }
.adv-row-user { justify-content: flex-end; }
.adv-row-ai { justify-content: flex-start; }

/* 아바타 */
.adv-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

/* 말풍선 */
.adv-bubble-user {
    max-width: 75%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    color: white;
    border-radius: 16px 16px 4px 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: keep-all;
}
.adv-bubble-ai {
    max-width: 75%;
    padding: 10px 16px;
    background: white;
    color: #1e293b;
    border-radius: 16px 16px 16px 4px;
    font-size: 14px;
    line-height: 1.6;
    word-break: keep-all;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* 타이핑 인디케이터 */
.adv-typing-bubble .adv-dots {
    display: flex;
    gap: 5px;
    padding: 6px 0;
}
.adv-typing-bubble .adv-dots span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: advDotBounce 1.2s infinite;
}
.adv-typing-bubble .adv-dots span:nth-child(2) { animation-delay: 0.2s; }
.adv-typing-bubble .adv-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes advDotBounce {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1.1); }
}

/* 제품 카드 */
.adv-cards-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    max-width: 100%;
    margin: 8px 0 12px;
}
.adv-card {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s;
}
.adv-card:hover { border-color: #8b5cf6; box-shadow: 0 4px 16px rgba(99,102,241,0.12); }
.adv-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.adv-card-badge {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.adv-card-thumb { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: #f1f5f9; }
.adv-card-name { font-weight: 700; color: #1e293b; font-size: 14px; }
.adv-card-reason { color: #64748b; font-size: 13px; line-height: 1.4; margin: 0 0 8px; }
.adv-card-meta { display: flex; gap: 10px; font-size: 12px; color: #64748b; margin-bottom: 10px; flex-wrap: wrap; }
.adv-card-meta i { color: #8b5cf6; margin-right: 2px; }
.adv-card-btns { display: flex; gap: 6px; }
.adv-btn-editor {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.adv-btn-editor:hover { opacity: 0.85; }
.adv-btn-cart {
    flex: 1;
    padding: 8px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.adv-btn-cart:hover { border-color: #6366f1; color: #6366f1; }

/* 입력 영역 */
.adv-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 16px 16px;
    width: 100%;
    min-width: 0;
}
.adv-input { min-width: 0; }
.adv-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
}
.adv-input:focus { border-color: #6366f1; background: white; }
.adv-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.adv-send-btn:hover { opacity: 0.85; }

/* 업로드 버튼 */
.adv-upload-btn {
    width: 42px;
    height: 42px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #6366f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.adv-upload-btn:hover { background: #eef2ff; border-color: #6366f1; }

/* 이미지 미리보기 */
.adv-img-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}
.adv-img-preview img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.adv-img-preview span {
    flex: 1;
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.adv-img-remove {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.adv-img-remove:hover { background: #dc2626; }

/* 채팅 내 이미지 */
.adv-chat-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    display: block;
}
.adv-bubble-img { padding: 6px !important; }

/* ── 모바일 advisor ── */
@media (max-width: 768px) {
    .advisor-panel { padding: 0 8px; }
    .adv-chat-area { min-height: 300px; max-height: 70vh; padding: 14px; }
    .adv-cards-wrap { grid-template-columns: 1fr; }
    .adv-bubble-user, .adv-bubble-ai { max-width: 88%; }
    .hero-ai-btn { padding: 10px 18px !important; font-size: 13px !important; }
}

/* =========================================
   [수정됨] 리얼 후기 (Marquee) 섹션
   ========================================= */
.review-section {
    width: 100%;
    padding: 60px 0;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    overflow: hidden;
}

.review-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.review-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 10px 0;
}

.review-header p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

/* 무한 스크롤 트랙 */
.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 10px 0 30px 0; /* 높이 확보를 위한 패딩 */
}

.marquee-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 개별 후기 카드 */
.review-card {
    width: 300px; /* 카드 너비 고정 */
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    flex-shrink: 0; /* 찌그러짐 방지 */
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
}

/* 후기 이미지 영역 (이미지 없어도 높이 유지) */
.review-img {
    width: 100%;
    height: 180px; /* 높이값 필수 지정 */
    background-color: #cbd5e1; /* 이미지 로딩 실패 시 회색 배경 */
    background-size: cover;
    background-position: center;
    position: relative;
}

/* 후기 내용 */
.review-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.review-stars {
    color: #f59e0b;
    font-size: 14px;
    margin-bottom: 10px;
}

.review-text {
    font-size: 14px;
    color: #334155;
    line-height: 1.5;
    margin: 0 0 15px 0;
    flex: 1;
    word-break: keep-all;
    font-weight: 500;
}

.review-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    font-size: 12px;
}

.u-name { font-weight: 700; color: #1e293b; }
.u-date { color: #94a3b8; }

/* 모바일 대응 */
@media (max-width: 768px) {
    .review-card { width: 260px; }
    .review-img { height: 150px; }
}

.category-tabs {
    display: flex;
    justify-content: flex-start !important;
    gap: 8px;
    padding: 0 10px 15px 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
    
    /* 스크롤바 디자인 (선택사항) */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
/* 크롬/사파리 스크롤바 숨김 해제 (스크롤 가능함을 보여줌) */
.category-tabs::-webkit-scrollbar { height: 4px; display: block; }
.category-tabs::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
    flex: 1;                  /* 모든 탭이 동일한 너비를 가짐 */
    min-width: 120px;         /* 일본어 대응을 위한 최소 너비 확보 */
    padding: 12px 5px;        /* 좌우 여백 축소 */
    border-radius: 50px;
    font-size: 13px;          /* 일본어는 한글보다 1px 작게 설정 추천 */
    font-weight: 700;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;      /* 줄바꿈 방지 */
}

.cat-tab:hover {
    background: #f8fafc;
    color: #334155;
    transform: translateY(-2px);
}

.cat-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

/* 모바일 화면 (768px 이하)에서만 왼쪽 정렬 강제 */
@media (max-width: 768px) {
    .category-tabs {
        justify-content: flex-start !important;
        padding: 0 20px 15px 20px !important;
    }
}
/* 썸네일 이미지를 감싸는 박스 */
.quick-icon-img-box {
    width: 65px; height: 65px; 
    border-radius: 18px; 
    overflow: hidden;
    margin-bottom: 10px;
    background: #f1f5f9; 
    border: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: center;
}

/* 실제 이미지 스타일 */
.quick-icon-img-box img {
    width: 100%; height: 100%;
    object-fit: cover; /* 이미지를 박스에 꽉 차게 (잘림 허용) */
}

/* 마우스 올렸을 때 효과 */
.quick-item:hover .quick-icon-img-box {
    border-color: #6366f1; /* 보라색 테두리 */
    transform: translateY(-3px); /* 살짝 위로 */
}
/* [추가] 팝업창(모달) 전용 상품 그리드 스타일 */
#catProductGrid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* 한 줄에 4개 강제 고정 */
    gap: 20px !important; /* 간격 넓게 */
    padding: 10px !important;
}

/* 팝업창 안의 개별 상품 박스 */
#catProductGrid .quick-item {
    width: 100% !important; /* 너비를 그리드 칸에 꽉 채움 */
    height: auto !important;
    margin-bottom: 0 !important;
    padding: 15px !important; /* 내부 여백 추가 */
    background: #fff;
    border: 1px solid #eee;
}

/* [수정됨] 팝업창 안의 상품 이미지 박스 (정사각형 & 중앙 정렬) */
#catProductGrid .quick-icon-img-box {
    width: 100% !important;  /* 가로 꽉 채움 */
    height: auto !important; /* 높이는 자동으로 (비율에 맞춤) */
    aspect-ratio: 1 / 1 !important; /* ★ 핵심: 1:1 정사각형 비율 강제 */
    margin-bottom: 15px !important;
    border-radius: 12px !important;
    background: #f8fafc;
    border: 1px solid #eee;
    overflow: hidden; /* 네모 밖으로 나간 이미지 숨김 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* [수정됨] 이미지 스타일 (잘려서 중앙이 보이게) */
#catProductGrid .quick-icon-img-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* ★ 핵심: 박스에 꽉 차게 (넘치면 잘림) */
    object-position: center !important; /* 잘릴 때 중앙을 보여줌 */
    padding: 0 !important; /* 패딩 제거 */
}

/* 팝업창 안의 텍스트 크기 조정 */
#catProductGrid .quick-text {
    font-size: 16px !important; /* 글자도 조금 크게 */
    margin-bottom: 5px !important;
}

    /* =========================================
       [팝업창 상품 목록 디자인 수정 - PC/모바일 완벽 분리]
       ========================================= */

    /* ----------------------------------------------------
       [1] PC 및 공통 설정 (기본값) 
       화면이 클 때 이 스타일이 먼저 적용됩니다.
       ---------------------------------------------------- */
    
    /* 1. 팝업창 크기 확장 (PC에서 4개가 넉넉하게 들어가도록) */
    /* =========================================
   [수정완료] 팝업창 상품 목록 디자인 (PC/모바일 완벽 분리)
   ========================================= */

/* ----------------------------------------------------
   [1] PC 및 공통 설정 (기본값)
   ---------------------------------------------------- */

/* 1. 팝업창 크기 */
#categoryDetailModal .modal-box {
    width: 1000px !important;
    max-width: 95% !important;
    max-height: 90vh !important; /* 화면 높이 넘치지 않게 */
    overflow-y: auto !important; /* 내용 많으면 스크롤 */
    padding: 20px 10px !important; /* 패딩 조정 */
}

/* 2. 그리드 레이아웃 (PC: 한 줄에 4개) */
#catProductGrid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important; /* ★ 간격 좁힘 (좌우 공간 확보) */
    padding: 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 3. 개별 상품 박스 (높이 통일) */
#catProductGrid .quick-item {
    width: 100% !important;
    height: 100% !important; /* 높이 꽉 채우기 */
    min-height: auto !important; /* 강제 높이 제거 */
    margin-bottom: 0 !important;
    padding: 15px !important;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    display: flex !important;
    flex-direction: column !important; /* 세로 정렬 */
    justify-content: flex-start !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
    transition: transform 0.2s;
    box-sizing: border-box !important;
}

#catProductGrid .quick-item:hover {
    transform: translateY(-5px);
    border-color: #6366f1;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.15) !important;
    z-index: 5;
}

/* 4. 이미지 & 아이콘 박스 (정사각형 비율 강제 통일) */
#catProductGrid .quick-icon-img-box,
#catProductGrid .quick-icon { /* 아이콘만 있는 경우도 포함 */
    width: 100% !important;
    aspect-ratio: 1 / 1 !important; /* ★ 핵심: 무조건 정사각형 */
    height: auto !important;
    margin-bottom: 12px !important;
    border-radius: 10px !important;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0 !important; /* 찌그러짐 방지 */
}

/* 큐브 아이콘 크기 키우기 */
#catProductGrid .quick-icon {
    font-size: 40px !important; /* 아이콘 크기 확대 */
    color: #cbd5e1;
}

/* 5. 이미지 (꽉 차게) */
#catProductGrid .quick-icon-img-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    padding: 0 !important;
    display: block !important;
}

/* 6. 상품명 텍스트 (높이 고정하여 들쑥날쑥 방지) */
#catProductGrid .quick-text {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 8px !important;
    line-height: 1.4 !important;
    
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important; /* 2줄 말줄임 */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    
    height: 42px !important; /* ★ 핵심: 2줄 높이로 고정 */
    text-align: center !important;
    white-space: normal !important; /* 줄바꿈 허용 */
}

/* 7. 가격 정보 (항상 바닥에 붙기) */
#catProductGrid .quick-item > div:last-child {
    margin-top: auto !important; /* 위쪽 여백을 최대로 밀어서 바닥 고정 */
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #6366f1;
    text-align: center !important;
}


/* ----------------------------------------------------
   [2] 모바일 전용 설정 (화면 너비 768px 이하)
   ---------------------------------------------------- */
@media (max-width: 768px) {
    
    /* 모달창 크기 최적화 */
    #categoryDetailModal .modal-box {
        width: 90% !important; /* 화면 꽉 차게 */
        max-width: 360px !important;
        padding: 15px !important;
    }

    /* 2칸 그리드 (모바일) */
    #catProductGrid {
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px !important;
        padding: 5px !important;
    }

    /* 카드 크기 줄이기 */
    #catProductGrid .quick-item {
        padding: 10px !important;
        min-height: auto !important; /* 높이 강제 제거 */
    }
    
    /* 텍스트 크기 조정 */
    #catProductGrid .quick-text {
        font-size: 13px !important;
        height: 36px !important; /* 모바일은 조금 더 작게 고정 */
        margin-bottom: 5px !important;
    }
    
    /* 가격 텍스트 */
    #catProductGrid .quick-item > div:last-child {
        font-size: 12px !important;
    }
}

.mp-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); /* 가로 4개 강제 */
    gap: 20px; /* 간격 넓힘 */
    padding-bottom: 50px;
}

/* 모바일/태블릿 반응형 처리 */
@media (max-width: 1200px) { .mp-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .mp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .mp-grid { grid-template-columns: 1fr; } }

/* [수정] 디자인 카드 스타일 개선 (이미지 강조) */
.mp-design-card { 
    border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; 
    background: #fff; transition: all 0.2s ease; position: relative;
    display: flex; flex-direction: column;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02); /* 부드러운 그림자 추가 */
}

.mp-design-card:hover { 
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.15); /* 마우스 올리면 뜨는 효과 */
    transform: translateY(-5px); 
    border-color: #6366f1; 
}

/* 썸네일 영역 - 꽉 차게 보이도록 설정 */
.mp-design-thumb { 
    width: 100%; 
    aspect-ratio: 1 / 1; /* 정사각형 비율 고정 */
    object-fit: cover; /* 이미지를 꽉 채움 (여백 없음) */
    /* 만약 이미지가 잘리는 게 싫다면 object-fit: contain; 으로 변경하고 background: #f8fafc; 추가 */
    background: #f1f5f9; 
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.mp-design-body { padding: 15px; display: flex; flex-direction: column; gap: 8px; }
.mp-design-title { font-size: 15px; font-weight: 800; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 5) 계좌번호 입력 섹션 */
.bank-section {
    background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 12px; padding: 20px;
    margin-bottom: 30px; display: flex; flex-direction: column; gap: 10px;
}
.bank-header { display: flex; justify-content: space-between; align-items: center; }
.bank-notice { font-size: 13px; color: #0369a1; font-weight: 600; }
.bank-form { display: flex; gap: 10px; flex-wrap: wrap; }
.bank-input { 
    padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; flex: 1;
}

/* 수익 에셋 리스트 */
.asset-list { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.asset-item { 
    display: flex; align-items: center; gap: 15px; background: white; 
    padding: 15px; border: 1px solid #e2e8f0; border-radius: 8px; 
}
.asset-thumb { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; background: #f1f5f9; border: 1px solid #eee; }
.asset-info { flex: 1; }
.asset-revenue { font-size: 16px; font-weight: 800; color: #16a34a; }
/* =========================================
   1. 기본 설정 및 변수 (수정됨)
   ========================================= */
body { 
    margin: 0; 
    height: 100vh; 
    overflow: hidden; /* 스크롤은 내부 div에서 처리 */
    background: var(--bg-sidebar); 
    padding-top: 60px; /* ★ 탑바(60) 높이만큼 여백 확보 (국가바 투명화) */
    box-sizing: border-box;
}

/* =========================================
   4. 메인 에디터 레이아웃 (수정됨)
   ========================================= */
/* 탑바 고정 스타일 */
.topbar { 
    position: fixed; top: 0; left: 0; right: 0; /* ★ 상단 고정 */
    height: 60px; display: flex; align-items: center; 
    padding: 0 25px; background: #fff; border-bottom: 1px solid var(--border);
    gap: 10px; z-index: 1000; /* z-index 높임 */
    overflow-x: auto; white-space: nowrap; 
}

/* 시작 화면 스크롤 처리 */
#startScreen {
    position: absolute; inset: 0; top: 60px; /* ★ 탑바(60) 아래부터 시작 (국가바 투명화) */
    background: #fff;
    z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    overflow-y: auto; /* ★ 내부 스크롤 활성화 */
    padding-bottom: 80px;
    height: calc(100vh - 60px); /* 높이 계산 */
}

/* 에디터 화면 높이 조정 */
#mainEditor { 
    display: none; width: 100vw; height: 100%; /* 부모 높이(body-padding 제외) */
    flex-direction: column; 
}

.editor-wrap { 
    display: grid; grid-template-columns: 280px 1fr; 
    height: 100%; /* ★ 꽉 채우기 */
    width: 100vw; overflow: hidden; 
}

/* 가벽 컨트롤 위치 조정 (탑바 아래로) */
#wallHeightControls { 
    top: 75px; /* 60px(탑바) + 15px(여백) */
}
@media (max-width: 768px) {
        .hero-search-wrap {
            display: flex !important;
            align-items: center !important;
            height: 50px !important; /* 높이 고정 */
            padding: 0 !important;
            border-radius: 50px !important;
            overflow: hidden !important;
            border: 2px solid #6366f1; /* 테두리 강조 */
            background: #fff;
        }

        .hero-search-input {
            flex: 1 !important; /* 남은 공간 모두 차지 */
            height: 100% !important;
            border: none !important;
            padding: 0 15px !important;
            font-size: 14px !important;
            margin: 0 !important;
            border-radius: 0 !important;
        }

        .hero-search-btn {
            width: 50px !important; /* 버튼 너비 고정 */
            height: 100% !important;
            border: none !important;
            background: #6366f1 !important;
            color: white !important;
            margin: 0 !important;
            padding: 0 !important;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 0 !important;
        }
        
        /* 검색 버튼 안의 텍스트 숨기고 돋보기만 보여주기 (공간 확보) */
        .hero-search-btn span {
            display: none; 
        }
        .hero-search-btn i {
            font-size: 18px;
            margin: 0 !important;
        }
    }

    /* [2번 해결] 에디터 조절 버튼(양쪽) 기본적으로 숨기기 */
    #mobileControlDock {
        display: none !important; /* 시작 화면 등에서는 안 보이게 설정 */
    }
    
    /* 에디터가 켜졌을 때만 보이게 하는 클래스 */
    body.editor-active #mobileControlDock {
        display: flex !important;
    }
    /* 핫딜 섹션 스타일 */
.hotdeal-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    animation: fadeIn 0.5s ease-in-out;
}

.hotdeal-header {
    margin-bottom: 20px;
}

.hotdeal-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: #111;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 5px 0;
}

.hotdeal-header p {
    color: #333;
    font-size: 14px;
    margin: 0;
}

.badge-hot {
    background: #ef4444;
    color: white;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    animation: pulse 2s infinite;
}

.hotdeal-scroll-wrap {
    position: relative;
}

.hotdeal-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.hotdeal-grid .hotdeal-card {
    min-width: unset;
    max-width: unset;
}

.hotdeal-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: rgba(255,255,255,0.95);
    color: #334155;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.hotdeal-arrow:hover { background: #6366f1; color: #fff; border-color: #6366f1; }
.hotdeal-arrow-left { left: -18px; }
.hotdeal-arrow-right { right: -18px; }

@media (max-width: 768px) {
    .hotdeal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .hotdeal-img-box {
        height: 120px;
    }
    .hotdeal-info {
        padding: 8px 10px;
    }
    .hotdeal-title { font-size: 12px; }
    .hotdeal-meta { font-size: 10px; margin-bottom: 4px; }
    .hotdeal-price { font-size: 13px; }
    .hotdeal-wrapper { padding: 0 12px; margin: 20px auto; }
    .hotdeal-header h2 { font-size: 18px; }
    .hotdeal-header p { font-size: 12px; }
    .hotdeal-scroll-wrap { position: relative; }
}

.hotdeal-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.hotdeal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: #6366f1;
}

.hotdeal-img-box {
    width: 100%;
    height: 180px;
    background: #f8fafc;
    overflow: hidden;
    position: relative;
}

.hotdeal-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.hotdeal-card:hover .hotdeal-img-box img {
    transform: scale(1.05);
}

.hotdeal-info {
    padding: 15px;
}

.hotdeal-title {
    font-weight: bold;
    font-size: 15px;
    color: #333;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hotdeal-meta {
    font-size: 12px;
    color: #fff;
    margin-bottom: 8px;
}

.hotdeal-price {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* 모바일 화면 (768px 이하) 설정 */
    @media (max-width: 768px) {
        
        /* 퀵메뉴(카테고리) 컨테이너를 3칸으로 설정 */
        #quickMenuContainer {
            display: grid !important;
            grid-template-columns: repeat(3, 1fr) !important; /* 핵심: 1줄에 3개 */
            gap: 8px !important; /* 간격을 조금 좁게 조정 */
        }

        /* 3개씩 배치되면 공간이 좁아지므로 폰트 크기 미세 조정 */
        .quick-item .quick-text {
            font-size: 11px !important; 
            letter-spacing: -0.5px;
            white-space: nowrap; /* 글자가 두 줄로 안 떨어지게 */
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        /* 아이콘 박스 크기도 화면에 맞게 유동적으로 */
        .quick-item .quick-icon-img-box {
            height: auto !important;
            aspect-ratio: 1 / 1; /* 정사각형 비율 유지 */
        }
    }
    /* 커뮤니티 버튼 스타일 */
.community-nav-wrapper { max-width: 1200px; margin: 20px auto 40px; padding: 0 10px; }
.comm-grid { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.comm-btn { display: flex; flex-direction: column; align-items: center; text-decoration: none; width: 90px; cursor: pointer; transition: transform 0.2s; }
.comm-btn:hover { transform: translateY(-5px); }
.comm-icon { width: 70px; height: 70px; border-radius: 50%; background: #fff; border: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #475569; margin-bottom: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: all 0.2s; }
.comm-btn:hover .comm-icon { border-color: #6366f1; color: #6366f1; box-shadow: 0 10px 15px rgba(99,102,241,0.2); }
.comm-btn.blog .comm-icon { background: #6366f1; color: white; border: none; }
.comm-btn span { font-size: 13px; font-weight: 700; color: #333; text-align: center; line-height: 1.3; }
@media (max-width: 768px) {
    .comm-grid { gap: 10px; display: grid; grid-template-columns: repeat(3, 1fr); }
    .comm-btn { width: 100%; margin-bottom: 10px; }
    .comm-icon { width: 60px; height: 60px; font-size: 24px; }
}
/* 세련된 커뮤니티 버튼 스타일 (Glassmorphism + Gradient) */
.community-nav-wrapper { max-width: 1200px; margin: 30px auto 50px; padding: 0 20px; }
.comm-grid { display: flex; justify-content: center; gap: 25px; flex-wrap: wrap; }

.comm-btn {
    display: flex; flex-direction: column; align-items: center; text-decoration: none;
    width: 100px; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

/* 아이콘 박스: 그라데이션 테두리와 그림자 효과 */
.comm-icon {
    width: 75px; height: 75px; border-radius: 24px;
    background: #ffffff;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: #64748b; margin-bottom: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05), 0 6px 6px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    transition: all 0.3s ease;
}

/* 호버 시 둥둥 뜨는 효과와 색상 변경 */
.comm-btn:hover { transform: translateY(-8px); }

.comm-btn:hover .comm-icon {
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.25);
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6); /* 보라색 그라데이션 */
    border-color: transparent;
}

/* 블로그 버튼은 처음부터 강조 */
.comm-btn.blog .comm-icon {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}
.comm-btn.blog:hover .comm-icon {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.comm-btn span {
    font-size: 14px; font-weight: 700; color: #475569;
    text-align: center; line-height: 1.4; transition: color 0.2s;
}
.comm-btn:hover span { color: #6366f1; }

/* 모바일 대응 */
@media (max-width: 768px) {
    .comm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
    .comm-btn { width: 100%; }
    .comm-icon { width: 65px; height: 65px; font-size: 26px; border-radius: 20px; }
}

/* =========================================
   [모바일 탑바 버튼 순서 수정]
   ========================================= */
@media (max-width: 768px) {
    /* 1. 브랜드 로고 숨김 (공간 확보) */
    .brand { display: none !important; }

    /* 2. 버튼 순서 강제 지정 — HOME > 로그인 > 구매 > 국기 > 주문조회 > 마이페이지 */
    #btnHomeTop       { order: 1 !important; }
    #btnLoginBtn      { order: 2 !important; }
    #btnOrderTop      { order: 3 !important; }
    #siteNavBar       { order: 4 !important; }
    #btnOrderTracking { order: 5 !important; }
    #btnMyLibrary     { order: 6 !important; }

    .template-tabs { display: none !important; }
    .btn-save-top { order: 7 !important; }

    /* 3. 좁은 화면을 위한 스타일 최적화 */
    .topbar {
        justify-content: space-between !important; /* 간격 균등 배치 */
        padding: 0 5px !important;
    }
    
    .topbar .btn {
        margin: 0 2px !important;      /* 버튼 간격 좁힘 */
        padding: 0 8px !important;     /* 내부 여백 줄임 */
        font-size: 12px !important;    /* 글자 크기 줄임 */
        height: 36px !important;       /* 높이 통일 */
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    /* (선택사항) 공간이 너무 좁으면 글자 숨기고 아이콘만 보이게 처리 */
    /* 필요시 아래 주석을 해제하세요 */
    /*
    .topbar .btn span { display: none !important; }
    .topbar .btn i { margin: 0 !important; font-size: 14px; }
    */
}
/* 떠있는(Floating) 텍스트 마법사 툴바 */
.wizard-toolbar.floating-bar {
    position: absolute;       /* 캔버스 위에 둥둥 뜨게 설정 */
    top: 20px;                /* 상단 여백 */
    left: 50%;                /* 가로 중앙 */
    transform: translateX(-50%); /* 정중앙 맞춤 */
    z-index: 100;             /* 캔버스보다 위에 */
    
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95); /* 살짝 투명한 흰색 */
    border: 1px solid #e2e8f0;
    border-radius: 50px;      /* 둥근 알약 모양 */
    padding: 8px 25px;        /* 패딩을 줄여서 작게 만듦 */
    height: 65px;             /* 전체 높이 축소 */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15); /* 그림자 예쁘게 */
    width: auto;              /* 내용만큼만 크기 잡기 */
    max-width: 90%;
}

/* 브랜드 아이콘 (타이틀 글씨 제거하고 아이콘만 심플하게) */
.wiz-brand {
    padding-right: 15px;
    margin-right: 15px;
    border-right: 2px solid #f1f5f9;
}
.wiz-brand .wiz-icon { font-size: 28px; animation: bounce 2s infinite; }
.wiz-brand .wiz-title { display: none; } /* 타이틀 글씨 숨김 (심플하게) */

/* 스크롤 영역 */
.wiz-scroll-track {
    display: flex;
    gap: 10px;       /* 간격 좁힘 */
    overflow-x: auto;
    align-items: center;
}
.wiz-scroll-track::-webkit-scrollbar { display: none; } /* 스크롤바 숨김 */

/* 버튼 스타일 (작게 수정) */
.wiz-btn {
    background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-width: 50px; /* 너비 줄임 */
    transition: all 0.2s;
    position: relative;
}
.wiz-btn:hover { transform: translateY(-3px); }

.wiz-btn .icon-box {
    width: 34px; height: 34px; /* 아이콘 박스 크기 축소 */
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; /* 아이콘 크기 축소 */
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 텍스트 크기 축소 */
.wiz-btn span { font-size: 10px; font-weight: 600; color: #64748b; letter-spacing: -0.5px; margin-top: 2px; }

/* 구분선 */
.wiz-divider { width: 1px; height: 30px; background: #e2e8f0; margin: 0 5px; }

/* 색상 및 효과는 기존 유지 */
.c-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.c-red { background: linear-gradient(135deg, #f87171, #ef4444); }
.c-green { background: linear-gradient(135deg, #34d399, #10b981); }
.c-orange { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.c-blue { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.c-purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.c-pink { background: linear-gradient(135deg, #f472b6, #ec4899); }
.c-teal { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }

/* New 뱃지 위치 조정 */
.new-badge::after {
    content: 'N';
    position: absolute;
    top: -3px; right: 0px;
    background: #ef4444; color: white;
    font-size: 8px; font-weight: bold;
    padding: 1px 4px; border-radius: 8px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}
/* 배경풀기 플로팅 원형 버튼 */
#btnBgLockFloat:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    border-color: #6366f1;
}

/* [슬림형] 떠있는 마법사 툴바 */
.wizard-toolbar.floating-island {
    position: absolute;
    top: 15px;                /* 상단 여백 축소 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    
    display: flex;
    align-items: center;
    
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border: 1px solid #e2e8f0;
    border-radius: 40px;      /* 더 둥글게 */
    padding: 5px 20px;        /* 패딩을 대폭 줄여 슬림하게 */
    height: 56px;             /* 높이를 56px로 고정 (매우 슬림) */
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.1);
    width: auto;
    max-width: 95%;
    overflow: hidden;
}

/* 브랜드 아이콘 (작게) */
.wizard-toolbar.floating-island .wiz-brand {
    border-right: 1px solid #eee;
    margin-right: 10px;
    padding-right: 10px;
    display: flex;
    align-items: center;
}
.wizard-toolbar.floating-island .wiz-brand .wiz-icon {
    font-size: 20px; /* 아이콘 크기 축소 */
    animation: bounce 2s infinite;
}
.wizard-toolbar.floating-island .wiz-brand .wiz-title {
    display: none;
}

/* 스크롤 영역 */
.wiz-scroll-track {
    display: flex;
    gap: 8px; /* 버튼 간격 축소 */
    align-items: center;
}

/* 버튼 스타일 (슬림화) */
.wiz-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px; /* 아이콘과 글씨 사이 간격 최소화 */
    min-width: 45px;
    transition: all 0.2s;
    padding: 0;
}
.wiz-btn:hover {
    transform: translateY(-2px);
}

/* 아이콘 박스 (작게) */
.wiz-btn .icon-box {
    width: 28px;  /* 42px -> 28px 로 축소 */
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px; /* 내부 아이콘 크기 축소 */
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 텍스트 (작게) */
.wiz-btn span {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: -0.5px;
}

/* 구분선 */
.wiz-divider {
    width: 1px;
    height: 20px; /* 구분선 높이 축소 */
    background: #e2e8f0;
    margin: 0 5px;
}

/* 색상 테마 (유지) */
.c-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.c-red { background: linear-gradient(135deg, #f87171, #ef4444); }
.c-green { background: linear-gradient(135deg, #34d399, #10b981); }
.c-orange { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.c-blue { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.c-purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.c-pink { background: linear-gradient(135deg, #f472b6, #ec4899); }
.c-teal { background: linear-gradient(135deg, #2dd4bf, #14b8a6); }

/* 바운스 애니메이션 */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
/* ========================================================= */
/* [1] 모바일 (기본값): 원래대로 깔끔하게 복구 */
/* ========================================================= */

/* 가로 스크롤 방지 (필수) */
body {
    overflow-x: hidden; 
}

.quick-menu-wrapper {
    /* 모바일에서도 보라 그라데이션 유지 */
    background: linear-gradient(160deg, #5b21b6 0%, #7c3aed 50%, #a78bfa 100%) !important;

    /* 여백 및 크기 초기화 */
    padding: 15px 0 20px;
    margin: 0;
    width: 100%; /* 부모 너비에 딱 맞춤 */

    /* 위치 강제 초기화 (PC 설정 무시) */
    position: static;
    left: auto;
    transform: none;
    margin-left: 0 !important;
    margin-right: 0 !important;

    box-shadow: none;
    border-radius: 0;
}

/* 모바일에서는 캐릭터 숨김, 타이틀은 표시 */
.bouncing-char {
    display: none !important;
}
.quick-title-box {
    display: block !important;
    text-align: center;
    margin-bottom: 15px;
    padding: 0 15px;
}
.qt-badge {
    font-size: 11px !important;
    padding: 4px 10px !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255,255,255,0.85) !important;
}
.qt-text {
    font-size: 20px !important;
    color: #fff !important;
}
/* 모바일 시작 버튼 풀와이드 */
#btnDesignStart {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 20px !important;
    box-sizing: border-box !important;
}
/* 모바일 상품 아이콘 보라배경 안 */
.quick-menu-wrapper .quick-item {
    background: transparent !important;
    border-color: transparent !important;
    border-radius: 16px !important;
}
.quick-menu-wrapper .quick-item:hover {
    background: rgba(255,255,255,0.1) !important;
}
.quick-menu-wrapper .quick-text {
    color: #fff !important;
}
.quick-menu-wrapper .quick-icon {
    background: rgba(255,255,255,0.15) !important;
    border: none !important;
}

/* 모바일 내부 여백 미세 조정 */
.quick-menu-wrapper > div {
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
}


/* ========================================================= */
/* [2] PC 화면 (1000px 이상): 디자인 전면 수정 (파란색 라운드 스타일) */
/* ========================================================= */
@media screen and (min-width: 1000px) {

    .quick-menu-wrapper {
        /* 1. 배경 디자인: 세련된 보라 그라데이션 */
        background: linear-gradient(160deg, #4c1d95 0%, #6d28d9 35%, #7c3aed 60%, #a78bfa 100%) !important;
        
        /* 2. 크기 및 위치: 화면 꽉 참 방지 & 중앙 정렬 */
        width: 100% !important;
        max-width: 1200px !important; /* 최대 너비 제한 */
        margin: 40px auto !important; /* 위아래 여백 & 중앙 정렬 */
        padding: 50px 40px !important;
        
        /* 3. 테두리 및 그림자: 둥글고 세련되게 */
        border-radius: 30px !important; /* 둥근 모서리 */
        box-shadow: 0 20px 50px rgba(89, 103, 138, 0.2), 
                    0 0 0 1px rgba(139, 112, 112, 0.1) !important; /* 은은한 테두리 */
        
        /* 위치 초기화 */
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        overflow: visible !important; /* 캐릭터가 튀어나올 수 있게 */
    }

    /* 배경 장식 (은은한 빛 효과) */
    .quick-menu-wrapper::before {
        content: '';
        position: absolute;
        top: -100px; right: -100px;
        width: 400px; height: 400px;
        background: radial-gradient(circle, rgba(196, 181, 253, 0.2) 0%, transparent 70%);
        border-radius: 50%;
        pointer-events: none;
    }

    /* 타이틀 박스 */
    .quick-title-box {
        display: block !important;
        text-align: center;
        margin-bottom: 40px;
        position: relative;
        z-index: 2;
    }
    
    /* 뱃지 스타일 */
    .qt-badge {
        background-color: rgba(255,255,255,0.15) !important;
        color: #fff !important;
        padding: 6px 15px;
        border-radius: 50px;
        font-size: 13px;
        font-weight: 600;
        display: inline-block;
        margin-bottom: 15px;
        backdrop-filter: blur(4px);
        border: 1px solid rgba(255,255,255,0.15);
    }

    /* 텍스트 색상 변경 (검정 -> 흰색) */
    .qt-text {
        font-size: 36px;
        font-weight: 700;
        margin: 0;
        color: #ffffff !important; /* 흰색 텍스트 */
        letter-spacing: -1px;
        text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }

    /* 내부 아이템들 배치 */
    .quick-menu-wrapper > div {
        padding: 0;
        position: relative;
        z-index: 2;
    }

    /* 캐릭터 이미지 위치 조정 (박스 위로 얹기) */
    .bouncing-char {
        display: block !important;
        position: absolute;
        z-index: 10;
        width: 280px; /* 크기 적당히 조절 */
        
        /* 박스 오른쪽 상단에 걸치게 배치 */
        right: -30px; 
        top: -90px; 
        
        animation: bounceUpDn 3s ease-in-out infinite;
        pointer-events: none;
        filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
    }
}

/* 바운스 애니메이션 */
@keyframes bounceUpDn {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}
/* --- 디자인 판매 모달 스타일 시작 --- */

/* 배경 (어두운 영역) */
#sellModal.modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002; /* 기존 코드 유지 */
}

/* 모달 박스 본체 */
#sellModal .modal-box {
    background: #fff;
    width: 90%;          /* 모바일 대응 */
    max-width: 400px;    /* PC 최대 너비 */
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    font-family: inherit;
    box-sizing: border-box;
}

/* 제목 */
#sellModal .modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin-bottom: 20px;
    margin-top: 0;
}

/* 혜택 안내 박스 (회색/파란색 박스 영역) */
#sellModal .benefit-box {
    background: #f0f7ff;
    border-radius: 12px;
    padding: 15px;
    text-align: left;
    margin-bottom: 25px;
}

#sellModal .benefit-item {
    font-size: 13px;
    color: #444;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}

#sellModal .benefit-item:last-child {
    margin-bottom: 0;
}

#sellModal .benefit-icon {
    margin-right: 8px;
    font-size: 14px;
}

#sellModal .highlight {
    color: #007bff; /* 포인트 컬러 (파랑) */
    font-weight: 700;
}

/* 입력창 영역 */
#sellModal .input-group {
    text-align: left;
    margin-bottom: 20px;
}

#sellModal .input-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

#sellModal .ai-input-pretty {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: 0.2s;
}

#sellModal .ai-input-pretty:focus {
    border-color: #007bff;
    outline: none;
}

/* 버튼 영역 */
#sellModal .btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#sellModal .btn-round {
    flex: 1;
    padding: 12px 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;       /* 기존 플렉스 스타일 유지 */
    justify-content: center;
    align-items: center;
}

#sellModal .btn-round.primary {
    background: #007bff;
    color: white;
}

#sellModal .btn-round.primary:hover {
    background: #0056b3;
}

#sellModal .btn-round.cancel {
    background: #f1f3f5;
    color: #333;
}

#sellModal .btn-round.cancel:hover {
    background: #e9ecef;
}
/* 파트너스 콘솔 스타일 */
.partner-order-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.partner-order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #6366f1;
}
.poc-header {
    display: flex; justify-content: space-between; align-items: start;
    margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #f1f5f9;
}
.poc-badge {
    background: #ef4444; color: white; font-size: 11px; font-weight: bold;
    padding: 3px 8px; border-radius: 4px; animation: pulse 2s infinite;
}
.poc-address {
    font-size: 15px; font-weight: 800; color: #1e293b; margin-bottom: 5px;
}
.poc-items {
    font-size: 13px; color: #64748b; margin-bottom: 15px;
    background: #f8fafc; padding: 10px; border-radius: 6px;
}
.poc-price {
    font-size: 18px; font-weight: 900; color: #0f172a; text-align: right;
    margin-bottom: 15px;
}
.btn-dibs {
    width: 100%; padding: 12px; background: #6366f1; color: white;
    font-weight: 800; border-radius: 8px; border: none; cursor: pointer;
    font-size: 14px; transition: background 0.2s;
}
.btn-dibs:hover { background: #4f46e5; }

/* 탭 활성화 스타일 */
.nav-item.active { background: #eff6ff !important; color: #6366f1 !important; }
.nav-item:not(.active):hover { background: #f8fafc !important; }
/* =========================================
   [모바일 탑바 버튼 순서 수정] (맨 아래에 추가)
   ========================================= */
@media (max-width: 768px) {
    /* 1. 브랜드 로고 숨김 */
    .brand { display: none !important; }

    /* 2. 템플릿 버튼 숨김 + 버튼 순서 재배치 */
    .template-tabs { display: none !important; } /* 템플릿 버튼 숨김 (사이드바에 있음) */

    #btnHomeTop    { order: 0 !important; } /* 홈 (맨 앞) */
    #btnOrderTop   { order: 1 !important; } /* 구매하기 */
    #btnLoginBtn   { order: 3 !important; } /* 로그인/로그아웃 */
    #btnMyLibrary  { order: 4 !important; } /* MY Page (보관함) */

    /* 나머지 버튼들 */
    #btnViewCart   { order: 6 !important; }
    .btn-save-top  { order: 7 !important; }

    /* 3. 좁은 화면을 위한 스타일 최적화 */
    .topbar {
        justify-content: space-between !important;
        padding: 0 5px !important;
    }
    
    .topbar .btn {
        margin: 0 2px !important;
        padding: 0 8px !important;
        font-size: 12px !important;
        height: 36px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}
/* =========================================
   [신규] 기여자 시스템 (Contributor) 스타일
   ========================================= */
.contributor-section {
    max-width: 1000px;
    margin: 0 auto 40px auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

/* 상단 그라데이션 바 */
.contributor-section::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
}

.contributor-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px; border-bottom: 1px solid #d5eaff; padding-bottom: 15px;
}

.contributor-title {
    font-size: 20px; font-weight: 800; color: #1e293b;
    display: flex; align-items: center; gap: 10px;
}

.contributor-badge {
    font-size: 11px; padding: 4px 8px; border-radius: 20px;
    background: #f1f5f9; color: #64748b; font-weight: bold; border: 1px solid #e2e8f0;
}
/* 등급별 뱃지 컬러 */
.badge-hero { background: linear-gradient(135deg, #ef4444, #f97316); color: white; border: none; box-shadow: 0 2px 5px rgba(239,68,68,0.3); }
.badge-excellent { background: linear-gradient(135deg, #3b82f6, #6366f1); color: white; border: none; box-shadow: 0 2px 5px rgba(59,130,246,0.3); }

.contributor-balance-box { text-align: right; }
.live-money { font-size: 24px; font-weight: 900; color: #16a34a; letter-spacing: -0.5px; }

.contributor-desc {
    font-size: 14px; color: #666; margin-bottom: 20px; background: #f8fafc;
    padding: 10px 15px; border-radius: 8px; line-height: 1.5;
}

.contributor-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px;
}

.contrib-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 20px 10px; cursor: pointer; transition: all 0.2s; position: relative;
}
.contrib-btn:hover {
    transform: translateY(-5px); border-color: #6366f1;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.1);
}

.c-icon-box {
    width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white; margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.bg-blue { background: #3b82f6; }
.bg-purple { background: #8b5cf6; }
.bg-orange { background: #f59e0b; }
.bg-green { background: #10b981; }

.c-info { text-align: center; }
.c-name { display: block; font-size: 14px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.c-reward { display: block; font-size: 13px; font-weight: 800; color: #6366f1; }
.tier-bonus { font-size: 10px; color: #ef4444; margin-left: 2px; }

/* 모바일 대응 */
@media (max-width: 768px) {
    .contributor-grid { grid-template-columns: repeat(2, 1fr); }
    .contributor-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .contributor-balance-box { width: 100%; text-align: right; background: #f0fdf4; padding: 10px; border-radius: 8px; }
}
/* [공통] 카테고리 텍스트 기본 스타일 */
.quick-text {
    margin-top: 6px;
    font-size: 13px;           /* 한국어 기본 크기 */
    font-weight: 600;
    color: #334155;
    line-height: 1.35;         /* 줄 간격 */
    
    /* 2줄 넘어가면 ... 처리 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    
    height: 36px;              /* 높이 고정 (글자 짤림 방지) */
    padding: 0 2px;
    word-break: keep-all;      /* 단어 단위 줄바꿈 (한국어용) */
}

.long-text-mode .quick-text {
    font-size: 13px !important;  /* 한국어와 동일하게 13px로 복구 */
    line-height: 1.35 !important;
    letter-spacing: -0.3px;
    word-break: keep-all;        /* 일본어 가독성을 위해 단어 단위 유지 */
    white-space: normal;
    height: 36px !important;     /* 높이도 한국어와 동일하게 확보 */
}

/* 모바일 화면에서는 더 작게 */
@media (max-width: 768px) {
    .quick-text { font-size: 12px; height: 32px; }
    .long-text-mode .quick-text { font-size: 11px !important; height: 28px !important; }
}
/* 상단 퀵메뉴 아이템 스타일 (크기 고정) */
.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 12px;
    cursor: pointer;
    
    /* ★ 핵심 수정: 너비를 강제로 고정시킵니다 ★ */
    width: 100px !important;      /* 고정 너비 */
    min-width: 100px !important;  /* 줄어들지 않도록 최소폭 지정 */
    flex-shrink: 0;               /* 공간이 좁아도 절대 찌그러지지 않음 */
    
    text-align: center;
    vertical-align: top;
}

/* 이미지 박스 스타일도 꽉 차게 */
.quick-icon {
    width: 100%;       /* 부모(100px)에 꽉 차게 */
    height: 100px;     /* 높이도 고정 (정사각형) */
    border-radius: 18px;
    background: #fff;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    transition: transform 0.2s;
}
/* =========================================
   [수정완료] 상단 카테고리 (대분류) - 7열 최적화 (글자 넘침 방지)
   ========================================= */
.category-tabs {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important; 
    gap: 4px !important;       /* 간격을 8px에서 4px로 줄여 여백 확보 */
    width: 100%;
    max-width: 1100px;         /* 가로폭을 살짝 넓힘 */
    margin: 0 auto 20px auto;  
    padding: 0 !important;
    overflow: visible !important; 
}

.cat-tab {
    width: 100%;
    min-height: 42px;          /* 높이를 고정하여 2줄이 되어도 버튼 크기 유지 */
    padding: 6px 2px !important; /* 내부 여백 최소화 */
    border-radius: 50px;
    
    /* 폰트 크기 및 줄간격 최적화 */
    font-size: 13px !important;  /* 16px -> 13px로 축소 (7열 필수 사항) */
    line-height: 1.2 !important; /* 줄 간격 좁힘 */
    font-weight: 800;          
    
    color: #4b5563;
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    
    /* 텍스트 정렬 및 줄바꿈 허용 */
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: keep-all;        /* 단어 단위 줄바꿈 */
    white-space: normal !important; /* 한 줄 고정 해제하여 두 줄 허용 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.cat-tab.active {
    background: #111827;      
    color: #fff;
    border-color: #111827;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* 모바일 화면에서는 7열 그리드 대신 가로 스크롤로 가독성 확보 */
@media (max-width: 768px) {
    .category-tabs {
        display: flex !important; 
        overflow-x: auto !important;
        justify-content: flex-start;
        padding-bottom: 5px !important;
    }
    .cat-tab {
        width: auto !important;
        min-width: 80px;
        flex-shrink: 0;
        padding: 8px 15px !important;
    }
}

.cat-tab:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    border-color: #cbd5e1;
    color: #1e293b;
}

.cat-tab.active {
    background: #111827;      /* 활성 상태: 진한 검정 (브랜드 컬러) */
    color: #fff;
    border-color: #111827;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* =========================================
   [수정] 하단 카테고리 (소분류) - 간격 축소
   ========================================= */
.quick-menu-track {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px !important;       /* ★ 핵심: 좌우 간격을 8px로 좁힘 */
    width: 100%;
    margin-top: 20px;
}

.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 95px !important;    /* ★ 핵심: 아이콘 박스 너비를 95px로 줄여 밀착 */
    min-width: 95px !important;
    margin: 0 !important;      /* 외부 여백 제거 */
    cursor: pointer;
    transition: transform 0.2s;
    background: transparent;   /* 배경 투명 */
}

.quick-item:hover {
    transform: translateY(-5px);
}

/* 하단 아이콘 박스 */
.quick-icon {
    width: 110% !important;    /* 부모(95px)에 꽉 차게 */
    height: 120px !important;   /* 정사각형 비율 유지 */
    border-radius: 10px;
    background: #fff;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    margin-bottom: 8px;
}

.quick-item:hover .quick-icon {
    border-color: #6366f1;     /* 호버 시 보라색 테두리 */
    box-shadow: 0 8px 15px rgba(99, 102, 241, 0.15);
}

/* 하단 텍스트 */
.quick-text {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    line-height: 1.3;
    letter-spacing: -0.3px;
    word-break: keep-all;
    width: 100%;
    margin-top: 0;
}

/* =========================================
   [모바일 대응] 모바일에서는 스크롤 유지 or 4열 변경
   ========================================= */
@media (max-width: 768px) {
    /* 모바일 상단: 스크롤 방식이 더 편하므로 그리드 해제하거나, 
       요청하신 대로 그리드를 원하시면 아래 repeat 숫자를 4로 변경하세요 */
    .category-tabs {
        display: flex !important; /* 모바일은 스크롤 유지 권장 */
        overflow-x: auto !important;
        justify-content: flex-start;
        padding-bottom: 10px !important;
        gap: 6px !important;
    }
    
    .cat-tab {
        width: auto;
        min-width: 70px;
        padding: 8px 16px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* 모바일 하단: 3열로 꽉 차게 */
    .quick-menu-track {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    
    .quick-item {
        width: 100% !important; /* 그리드에 맞춤 */
        min-width: 0 !important;
    }
    
    .quick-icon {
        height: auto !important;
        aspect-ratio: 1/1;
    }
}
/* ========================================================= */
/* [PC 전용 설정] 1줄 5개 배치 & 썸네일 대형화 (요청사항 적용) */
/* ========================================================= */
@media screen and (min-width: 1000px) {

    /* 1. 컨테이너: 플렉스 대신 그리드 사용 (1줄 5개 강제) */
    .quick-menu-track {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important; /* ★ 핵심: 5칸으로 분할 */
        gap: 30px 20px !important; /* 세로간격 30px, 가로간격 20px */
        width: 100% !important;
        max-width: 1200px !important;
        margin: 30px auto !important;
        justify-content: center !important;
    }

    /* 2. 개별 아이템 박스: 그리드 칸에 꽉 차게 */
    .quick-item {
        width: 100% !important;       /* 고정 픽셀(95px) 제거하고 꽉 채움 */
        min-width: 0 !important;      /* 최소 너비 제한 해제 */
        margin: 0 !important;
        background: transparent !important; /* 배경 투명 */
    }

    /* 3. 썸네일 이미지 박스: 정사각 비율 & 크기 확대 */
    .quick-icon, 
    .quick-icon-img-box {
        width: 100% !important;       /* 부모 너비에 꽉 차게 (약 200px 정도로 커짐) */
        height: auto !important;      /* 높이 자동 */
        aspect-ratio: 1 / 1 !important; /* ★ 핵심: 무조건 1:1 정사각형 */
        border-radius: 20px !important; /* 모서리 둥글게 */
        margin-bottom: 12px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important; /* 그림자 조금 더 진하게 */
        border: 1px solid #e2e8f0 !important;
    }

    /* 4. 이미지 내부 스타일: 찌그러짐 방지 */
    .quick-icon img, 
    .quick-icon-img-box img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; /* 꽉 채우되 비율 유지 (넘치면 잘림) */
    }

    /* 5. 텍스트 스타일: 이미지가 커진 만큼 글씨도 조정 */
    /* 상품명 텍스트 색상 및 레이아웃 강제 수정 */
    .quick-item .quick-text {
        font-size: 14px !important;
        font-weight: 700 !important;
        margin-top: 8px !important;
        color: #1e293b !important;
        display: block !important;
        text-align: center !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        height: auto !important;
    }

    .long-text-mode .quick-text {
        color: #1e293b !important;
        font-size: 13px !important;
    }
    
    /* 호버 효과 강화 */
    .quick-item:hover {
        transform: translateY(-8px) !important;
    }
    .quick-item:hover .quick-icon,
    .quick-item:hover .quick-icon-img-box {
        border-color: #6366f1 !important;
        box-shadow: 0 10px 25px rgba(99, 102, 241, 0.25) !important;
    }
}
/* [신규] 감성적인 설명 박스 디자인 */
.info-desc-box {
    background: #f0f9ff; /* 아주 연한 하늘색 배경 */
    border-left: 4px solid #6366f1; /* 왼쪽 포인트 컬러 */
    padding: 15px 20px;
    border-radius: 8px; /* 오른쪽만 둥글게 */
    margin: 10px auto 25px auto;
    font-size: 15px;
    color: #334155;
    line-height: 1.6;
    text-align: left; /* 왼쪽 정렬이 가독성 좋음 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    word-break: keep-all; /* 단어 단위 줄바꿈 */
    display: none; /* 내용 없으면 숨김 */
    width: 100%;
    max-width: 900px;
}

/* 제품 선택 모달 내부 설명 박스 특화 */
.info-desc-box.product-desc {
    background: #fff7ed; /* 제품은 연한 주황색 배경 */
    border-left-color: #f97316;
    font-size: 14px;
    margin-bottom: 15px;
}

/* 설명 박스 내부 아이콘 효과 (가상 요소) */
.info-desc-box::before {
    content: '💡 Info';
    display: block;
    font-weight: 800;
    font-size: 12px;
    color: inherit;
    opacity: 0.7;
    margin-bottom: 4px;
    text-transform: uppercase;
}

/* 메인 화면 대분류 설명창 (ID로 덮어쓰기) */
#categoryDescriptionBox {
    /* 인라인 스타일 무시하고 이 클래스 적용을 위해 !important 사용 가능하거나 인라인 스타일 제거 권장 */
    max-width: 1000px;
    margin: 10px auto 30px auto !important; 
    padding: 20px !important;
    background: #f8fafc !important;
    border-radius: 12px !important;
    text-align: center !important;
    font-size: 15px !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .info-desc-box {
        font-size: 13px;
        padding: 12px 15px;
        margin: 10px 0 20px 0;
    }
    #categoryDescriptionBox {
        font-size: 13px !important;
        padding: 15px !important;
        margin-bottom: 20px !important;
        text-align: left !important; /* 모바일은 왼쪽 정렬이 나음 */
    }
}
/* --- [최종 수정 v2] 별점 아이콘 디자인 (비율 깨짐 방지 포함) --- */

        /* 1. 반짝이는 애니메이션 정의 */
        @keyframes twinkle {
            0%, 100% { 
                opacity: 1; 
                transform: scale(1); 
                filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.6)); 
            }
            50% { 
                opacity: 0.85; 
                transform: scale(0.92); 
                filter: drop-shadow(0 0 5px rgba(245, 158, 11, 1)) brightness(1.2); 
            }
        }

        /* 2. 별 아이콘 기본 스타일 */
        .star-icon {
            /* [중요] flex 컨테이너 안에서 찌그러짐 방지 */
            flex-shrink: 0; 
            width: 14px; /* 크기 강제 지정 */
            height: 14px;
            font-size: 14px;
            line-height: 14px;
            
            background: linear-gradient(to bottom right, #fcd34d, #f59e0b, #d97706);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            display: inline-block;
            vertical-align: middle; /* 수직 정렬 보정 */
            
            /* 애니메이션 실행 */
            animation: twinkle 2s ease-in-out infinite;
        }

        /* 3. 별점 버튼('별+점수') 스타일 */
        .quick-review-bar .review-pill:first-child {
            border-color: #fbbf24; 
            background: #fffbeb; 
            /* 금테두리 효과 */
            box-shadow: inset 0 0 0 1px #fff, 0 0 4px rgba(245, 158, 11, 0.5);
            font-weight: 800;
            
            /* 내부 정렬 보정 */
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 3px;
        }

        /* 4. 점수 텍스트 보정 */
        .star-score {
            font-size: 12px;
            color: #b45309; /* 글자색도 약간 진한 금색으로 */
            line-height: 1;
            margin-top: 1px; /* 미세 위치 조정 */
        }

        /* 5. 마우스 호버 효과 */
        .review-pill:hover .star-icon {
            animation: none;
            transform: scale(1.2) rotate(5deg);
            filter: drop-shadow(0 0 7px rgba(245, 158, 11, 1)) brightness(1.3);
        }
        /* [추가] 소분류 카드 내 후기/별점 버튼 스타일 */
        .quick-review-bar { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; }
        .review-pill { display: inline-flex; align-items: center; gap: 4px; background: #f8fafc; border: 1px solid #e2e8f0; padding: 4px 10px; border-radius: 20px; color: #64748b; cursor: pointer; transition: all 0.2s; font-weight: 600; }
        .review-pill:hover { background: #eff6ff; border-color: #6366f1; color: #6366f1; transform: translateY(-2px); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
        .star-score { color: #334155; font-weight: 800; margin-left: 2px; }
        .star-icon { color: #f59e0b; }
        /* =========================================
   [캔바 스타일] 아이콘바 + 서브패널 레이아웃
   ========================================= */
.editor-wrap {
    display: flex !important;
    flex-direction: row !important;
    height: 100% !important;
    width: 100vw !important;
    overflow: hidden !important;
}

/* 기존 .side 숨김 (새 아이콘바로 대체) */
.side { display: none !important; }

/* 좌측 아이콘 바 */
#iconBar {
    width: 72px;
    flex-shrink: 0;
    background: #1e1e2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
    gap: 2px;
    z-index: 25;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid #2d2d44;
}
.icon-item {
    width: 64px;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    color: #94a3b8;
    position: relative;
}
.icon-item i { font-size: 20px; }
.icon-item span { font-size: 10px; font-weight: 600; letter-spacing: -0.3px; white-space: nowrap; }
.icon-item:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.icon-item.active {
    background: rgba(99,102,241,0.15);
    color: #818cf8;
}
.icon-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    background: #6366f1;
    border-radius: 0 3px 3px 0;
}

/* 서브 패널 */
#subPanel {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 20;
    height: 100%;
    animation: subPanelSlide 0.2s ease-out;
}
@keyframes subPanelSlide {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}
.sub-content { display: none; padding: 15px 12px; }
/* 아이콘/로고 탭 */
.icon-tab { background:#f8fafc; color:#94a3b8; }
.icon-tab.active { background:#6366f1; color:#fff; }
.icon-tab:hover:not(.active) { background:#e2e8f0; color:#333; }
.sub-content .section-title { margin-top: 15px; margin-bottom: 8px; }
.sub-content .section-title:first-child { margin-top: 0; }
/* 템플릿 패널: 리스트가 패널 내에서 스크롤 */
#sub-template { flex-direction: column; height: 100%; padding: 15px 12px; overflow: hidden; }
#sub-template .drawer-content { flex: 1; overflow-y: auto; min-height: 0; }
#subPanelDragHandle { display: none; } /* PC에서 숨김, 모바일에서만 표시 */
.sub-panel-header {
    font-size: 14px; font-weight: 800; color: #334155;
    padding-bottom: 12px; border-bottom: 1px solid #f1f5f9;
    margin-bottom: 12px;
}

/* 캔버스 영역 */
.stage {
    flex: 1 !important;
    min-width: 0 !important;
    position: relative !important;
}

/* 기존 side-drawer 숨김 (서브패널에 통합) */
.side-drawer { display: none !important; }

/* 패널 닫기 버튼 스타일 */
.btn-close-drawer {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.btn-close-drawer:hover {
    background: #f8fafc; color: #ef4444; border-color: #fee2e2;
}

@keyframes drawerSlideIn {
    from { width: 0; opacity: 0; transform: translateX(-20px); }
    to { width: 260px; opacity: 1; transform: translateX(0); }
}

/* =========================================
   [모바일] 캔바 스타일 하단 아이콘 바 + 바텀시트
   ========================================= */
@media (max-width: 768px) {
    /* 하단 아이콘 바 (캔바 스타일) */
    #iconBar {
        display: flex !important;
        flex-direction: row !important;
        position: fixed !important;
        bottom: 0; left: 0; right: 0;
        width: 100% !important;
        height: auto;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        border-right: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 4px) 4px;
        gap: 0;
        z-index: 10001;
        -webkit-overflow-scrolling: touch;
    }
    #iconBar::-webkit-scrollbar { display: none; }

    .icon-item {
        min-width: 56px;
        width: auto;
        flex-shrink: 0;
        padding: 6px 4px;
        color: #64748b;
    }
    .icon-item i { font-size: 20px; }
    .icon-item span { font-size: 9px; font-weight: 500; }
    .icon-item.active { background: transparent; color: #6366f1; }
    .icon-item.active::before { display: none; }

    /* 서브패널 바텀시트 */
    #subPanel {
        position: fixed !important;
        bottom: 56px !important;
        left: 0 !important; right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 120px);
        z-index: 10000 !important;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
        padding: 0 12px 12px 12px !important;
        overflow-y: auto;
        overflow-x: hidden;
        transition: transform 0.3s ease;
    }
    /* 드래그 핸들 + 닫기 버튼 표시 */
    #subPanelDragHandle { display: block; }
    #subPanelCloseBtn { display: block !important; }
    #subPanel .sub-panel-header { font-size: 13px; padding-bottom: 8px; margin-bottom: 8px; }

    /* 모바일 FAB 숨김 (아이콘바로 대체) */
    .mobile-fab { display: none !important; }
}

/* =========================================
   [필수 추가] 추천 템플릿 내부 디자인 (크기 오류 해결용)
   ========================================= */

/* 패널 헤더 (제목 + 닫기 버튼) */
.drawer-header {
    height: 50px;
    padding: 0 15px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
}

/* 템플릿 목록 스크롤 영역 */
.drawer-content {
    flex: 1;                /* 남은 높이 채우기 */
    overflow-y: auto;       /* 세로 스크롤 허용 */
    overflow-x: hidden;     /* 가로 스크롤 방지 */
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
}

/* =========================================
   [추가 수정] 사이드바 카드 이미지 꽉 차게
   ========================================= */

/* 1. 카드 디자인 (둥근 모서리 적용) */
.side-tpl-card {
    width: 100% !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    flex-shrink: 0 !important;
    overflow: hidden !important; /* 이미지가 카드 밖으로 나가지 않게 잘라냄 */
    position: relative !important; /* 뱃지 위치 기준 */
}

/* 2. 이미지 꽉 차게 설정 (핵심 수정) */
.side-tpl-img {
    width: 100% !important;       /* 너비 100% */
    height: auto !important;      /* 높이 자동 */
    aspect-ratio: 1 / 1;          /* 1:1 정사각형 비율 (필요에 따라 삭제 가능) */
    object-fit: cover !important; /* 영역을 빈틈없이 꽉 채움 */
    padding: 0 !important;        /* 안쪽 여백 제거 */
    display: block !important;    /* 이미지 하단 미세한 공백 제거 */
    background: #f1f5f9 !important; /* 로딩 전 배경색 */
}

/* 3. 하단 정보 영역 스타일 */
.side-tpl-info {
    padding: 12px !important;     /* 내부 여백 */
    font-size: 13px !important;
    color: #334155 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border-top: 1px solid #f1f5f9 !important; /* 이미지와 구분선 */
}
/* 닫기 버튼 아이콘 정렬 */
.btn-close-drawer i {
    pointer-events: none;
}
/* style.css 수정 */

 

/* 로딩 스피너가 자연스럽게 보이도록 */
.fa-spinner {
    font-size: 24px;
    margin-top: 10px;
}
/* style.css - 사이드바 1열 디자인 & 검색창 스타일 */

/* =========================================
   1. 예쁜 검색창 디자인 (수정됨)
   ========================================= */
.drawer-search-box {
    position: relative !important;
    width: 100%;
    margin-bottom: 20px;
}

/* 입력창 스타일 */
#sideTemplateSearch {
    width: 100%;
    padding: 12px 15px 12px 42px !important; /* 왼쪽에 아이콘 공간 확보 */
    border: 2px solid #f1f5f9;
    border-radius: 50px;
    background: #f8fafc;
    font-size: 14px;
    color: #334155;
    outline: none;
    transition: all 0.2s;
    height: 45px; /* 높이 고정 */
}

#sideTemplateSearch:focus {
    background: #fff;
    border-color: #6366f1;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

/* 돋보기 아이콘 위치 강제 고정 */
.drawer-search-box i.fa-magnifying-glass {
    position: absolute !important;
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none; /* 클릭 통과 */
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}
/* =========================================
   2. 템플릿 목록 (1열 수직 배치)
   ========================================= */
#sideTemplateList {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    padding: 15px !important;
    /* [수정] 높이 계산을 명확히 하고 스크롤 강제 */
    height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    min-height: 0; /* 플렉스 박스 스크롤 버그 방지 */
}

/* 개별 카드 스타일 */
.side-tpl-card {
    width: 100% !important;
    
    /* ★ 핵심: 카드 전체 배경을 회색으로 변경 */
    background: #e5e5e5 !important; 
    
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid #d4d4d4; /* 테두리도 약간 진하게 */
    transition: transform 0.3s, box-shadow 0.3s;
}

.side-tpl-card:hover {
    transform: translateY(-5px); /* 마우스 올리면 둥실 */
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
    border-color: #c7d2fe;
}

/* 이미지: 1:1 비율 유지하면서 꽉 차게 */
.side-tpl-img {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important; 
    object-fit: cover;
    background: #f8fafc;
    display: block;
}

/* 정보창 (제목 표시) */
.side-tpl-info {
    padding: 12px 15px !important;
    
    /* ★ 핵심: 텍스트 영역 배경도 회색으로 변경 */
    background: #e5e5e5 !important; 
    
    border-top: 1px solid #d4d4d4;
    text-align: center;
}

.side-tpl-title {
    font-size: 14px !important;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   [추가] 사이드바 템플릿: 랭킹 / 없음 / 페이징
   ========================================= */

/* 1. 랭킹 뱃지 (1~3위) */
.rank-badge {
    position: absolute;
    top: 0; left: 0;
    padding: 6px 10px;
    font-size: 11px; font-weight: 900; color: #fff;
    border-bottom-right-radius: 12px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    letter-spacing: -0.5px;
}
/* 금/은/동 컬러 */
.rank-1 { background: linear-gradient(135deg, #FFD700, #FDB931); border: 1px solid rgba(255,255,255,0.5); }
.rank-2 { background: linear-gradient(135deg, #E0E0E0, #BDBDBD); border: 1px solid rgba(255,255,255,0.5); color: #555; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); border: 1px solid rgba(255,255,255,0.5); }

/* 2. 데이터 없음 (이미지 표시) */
.empty-sidebar-box {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 20px; text-align: center;
    color: #94a3b8; height: 100%;
}
.empty-sidebar-img {
    width: 100px; height: 100px;
    object-fit: contain; margin-bottom: 15px;
    opacity: 0.7;
}

/* 3. 하단 페이징 버튼 */
.sidebar-pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 10px; padding: 20px 0; margin-top: auto;
}
.side-page-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.side-page-btn:hover:not(:disabled) {
    background: #6366f1; color: #fff; border-color: #6366f1;
}
.side-page-btn:disabled {
    background: #f8fafc; color: #cbd5e1; cursor: not-allowed;
}
/* ▼▼▼ [추가] 배경색 및 페이지 컨트롤 스타일 ▼▼▼ */

/* 색상 팔레트 */
.color-swatch {
    width: 100%; aspect-ratio: 1/1; border-radius: 4px;
    border: 1px solid #e2e8f0; cursor: pointer; transition: transform 0.1s;
}
.color-swatch:hover { transform: scale(1.15); border-color: #6366f1; z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.color-swatch.picker {
    background: #fff; display: flex; align-items: center; justify-content: center;
    color: #64748b; font-size: 12px; border: 1px dashed #cbd5e1;
}

/* 페이지 컨트롤러 (하단 플로팅 바) */
.page-controls-bar {
    position: absolute; 
    bottom: 85px; /* bottom-dock 위에 띄움 */
    left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 5px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    padding: 6px 15px; border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0; z-index: 90;
    transition: bottom 0.3s;
}

/* 컨트롤러 내부 버튼 */
.btn-icon-only {
    background: transparent; border: none; cursor: pointer;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #475569; transition: all 0.2s;
}
.btn-icon-only:hover:not(:disabled) { background: #f1f5f9; color: #6366f1; }
.btn-icon-only:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-text-icon {
    background: transparent; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 20px;
    color: #475569; transition: all 0.2s;
}
.btn-text-icon:hover { background: #f1f5f9; color: #6366f1; }
.btn-text-icon.delete:hover { background: #fee2e2; color: #ef4444; }
/* ▲▲▲ [추가 끝] ▲▲▲ */
/* 가이드 팝업 메뉴 스타일 */
.guide-popup {
    position: absolute;
    bottom: 50px; /* 버튼 바로 위 */
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column; /* 세로형 메뉴 */
    gap: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 200;
    min-width: 100px;
}

/* 가로형 메뉴를 원하면 아래 flex-direction을 row로 변경하고 bottom 값을 조정하세요 */
@media (min-width: 768px) {
    .guide-popup {
        flex-direction: row; /* PC에서는 가로로 펼침 */
        white-space: nowrap;
        bottom: 45px; 
    }
}

.guide-opt-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #475569;
    font-weight: 600;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-opt-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.guide-opt-btn.active {
    background: #eff6ff;
    color: #6366f1;
    font-weight: 800;
}
/* i18n 라이브러리가 강제로 주입하는 한글 텍스트 숨기기 */
#tplPageLabel [data-i18n="label_page_suffix"] {
    display: none !important;
}

/* 라벨 레이아웃 정렬 */
#tplPageLabel {
    display: inline-flex !important;
    gap: 6px;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase; /* PAGE 대문자 고정 */
}
video {
    background-color: transparent !important; /* 비디오 배경 투명화 */
    outline: none;
}
.view-content {
            line-height: 1.8;
            font-size: 1.1rem;
            color: #333;
            word-break: break-word; /* 긴 텍스트 줄바꿈 */
        }

        /* [추가] 에디터에서 설정한 정렬이 상세보기에서도 적용되도록 설정 */
        .view-content .ql-align-center {
            text-align: center;
        }
        .view-content .ql-align-right {
            text-align: right;
        }
        .view-content .ql-align-justify {
            text-align: justify;
        }
        /* 노란색 원형 닫기 버튼 스타일 */
        /* X 버튼을 모달 박스 오른쪽 상단 안쪽으로 이동 */
#choiceModal button[onclick*="none"] {
    position: absolute !important; /* fixed에서 absolute로 변경 */
    top: 25px !important;
    right: 335px !important;
    width: 40px !important;
    height: 40px !important;
    background: #ffeb3b !important;
    border-radius: 50% !important;
    z-index: 10001 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff !important;
}

/* 모바일에서도 위치 유지 */
@media (max-width: 768px) {
    #choiceModal button[onclick*="none"] {
        top: 10px !important;
        right: 10px !important;
    }
}
        
/* =========================================
   [개편] 선택 모달 - 좌(상세페이지) / 우(액션) 레이아웃
   ========================================= */
#choiceModal .modal-box {
    width: 1200px !important; 
    max-width: 98% !important;
    height: 90vh !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 24px !important;
}

.choice-layout {
    display: flex;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 좌측 상세페이지 본문 영역 */
.choice-left-content {
    flex: 1;
    background: #fff;
    overflow-y: auto;
    padding: 50px 60px;
    text-align: left;
    border-right: 1px solid #f1f5f9;
}

/* 우측 액션/버튼 영역 */
.choice-right-actions {
    width: 380px;
    background: #f8fafc;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
    overflow-y: auto;
}

/* 상세페이지 내 텍스트/이미지/영상 스타일 (Board 게시판 스타일 계승) */
.choice-left-content h2 { 
    font-size: 32px; font-weight: 900; color: #111; 
    margin-bottom: 30px; line-height: 1.2; 
}
.choice-left-content .product-detail-render {
    line-height: 1.8; font-size: 16px; color: #334155;
    overflow: hidden;          /* 내부 콘텐츠가 밖으로 넘치지 않도록 */
    contain: layout style;     /* CSS 격리: 내부 레이아웃이 외부에 영향 안 줌 */
}
/* 상세페이지 내부 요소가 모달 레이아웃을 깨지 않도록 제한 */
.choice-left-content .product-detail-render > * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}



/* 우측 상품 요약 카드 */
.choice-summary-card {
    background: white; border: 1px solid #e2e8f0; border-radius: 20px;
    padding: 25px; text-align: center; margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.choice-summary-card img { width: 100%; height: 200px; object-fit: contain; margin-bottom: 15px; }
.choice-summary-price { font-size: 24px; font-weight: 900; color: #6366f1; }

/* 모바일 대응 (상하 배치) */
@media (max-width: 768px) {
    .choice-layout { flex-direction: column; }
    .choice-right-actions { width: 100%; order: 1; border-bottom: 1px solid #eee; padding: 20px; }
    .choice-left-content { order: 2; padding: 30px 20px; border-right: none; }
    .choice-left-content h2 { font-size: 24px; }
}
/* =========================================================
   [대분류 탭 최적화] PC는 7열 유지 / 모바일은 가로스크롤 알약
   ========================================================= */

/* [1] 공통 및 PC 전용 (기본값) */
.category-tabs {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important; /* PC: 7열 고정 */
    gap: 8px !important;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 20px auto !important;
    padding: 0 !important;
    overflow: visible !important;
}

.cat-tab {
    width: 100%;
    min-height: 42px;
    padding: 6px 2px !important;
    border-radius: 8px; /* PC는 사각형에 가까운 라운드 */
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 800;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: keep-all;
    white-space: normal !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.cat-tab.active {
    background: #111827 !important;
    color: #fff !important;
    border-color: #111827 !important;
}


/* [2] 모바일 전용 (768px 이하에서만 적용) */
@media screen and (max-width: 768px) {
    .category-tabs {
        display: flex !important; /* 그리드 해제 -> 가로 정렬 */
        grid-template-columns: none !important;
        overflow-x: auto !important; /* 가로 스크롤 활성화 */
        -webkit-overflow-scrolling: touch;
        gap: 10px !important;
        padding: 10px 20px !important; /* 좌우 여백 */
        margin-bottom: 10px !important;
        scrollbar-width: none; /* 스크롤바 숨김 */
    }

    .category-tabs::-webkit-scrollbar {
        display: none;
    }

    .cat-tab {
        flex: 0 0 auto !important; /* 너비 고정 해제 */
        width: auto !important;
        min-width: 90px !important;
        max-width: 120px !important;
        height: 48px !important;
        padding: 5px 15px !important;
        
        /* 모바일만 알약 모양 */
        border-radius: 30px !important; 
        font-size: 13px !important;
        
        /* 모바일만 노란색 테마 */
        color: #422006 !important;
        background: #fef9c3 !important;
        border: 2px solid #fde047 !important;
    }

    .cat-tab.active {
        background: #facc15 !important;
        color: #000 !important;
        border-color: #eab308 !important;
        box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3) !important;
        transform: scale(1.05);
    }
}
/* 상세페이지 미디어 작게 보이는 문제 근본 해결 */
.product-detail-render video, 
.product-detail-render .ql-video, 
.product-detail-render img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important; /* 비율 강제 해제 */
    display: block !important;
    margin: 15px auto !important;
}

/* 에디터 내부 비디오 박스 크기 보정 */
.ql-video {
    min-height: 400px; /* PC 기준 영상 가독성 확보 */
}
@media (max-width: 768px) {
    .ql-video { min-height: 250px; }
}
/* 상세페이지 내부 미디어 지연 로딩 스타일 */
.product-detail-render video {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    background: #000;
}

/* 텍스트 마법사 및 상단바 최적화 (모바일) */
@media (max-width: 768px) {
    /* 화면에 안 보이는 요소는 렌더링 제외 */
    .hero-section { content-visibility: auto; }
}
/* =========================================
   [타겟 수정] 팝업창(소분류) 내부의 파란색 가격만 흰색으로 변경
   ========================================= */

/* 팝업창(catProductGrid) 내부의 마지막 자식 요소(가격)만 선택 */
#catProductGrid .quick-item > div:last-child {
    color: #ffffff !important;   /* 글자색 흰색 */
    text-decoration: none;       /* 혹시 모를 밑줄 제거 */
    user-select: none;           /* 드래그 방지 */
    opacity: 1;                  /* 투명도 유지 */
}

/* 마우스 올렸을 때(hover)도 계속 흰색 유지 */
#catProductGrid .quick-item:hover > div:last-child {
    color: #ffffff !important;
}
/* [옵션 스와치 그리드 스타일] */
    .addon-swatch-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); /* 한 줄에 여러개 (반응형) */
        gap: 10px;
        margin-top: 10px;
    }

    .addon-swatch-item {
        position: relative;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* 실제 체크박스는 숨김 */
    .addon-swatch-item input[type="checkbox"] {
        display: none;
    }

    /* 이미지 스타일 (동그라미) */
    .addon-swatch-img {
        width: 50px;
        height: 50px;
        border-radius: 50%; /* 네모를 원하시면 8px로 변경 */
        object-fit: cover;
        border: 2px solid #e2e8f0;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    /* 선택되었을 때 스타일 (테두리 강조) */
    .addon-swatch-item input:checked + .addon-swatch-img {
        border-color: #6366f1;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
        transform: scale(1.1);
    }

    /* 선택 됨 표시 아이콘 */
    .addon-swatch-check {
        position: absolute;
        top: 0;
        right: 5px;
        background: #6366f1;
        color: white;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        font-size: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transform: scale(0);
        transition: 0.2s;
        z-index: 2;
    }

    .addon-swatch-item input:checked ~ .addon-swatch-check {
        opacity: 1;
        transform: scale(1);
    }

    /* 마우스 오버 시 이름 툴팁 표시 */
    .addon-swatch-item:hover::after {
        content: attr(data-name);
        position: absolute;
        bottom: -25px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(30, 41, 59, 0.9);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 11px;
        white-space: nowrap;
        z-index: 10;
        pointer-events: none;
        font-weight: bold;
    }
    /* =========================================================
   [최종 긴급 수정] 모바일 UI 강제 적용 패치 (v3)
   1) 장바구니 JS 인라인 스타일 무력화 (옵션 하단 배치)
   2) 모달창 스크롤 고정 및 내부 스크롤 활성화
   ========================================================= */

@media (max-width: 768px) {

    /* --- [1. 장바구니 문제 해결] --- */
    
    /* JS가 강제로 넣은 .cart-top-row 클래스의 가로 정렬을 세로로 강제 변경 */
    .cart-top-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        padding: 15px !important;
    }

    /* 내부의 모든 박스(이미지, 정보, 옵션, 가격) 너비를 100%로 강제 확장 */
    .cart-top-row > div {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        flex: none !important; /* flex-grow 무시 */
    }

    /* 1. 썸네일 이미지 중앙 정렬 */
    .cart-top-row > div:first-child {
        margin: 0 auto 10px auto !important; /* 가운데 정렬 */
    }

    /* 2. 상품명/단가 텍스트 */
    .cart-top-row > div:nth-child(2) {
        text-align: left !important;
        margin-bottom: 5px !important;
    }

    /* 3. 옵션 박스 (우측에 찌그러져 있던 것) */
    .cart-top-row > div:nth-child(3) {
        max-height: none !important; /* 높이 제한 해제 */
        overflow: visible !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
    }

    /* 4. 가격 및 삭제 버튼 영역 */
    .cart-top-row > div:last-child {
        display: flex !important;
        flex-direction: row !important; /* 가로 배치 */
        justify-content: space-between !important;
        align-items: center !important;
        margin-top: 10px !important;
        border-top: 1px solid #eee !important;
        padding-top: 15px !important;
    }
    
    /* 삭제 버튼 위치 조정 */
    .cart-top-row > div:last-child > button {
        order: 2; /* 오른쪽으로 보냄 */
    }
    .cart-top-row > div:last-child > div {
        order: 1; /* 가격을 왼쪽으로 */
        text-align: left !important;
    }


    /* --- [2. 모달창 스크롤 문제 해결] --- */

    /* 모달 박스 자체의 스크롤 기능 강화 */
    .modal-box {
        position: relative !important;
        max-height: 80vh !important; /* 화면 높이의 80%까지만 차지 */
        overflow-y: auto !important; /* 내용이 넘치면 내부 스크롤 생성 */
        -webkit-overflow-scrolling: touch !important; /* 아이폰 부드러운 스크롤 */
        overscroll-behavior: contain !important; /* 스크롤이 끝에 닿아도 뒷배경 스크롤 방지 */
        margin-top: 20px !important; /* 상단 여백 확보 */
        margin-bottom: 20px !important;
    }

    /* 모달 배경이 꽉 차게 */
    .modal-bg {
        padding-bottom: 0 !important;
        align-items: center !important; /* 중앙 정렬 */
    }

    /* --- [3. 결제창 하단 고정 해제 (기존 유지)] --- */
    #cartPage > div > div > div:last-child {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 12px !important;
        margin-top: 20px !important;
        background: #fff !important;
        z-index: 1 !important;
    }
    
    /* 리스트 하단 여백 축소 */
    #cartListArea {
        padding-bottom: 20px !important;
    }
}
/* =========================================
   [긴급 패치] 모바일 스크롤 및 터치 문제 해결
   ========================================= */

@media (max-width: 768px) {

    /* 1. 전체 화면 스크롤 허용 (에디터 고정 해제) */
    body {
        overflow: auto !important; /* 스크롤 잠금 해제 */
        overflow-x: hidden !important; /* 가로 스크롤만 막음 */
        height: auto !important; /* 고정 높이 해제 */
        position: relative !important;
    }

    /* 에디터 화면은 캔버스 조작을 위해 예외적으로 고정 (필요 시) */
    body.editor-active {
        overflow: hidden !important;
        height: 100% !important;
    }
    
    /* 시작 화면 스크롤 확보 */
    #startScreen {
        position: absolute !important; 
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 100px !important; /* 하단 여백 충분히 */
    }

    /* 2. [상품 선택 모달] 스크롤 잘림 해결 (핵심) */
    #choiceModal .modal-box {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;

        /* ★ 스크롤 핵심 설정 */
        overflow-y: visible !important;
        display: block !important;
        padding: 0 !important;
    }

    .choice-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* 상단: 옵션 및 버튼 영역 (먼저 표시) */
    .choice-right-actions {
        order: -1 !important;
        width: 100% !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        overflow-y: visible !important;
        padding: 20px !important;
        padding-bottom: 20px !important;
        background: #f8fafc !important;
        border-bottom: 1px solid #e2e8f0;
        border-top: none !important;
    }

    /* 하단: 상세 내용 (아래로 이동) */
    .choice-left-content {
        order: 1 !important;
        height: auto !important;
        overflow: visible !important;
        padding: 20px !important;
    }

    /* 3. [카테고리/상품목록 모달] 스크롤 해결 */
    #categoryDetailModal .modal-box,
    #generalProductModal .modal-box {
        max-height: 85dvh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* 4. 장바구니 페이지 스크롤 */
    #cartPage {
        position: fixed !important;
        overflow-y: auto !important;
        padding-bottom: 100px !important;
    }
    
    #cartListArea {
        max-height: none !important; /* 높이 제한 해제 */
        overflow: visible !important;
    }
}
/* =========================================
   [모바일 UI 수정] 가이드 버튼 텍스트 숨김
   ========================================= */
@media (max-width: 768px) {
    /* 가이드 버튼: 텍스트는 숨기고 아이콘만 표시 */
    #guideToggle {
        font-size: 0 !important;       /* 글씨 크기를 0으로 해서 숨김 */
        width: 32px !important;        /* 줌 버튼과 동일한 크기 */
        height: 32px !important;
        padding: 0 !important;         /* 여백 제거 */
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* 아이콘 크기는 복구 */
    #guideToggle i {
        font-size: 14px !important;    
        margin: 0 !important;
    }
}
/* =========================================
   [모바일 UI 최종 정리] 
   불필요한 버튼 숨김 & 하단 레이아웃 재배치
   ========================================= */

@media (max-width: 768px) {

    /* 1. 페이지 컨트롤 바 (< 1 / 1 > + Page) 숨기기 */
    .page-controls-bar {
        display: none !important;
    }

    /* 2. 화면에 떠다니는 모든 '닫기' 류 버튼 숨기기 */
    /* 노란색 X 버튼, 텍스트 닫기 버튼 등 (로그인 모달 제외) */
    #choiceModal button,
    .modal-box > button[onclick*="display='none'"],
    button[onclick*="display='none'"]:not(#loginModal button) {
        display: none !important;
    }
    /* 로그인 모달 버튼은 항상 표시 */
    #loginModal .modal-box > button,
    #loginModal .modal-box button {
        display: flex !important;
    }
    /* 디자인마법사 닫기 버튼: onclick에 display='none' 없으므로 자동으로 표시됨 */

    /* 3. 하단 줌/가이드 바 (아이콘바 위) */
    .bottom-dock {
        bottom: 68px !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        z-index: 9000 !important;
    }

    /* 4. FAB 숨김 */
    .mobile-fab, .mobile-fab.left, .mobile-fab.right { display: none !important; }
    
    /* 5. (혹시 남아있을 수 있는) 채널톡 버튼 숨김 */
    #ch-plugin-launcher,
    iframe[id*="ch-plugin"] {
        display: none !important;
    }
}
/* =========================================
   [채널톡 제어] 모바일
   ========================================= */
@media (max-width: 768px) {
    /* 채널톡 버튼을 아이콘바 위로 올림 */
    #ch-plugin-launcher,
    div[id*="ch-plugin"],
    iframe[id*="ch-plugin"] {
        bottom: 130px !important;
    }
    /* 에디터 화면에서는 숨김 */
    body.editor-active #ch-plugin-launcher,
    body.editor-active iframe[id*="ch-plugin"] {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}
/* =========================================
   [모바일 에디터 UI 최종 완성 패치]
   상단 바짝 올리기 + 하단 버튼 강제 재배치
   ========================================= */

@media (max-width: 768px) {

    /* --- 1. 배경풀기 플로팅 버튼 모바일 --- */
    #btnBgLockFloat {
        width: 42px !important;
        height: 42px !important;
        top: 55px !important;
        left: 8px !important;
    }


    /* --- 2. 하단 줌/가이드 바 (아이콘바 위에 고정) --- */
    .bottom-dock {
        position: fixed !important;
        bottom: 68px !important;        /* 아이콘바(56px) 위에 배치 */
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;

        width: auto !important;
        min-width: 200px !important;
        padding: 8px 20px !important;
        
        background: #ffffff !important;
        border-radius: 50px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
        z-index: 9999 !important;       /* 가장 위에 오도록 */
        display: flex !important;
        justify-content: space-between !important;
        gap: 15px !important;
    }


    /* --- 3. FAB 버튼 숨김 (아이콘바로 대체) --- */
    .mobile-fab, .mobile-fab.left, .mobile-fab.right, .mobile-fab span {
        display: none !important;
    }


    /* --- 4. 불필요한 요소 숨김 (페이지 버튼, 닫기 등) --- */
    .page-controls-bar { display: none !important; }
    #choiceModal button[onclick*="none"],
    .modal-box > button:last-child { display: none !important; }
    /* 로그인 모달 버튼은 숨기지 않음 */
    #loginModal .modal-box > button { display: flex !important; }
    
    /* 에디터 화면에서 채널톡 숨김 */
    body.editor-active #ch-plugin-launcher,
    body.editor-active iframe[id*="ch-plugin"] {
        display: none !important;
    }
}
/* =========================================
   [모바일 장바구니 UI 패치] 
   닫기 버튼 복구 및 헤더 스타일 조정
   ========================================= */

@media (max-width: 768px) {

    /* 1. 장바구니(cartPage) 내부의 닫기 버튼 강제 표시 */
    #cartPage button[onclick*="display='none'"] {
        display: flex !important; /* 다시 보이게 설정 */
        position: relative !important; /* 둥둥 떠다니지 않게 */
        width: auto !important;
        height: 36px !important;
        background: transparent !important;
        border: 1px solid #e2e8f0 !important;
        color: #64748b !important;
        font-size: 13px !important; /* 글씨 크기 복구 */
        padding: 0 15px !important;
        border-radius: 8px !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: none !important;
    }

    /* 2. 닫기 버튼 안의 아이콘(X) 제거 (텍스트 '닫기'만 보이게) */
    #cartPage button[onclick*="display='none'"]::after {
        content: none !important;
    }

    /* 3. 장바구니 상단 헤더 레이아웃 정리 */
    #cartPage > div > div:first-child {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 15px 20px !important; /* 여백 확보 */
        background: #fff !important;
        border-bottom: 1px solid #e2e8f0 !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
    }

    /* 장바구니 제목(H1) 스타일 조정 */
    #cartPage h1 {
        font-size: 18px !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
}
/* =========================================
   [긴급 수정] 상품 선택/구매 팝업 버튼 복구
   ========================================= */

@media (max-width: 768px) {

    /* 1. 상품 선택 팝업(#choiceModal) 내부의 버튼들은 무조건 보이게 설정 */
    #choiceModal button {
        display: flex !important;
        visibility: visible !important;
    }

    /* 2. '직접 디자인하기', '구매하기' 버튼 스타일 복구 */
    .choice-right-actions button.btn-round {
        display: flex !important;
        width: 100% !important;
        height: 60px !important; /* 버튼 높이 확보 */
        margin-top: 10px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* 3. 팝업창 닫기(X) 버튼 위치 및 모양 복구 */
    #choiceModal button[onclick*="display='none'"] {
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        width: 40px !important;
        height: 40px !important;
        background: #f1f5f9 !important;
        border: 1px solid #ddd !important;
        border-radius: 50% !important;
        color: #555 !important;
        font-size: 0 !important; /* '닫기' 텍스트 대신 아이콘만 */
        z-index: 20000 !important;
    }

    /* 닫기 버튼에 X 아이콘 강제 삽입 */
    #choiceModal button[onclick*="display='none'"]::after {
        content: '\f00d'; /* FontAwesome X 아이콘 */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 18px;
        display: block;
    }
}
/* =========================================
   [긴급 수정 2] 배송/결제 모달 버튼 완벽 복구
   ========================================= */

@media (max-width: 768px) {

    /* 1. 배송 정보 입력(#deliveryInfoModal) 및 결제(#checkoutModal) 내부 버튼 강제 표시 */
    #deliveryInfoModal .modal-box button,
    #checkoutModal .modal-box button {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important; /* 둥둥 떠다니지 않고 제자리에 */
        width: 100% !important;        /* 가로 꽉 차게 */
        height: 50px !important;       /* 터치하기 편한 높이 */
        margin-top: 10px !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 10 !important;
    }

    /* 2. '취소'나 '닫기' 버튼은 회색으로 구별 */
    #deliveryInfoModal button[onclick*="none"],
    #checkoutModal button[onclick*="none"] {
        background: #f1f5f9 !important;
        color: #64748b !important;
        border: 1px solid #e2e8f0 !important;
    }

    /* 3. '주문서 생성' 등 주요 버튼은 원래 색상 유지 (Primary) */
    #deliveryInfoModal button.primary,
    #checkoutModal button.primary {
        background: var(--primary) !important;
        color: white !important;
        box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3) !important;
    }
    
    /* 4. 결제 수단 선택 박스(라디오 버튼)도 보이게 복구 */
    .pay-method-item {
        display: flex !important;
        visibility: visible !important;
    }
}
/* [상품 상세페이지 전용 전체화면 스타일] */
.product-full-page {
    position: fixed !important;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #ffffff !important;
    z-index: 20000 !important;
    overflow-y: auto !important;
    display: flex; flex-direction: column;
}

/* 상단 헤더바 고정 */
.product-full-header {
    position: sticky; top: 0; left: 0; width: 100%; height: 60px;
    background: #ffffff; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 15px; z-index: 21000; flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.product-full-header .back-btn {
    font-size: 16px; font-weight: bold; color: #334155;
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
}
.product-full-header .page-title { 
    font-size: 16px; font-weight: 800; color: #1e293b; 
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%;
}

/* 안내 문구 박스 */
.product-guide-banner {
    display: none;
}
.product-guide-banner strong { color: #6366f1; }
/* [상단바 전역 고정 설정] */
.topbar {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 99999 !important; /* 무조건 최상위 */
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* [상품 상세페이지 스타일 수정] */
.product-full-page {
    position: fixed !important;
    top: 60px !important; /* ★ 상단바 높이(60px)만큼 아래에서 시작 */
    left: 0; 
    width: 100vw; 
    height: calc(100vh - 60px) !important; /* 전체 높이에서 상단바 제외 */
    background: #ffffff !important;
    z-index: 20000 !important; /* 상단바(99999)보다는 아래 */
    overflow-y: auto !important;
    display: flex; 
    flex-direction: column;
    padding-top: 0 !important;
}

/* 기존에 추가했던 커스텀 헤더(.product-full-header)는 숨김 처리 */
.product-full-header {
    display: none !important;
}
/* 상세페이지 유튜브 영상 예쁘게 만들기 */
.product-detail-render iframe,
.product-detail-render .ql-video {
    border-radius: 24px !important;  /* 둥근 모서리 */
    box-shadow: 0 15px 35px rgba(0,0,0,0.2) !important; /* 그림자 */
    aspect-ratio: 16 / 9 !important; /* 16:9 비율 유지 */
    width: 100% !important;
    height: auto !important;
    margin: 30px 0 !important;
    display: block;
}

/* ===== 상품 리뷰 섹션 ===== */
.product-review-section { margin-top:40px; border-top:2px solid #f1f5f9; padding-top:30px; }
.review-section-title { font-size:22px; font-weight:800; margin-bottom:20px; color:#1e1b4b; }
.review-summary { display:flex; align-items:center; gap:15px; margin-bottom:24px; padding:20px; background:#fffbeb; border-radius:12px; border:1px solid #fde68a; }
.review-summary .review-avg-score { font-size:42px; font-weight:900; color:#f59e0b; line-height:1; }
.review-summary .review-avg-stars { color:#f59e0b; font-size:18px; letter-spacing:1px; }
.review-list { display:grid; grid-template-columns:repeat(2, 1fr); gap:14px; }
.review-card { background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:20px; transition:box-shadow 0.2s; box-shadow:0 1px 4px rgba(0,0,0,0.04); }
.review-card:hover { box-shadow:0 6px 16px rgba(0,0,0,0.08); border-color:#cbd5e1; }
.review-card .review-stars { color:#f59e0b; font-size:14px; letter-spacing:2px; }
.review-photo-wrap { margin-top:12px; border-radius:10px; overflow:hidden; background:#f8fafc; border:1px solid #e2e8f0; }
.review-card .review-photo { width:100%; max-height:220px; border-radius:0; cursor:pointer; object-fit:cover; display:block; transition:transform 0.2s; }
.review-card .review-photo:hover { transform:scale(1.03); }
.review-write-box { background:#f8fafc; border:1px solid #e2e8f0; border-radius:12px; padding:20px; margin-bottom:36px; }
.review-star-selector i { font-size:28px; cursor:pointer; transition:color 0.2s; }
.review-star-selector i:hover { transform:scale(1.15); }
/* 리뷰 사진 라이트박스 */
.review-lightbox { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.85); display:flex; align-items:center; justify-content:center; z-index:100000; cursor:pointer; animation:rvLbFadeIn 0.2s ease; }
.review-lightbox img { max-width:90%; max-height:90vh; border-radius:8px; object-fit:contain; box-shadow:0 8px 40px rgba(0,0,0,0.4); }
.review-lightbox-close { position:absolute; top:20px; right:30px; color:#fff; font-size:36px; font-weight:700; cursor:pointer; line-height:1; }
@keyframes rvLbFadeIn { from { opacity:0; } to { opacity:1; } }
@media (max-width:768px) {
    .review-list { grid-template-columns:1fr; gap:10px; }
    .review-card .review-photo { max-height:180px; }
    .review-summary { flex-direction:column; text-align:center; }
}

/* =========================================
   미니 키링 에디터 (모달 내)
   ========================================= */
.mini-keyring-editor {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    border: 2px solid #e0e7ff;
    overflow: hidden;
    margin: 10px 0;
}
.mkr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 8px;
}
.mkr-canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-height: 350px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}
.mkr-canvas-wrapper canvas {
    width: 100%;
    height: 100%;
}
.mkr-eraser-cursor {
    display: none;
    position: absolute;
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
    z-index: 5;
}
.mkr-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}
.mkr-tool-btn {
    width: 36px; height: 36px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #475569;
    transition: all 0.15s;
}
.mkr-tool-btn:hover { background: #f1f5f9; color: #6366f1; }
.mkr-tool-btn.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.mkr-slider { accent-color: #6366f1; }
.mkr-cancel-btn {
    padding: 6px 14px; border: 1px solid #fca5a5; background: #fff;
    border-radius: 8px; cursor: pointer; color: #ef4444; font-size: 13px; font-weight: 600;
}
.mkr-confirm-btn {
    padding: 6px 18px; border: none; background: #6366f1; color: #fff;
    border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 700;
}
@media (max-width: 768px) {
    .mkr-canvas-wrapper { max-height: 280px; }
    .mkr-toolbar { padding: 6px 8px; gap: 6px; }
    .mkr-tool-btn { width: 32px; height: 32px; font-size: 13px; }
}

/* =========================================
   [일본어 전용] 글씨·자간·행간 대폭 축소
   ========================================= */
html[lang="ja"] {
    letter-spacing: -0.04em;
    word-break: break-word;
    overflow-wrap: break-word;
}
html[lang="ja"] body {
    font-size: 14px !important;
    line-height: 1.45 !important;
    letter-spacing: -0.02em !important;
}
/* 한국어 이외 사이트에서 카카오 로그인 숨김 (JS가 lang="kr"로 설정) */
html:not([lang="kr"]):not([lang="ko"]) #btnKakaoLogin { display: none !important; }

html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3, html[lang="ja"] h4 {
    letter-spacing: -0.05em !important;
    line-height: 1.15 !important;
}
html[lang="ja"] .hero-title {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', 'Meiryo', sans-serif !important;
    font-size: 60px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.04em !important;
}
html[lang="ja"] .hero-title span {
    font-size: 38px !important;
    font-weight: 900 !important;
}
html[lang="ja"] .hero-desc {
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: #fff !important;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
}
/* 해외 사이트 공통 — 두꺼운 서체 + hero-desc 보라 배경 강제 */
html:not([lang="kr"]):not([lang="ko"]) .hero-title {
    font-weight: 900 !important;
}
html:not([lang="kr"]):not([lang="ko"]) .hero-title span {
    font-weight: 900 !important;
}
html:not([lang="kr"]):not([lang="ko"]) .hero-desc {
    color: #fff !important;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    font-weight: 700 !important;
}
html[lang="ja"] .quick-menu-label,
html[lang="ja"] .section-title {
    font-size: 14px !important;
    letter-spacing: -0.04em !important;
}
html[lang="ja"] .quick-menu-card span {
    font-size: 11px !important;
    letter-spacing: -0.03em !important;
    line-height: 1.2 !important;
}
html[lang="ja"] p,
html[lang="ja"] .desc-text,
html[lang="ja"] .product-desc {
    font-size: 12px !important;
    line-height: 1.4 !important;
    letter-spacing: -0.03em !important;
}
/* 상세페이지 내 텍스트 */
html[lang="ja"] .product-detail-render h2,
html[lang="ja"] .product-detail-render h3 {
    font-size: 16px !important;
    letter-spacing: -0.05em !important;
    line-height: 1.2 !important;
}
html[lang="ja"] .product-detail-render p,
html[lang="ja"] .product-detail-render span,
html[lang="ja"] .product-detail-render div {
    font-size: 12px !important;
    line-height: 1.35 !important;
    letter-spacing: -0.03em !important;
}
/* 일본어 모바일 추가 축소 */
@media (max-width: 768px) {
    html[lang="ja"] .hero-title {
        font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', 'Meiryo', sans-serif !important;
        font-size: 28px !important;
        font-weight: 900 !important;
        line-height: 1.1 !important;
    }
    html[lang="ja"] .hero-title span {
        font-size: 20px !important;
        font-weight: 900 !important;
    }
    html[lang="ja"] .hero-desc {
        font-size: 13px !important;
        font-weight: 700 !important;
        color: #fff !important;
        background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    }
    html[lang="ja"] .quick-menu-label,
    html[lang="ja"] .section-title {
        font-size: 13px !important;
    }
}

/* ═══════════════════════════════════════════════
   NPC 가이드 위자드 스타일 (PC + 모바일 공통)
   ═══════════════════════════════════════════════ */
.npc-guide-area {
    padding: 10px 0 6px;
}
.npc-bubble-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
}
.npc-bubble {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 18px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    animation: npcFadeIn 0.3s ease;
    text-align: center;
}
.npc-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 8px 0 8px;
    border-style: solid;
    border-color: #1a1a1a transparent transparent transparent;
}
.npc-avatar {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    animation: npcBounce 2s ease infinite;
    margin-top: 6px;
}
.npc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#npcContentSlot {
    width: 100%;
}
@keyframes npcBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
@keyframes npcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.npc-choices {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    animation: npcFadeIn 0.4s ease;
}
.npc-choice-btn {
    flex: 1;
    padding: 16px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    word-break: keep-all;
    line-height: 1.3;
}
.npc-choice-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.npc-choice-btn:active {
    transform: scale(0.96);
}
.npc-yes {
    background: #ecfdf5;
    border-color: #86efac;
    color: #16a34a;
}
.npc-yes:hover { background: #d1fae5; }
.npc-yes:active { background: #d1fae5; }
.npc-no {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #b45309;
}
.npc-no:hover { background: #fde68a; }
.npc-no:active { background: #fde68a; }
.npc-next {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #6366f1;
    color: #fff;
}
.npc-next:hover { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.npc-next:active { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.npc-expert {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
    color: #fff;
}
.npc-expert:hover { background: linear-gradient(135deg, #d97706, #b45309); }
.npc-expert:active { background: linear-gradient(135deg, #d97706, #b45309); }
.npc-hc-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
}
.npc-hc-amount {
    width: 100%;
    padding: 16px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    border: 2px solid #bae6fd;
    border-radius: 12px;
    background: #f0f9ff;
    color: #0c4a6e;
    outline: none;
    box-sizing: border-box;
}
.npc-hc-amount:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.npc-hc-pay-btn {
    padding: 16px !important;
    font-size: 18px !important;
}
.npc-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}
.npc-nav-btn {
    background: none;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.2s;
}
.npc-nav-btn:hover { color: #6366f1; border-color: #6366f1; }
.npc-nav-btn:active { color: #6366f1; border-color: #6366f1; }
.npc-prev { text-align: left; }
.npc-next-nav {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-color: #6366f1;
}
.npc-next-nav:hover { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }
.npc-next-nav:active { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }

/* 모바일에서 아바타 더 크게 */
@media (max-width: 768px) {
    .npc-avatar {
        width: 120px;
        height: 120px;
    }
}

/* ═══ 종이매대 (Paper Display Stand) 위자드 ═══ */
.pd-input-row {
    display: flex;
    gap: 10px;
    margin: 8px 0;
    align-items: center;
}
.pd-input-row label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    min-width: 80px;
    display: flex;
    align-items: center;
}
.pd-input-row input[type="number"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    background: #fff;
    transition: border-color 0.2s;
}
.pd-input-row input[type="number"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    outline: none;
}

/* 선반 시각화 다이어그램 */
.pd-diagram {
    display: flex;
    flex-direction: column;
    border: 2px solid #6366f1;
    border-radius: 8px;
    overflow: hidden;
    margin: 12px auto;
}
.pd-diagram-ad {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 2px dashed #f59e0b;
    text-align: center;
    font-size: 12px;
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.pd-diagram-shelf {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-bottom: 1px solid #86efac;
    text-align: center;
    font-size: 11px;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}
.pd-diagram-shelf:last-child {
    border-bottom: none;
}
.pd-diagram-remainder {
    background: #f1f5f9;
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 레퍼런스 그리드 */
.pd-ref-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}
.pd-ref-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}
.pd-ref-card:hover {
    border-color: #a5b4fc;
    box-shadow: 0 2px 8px rgba(99,102,241,0.15);
}
.pd-ref-card.selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.pd-ref-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}
.pd-ref-name {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 커스터마이징 카드 */
.pd-custom-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}
.pd-custom-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.pd-custom-header {
    padding: 12px;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: #334155;
    transition: background 0.2s;
}
.pd-custom-header:hover {
    background: #f1f5f9;
}
.pd-custom-status {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}
.pd-custom-body {
    display: none;
    padding: 12px;
    gap: 8px;
    flex-direction: column;
    border-top: 1px solid #e2e8f0;
}
.pd-custom-card.open .pd-custom-body {
    display: flex;
}

/* 주문 요약 카드 */
.pd-summary-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    margin: 8px 0;
}
.pd-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}
.pd-summary-row:last-child {
    border-bottom: none;
}
.pd-summary-row strong {
    color: #1e293b;
    font-weight: 700;
}

