@charset "UTF-8";

/* ========================================================
   1. 기본 초기화 (Fluid Base & Kiosk Optimization)
   ======================================================== */
* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
    font-family: 'Pretendard', 'Malgun Gothic', sans-serif; 
}
a { text-decoration: none; }
button { touch-action: manipulation; outline: none; } 

html, body {
    margin: 0; padding: 0; 
    width: 100%; height: 100%; 
    background-color: #f8fafc; 
    user-select: none; -webkit-user-select: none; touch-action: none; 
    overflow: hidden; 
}

/* 💡 100vh 버그 방지: 100% 기반 모바일/키오스크 뷰포트 대응 */
.kiosk-app { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    background: #f8fafc; 
}

.kiosk-body { 
    display: flex; 
    flex-direction: row; 
    flex: 1; 
    height: 100%; 
    overflow: hidden; 
    position: relative; 
}
.goods-layout { 
    display: flex; 
    width: 100%; 
    height: 100%; 
    background: #f8fafc; 
    overflow: hidden; 
    flex-direction: row; 
}

/* ========================================================
   2. 상단 헤더 바 (Header Component)
   ======================================================== */
.header-bar { 
    height: max(70px, 8vh); 
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 0 3vw; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    flex-shrink: 0; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.12); 
    z-index: 100;
}
.header-brand { display: flex; align-items: center; white-space: nowrap; }
.brand-badge { 
    background: rgba(56, 189, 248, 0.12); 
    border: 1px solid rgba(56, 189, 248, 0.35); 
    color: #38bdf8; 
    padding: 6px 12px; 
    border-radius: 20px; 
    font-size: clamp(12px, 1.5vw, 19px); 
    font-weight: 800; 
}
.header-title { 
    font-size: clamp(16px, 2.5vw, 32px); 
    font-weight: 800; 
    color: #ffffff; 
    text-align: center; 
    flex: 1; 
    margin: 0 10px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.header-actions { display: flex; justify-content: flex-end; white-space: nowrap; }
.btn-home { 
    height: max(40px, 5vh); 
    padding: 0 15px; 
    background: rgba(255, 255, 255, 0.08); 
    color: #f8fafc; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 28px; 
    font-size: clamp(14px, 1.8vw, 21px); 
    font-weight: 700; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    cursor: pointer; 
    transition: all 0.1s; 
}
.btn-home:active { 
    background: #2563eb; 
    border-color: #3b82f6; 
    color: #ffffff; 
    transform: scale(0.95); 
}

/* ========================================================
   3. 🚀 좌측 사이드바 (화면의 25~28% 강제 유지)
   ======================================================== */
.goods-sidebar, .sidebar-category { 
    width: 28%; 
    max-width: 280px; 
    min-width: 100px; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    background: #ffffff; 
    border-right: 2px solid #e2e8f0; 
    overflow-y: auto; 
    height: 100%;
}
.cat-btn, .cat-item { 
    width: 100%; 
    border: none; 
    font-weight: bold; 
    cursor: pointer; 
    background: transparent; 
    transition: all 0.1s; 
    text-align: center; 
}
.cat-btn { 
    padding: clamp(12px, 2vw, 22px) 10px; 
    border-bottom: 1px solid #f1f5f9; 
    text-align: left; 
    font-size: clamp(12px, 1.6vw, 18px); 
    color: #475569; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}
.cat-item { 
    padding: clamp(12px, 2vw, 22px) 10px; 
    border-bottom: 1px solid #e9ecef; 
    font-size: clamp(12px, 1.8vw, 20px); 
    color: #495057; 
    word-break: keep-all; 
}
.cat-btn.active, .cat-item.active { background: #2563eb; color: #ffffff; border-left: 6px solid #1d4ed8; }
.cat-item.cat-original { color: #854d0e; background: #fffbeb; }
.cat-item.cat-original.active { background: #d97706; color: #ffffff; border-left: 6px solid #92400e; }

/* 사이드바 하단 영역 및 이전으로 버튼 */
.sidebar-bottom { 
    margin-top: auto; 
    padding: clamp(10px, 1.5vw, 20px); 
    border-top: 1px solid #e2e8f0; 
    background: #ffffff; 
    position: sticky; 
    bottom: 0; 
    z-index: 10; 
    flex-shrink: 0;
}
.btn-back { 
    width: 100%; 
    background-color: #e2e8f0; 
    color: #475569; 
    padding: clamp(12px, 2vh, 20px) 5px; 
    font-size: clamp(14px, 1.8vw, 22px); 
    font-weight: 900; 
    border: none; 
    border-radius: 12px; 
    cursor: pointer; 
    text-align: center; 
    line-height: 1.3;
    transition: transform 0.1s, background-color 0.2s; 
}
.btn-back:active { 
    background-color: #cbd5e1; 
    transform: scale(0.97); 
}

/* ========================================================
   4. 🚀 우측 컨텐츠 리스트 및 카드 (화면의 나머지 72% 차지)
   ======================================================== */
.goods-content { 
    width: 72%; 
    flex: 1; 
    padding: max(10px, 2vw); 
    overflow-y: auto; 
    scroll-behavior: smooth; 
    background: #ffffff; 
}
.goods-content::-webkit-scrollbar { display: none; } 

.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: max(10px, 1.5vw); }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: max(10px, 1.5vw); }

.goods-card, .design-card { 
    background: #ffffff; 
    border-radius: 16px; 
    padding: clamp(8px, 1.5vw, 20px); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    cursor: pointer; 
    transition: transform 0.1s; 
    text-align: center; 
    position: relative; 
    border: 2px solid #e2e8f0; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.03); 
}
.goods-card:active, .design-card:active { transform: scale(0.97); background: #f8fafc; border-color: #2563eb; }

.goods-card-img, .design-img { width: 100%; object-fit: contain; margin-bottom: 10px; background: #f1f5f9; border-radius: 12px; }
.goods-card-img { height: clamp(80px, 15vw, 220px); }
.design-img { height: clamp(100px, 18vw, 260px); padding: 10px; }

.goods-card-title, .design-title { font-weight: 800; color: #0f172a; margin-bottom: 6px; line-height: 1.3; font-size: clamp(11px, 1.6vw, 20px); word-break: keep-all; }
.design-author { font-size: clamp(10px, 1.4vw, 16px); color: #666; margin-bottom: 8px; }

.goods-card-price, .orig-price { font-size: clamp(13px, 1.8vw, 22px); font-weight: 800; color: #2563eb; margin-top: auto; }
.goods-card-size, .orig-size { font-size: clamp(10px, 1.2vw, 14px); color: #0284c7; background: #e0f2fe; padding: 4px 8px; border-radius: 20px; font-weight: 700; margin-bottom: 8px; }
.badge-orig { background: #fef3c7; color: #92400e; font-size: clamp(10px, 1.2vw, 14px); font-weight: 800; padding: 4px 8px; border-radius: 6px; margin-bottom: 8px; }

/* ========================================================
   5. Step 2 하이브리드 모달 팝업
   ======================================================== */
#originalChoiceModal { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh; 
    background: rgba(0,0,0,0.75); 
    z-index: 99999; 
    justify-content: center; 
    align-items: center; 
}
.modal-content-box { 
    background: #fff; 
    width: 90%; 
    max-width: 680px; 
    border-radius: 24px; 
    padding: clamp(20px, 4vw, 50px); 
    text-align: center; 
    box-shadow: 0 15px 50px rgba(0,0,0,0.4); 
}
.modal-title { font-size: clamp(20px, 3vw, 32px); font-weight: 900; color: #0f172a; margin-bottom: 15px; }
.modal-desc { font-size: clamp(14px, 2vw, 22px); color: #475569; line-height: 1.6; margin-bottom: 30px; }
.btn-choice-orig, .btn-choice-goods { 
    width: 100%; 
    padding: clamp(12px, 2vw, 25px); 
    font-size: clamp(16px, 2.5vw, 26px); 
    font-weight: 900; 
    color: #fff; 
    border: none; 
    border-radius: 16px; 
    cursor: pointer; 
    margin-bottom: 15px; 
    transition: transform 0.1s; 
}
.btn-choice-orig { background: #0f172a; }
.btn-choice-goods { background: #2563eb; margin-bottom: 20px; }
.btn-choice-orig:active, .btn-choice-goods:active { transform: scale(0.98); }
.btn-choice-cancel { 
    width: 100%; 
    padding: clamp(12px, 2vw, 20px); 
    font-size: clamp(14px, 2vw, 22px); 
    font-weight: bold; 
    background: #e2e8f0; 
    color: #475569; 
    border: none; 
    border-radius: 12px; 
    cursor: pointer; 
}

/* ========================================================
   6. 대기 화면 (Splash Screen - index.php)
   ======================================================== */
.splash-container { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; background: #0f172a; color: white; cursor: pointer; }
.bg-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s; z-index: 1; }
.bg-layer.active { opacity: 1; z-index: 2; }
.bg-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.35); z-index: 3; pointer-events: none; }
.center-glass-panel { z-index: 10; display: flex; flex-direction: column; align-items: center; background: rgba(30, 41, 59, 0.5); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 40px; padding: clamp(30px, 5vw, 50px); text-align: center; backdrop-filter: blur(10px); width: 85%; max-width: 800px; }
.current-art-info { font-size: clamp(14px, 2vw, 20px); font-weight: 600; color: #e2e8f0; margin-bottom: 20px; background: rgba(0, 0, 0, 0.6); padding: 12px 30px; border-radius: 30px; border: 1px solid rgba(255,255,255,0.2); }
.splash-title { font-size: clamp(32px, 6vw, 60px); font-weight: 900; margin-bottom: 20px; color: #ffffff; letter-spacing: -1px; }
.splash-subtitle { font-size: clamp(18px, 3vw, 28px); color: #cbd5e1; margin-bottom: 50px; }
.touch-icon { font-size: clamp(50px, 8vw, 80px); margin-bottom: 25px; animation: bounce 1.8s infinite; }
.touch-text-box { font-size: clamp(20px, 3.5vw, 36px); font-weight: bold; color: #fff; padding: 15px 40px; background: #2563eb; border-radius: 60px; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

/* ========================================================
   8. 원작 작품 상세 뷰어 (step3_artwork.php) - 비율 완벽 유지
   ======================================================== */
.artwork-modal-bg { background-color: #1e293b; display: flex; justify-content: center; align-items: center; height: 100vh; width: 100vw; overflow: hidden; margin: 0; }
.modal-container { width: 95vw; max-width: 1200px; height: 85vh; max-height: 900px; background: #ffffff; border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); display: flex; flex-direction: column; overflow: hidden; }
.modal-header { background: #0f172a; color: #ffffff; text-align: center; padding: clamp(12px, 2vh, 24px); font-size: clamp(18px, 2.5vw, 28px); font-weight: 800; letter-spacing: 2px; flex-shrink: 0; }

.modal-body { display: flex; flex-direction: row !important; flex: 1; padding: clamp(15px, 3vw, 30px); gap: clamp(15px, 3vw, 40px); background: #f8fafc; overflow: hidden; }

/* 뷰어 좌측 (이미지 영역) */
.artwork-left { flex: 1.2; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; height: 100%; }

/* 이미지 프레임 및 비율 보장 */
.artwork-img-box { 
    width: 100%; 
    flex: 1; 
    background: #ffffff; 
    border-radius: 16px; 
    padding: clamp(10px, 2vw, 20px); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 0; 
    overflow: hidden; 
}
.artwork-img { 
    max-width: 100% !important; 
    max-height: 100% !important; 
    width: auto !important; 
    height: auto !important; 
    object-fit: contain !important; /* 이미지 잘림 완전 방지 */
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
}

.artwork-notice { margin-top: clamp(8px, 1.5vh, 15px); font-size: clamp(10px, 1.2vw, 14px); color: #94a3b8; text-align: center; flex-shrink: 0; }

/* 뷰어 우측 (상세 정보) */
.artwork-right { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding-right: 5px; }
.category-badge-group { display: flex; gap: 6px; margin-bottom: clamp(10px, 1.5vh, 15px); align-items: center; flex-wrap: wrap; }
.category-badge, .sub-category-badge { padding: 4px 10px; border-radius: 20px; font-size: clamp(11px, 1.2vw, 14px); font-weight: 700; }
.category-badge { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.sub-category-badge { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

.artwork-title { font-size: clamp(18px, 2.5vw, 36px); font-weight: 800; color: #0f172a; margin-bottom: 8px; line-height: 1.3; word-break: keep-all; }
.artwork-price { font-size: clamp(16px, 2.2vw, 32px); font-weight: 800; color: #2563eb; margin-bottom: clamp(12px, 2.5vh, 25px); }

.author-box { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: clamp(10px, 1.5vw, 20px); display: flex; gap: clamp(10px, 1.5vw, 20px); margin-bottom: clamp(15px, 2.5vh, 25px); box-shadow: 0 2px 10px rgba(0,0,0,0.02); align-items: center; flex-shrink: 0; }
.author-img { width: clamp(50px, 7vw, 90px); height: clamp(50px, 7vw, 90px); border-radius: 50%; object-fit: cover; border: 3px solid #f1f5f9; flex-shrink: 0; }
.author-info { flex: 1; overflow: hidden; }
.author-name { font-size: clamp(14px, 1.8vw, 20px); font-weight: 800; color: #1e293b; margin-bottom: 4px; }
.author-bio { font-size: clamp(11px, 1.3vw, 14px); color: #475569; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; white-space: normal; }

.spec-table { width: 100%; border-collapse: collapse; margin-bottom: auto; }
.spec-table th, .spec-table td { padding: clamp(6px, 1.2vh, 14px) 0; border-bottom: 1px dashed #cbd5e1; font-size: clamp(11px, 1.4vw, 16px); }
.spec-table th { text-align: left; color: #64748b; font-weight: 600; width: 35%; }
.spec-table td { text-align: right; color: #0f172a; font-weight: 700; word-break: keep-all; }
.highlight-text { color: #16a34a; }

.modal-footer { display: flex; gap: clamp(8px, 1.5vw, 15px); padding-top: 15px; flex-shrink: 0; }
.btn { flex: 1; padding: clamp(12px, 2vh, 22px) 5px; border-radius: 12px; font-size: clamp(14px, 1.8vw, 22px); font-weight: 800; text-align: center; cursor: pointer; transition: background 0.2s; border: none; touch-action: manipulation; }
.btn-cancel { background: #e2e8f0; color: #475569; }
.btn-cancel:active { background: #cbd5e1; transform: scale(0.98); }
.btn-buy { background: #0f172a; color: #ffffff; }
.btn-buy:active { background: #1e293b; transform: scale(0.98); }

/* ========================================================
   9. 최종 굿즈 & 디자인 미리보기 (step3_preview.php)
   ======================================================== */
.preview-sidebar { 
    width: 28%; max-width: 350px; min-width: 120px; 
    background-color: #ffffff; border-right: 2px solid #e2e8f0; 
    padding: clamp(15px, 2vw, 30px) clamp(10px, 1.5vw, 20px) clamp(30px, 5vh, 50px); 
    display: flex; flex-direction: column; z-index: 100; height: 100%; box-sizing: border-box; overflow-y: auto; 
    flex-shrink: 0;
}
.preview-sidebar-title { font-size: clamp(16px, 2vw, 28px); font-weight: 900; margin-bottom: 12px; color: #0f172a; line-height: 1.3; word-break: keep-all; }
.preview-sidebar-desc { font-size: clamp(11px, 1.3vw, 15px); color: #64748b; margin-bottom: 20px; line-height: 1.5; word-break: keep-all; }

.preview-info-card { background: #f8fafc; border-radius: 12px; padding: clamp(10px, 1.2vw, 18px); border: 1px solid #e2e8f0; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); flex-shrink: 0; }
.preview-info-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: clamp(11px, 1.3vw, 16px); }
.preview-info-row:last-child { margin-bottom: 0; }
.preview-info-label { color: #64748b; font-weight: 700; white-space: nowrap; margin-right: 10px; }
.preview-info-value { color: #0f172a; font-weight: 800; text-align: right; word-break: keep-all; }

/* 💡 버튼 그룹 축소 방지 강제 적용 */
.preview-btn-group { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    margin-top: auto; 
    flex-shrink: 0; 
}
.preview-btn { padding: clamp(12px, 2vh, 20px); font-size: clamp(14px, 1.8vw, 22px); font-weight: 900; border: none; border-radius: 12px; cursor: pointer; text-align: center; touch-action: manipulation; transition: transform 0.1s; }
.preview-btn:active { transform: scale(0.97); }
.preview-btn-prev { background-color: #e2e8f0; color: #475569; }
.preview-btn-next { background-color: #2563eb; color: white; box-shadow: 0 4px 12px rgba(37,99,235,0.2); }

/* 메인 영역 */
.preview-main { 
    flex: 1; 
    display: flex; 
    justify-content: center; 
    align-items: flex-start; 
    position: relative; 
    padding: clamp(15px, 2vw, 40px); 
    overflow-y: auto; 
    background: #f1f5f9; 
}

/* 센터 래퍼 */
.preview-center-wrap { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: clamp(10px, 1.5vw, 20px); 
    width: 100%; 
    max-width: 550px; 
    margin: 0 auto; 
    padding-bottom: 30px; 
}

/* 시안 안내 박스 */
.sian-notice-box { 
    width: 100%; 
    background: #ffffff; 
    border: 2px solid #cbd5e1; 
    border-radius: 16px; 
    padding: clamp(12px, 1.5vw, 25px); 
    text-align: center; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
}
.sian-icon { font-size: clamp(20px, 2.5vw, 32px); margin-bottom: 6px; }
.sian-title { font-size: clamp(14px, 1.8vw, 22px); font-weight: 900; color: #0f172a; margin-bottom: 10px; word-break: keep-all; }
.sian-desc { font-size: clamp(11px, 1.2vw, 16px); color: #334155; line-height: 1.5; font-weight: 600; word-break: keep-all; }
.sian-subtext { font-size: clamp(10px, 1vw, 14px); color: #64748b; margin-top: 6px; display: inline-block; font-weight: normal; }

/* 목업 이미지 박스 */
.preview-mockup-box { 
    width: 100%; 
    aspect-ratio: 1 / 1; 
    max-height: 45vh; 
    background-color: #ffffff; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.06); 
    border-radius: 20px; 
    border: 1px solid #e2e8f0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: clamp(10px, 1.5vw, 20px); 
    overflow: hidden; 
}
.preview-mockup-img { width: 100%; height: 100%; object-fit: contain; }

/* 🎨 3. 붉은색 선택 디자인 박스 (가로형 이미지 대응 - 최대 300px 대폭 확장) */
.preview-design-box-inline { 
    width: clamp(200px, 26vw, 300px); 
    align-self: flex-end; 
    background: #ffffff; 
    border: 3px solid #ef4444; 
    border-radius: 16px; 
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.25); 
    padding: clamp(8px, 1.2vw, 14px); 
    text-align: center; 
}
.preview-design-title { font-size: clamp(11px, 1.2vw, 15px); font-weight: 900; color: #ef4444; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; gap: 4px; }

/* 💡 가로 비율(16:10) 프레임 적용으로 명화 작품 시인성 확보 */
.preview-design-img-wrap { 
    width: 100%; 
    aspect-ratio: 16 / 10; 
    background-color: #f8fafc; 
    border-radius: 10px; 
    overflow: hidden; 
    border: 1px solid #e2e8f0; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}
.preview-design-img { 
    max-width: 100% !important; 
    max-height: 100% !important; 
    width: auto !important; 
    height: auto !important; 
    object-fit: contain !important; /* 잘림 완전 방지 */
    border-radius: 6px;
}
.preview-design-name { font-size: clamp(12px, 1.3vw, 15px); font-weight: 800; color: #0f172a; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }