/* Product image lightbox — optimized for product detail gallery */
.product-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.product-gallery-modal.is-open {
    display: flex;
}

.product-gallery-modal__inner {
    position: relative;
    width: 100%;
    max-width: 1120px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-gallery-modal__toolbar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: #fff;
    flex-shrink: 0;
}

.product-gallery-modal__counter {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.product-gallery-modal__close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.product-gallery-modal__close:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: scale(1.05);
}

.product-gallery-modal__stage {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.product-gallery-modal__image {
    max-width: 100%;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    transition: opacity 0.2s ease;
}

.product-gallery-modal__image.is-loading {
    opacity: 0.45;
}

.product-gallery-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.product-gallery-modal__nav:hover {
    background: rgba(0, 0, 0, 0.78);
    transform: translateY(-50%) scale(1.06);
}

.product-gallery-modal__nav--prev {
    left: 12px;
}

.product-gallery-modal__nav--next {
    right: 12px;
}

.product-gallery-modal__thumbs {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-shrink: 0;
}

.product-gallery-modal__thumb {
    width: 64px;
    height: 64px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.72;
    flex-shrink: 0;
    transition: border-color 0.2s ease, opacity 0.2s ease;
    background: #fff;
}

.product-gallery-modal__thumb:hover,
.product-gallery-modal__thumb.is-active {
    border-color: #2196f3;
    opacity: 1;
}

.product-gallery-modal__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-img .slide-img .img-item {
    cursor: zoom-in;
}

@media (max-width: 768px) {
    .product-gallery-modal {
        padding: 12px;
    }

    .product-gallery-modal__nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .product-gallery-modal__nav--prev {
        left: 4px;
    }

    .product-gallery-modal__nav--next {
        right: 4px;
    }

    .product-gallery-modal__image {
        max-height: calc(100vh - 170px);
    }

    .product-gallery-modal__thumb {
        width: 52px;
        height: 52px;
    }
}
