/* ============================================
   商品詳細モーダルの画像表示
   ============================================ */
.modal-main-image {
    width: 100%;
    height: 500px;
    background: #000000;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-in;
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-main-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.modal-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.modal-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    background: #000000;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-thumbnail:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.modal-thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.2);
}

.modal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   画像ライトボックス
   ============================================ */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-lightbox.active {
    opacity: 1;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #000000;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: #ffffff;
    transform: rotate(90deg);
}

/* ============================================
   レスポンシブ対応
   ============================================ */
@media (max-width: 768px) {
    .modal-main-image {
        height: 300px;
        padding: 1rem;
    }
    
    .modal-thumbnail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
}
