/* 상품 상세 페이지 전용 */

.product-image-gallery {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
}

/* 황금비 φ ≈ 1.618 — 좌(메인) : 우(보조열) = φ : 1 (약 61.8% : 38.2%) */
.image-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr);
    /* 우측 열 상·하 = 1 : φ (위쪽이 더 작고 아래가 더 길게) */
    grid-template-rows: minmax(0, 1fr) minmax(0, 1.618fr);
    gap: 10px;
    width: 100%;
    min-height: 320px;
    height: clamp(340px, 38vw, 540px);
}

.image-grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    min-height: 0;
}

.image-grid-item:first-child {
    grid-row: span 2;
    grid-column: 1;
}

.image-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-grid-item:hover img {
    transform: scale(1.05);
}

.view-all-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: white;
    color: #1e293b;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.view-all-btn:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .view-all-btn {
    background: #1e293b;
    color: white;
    border-color: #334155;
}

.dark .view-all-btn:hover {
    background: #334155;
}

/* 전체보기 모달 */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    padding: 20px;
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
}

.gallery-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: white;
    color: #1e293b;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    z-index: 10;
}

.gallery-modal-close:hover {
    background: #f1f5f9;
}

@media (max-width: 768px) {
    .image-grid {
        /* 모바일: 세로 스택 (황금비 2열은 좁아서 어색함) */
        grid-template-columns: 1fr;
        grid-template-rows: minmax(200px, 52vw) minmax(140px, 36vw) minmax(140px, 36vw);
        height: auto;
        min-height: 0;
        gap: 6px;
    }

    .image-grid-item:first-child {
        grid-row: auto;
    }

    .view-all-btn {
        padding: 8px 16px;
        font-size: 12px;
        bottom: 12px;
        right: 12px;
    }
}

.product-tab-content {
    display: none;
}

.product-tab-content.active {
    display: block;
}

.product-tab-btn {
    position: relative;
    padding: 16px 24px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}

.product-tab-btn.active {
    color: #007ACC;
    border-bottom-color: #007ACC;
}

.sticky-booking {
    position: sticky;
    top: 80px;
    align-self: flex-start;
}

.sticky-tab-menu {
    position: sticky;
    top: 64px;
    z-index: 40;
    background: white;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.dark .sticky-tab-menu {
    background: #111827;
}

.sticky-tab-menu > div {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sticky-tab-menu > div::-webkit-scrollbar {
    display: none;
}

@media (max-width: 1024px) {
    .sticky-booking {
        position: relative;
        top: 0;
    }

    .sticky-tab-menu {
        top: 64px;
    }
}

.review-star {
    color: #f59e0b;
}

.tag-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

.dark .tag-badge {
    background: #1e293b;
    color: #94a3b8;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #007ACC;
}

.dark .info-icon {
    background: #1e293b;
}

.price-strike {
    text-decoration: line-through;
    color: #94a3b8;
}

.gallery-swiper .swiper-slide {
    width: 100% !important;
}

/* 이미지 1~2장일 때 그리드 단순화 */
.image-grid.image-grid--1 {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 52vh);
    min-height: 260px;
    height: auto;
}

.image-grid.image-grid--1 .image-grid-item:first-child {
    grid-row: 1;
    grid-column: 1;
}

.image-grid.image-grid--2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(220px, 42vh);
    min-height: 220px;
    height: auto;
}

.image-grid.image-grid--2 .image-grid-item:first-child {
    grid-row: 1;
    grid-column: 1;
}

.image-grid.image-grid--2 .image-grid-item:nth-child(2) {
    grid-row: 1;
    grid-column: 2;
}

.product-guide-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.65;
}

/* API에서 내려오는 HTML 본문 (guides 등) */
.prose-product-html img,
.product-guide-body img {
    max-width: 100%;
    height: auto;
}

.prose-product-html table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
}
