/**
 * WoodMart first-paint stability contract.
 * Keep this file presentation-only: no product business logic lives here.
 */

/* WoodMart 8.x builds the single-product gallery as a Swiper carousel. Before
 * Swiper attaches, every slide may briefly take part in normal flow and create
 * the multi-image flash seen on first load. Keep only the LCP/first slide in
 * flow until the carousel reports itself initialized. Older Owl builds are
 * covered by the owl-loaded guard as well. */
.single-product .woocommerce-product-gallery__wrapper.wd-carousel:not(.swiper-initialized):not(.owl-loaded) {
    display: block !important;
    overflow: hidden !important;
}

.single-product .woocommerce-product-gallery__wrapper.wd-carousel:not(.swiper-initialized):not(.owl-loaded) > .wd-carousel-item:not(:first-child),
.single-product .woocommerce-product-gallery__wrapper.wd-carousel:not(.swiper-initialized):not(.owl-loaded) > :not(:first-child) {
    display: none !important;
}

.single-product .woocommerce-product-gallery__wrapper.wd-carousel:not(.swiper-initialized):not(.owl-loaded) > .wd-carousel-item:first-child,
.single-product .woocommerce-product-gallery__wrapper.wd-carousel:not(.swiper-initialized):not(.owl-loaded) > :first-child {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Give the two main product columns a deterministic top alignment. Content
 * Control can then place its purchase panel opposite the gallery without JS. */
@media (min-width: 992px) {
    .single-product .product-image-summary-inner > .woocommerce-product-gallery,
    .single-product .product-image-summary-inner > .summary.entry-summary {
        align-self: flex-start;
    }
}
