.afl-external-product-image,
.afl-external-cart-image {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.afl-external-gallery {
    position: relative;
}

.afl-external-gallery__wrapper {
    margin: 0;
}

.afl-external-gallery__main {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
}

.afl-external-gallery__main a {
    display: block;
    cursor: zoom-in;
}

.afl-external-gallery-main-img {
    width: 100%;
    max-height: 720px;
    object-fit: contain;
    margin: 0 auto;
}

.afl-external-gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.afl-external-gallery__thumb {
    appearance: none;
    border: 1px solid rgba(0,0,0,.12);
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    overflow: hidden;
    min-height: 72px;
}

.afl-external-gallery__thumb.is-active {
    border-color: currentColor;
    box-shadow: 0 0 0 1px currentColor;
}

.afl-external-gallery__thumb-img {
    width: 100%;
    height: 72px;
    object-fit: contain;
    display: block;
}

.woocommerce ul.products li.product .afl-external-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.afl-external-cart-image {
    width: 64px;
    max-height: 64px;
}

.afl-external-lightbox-open,
.afl-external-lightbox-open body {
    overflow: hidden;
}

.afl-external-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 72px;
    background: rgba(0,0,0,.86);
}

.afl-external-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
}

.afl-external-lightbox__close,
.afl-external-lightbox__nav {
    position: fixed;
    z-index: 1000000;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: #111;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.afl-external-lightbox__close {
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    font-size: 34px;
}

.afl-external-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 64px;
    font-size: 44px;
}

.afl-external-lightbox__nav--prev {
    left: 16px;
}

.afl-external-lightbox__nav--next {
    right: 16px;
}

@media (max-width: 640px) {
    .afl-external-lightbox {
        padding: 56px 12px;
    }

    .afl-external-lightbox__nav {
        width: 40px;
        height: 54px;
        font-size: 36px;
    }
}
