/* --- 외부 폰트 정의 (눈누) --- */
@font-face {
    font-family: 'Cafe24Ssurround';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2105_2@1.0/Cafe24Ssurround.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'YeogiEottaeJalnan';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2104@1.0/YeogigeottaeJallan.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'KyoboHandwriting2019';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/KyoboHand.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'JGaegujaengi';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_eleven@1.0/J-Gaegujaengi.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'PFStardust';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/PFStardust.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

:root {
    --bg-color: #080808;
    --glass-bg: rgba(25, 25, 25, 0.6);
    --glass-border: rgba(212, 175, 55, 0.15);
    --primary: #d4af37;
    /* Classic Gold */
    --primary-hover: #e2c256;
    --text-main: #fcfcfc;
    --text-muted: #9e9e9e;
    --canvas-texture: url('https://www.transparenttextures.com/patterns/white-wall.png');
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
}

.background-glass {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 40%);
    z-index: -1;
    animation: drift 30s infinite linear;
}

@keyframes drift {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.container {
    width: 100%;
    max-width: 1240px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.header-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 2;
}

.header-actions-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 인스타그램 링크 (로그인/장바구니 버튼 아래) */
.header-instagram {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #fff;
    text-decoration: none;
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.header-instagram:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--primary);
    color: var(--primary);
}

.header-instagram svg {
    flex-shrink: 0;
}

.header-action-btn {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.header-action-btn:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--primary);
    color: var(--primary);
}

.header-action-btn:hover .cart-badge {
    background: var(--primary);
}

/* 사용자 메뉴 (로그인 후 dropdown) */
.user-menu-wrap {
    position: relative;
}

.header-action-btn.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 5px;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(212, 175, 55, 0.25);
    color: #fff;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
    font-family: 'Pretendard', sans-serif;
    letter-spacing: 0;
}

.user-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Pretendard', sans-serif;
    letter-spacing: 0.3px;
    font-size: 0.88rem;
}

.user-chevron {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 1px;
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: #181818;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: #ddd;
    text-align: left;
    padding: 9px 12px;
    font-size: 0.88rem;
    font-family: 'Pretendard', sans-serif;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.user-menu-item:hover {
    background: rgba(212, 175, 55, 0.12);
    color: #fff;
}

.user-menu-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.user-menu-item-danger {
    color: #ff8e8e;
}

.user-menu-item-danger:hover {
    background: rgba(255, 142, 142, 0.12);
    color: #ffa8a8;
}

.user-menu-sep {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    margin: 4px 0;
}

@media (max-width: 700px) {
    .header-actions {
        position: static;
        align-items: center;
        margin-bottom: 1.2rem;
    }

    .header-actions-row {
        justify-content: center;
    }
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.header-tagline {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--primary);
    letter-spacing: 3px;
    margin-bottom: 1rem;
    opacity: 0.85;
}

header p {
    font-family: 'Noto Serif KR', serif;
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

header p.header-notice {
    font-size: 0.85rem;
    margin-top: 0.4rem;
    opacity: 0.75;
    letter-spacing: 0.3px;
}

/* Gold hairline divider utility */
.section-divider {
    height: 1px;
    width: 80px;
    margin: 1.5rem auto;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent);
    border: none;
}

/* Editorial 2-column layout (gallery left, panels right) */
.editorial-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    width: 100%;
}

.editorial-layout .panel-wrapper {
    flex: 1;
    min-width: 0;
}

/* Only show gallery on upload section; on loading/preview/result, let panels take full width */
.editorial-layout:not(:has(#upload-section.active)) .hero-gallery {
    display: none;
}

/* My History 사이드바 — upload / result 섹션에서만 표시 */
.editorial-layout:not(:has(#upload-section.active, #result-section.active)) .my-history {
    display: none;
}

/* 태블릿 (901~1200px): 아직 2단 가로 레이아웃이라 3번째 컬럼 끼우면 비좁음 → 숨김.
   ≤900px (세로 1단)에서는 아래 900px 블록에서 맨 아래 전체폭으로 다시 노출. */
@media (min-width: 901px) and (max-width: 1200px) {
    .my-history {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .editorial-layout {
        flex-direction: column;
        gap: 1.5rem;
    }

    /* 선택자 우선순위(0,2,0)를 올려 둠 — 기본 .hero-gallery 규칙이 이 미디어쿼리
       *뒤*에 정의돼 있어, 단순 .hero-gallery 로 쓰면 소스 순서상 기본 sticky 에
       덮인다. .editorial-layout 을 앞에 붙여 순서와 무관하게 모바일에서 이기게 함. */
    .editorial-layout .hero-gallery {
        width: 100%;
        /* 모바일 1단에선 sticky 해제 — 갤러리가 화면보다 길어 상단에 고정되면
           업로드 폼이 실제 아크릴 사진보다 먼저 올라와 보임. 소스 순서대로
           자연 스크롤(스타일 샘플 → 실물 → 업로드)되게 static 으로 둠. */
        position: static;
        top: auto;
    }

    /* 내 생성 목록 — 모바일에선 맨 아래(DOM 순서상 마지막 자식)에 전체폭으로 노출.
       데스크탑의 280px sticky 사이드바 설정을 해제: 우선순위(.editorial-layout)를
       올려 뒤에 오는 기본 .my-history 규칙을 이기고, sticky/고정높이/내부스크롤을
       풀어 페이지 흐름대로 자연스럽게 펼쳐지게 함. upload/result 섹션 노출 조건은
       위 :not(:has(...)) 규칙이 그대로 관장 (모바일에서도 동일). */
    .editorial-layout .my-history {
        flex: 0 0 auto;
        width: 100%;
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
    }
}

/* Hero Gallery */
.hero-gallery {
    flex: 0 0 340px;
    position: sticky;
    top: 2rem;
}

.gallery-title--sub {
    margin-top: 1.5rem;
}

.gallery-title-hint {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 300;
    color: #fff;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.gallery-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--primary);
    text-align: center;
    letter-spacing: 4px;
    margin-bottom: 1.2rem;
    opacity: 0.9;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gallery-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gallery-item.gallery-item--wide {
    grid-column: 1 / -1;
}

.gallery-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px dashed rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.8) 0%, rgba(15, 15, 15, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(212, 175, 55, 0.5);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    text-align: center;
    padding: 0.5rem;
    transition: all 0.35s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.gallery-item--wide .gallery-placeholder {
    aspect-ratio: 4 / 3;
}

.gallery-item:hover .gallery-placeholder {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.15);
    transform: translateY(-2px);
}

.gallery-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    cursor: zoom-in;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover .gallery-image {
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25);
    transform: translateY(-2px);
}

.gallery-caption {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 1px;
    opacity: 0.75;
}

/* Layout shift fix */
.panel-wrapper {
    position: relative;
    width: 100%;
    min-height: 500px;
    /* 고정된 최소 높이로 화면 점프 방지 */
}

.panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: opacity 0.5s ease, transform 0.5s ease;

    /* Absolute positioning to stack panels on top of each other */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.panel.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    z-index: 0;
}

.panel.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    z-index: 10;
    position: relative;
    /* Expand wrapper height based on active panel */
}

