/* ============================================================
   공용 이미지 라이트박스 (Swiper 기반 · 줌/슬라이드/썸네일)
   - 쇼핑몰 상세(detail_style.css)의 .lb-* 스타일을 공용으로 추출
   - 사용: image_lightbox.js + Swiper(전역), openImageLightbox() 호출
   ============================================================ */
.lb-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;   /* 100vw 는 세로 스크롤바 폭까지 세어 오른쪽이 잘린다 */
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
    user-select: none;
    overflow: hidden;
}

.lb-header-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-sizing: border-box;
    z-index: 30;
}

.lb-counter-badge {
    font-size: 0.85rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.15);
    color: var(--c-white, #ffffff);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    letter-spacing: 0.5px;
}

/* 상단 줌 & 원본보기 툴바 컨트롤 그룹 */
.lb-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 10px;
    border-radius: 30px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lb-tool-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--c-white, #ffffff);
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}
.lb-tool-btn:hover {
    background: var(--c-accent, #ea580c);
    color: var(--c-white, #ffffff);
    transform: scale(1.08);
}

.lb-zoom-badge {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--c-bg, #f8fafc);
    padding: 4px 10px;
    min-width: 48px;
    text-align: center;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lb-zoom-badge:hover {
    background: rgba(234, 88, 12, 0.85);
}

.lb-close-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--c-white, #ffffff);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}
.lb-close-btn:hover {
    background: var(--c-accent, #ea580c);
    color: var(--c-white, #ffffff);
    transform: scale(1.05);
}

.lb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--c-white, #ffffff);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    outline: none;
}
.lb-nav-btn.prev { left: 20px; }
.lb-nav-btn.next { right: 20px; }
.lb-nav-btn:hover {
    background: var(--c-accent, #ea580c);
    color: var(--c-white, #ffffff);
    transform: translateY(-50%) scale(1.08);
}
.lb-nav-btn.swiper-button-disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
}

/* 키보드 포커스 표시(접근성) — outline:none 으로 사라진 초점 위치를 복원 */
.lb-tool-btn:focus-visible,
.lb-zoom-badge:focus-visible,
.lb-close-btn:focus-visible,
.lb-nav-btn:focus-visible {
    outline: 2px solid var(--c-white, #ffffff);
    outline-offset: 2px;
}

/* 메인 Swiper 래퍼 */
.lb-main-swiper-container {
    width: 100%;   /* 위와 같은 까닭 */
    height: calc(100vh - 150px);
    margin-top: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lb-main-swiper {
    width: 100%;
    height: 100%;
}
.lb-main-slide {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}
.lb-main-slide img {
    max-width: 90vw;
    max-height: 72vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.2s ease-out;
    transform-origin: center center;
    will-change: transform;
}
.lb-main-slide img.zoomed {
    cursor: grab;
    transition: none !important;
}
.lb-main-slide img.zoomed:active {
    cursor: grabbing;
}

/* 하단 섬네일 아이콘 바 */
.lb-thumbs-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: rgba(15, 23, 42, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    box-sizing: border-box;
    z-index: 30;
}
.lb-thumbs-swiper {
    width: 100%;
    max-width: 900px;
    height: 70px;
}
.lb-thumb-slide {
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
    background: var(--c-ink, #0f172a);
    box-sizing: border-box;
}
.lb-thumb-slide:hover {
    opacity: 0.9;
    border-color: rgba(255, 255, 255, 0.6);
}
.lb-thumb-slide.swiper-slide-thumb-active,
.lb-thumb-slide.active {
    opacity: 1;
    border-color: var(--c-accent, #ea580c) !important;
    box-shadow: 0 0 12px rgba(234, 88, 12, 0.6);
    transform: scale(1.05);
}
.lb-thumb-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .lb-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .lb-nav-btn.prev { left: 10px; }
    .lb-nav-btn.next { right: 10px; }
    .lb-main-swiper-container {
        height: calc(100vh - 130px);
    }
    .lb-main-slide img {
        max-width: 95vw;
        max-height: 68vh;
    }
    .lb-thumbs-bar {
        height: 70px;
        padding: 6px 12px;
    }
    .lb-thumbs-swiper {
        height: 52px;
    }
    .lb-thumb-slide {
        width: 48px !important;
        height: 48px !important;
    }
}
