.product-gallery-main {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #eeeae3;
    cursor: zoom-in;
    overflow: hidden;
}

.product-gallery-main img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.product-gallery-count {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 7px 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .62);
    font-size: 12px;
}

.product-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.product-gallery-thumbs.single { display: none; }

.product-gallery-thumb {
    padding: 0;
    border: 2px solid transparent;
    background: #eeeae3;
    cursor: pointer;
    opacity: 1;
}

.product-gallery-thumb.active {
    border-color: #8c7b65;
    opacity: 1;
}

.product-gallery-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.product-lightbox[hidden] { display: none !important; }
.product-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    align-items: center;
    padding: 34px;
    background: rgba(250, 249, 247, .99);
}

.product-lightbox figure {
    margin: 0;
    min-width: 0;
    text-align: center;
}

.product-lightbox figure img {
    display: block;
    max-width: min(1080px, 100%);
    max-height: calc(100vh - 100px);
    margin: auto;
    object-fit: contain;
    filter: none;
    opacity: 1;
    box-shadow: 0 18px 55px rgba(0, 0, 0, .16);
}

.product-lightbox figcaption {
    margin-top: 12px;
    color: #222;
    font-size: 13px;
}

.product-lightbox-close,
.product-lightbox-nav {
    border: 0;
    color: #222;
    background: rgba(0, 0, 0, .08);
    cursor: pointer;
}

.product-lightbox-close {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 30px;
}

.product-lightbox-nav {
    width: 52px;
    height: 72px;
    border-radius: 6px;
    font-size: 48px;
    line-height: 1;
}

.product-lightbox-nav.next { justify-self: end; }
.gallery-modal-open { overflow: hidden; }

@media (max-width: 700px) {
    .product-gallery-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .product-lightbox { grid-template-columns: 44px minmax(0, 1fr) 44px; padding: 18px 8px; }
    .product-lightbox-nav { width: 40px; height: 58px; font-size: 38px; }
    .product-lightbox figure img { max-height: calc(100vh - 80px); }
}