.input-group {
    margin-bottom: 2rem;
}

label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    color: white;
    font-size: 1.1rem;
    font-family: 'Pretendard', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.drop-zone {
    border: 1px dashed rgba(212, 175, 55, 0.4);
    border-radius: 16px;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    gap: 12px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(212, 175, 55, 0.1);
}

.plus-icon {
    font-size: 3.5rem;
    color: var(--primary);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
    pointer-events: none;
    user-select: none;
    margin-bottom: 0.5rem;
}

.drop-zone:hover .plus-icon {
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(0 8px 20px rgba(212, 175, 55, 0.4));
}

.drop-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    padding: 0 1rem;
    pointer-events: none;
    /* 클릭 방해 금지 */
}

#file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
    /* 가장 위에 배치하여 계속 클릭 가능하게 함 */
}

/* 스타일 선택 카드 */
.style-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.style-card {
    cursor: pointer;
    position: relative;
}

.style-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.style-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.25s ease;
}

.style-card:hover .style-card-inner {
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.05);
}

.style-card.active .style-card-inner {
    border-color: var(--primary);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

.style-icon {
    font-size: 1.6rem;
}

.style-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.style-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

#image-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    pointer-events: none;
    /* 이미지가 위를 덮어도 클릭 가능하게 */
    z-index: 5;
    /* 아이콘과 글자보다 위에 위치 */
}

.primary-btn,
.secondary-btn {
    width: 100%;
    height: 80px;
    /* 고정된 일관된 높이 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
    line-height: 1.2;
    padding: 0 1rem;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #b5952f 100%);
    color: #fff;
    border: 2px solid transparent;
    /* 테두리 두께 일치 (투명) */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.primary-btn:disabled,
.primary-btn:disabled:hover {
    background: #555;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
    text-shadow: none;
    transform: none;
    opacity: 0.65;
}

.secondary-btn {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    /* 테두리 두께 일치 */
    margin-bottom: 0;
}

.secondary-btn:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* Loading Section */
.loader-container {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: var(--primary);
}

.loading-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Preview Confirm Section */
.preview-description {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.preview-description strong {
    color: var(--primary);
}

.preview-cutout-wrapper {
    max-width: 420px;
    margin: 0 auto 1.5rem;
    aspect-ratio: 1 / 1;
    /* 투명 배경이 보이도록 체커보드 패턴 */
    background-color: #1a1a1a;
    background-image:
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#preview-cutout-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Result Section */
.result-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--primary);
    text-align: center;
}

.result-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 800px) {
    .result-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .canvas-container {
        flex: 1;
        position: sticky;
        top: 2rem;
        align-self: flex-start;
    }

    .editor-panel {
        width: 350px;
        margin-top: 0 !important;
        /* Override old margin */
        /* 에디터가 길어지면 페이지 전체 스크롤 대신 자체 스크롤되도록.
           canvas-container 와 같은 sticky 패턴으로 좌/우 모두 뷰포트에 고정되면서
           에디터만 내부 스크롤 → "얼마나 내려야 끝인지" 스크롤바로 즉시 인지 가능. */
        position: sticky;
        top: 2rem;
        align-self: flex-start;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }
}

/* ============================================
   스크롤바 가시화 — editor-panel / my-history
   macOS 기본 스크롤바는 auto-hide 라 스크롤 중에만 살짝 보임 → 진행도 파악이 어려움.
   Firefox: scrollbar-width/color, Chrome·Safari: ::-webkit-scrollbar 로 상시 표시.
   골드 톤으로 통일해 editorial 테마와 일관.
   ============================================ */
