/* =============================================================================
   商品画像ライトボックス - モダンフローティングUI
   ============================================================================= */

/* オーバーレイ（全画面暗幕） */
.lb-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: background 0.3s ease;
    padding: 0;
    margin: 0;
}

.lb-overlay.is-active {
    display: flex;
    background: rgba(0, 0, 0, 0.85);
}

/* フェードアニメーション */
.lb-overlay .lb-content {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lb-overlay.is-visible .lb-content {
    opacity: 1;
    transform: scale(1);
}

/* コンテンツラッパー */
.lb-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 720px;
    width: 90vw;
}

/* 閉じるボタン（画像右上） */
.lb-close {
    position: absolute;
    top: -18px;
    right: -18px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    z-index: 100001;
    background: rgba(40, 40, 40, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.25s ease, transform 0.2s ease;
}

.lb-close:hover {
    background: rgba(60, 60, 60, 0.95);
    transform: scale(1.08);
}

/* 画像コンテナ */
.lb-image-wrap {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: pinch-zoom;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.lb-image-wrap img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    transition: opacity 0.2s ease;
}

.lb-image-wrap img.lb-loading {
    opacity: 0.4;
}

/* 前後ナビ */
.lb-prev,
.lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    background: rgba(40, 40, 40, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    user-select: none;
    transition: background 0.25s ease, transform 0.2s ease;
}

.lb-prev:hover,
.lb-next:hover {
    background: rgba(60, 60, 60, 0.9);
    transform: translateY(-50%) scale(1.08);
}

.lb-prev {
    left: -56px;
}

.lb-next {
    right: -56px;
}

/* カウンター */
.lb-counter {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    margin-top: 16px;
    text-align: center;
}

/* body スクロール無効化 */
body.lb-no-scroll {
    overflow: hidden;
}

/* --- レスポンシブ --- */

@media (max-width: 768px) {
    .lb-content {
        max-width: 92vw;
        width: 92vw;
    }

    .lb-prev { left: -48px; }
    .lb-next { right: -48px; }

    .lb-prev,
    .lb-next {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .lb-close {
        top: -16px;
        right: -10px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 580px) {
    .lb-content {
        max-width: 96vw;
        width: 96vw;
    }

    /* ナビを画像内に重ねる */
    .lb-prev {
        left: 8px;
    }

    .lb-next {
        right: 8px;
    }

    .lb-prev,
    .lb-next {
        width: 36px;
        height: 36px;
        font-size: 13px;
        background: rgba(0, 0, 0, 0.5);
    }

    .lb-close {
        top: -14px;
        right: -4px;
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .lb-image-wrap {
        border-radius: 8px;
    }

    .lb-image-wrap img {
        max-height: 60vh;
    }
}

/* メイン画像にカーソルで拡大アイコン */
.ec-sliderItemRole .slide-item {
    cursor: zoom-in;
}
