.product-gallery-modern {
    width: 100%;
    max-width: 700px;
    margin: 2rem auto;
    border-radius: 22px;
    position: relative;
}

.pg-main {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #edf2f7;
    transition: border-color 0.3s ease;
}

.pg-main:hover {
    border-color: #6b46c1;
}

.pg-slide {
    position: absolute;
    top: 0; right: 0; left: 0; bottom: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.pg-slide img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    padding: 2px;
    object-fit: contain;
    transition: transform 0.3s;
}

.pg-slide img:hover {
    transform: scale(1.04);
}

.pg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(107,70,193,0.09);
    border: none;
    border-radius: 50%;
    color: #6b46c1;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.pg-nav:hover {
    background: #6b46c1;
    color: #fff;
}

.pg-prev { right: 18px; }
.pg-next { left: 18px; }

.pg-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 1.2rem;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.pg-thumb {
    flex: 0 0 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #f7f6fd;
}

.pg-thumb.active {
    opacity: 1;
    border-color: #6b46c1;
    box-shadow: 0 2px 8px rgba(107,70,193,0.08);
}

.pg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.pg-lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.pg-lightbox.active {
    display: flex;
}

.pg-lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(107,70,193,0.18);
    background: #fff;
}

.pg-lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    color: #6b46c1;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(107,70,193,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.pg-lightbox-close:hover {
    background: #6b46c1;
    color: #fff;
}

@media (max-width: 900px) {
    .product-gallery-modern { max-width: 98vw; }
    .pg-main { height: 400px; }
    .pg-slide img { max-height: 380px; }
    .pg-thumb, .pg-thumb img { height: 55px; flex-basis: 55px; }
}

@media (max-width: 600px) {
    .product-gallery-modern { 
        padding: 0.5rem 0.2rem; 
    }
    .pg-main { 
        height: 300px;
        border-radius: 20px;
    }
    .pg-slide img { 
        max-height: 280px;
        border-radius: 6px;
    }
    .pg-thumb {
        height: 65px;
        flex-basis: 65px;
    }
    .pg-thumb img {
        height: 100%;
        flex-basis: 100%;
    }
    .pg-lightbox-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 1.3rem; }
}