.editor-panel,
.my-history {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.55) rgba(255, 255, 255, 0.05);
}

.editor-panel::-webkit-scrollbar,
.my-history::-webkit-scrollbar {
    width: 10px;
}

.editor-panel::-webkit-scrollbar-track,
.my-history::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 5px;
}

.editor-panel::-webkit-scrollbar-thumb,
.my-history::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.55);
    border-radius: 5px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: background 0.2s ease;
}

.editor-panel::-webkit-scrollbar-thumb:hover,
.my-history::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.85);
}

.wall-mockup {
    position: relative;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8);
}

.canvas-frame {
    position: relative;
    /* Default studio blue */
    background-color: var(--canvas-bg, #153b82);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), background-color 0.4s ease;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    container-type: inline-size;
    /* cqw 단위 사용을 위한 컨테이너 쿼리 설정 */
    isolation: isolate;
    /* mix-blend-mode 가 프레임 바깥으로 새지 않도록 격리 */
}

.canvas-frame:hover {
    transform: scale(1.02) translateY(-5px);
}

#result-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    /* 텍스처(z:0) 위, 텍스트(z:3) 아래 */
    transform: scale(var(--dog-scale, 1)) translate(var(--dog-x, 0%), var(--dog-y, 0%));
    transform-origin: center center;
    transition: transform 0.15s ease;
}

/* 생성 이미지 다운로드 캐주얼 차단 (드래그 저장 / 길게 눌러 저장 / 선택).
   우클릭은 app.js 의 contextmenu 위임 핸들러가 막음. 완벽 차단은 불가능. */
#result-image,
#preview-cutout-image,
.history-item-thumb {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    /* iOS 길게 눌러 저장 메뉴 차단 */
}

.canvas-overlay-text {
    position: absolute;
    top: var(--canvas-text-y, 6%);
    left: var(--canvas-text-x, 50%);
    transform: translateX(-50%);
    z-index: 3;
    --font-scale: 1;
    font-family: var(--canvas-font), serif;
    font-size: calc(var(--canvas-text-size, 12cqw) * var(--font-scale));
    font-weight: 500;
    color: var(--canvas-text-color, #ffffff);
    letter-spacing: var(--canvas-letter-spacing, 4px);
    /* letter-spacing이 마지막 글자 뒤에도 적용되어 왼쪽으로 쏠리는 문제 보정 (모든 줄에 적용) */
    padding-left: var(--canvas-letter-spacing, 4px);
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transition: color 0.3s ease, font-family 0.3s ease, font-size 0.15s ease, top 0.15s ease, left 0.15s ease, letter-spacing 0.15s ease;
    white-space: pre-line;
    /* 줄바꿈(\n) 지원 */
    /* 이모지 조기 wrap 버그 수정:
       position:absolute + left:50% (right 미설정) 조합에서 shrink-to-fit 규칙이
       적용돼 가용 너비가 "프레임 절반"으로 제한됨 → 텍스트 박스가 250px 한계에 부딪혀
       wrap. width:max-content 는 이 제약을 해제하고 콘텐츠 자연 너비를 쓰게 함.
       max-width:100% 로 프레임 밖 overflow 만 최종 방어. */
    width: max-content;
    max-width: 100%;
    /* 이모지 경계 자동 줄바꿈도 함께 차단 (Unicode line-break 허용점 방지) */
    word-break: keep-all;
    overflow-wrap: normal;
    text-align: center;
    line-height: 1.3;
}

.canvas-overlay-text.font-dongle {
    --font-scale: 1.4;
    /* 동글 폰트 40% 확대 보정 */
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 정밀하게 1:1 비율 유지 */
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
}

@media (min-width: 600px) {
    .action-buttons button {
        flex: 1;
        min-width: 150px;
    }
}

.action-price-info {
    margin-top: 0.7rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.action-price-info .price-option {
    background: transparent;
    border: 1px solid transparent;
    color: #999;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.action-price-info .price-option strong {
    color: inherit;
    margin-left: 4px;
    font-weight: 600;
}

.action-price-info .price-option:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.action-price-info .price-option.active {
    color: #fff;
    background: rgba(212, 175, 55, 0.18);
    border-color: rgba(212, 175, 55, 0.6);
}

.action-price-info .price-option.active strong {
    color: #d4af37;
}

.action-price-info .price-divider {
    color: #555;
}

/* Editor Panel Styles */
.editor-panel {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: left;
    display: block;
}

.editor-panel h3 {
    font-family: 'Noto Serif KR', serif;
    color: var(--primary);
    margin-bottom: 0.4rem;
    font-size: 1.3rem;
}

/* 에디터 스크롤 안내 — 사용자가 패널 안쪽을 스크롤할 수 있다는 사실을 놓치지 않게 */
.editor-scroll-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0 0 1.4rem 0;
    opacity: 0.75;
    letter-spacing: 0.02em;
}

.editor-row {
    margin-bottom: 1.5rem;
}

.editor-row label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.color-swatches {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.swatch {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.swatch:hover,
.swatch.active {
    transform: scale(1.1);
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* 액자 사이즈 선택 버튼 (15cm / 25cm) */
.frame-size-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.size-btn {
    padding: 9px 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #ccc;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.size-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.size-btn.active {
    background: rgba(212, 175, 55, 0.18);
    border-color: #d4af37;
    color: #fff;
}

select {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

input[type="color"] {
    display: block;
    width: 50px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

/* Range Slider Styling */
.editor-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    margin-top: 0.5rem;
    cursor: pointer;
}

.editor-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
    transition: transform 0.15s ease;
}

.editor-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.editor-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

/* =====================================================================
   Top Navigation (홈 / 고객 리뷰)
   ===================================================================== */
.top-nav {
    margin-top: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: 'Playfair Display', serif;
    font-style: italic;
}

.top-nav .nav-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.25s ease;
    font-family: inherit;
    font-style: inherit;
    text-decoration: none;
}

.top-nav .nav-link:hover {
    color: var(--primary);
}

.top-nav .nav-sep {
    color: rgba(212, 175, 55, 0.4);
}

/* 제품 상세페이지 강조 배너 (/product.html 유도) */
/* 제품 상세 유도 배너 (A안) — 얇은 알약 → 채워진 골드 버튼 + 글로우 + 은은한 펄스.
   첫 방문자 눈에 "눌러볼 버튼"으로 읽히게 강조. 단, 1순위 업로드 버튼보다는
   작게 유지(강한 2순위). 텍스트·링크·위치는 기존 그대로. */
.product-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    max-width: 600px;
    margin: 1.6rem auto 0.3rem;
    padding: 0.9rem 1.7rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary) 0%, #b5952f 100%);
    color: #1a1400;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.2px;
    text-decoration: none;
    box-shadow: 0 6px 22px rgba(212, 175, 55, 0.32);
    transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease;
    animation: bannerPulse 2.6s ease-in-out infinite;
}

/* 천천히 차오르는 글로우 — 시선 유도용. hover 시엔 멈춤(흔들림 방지),
   prefers-reduced-motion 환경에선 아예 끔. */
@keyframes bannerPulse {
    0%, 100% { box-shadow: 0 6px 22px rgba(212, 175, 55, 0.30); }
    50%      { box-shadow: 0 6px 30px rgba(212, 175, 55, 0.62); }
}

.product-banner:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(212, 175, 55, 0.5);
    animation: none;
}

