.acf-product-gallery {
    max-width: 600px;
    min-width: 0;
    margin: auto;
}

.acf-product-gallery .main-slider {
    width: 100%;
    aspect-ratio: 1 / 0.86;
    overflow: hidden;
    margin-bottom: 10px;
    border-radius: 8px;
    background: #f8f8f8;
}

.acf-product-gallery .main-slider .swiper-wrapper {
    height: 100%;
}

.acf-product-gallery .main-slider .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.acf-product-gallery .main-slider img {
    display: block;
    width: auto;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

.acf-product-gallery .thumbs-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.acf-product-gallery .thumbs-slider {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.acf-product-gallery .thumbs-slider .swiper-slide {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.acf-product-gallery .thumbs-slider img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.acf-product-gallery .swiper-slide-thumb-active img {
    border-color: #c60f24;
}

.acf-product-gallery .thumbs-prev,
.acf-product-gallery .thumbs-next {
    flex-shrink: 0;
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    border: 0;
    background: transparent;
    color: #333;
}

.acf-product-gallery .thumbs-prev:hover,
.acf-product-gallery .thumbs-next:hover {
    color: #c60f24;
}

/* Reserve gallery space before Swiper initializes. */
.acf-product-gallery {
    width: 100%;
    max-width: 600px;
    min-width: 0;
}

.acf-product-gallery .main-slider {
    aspect-ratio: 1 / 0.86;
}

.acf-product-gallery .thumbs-wrapper {
    min-height: 80px;
}

.acf-product-gallery .thumbs-slider {
    height: 80px;
    min-width: 0;
}

/* Match slidesPerView: 5 and spaceBetween: 10. */
.acf-product-gallery .thumbs-slider .swiper-slide {
    width: calc((100% - 40px) / 5);
    flex-shrink: 0;
}

.acf-product-gallery .thumbs-slider img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}