/* gallery-style.css */
:root {
    --bg-dark: #0f1014;
    --bg-surface: #1a1b22;
    --bg-glass: rgba(26, 27, 34, 0.4);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #9badb9;
    --accent: #ff6b35;
    /* 음식사진.com 시그니처 오렌지 */
    --accent-hover: #ff8c5a;

    --transition-smooth: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

section {
    padding: 6rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* =========================================
   Stage 1: Masterpiece Slider
========================================= */
.masterpiece-stage {
    padding-top: 8rem;
    padding-bottom: 4rem;
    text-align: center;
}

.slider-container {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 3rem;
    overflow: hidden;
}

.slider-track {
    display: flex;
    gap: 24px;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.slider-track:hover {
    animation-play-state: paused;
}

.slide-item {
    position: relative;
    width: 600px;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background-color: #222;
    /* Placeholder */
}

/* 이미지 보호 공통 클래스 */
.protected-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    /* 드래그 금지 */
    user-select: none;
    display: block;
}

.anti-capture-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: transparent;
    cursor: default;
}

/* 무한 스크롤 애니메이션 */
@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-600px * 15 - 24px * 15));
    }

    /* 15개 슬라이드 기준 너비 이동 */
}

/* =========================================
   Stage 2: Interactive Pricing Module
========================================= */
.pricing-stage {
    text-align: center;
}

.pricing-module-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 3rem;
    margin-top: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 3rem;
    align-items: center;
}

/* 카테고리 선택 (좌측) */
.category-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cat-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
}

.cat-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.cat-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* 메인 뷰어 (중앙) */
.pricing-viewer {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.viewer-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* 크로스페이드 트리거 클래스 */
.viewer-image.fade-out {
    opacity: 0.2;
}

.micro-cta {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    z-index: 20;
    transition: var(--transition-smooth);
    transform: translateY(10px);
    opacity: 0;
}

.pricing-viewer:hover .micro-cta {
    transform: translateY(0);
    opacity: 1;
}

.micro-cta:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* 테어 선택 (우측) */
.tier-selector {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tier-option {
    position: relative;
    border: 2px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
}

.tier-option input[type="radio"] {
    display: none;
}

.tier-option label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tier-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tier-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.tier-option.active {
    border-color: var(--accent);
    background: rgba(255, 107, 53, 0.05);
    /* accent color with low opacity */
}

/* 모바일 텍스트 영역 (기본 숨김) */
.mobile-tier-info {
    display: none;
    text-align: center;
    margin-top: 1rem;
    grid-column: 1 / -1;
}

#tier-description-mobile {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* =========================================
   Stage 3: On-Demand Grid
========================================= */
.ondemand-stage {
    text-align: center;
    padding-bottom: 2rem;
}

.filter-controls {
    margin: 2rem 0;
}

#tier-filter {
    background: var(--bg-surface);
    color: white;
    border: 1px solid var(--border-glass);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    min-width: 250px;
}

.grid-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 2rem;
}

.grid-item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 12px;
    overflow: hidden;
    background: #222;
}

.grid-item .protected-img {
    transition: transform 0.6s ease;
}

.grid-item:hover .protected-img {
    transform: scale(1.03);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    pointer-events: none;
    /* Let clicks pass through to outer link if any */
}

.grid-item:hover .grid-overlay {
    opacity: 1;
}

.grid-overlay .badge {
    align-self: flex-start;
    background: rgba(255, 107, 53, 0.95);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
}

/* =========================================
   Stage 4: Final CTA
========================================= */
.final-cta-stage {
    text-align: center;
    padding-top: 2rem;
}

.cta-content {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(26, 27, 34, 0.5) 100%);
    border: 1px solid var(--border-glass);
    padding: 4rem 2rem;
    border-radius: 20px;
}

.cta-content h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.primary-cta-btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    text-decoration: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 20px rgba(255, 107, 53, 0.3);
}

.primary-cta-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(255, 107, 53, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .pricing-module-container {
        /* 원뷰(One-View)를 위해 불필요한 공백을 줄이고 단일 컬럼으로 변경 */
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 1.5rem;
    }

    /* 1. 카테고리 칩핑 (Segment Bar) */
    .category-selector {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
        gap: 0.5rem;
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        /* Firefox */
    }

    .category-selector::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari and Opera */
    }

    .cat-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
        border-radius: 20px;
        /* 알약 형태 */
        border: 1px solid var(--border-glass);
        background: var(--bg-surface);
    }

    .cat-btn.active {
        background: var(--text-primary);
        color: var(--bg-dark);
        border-color: var(--text-primary);
    }

    /* 2. 메인 뷰어 확장 */
    .pricing-viewer {
        max-width: 100%;
        margin: 0;
        border-radius: 12px;
    }

    /* 3. 티어 선택기(알약 스위치 화) */
    .tier-selector {
        flex-direction: row;
        background: rgba(0, 0, 0, 0.3);
        border: 1px solid var(--border-glass);
        border-radius: 12px;
        padding: 0.3rem;
        gap: 0;
    }

    .tier-option {
        flex: 1;
        padding: 0.8rem 0;
        border: none;
        border-radius: 8px;
        text-align: center;
        background: transparent;
    }

    .tier-option label {
        justify-content: center;
        align-items: center;
    }

    /* 모바일에서는 각 버튼 안에 있는 설명(Desc)을 완전히 숨김 */
    .tier-option .tier-desc {
        display: none;
    }

    .tier-name {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-secondary);
    }

    /* 액티브 시 알약 백그라운드 */
    .tier-option.active {
        background: var(--bg-surface);
        border: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .tier-option.active .tier-name {
        color: var(--accent);
    }

    /* 동적 하단 텍스트 노출 */
    .mobile-tier-info {
        display: block;
    }
}