.product-banner-arrow {
    color: #1a1400;
    font-weight: 800;
    transition: transform 0.2s ease;
}

.product-banner:hover .product-banner-arrow {
    transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
    .product-banner { animation: none; }
}

@media (max-width: 600px) {
    .product-banner {
        font-size: 0.9rem;
        padding: 0.8rem 1.3rem;
        max-width: 92%;
    }
}

/* =====================================================================
   Reviews Section
   ===================================================================== */
.reviews-header {
    text-align: center;
    margin-bottom: 2rem;
}

.reviews-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.3rem;
    margin-bottom: 1.5rem;
}

.reviews-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    max-width: 520px;
    margin: 0 auto;
}

.reviews-actions .reviews-btn {
    flex: 1;
    height: 54px;
    font-size: 0.95rem;
}

.required-mark {
    color: var(--primary);
    margin-left: 2px;
}

.field-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* 리뷰 작성 폼 */
.review-form {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
}

.review-form .input-group {
    margin-bottom: 1.5rem;
}

/* 리뷰 게이트 (로그인 필요 / 가능 주문 없음) */
.review-gate {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

.review-gate-message {
    color: var(--text-soft, #ddd);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 1.25rem;
    white-space: pre-line;
}

.review-gate .action-buttons {
    justify-content: center;
}

/* 리뷰 대상 주문 선택 리스트 */
.review-order-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.review-order-option {
    display: grid;
    grid-template-columns: auto 64px 1fr;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.review-order-option:hover {
    border-color: rgba(212, 175, 55, 0.35);
}

.review-order-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(212, 175, 55, 0.08);
}

.review-order-option input[type="radio"] {
    margin: 0;
    accent-color: var(--primary);
}

.review-order-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    flex-shrink: 0;
}

.review-order-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.review-order-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.88rem;
    color: var(--text-soft, #ddd);
    min-width: 0;
}

.review-order-meta strong {
    color: #fff;
    font-size: 0.95rem;
}

.review-order-number,
.review-order-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* 별점 위젯 (입력) */
.star-rating {
    display: flex;
    gap: 6px;
}

.star-rating .star {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.15s ease, transform 0.15s ease;
    font-family: inherit;
}

.star-rating .star:hover {
    transform: scale(1.1);
}

.star-rating .star.filled {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* 별점 표시 (읽기 전용) */
.review-stars-row {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
}

.star-display {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.15);
    line-height: 1;
}

.star-display.filled {
    color: var(--primary);
}

/* 리뷰 목록 그리드 */
.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.review-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.review-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.review-photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #0b0b0b;
    overflow: hidden;
}

.review-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.review-meta {
    padding: 1rem 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-author-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.review-author {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}

.review-pet {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.review-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.review-body-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.review-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 3rem 1rem;
}

/* 리뷰 사진 업로드 드랍존은 기본 .drop-zone 을 재사용하고 높이만 조정 */
#review-photo-drop {
    height: 200px;
}

/* ============================================
   My History — 24h 생성 이력 사이드바
   ============================================ */
.my-history {
    flex: 0 0 280px;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    padding-right: 6px;
}

.my-history .gallery-title {
    margin-bottom: 0.6rem;
}

.my-history-notice {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0 0 1rem;
    opacity: 0.8;
    letter-spacing: 0.2px;
}

.my-history-notice strong {
    color: var(--primary);
    font-weight: 600;
}

.my-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.my-history-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    margin-top: 1rem;
    opacity: 0.7;
}

.history-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.history-item:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.history-item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.3);
    display: block;
}

.history-item-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item-title {
    font-size: 0.85rem;
    color: #eee;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.history-item-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 1rem;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.history-item-delete:hover {
    background: rgba(220, 60, 60, 0.2);
    color: #ff6b6b;
}

.my-history-clear-btn {
    display: block;
    width: 100%;
    margin-bottom: 0.9rem;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid rgba(255, 107, 107, 0.35);
    border-radius: 8px;
    color: #ff9b9b;
    font-size: 0.78rem;
    font-family: inherit;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.my-history-clear-btn:hover {
    background: rgba(220, 60, 60, 0.18);
    border-color: rgba(255, 107, 107, 0.6);
    color: #ff6b6b;
}

.my-history-clear-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* ============================================
   이모지 팔레트 — 텍스트 입력 보조 UI.
   color emoji 는 font-size 에 따라 크기가 native 로 결정됨 → 버튼은 UX 기준(1.3rem)만 맞추고
   실제 캔버스 삽입 시엔 textContent 에 이모지 character 가 그대로 흘러가 글자 font-size 를 상속.
   ============================================ */
.emoji-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.emoji-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.emoji-btn:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.35);
}

.emoji-btn:active {
    transform: scale(0.92);
}

/* ============================================
   Cart — nav 뱃지 + drawer
   ============================================ */
.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 10px;
    background: var(--primary);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.cart-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: block;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100vh;       /* 구형 브라우저 fallback */
    height: 100dvh;      /* 모바일: 주소창·툴바 제외한 실제 보이는 높이 기준 —
                            100vh 면 드로어가 화면보다 커져 하단 결제하기 버튼이 잘림 */
    background: #141414;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    transform: translateX(0);
    transition: transform 0.3s ease;
    border-left: 1px solid rgba(212, 175, 55, 0.2);
}

.cart-drawer.hidden {
    transform: translateX(100%);
    pointer-events: none;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-header h2 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--primary);
    letter-spacing: 1px;
}

.cart-close {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.cart-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.cart-empty {
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-item-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
}

.cart-item-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cart-item-title {
    font-size: 0.95rem;
    color: #eee;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cart-item-price {
    font-size: 0.8rem;
    color: #ddd;
    margin-top: 2px;
}

.cart-item-price strong {
    color: var(--primary);
    font-weight: 700;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.cart-qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #eee;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.cart-qty-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--primary);
}

.cart-qty-val {
    min-width: 24px;
    text-align: center;
    color: #eee;
    font-weight: 500;
}

.cart-item-remove {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.cart-item-remove:hover {
    background: rgba(220, 60, 60, 0.2);
    color: #ff6b6b;
}

.cart-footer {
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cart-totals {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #eee;
    font-size: 0.9rem;
}

.cart-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cart-totals-row span:first-child {
    color: var(--text-muted);
}

.cart-totals-grand {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 1rem;
}

.cart-totals-grand span:first-child {
    color: #eee;
    font-weight: 600;
}

.cart-totals-grand strong {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
}

.cart-totals-qty {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-totals-qty strong {
    color: #ddd;
    font-weight: 600;
}

.cart-shipping-notice {
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 600;
}

.cart-shipping-free {
    background: rgba(76, 175, 80, 0.18);
    color: #6dd180;
    border: 1px solid rgba(76, 175, 80, 0.35);
}

.cart-shipping-progress {
    background: rgba(212, 175, 55, 0.12);
    color: var(--primary);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.cart-footer-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
    opacity: 0.7;
}

/* ============================================
   Cart 모드 전환 (list / checkout / success)
   각 모드는 drawer 안에서 헤더+본문+푸터 구조를 그대로 유지하기 위해
   세로 flex 로 펼침. .hidden 은 전역 display:none 우선순위로 가려짐.
   ============================================ */
.cart-mode {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cart-back {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.cart-back:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ─── 체크아웃 폼 ─────────────────────────────────────── */
.checkout-form {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.checkout-section h3 {
    font-size: 0.95rem;
    color: var(--primary);
    margin: 0 0 0.7rem;
    letter-spacing: 0.5px;
}

.checkout-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0.8rem;
}

.checkout-field span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.checkout-field span em {
    color: #f25c5c;
    font-style: normal;
    margin-left: 2px;
}

.checkout-field input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    color: #f0f0f0;
    font-size: 0.92rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.checkout-field input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.checkout-field input[readonly] {
    background: rgba(255, 255, 255, 0.03);
    color: #ccc;
}

.checkout-postal-row {
    display: flex;
    gap: 8px;
}

.checkout-postal-row input {
    flex: 1;
}

.checkout-postal-btn {
    background: rgba(212, 175, 55, 0.15);
    color: var(--primary);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    padding: 0 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.checkout-postal-btn:hover {
    background: rgba(212, 175, 55, 0.25);
}

.checkout-summary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    color: #ddd;
}

.checkout-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.checkout-line span:first-child {
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-line-total {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.checkout-line-total span:first-child {
    color: #eee;
    font-weight: 600;
}

.checkout-line-total strong {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
}

.checkout-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.85rem;
    color: #ddd;
    line-height: 1.45;
    cursor: pointer;
}

.checkout-consent input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkout-consent strong {
    color: var(--primary);
    font-weight: 600;
    margin-right: 4px;
}

.checkout-consent a {
    color: var(--primary);
    text-decoration: underline;
    margin-left: 6px;
    font-size: 0.78rem;
}

.checkout-error {
    background: rgba(242, 92, 92, 0.12);
    border: 1px solid rgba(242, 92, 92, 0.4);
    color: #ff8b8b;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.85rem;
    margin: 0;
}

#checkout-submit-btn {
    width: 100%;
}

#checkout-submit-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

/* ─── 결제 완료 화면 ─────────────────────────────────── */
.checkout-success {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    gap: 0.8rem;
}

.checkout-success-icon {
    font-size: 3.5rem;
    line-height: 1;
}

.checkout-success h3 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--primary);
}

.checkout-success-sub {
    font-size: 0.95rem;
    color: #ddd;
    margin: 0;
}

.checkout-success-sub strong {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.checkout-success-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
    line-height: 1.6;
}

.checkout-success .primary-btn {
    width: 100%;
}

/* ============================================
   Lightbox — 갤러리 이미지 확대 보기
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 1;
    transition: opacity 0.25s ease;
    cursor: zoom-out;
}

.lightbox.hidden {
    display: none;
    opacity: 0;
}

.lightbox-image {
    max-width: min(1200px, 100%);
    max-height: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* 실물 사진 라이트박스의 'product.html 실물 갤러리 더 보기' 버튼.
   확대 사진 위/아래는 세로 공간이 부족해서 오른쪽 세로 중앙에 배치. */
.lightbox-more {
    position: absolute;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    padding: 16px 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-more:hover {
    background: #fff;
    transform: translateY(-50%) translateX(2px);
}

/* 모바일/좁은 화면에선 오른쪽 배치가 사진과 겹치므로 사진 아래(하단 중앙)로 */
@media (max-width: 768px) {
    .lightbox-more {
        top: auto;
        bottom: 24px;
        right: 50%;
        transform: translateX(50%);
    }

    .lightbox-more:hover {
        transform: translateX(50%) translateY(-2px);
    }
}

/* =========================================
   Site Footer (홈/index.html 하단 사업자정보)
   ========================================= */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 1rem 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.7;
    text-align: center;
}

.footer-business {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 0.6rem;
    margin-bottom: 0.9rem;
}

.footer-business strong {
    color: var(--text-main);
    font-weight: 600;
}

.footer-sep {
    color: rgba(212, 175, 55, 0.35);
    user-select: none;
}

.footer-links {
    margin-bottom: 0.7rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.18s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-link--strong {
    color: var(--text-main);
    font-weight: 600;
}

.footer-copyright {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
}

/* =========================================
   Legal Pages (privacy.html, terms.html)
   별도 페이지: body.legal-body 가 활성화되면
   index.html 의 .container 중앙정렬을 무효화
   ========================================= */
body.legal-body {
    display: block;
    align-items: initial;
    justify-content: initial;
    padding: 2rem 1rem 4rem;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Pretendard', sans-serif;
    line-height: 1.7;
}

.legal-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.legal-header {
    text-align: center;
    padding: 1.5rem 1rem 2rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 2rem;
}

.legal-back {
    display: inline-block;
    margin-bottom: 1.2rem;
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.18s ease;
}

.legal-back:hover {
    color: var(--primary-hover);
}

.legal-header h1 {
    font-family: 'Noto Serif KR', serif;
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}

.legal-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.legal-article {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
}

.legal-intro {
    padding: 1rem 1.2rem;
    border-left: 3px solid var(--primary);
    background: rgba(212, 175, 55, 0.06);
    border-radius: 0 8px 8px 0;
    margin-bottom: 2rem;
    font-size: 0.92rem;
    line-height: 1.75;
}

.legal-section {
    margin-bottom: 2.5rem;
}

.legal-section h2 {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.18rem;
    color: var(--primary);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.legal-section h3 {
    font-size: 1rem;
    color: var(--text-main);
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.legal-section p {
    margin-bottom: 0.8rem;
}

.legal-list {
    margin: 0.5rem 0 1rem 1.4rem;
    color: rgba(255, 255, 255, 0.82);
}

.legal-list li {
    margin-bottom: 0.45rem;
}

.legal-list ul {
    margin-top: 0.4rem;
    margin-left: 1.2rem;
    list-style: circle;
}

.legal-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.6rem 0.9rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    margin-top: 0.6rem;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.88rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    overflow: hidden;
}

.legal-table th,
.legal-table td {
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(212, 175, 55, 0.12);
    text-align: left;
    vertical-align: top;
}

.legal-table thead th {
    background: rgba(212, 175, 55, 0.12);
    color: var(--primary);
    font-weight: 600;
}

.legal-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.legal-table--info th {
    width: 28%;
    background: rgba(212, 175, 55, 0.06);
    color: var(--primary);
    font-weight: 500;
    text-align: left;
}

.legal-contact-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin: 1rem 0;
}

.legal-contact-box p {
    margin-bottom: 0.5rem;
}

.legal-contact {
    margin-left: 0.5rem;
    list-style: none;
}

.legal-contact li {
    color: rgba(255, 255, 255, 0.85);
}

.legal-section a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-section a:hover {
    color: var(--primary-hover);
}

.legal-inline-link {
    font-size: 0.8rem;
    margin-left: 0.4rem;
}

/* =====================================================
   Profile page (/profile.html) — 내 정보
   ===================================================== */
.profile-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    font-size: 0.95rem;
}

.profile-dl {
    display: grid;
    grid-template-columns: minmax(120px, 30%) 1fr;
    gap: 0.6rem 1.2rem;
    margin: 1rem 0 0.5rem;
}

.profile-dl dt {
    color: var(--text-muted);
    font-size: 0.9rem;
    align-self: center;
}

.profile-dl dd {
    margin: 0;
    color: var(--text-main);
    font-size: 0.95rem;
    word-break: break-all;
}

.profile-note {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.profile-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.profile-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.profile-toggle input[type="checkbox"]:disabled {
    cursor: wait;
}

.profile-status {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-status-ok {
    color: #4ade80;
}

.profile-status-err {
    color: #ff7e7e;
}

.legal-section.legal-danger {
    border-top: 1px solid rgba(255, 100, 100, 0.2);
    margin-top: 2.5rem;
    padding-top: 1.5rem;
}

.legal-danger h2 {
    color: #ff7e7e !important;
}

.profile-delete-btn {
    margin-top: 1rem;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 100, 100, 0.4);
    background: rgba(255, 100, 100, 0.08);
    color: #ff7e7e;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.profile-delete-btn:hover:not(:disabled) {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.profile-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-delete-confirm {
    margin: 1rem 0 0.6rem;
    color: #ddd;
    font-size: 0.9rem;
}

.profile-delete-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.profile-delete-input:focus {
    outline: none;
    border-color: #ff7e7e;
}

.profile-delete-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.2rem;
}

.profile-delete-actions .secondary-btn,
.profile-delete-actions .profile-delete-btn {
    flex: 1;
    height: auto;
    padding: 12px 18px;
    margin: 0;
    font-size: 0.95rem;
}

/* ===== 내 주문 페이지 (dark theme — --text-main 흰색 톤) ===== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.order-card {
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 10px;
    padding: 1.25rem 1.4rem;
    background: rgba(20, 18, 14, 0.55);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    flex-wrap: wrap;
}

.order-card-number {
    font-size: 0.95rem;
    color: var(--text-main);
}

.order-card-number strong {
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--primary);
}

.order-card-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.order-card-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.order-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.badge-pending {
    background: rgba(212, 175, 55, 0.15);
    color: #e6c869;
    border-color: rgba(212, 175, 55, 0.4);
}

.badge-paid,
.badge-received {
    background: rgba(74, 175, 99, 0.15);
    color: #7dd498;
    border-color: rgba(74, 175, 99, 0.4);
}

.badge-printing {
    background: rgba(100, 130, 220, 0.15);
    color: #9fb3e8;
    border-color: rgba(100, 130, 220, 0.4);
}

.badge-shipped {
    background: rgba(80, 160, 220, 0.15);
    color: #8ec0e2;
    border-color: rgba(80, 160, 220, 0.4);
}

.badge-delivered {
    background: rgba(160, 110, 220, 0.15);
    color: #c4a3e8;
    border-color: rgba(160, 110, 220, 0.4);
}

.badge-failed,
.badge-cancelled {
    background: rgba(200, 90, 90, 0.15);
    color: #e29999;
    border-color: rgba(200, 90, 90, 0.4);
}

.order-card-items {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 0;
}

.order-empty-items {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.order-item-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.order-item-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.3);
}

.order-item-body {
    flex: 1;
    min-width: 0;
}

.order-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-item-spec {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.order-item-sep {
    color: rgba(255, 255, 255, 0.3);
}

.order-item-price {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    flex-shrink: 0;
}

.order-tracking {
    padding: 0.85rem 1rem;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 6px;
    margin-bottom: 0.9rem;
    font-size: 0.88rem;
}

.order-tracking-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.order-tracking-body {
    color: rgba(255, 255, 255, 0.78);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.order-tracking-sep {
    color: rgba(255, 255, 255, 0.3);
}

.order-tracking-number {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    color: var(--text-main);
}

.order-tracking-date {
    margin-left: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.order-card-footer {
    padding-top: 0.9rem;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}

.order-card-summary {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
}

.order-summary-label {
    color: rgba(255, 255, 255, 0.7);
}

.order-summary-value {
    color: var(--text-main);
    font-weight: 500;
}

.order-summary-total {
    margin-top: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(212, 175, 55, 0.2);
    align-items: baseline;
}

.order-card-total-label {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

.order-card-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.01em;
}

@media (max-width: 600px) {
    .order-card {
        padding: 1rem;
    }

    .order-item-thumb {
        width: 56px;
        height: 56px;
    }

    .order-item-price {
        font-size: 0.88rem;
    }
}

.legal-footer {
    margin-top: 2.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.legal-footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.4rem;
    transition: color 0.18s ease;
}

.legal-footer a:hover {
    color: var(--primary);
}

.legal-footer a strong {
    color: var(--text-main);
}

.legal-sep {
    color: rgba(212, 175, 55, 0.3);
}

@media (max-width: 720px) {
    .legal-container {
        padding: 1rem;
    }

    .legal-header h1 {
        font-size: 1.5rem;
    }

    .legal-table {
        font-size: 0.8rem;
    }

    .legal-table th,
    .legal-table td {
        padding: 0.5rem 0.6rem;
    }

    .legal-table--info th {
        width: 35%;
    }

    .footer-business {
        font-size: 0.72rem;
        gap: 0.3rem 0.45rem;
    }
}

/* ============================================================
   쿠키 동의 배너 (analytics.js 가 동의 결정 전에만 부착)
   - 옵트인: 동의 전엔 GA 미로드, 거부해도 서비스 정상 동작.
   - 모든 페이지(index/privacy/terms) 공통 — legal-body 도 적용.
   ============================================================ */
.consent-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(20, 20, 20, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    color: #f0f0f0;
    font-size: 0.9rem;
    line-height: 1.55;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

.consent-banner-text {
    flex: 1 1 320px;
    min-width: 260px;
}

.consent-banner-text a {
    color: #d4af37;
    text-decoration: underline;
}

.consent-banner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.consent-banner-btn {
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.consent-banner-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.consent-banner-btn--primary {
    background: #d4af37;
    border-color: #d4af37;
    color: #111;
    font-weight: 600;
}

.consent-banner-btn--primary:hover {
    background: #e2c256;
    border-color: #e2c256;
}

@media (max-width: 640px) {
    .consent-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }

    .consent-banner-actions {
        justify-content: stretch;
    }

    .consent-banner-btn {
        flex: 1 1 0;
    }
}

/* =====================================================================
   Login Modal — auth.js 가 토글
   ===================================================================== */
.login-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-modal.hidden {
    display: none;
}

.login-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.login-modal-panel {
    position: relative;
    background: #141414;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 14px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    color: #fff;
}

.login-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.2s;
}

.login-modal-close:hover {
    color: #fff;
}

.login-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 4px;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-modal-sub {
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    margin: 0 0 22px;
    font-family: 'Pretendard', 'Noto Serif KR', sans-serif;
}

.login-consents {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-family: 'Pretendard', sans-serif;
}

.login-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.88rem;
    color: #ddd;
    cursor: pointer;
}

.login-consent-row input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.login-consent-text {
    line-height: 1.4;
}

.login-consent-required {
    color: #ff7e7e;
    font-weight: 600;
    margin-right: 4px;
}

.login-consent-optional {
    color: #888;
    margin-right: 4px;
}

.login-consent-text a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.login-consent-text a:hover {
    color: var(--primary-hover);
}

.login-consent-error {
    color: #ff7e7e;
    font-size: 0.82rem;
    margin: 8px 0 0;
    text-align: center;
}

.login-consent-summary {
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-family: 'Pretendard', sans-serif;
    font-size: 0.86rem;
    color: #e8e8e8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-consent-summary.hidden {
    display: none;
}

.consent-summary-check {
    color: #4ade80;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
}

.consent-summary-text {
    flex: 1;
}

.consent-summary-edit {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
    padding: 0 2px;
}

.consent-summary-edit:hover {
    color: #fff;
}

.login-consent-error.hidden {
    display: none;
}

.login-oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.oauth-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 auto;
    cursor: pointer;
    line-height: 0;
    border-radius: 8px;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Kakao(4.07) / Google(4.38) PNG 비율이 살짝 달라서 두 버튼이 가시적으로
       같은 너비로 보이게 하려면 컨테이너 비율을 Kakao 에 맞춤 — Kakao 는 꽉 차고
       Google 은 거의 꽉 찬 상태에서 미세한 상하 letterbox 만 생김. */
    width: 100%;
    max-width: 240px;
    aspect-ratio: 366 / 90;
}

.oauth-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.oauth-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.oauth-btn:not(:disabled):active {
    transform: translateY(0);
}

.oauth-btn-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.login-modal-foot {
    text-align: center;
    color: #777;
    font-size: 0.78rem;
    margin: 0;
    font-family: 'Pretendard', sans-serif;
}

/* 이메일/비밀번호 로그인 — OAuth 아래에 추가된 옵션 */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 14px;
    color: #999;
    font-size: 0.75rem;
    font-family: 'Pretendard', sans-serif;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e5e5;
}

.login-email-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.login-email-input {
    padding: 11px 13px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: 'Pretendard', sans-serif;
    background: #fff;
    color: #222;
    transition: border-color 0.15s;
}
.login-email-input:focus {
    outline: none;
    border-color: #888;
}
.login-email-input.hidden {
    display: none;
}

.login-email-submit {
    margin-top: 4px;
    padding: 11px 14px;
    border: none;
    border-radius: 8px;
    background: #222;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Pretendard', sans-serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.login-email-submit:hover:not(:disabled) {
    background: #000;
}
.login-email-submit:active:not(:disabled) {
    transform: translateY(1px);
}
.login-email-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.login-email-info {
    margin: 6px 0 0;
    color: #2d6a4f;
    font-size: 0.82rem;
    line-height: 1.45;
    font-family: 'Pretendard', sans-serif;
    text-align: center;
}
.login-email-info.hidden {
    display: none;
}

.login-mode-toggle {
    text-align: center;
    color: #777;
    font-size: 0.82rem;
    margin: 0;
    font-family: 'Pretendard', sans-serif;
}
.login-mode-link {
    background: none;
    border: none;
    padding: 0 0 0 4px;
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Pretendard', sans-serif;
}
.login-mode-link:hover {
    text-decoration: underline;
}