.mdlc-variation-gallery-stage {
    width: 100%;
    margin: 0 0 14px;
    text-align: center;
}

.mdlc-variation-gallery-stage[hidden] {
    display: none !important;
}

.mdlc-variation-gallery-stage-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 420px;
    background: #fff;
    cursor: default;
}

.mdlc-variation-gallery-stage-image {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 620px;
    object-fit: contain;
}

.mdlc-variation-gallery-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 14px;
}

/* MDLC owns the visual gallery only while a valid variation is selected.
   Hide Blocksy/WooCommerce's parent-product viewport and thumbnail rails so
   the customer sees only the selected variation images. */
.woocommerce-product-gallery.mdlc-variation-gallery-active > .woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery.mdlc-variation-gallery-active > .flexy-container,
.woocommerce-product-gallery.mdlc-variation-gallery-active > .ct-product-gallery-container,
.woocommerce-product-gallery.mdlc-variation-gallery-active .flex-control-nav.flex-control-thumbs,
.woocommerce-product-gallery.mdlc-variation-gallery-active .woocommerce-product-gallery__thumbnails,
.woocommerce-product-gallery.mdlc-variation-gallery-active .ct-product-gallery-thumbnails,
.woocommerce-product-gallery.mdlc-variation-gallery-active .flexy-pills {
    display: none !important;
}

.mdlc-variation-gallery-thumb {
    width: 96px;
    height: 96px;
    padding: 4px;
    border: 1px solid #d7d7d7;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.mdlc-variation-gallery-thumb.is-active,
.mdlc-variation-gallery-thumb:hover,
.mdlc-variation-gallery-thumb:focus-visible {
    border-color: currentColor;
    box-shadow: 0 0 0 1px currentColor;
}

.mdlc-variation-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 767px) {
    .mdlc-variation-gallery-stage-link { min-height: 300px; }
    .mdlc-variation-gallery-strip { gap: 8px; margin-top: 12px; }
    .mdlc-variation-gallery-thumb { width: 76px; height: 76px; }
}

/* Navigation arrows for the MDLC variation gallery. */
.mdlc-variation-gallery-stage-link {
    position: relative;
}

.mdlc-variation-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.mdlc-variation-gallery-nav:hover,
.mdlc-variation-gallery-nav:focus-visible {
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .14);
}

.mdlc-variation-gallery-prev { left: 16px; }
.mdlc-variation-gallery-next { right: 16px; }

@media (max-width: 767px) {
    .mdlc-variation-gallery-nav {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
    .mdlc-variation-gallery-prev { left: 8px; }
    .mdlc-variation-gallery-next { right: 8px; }
}
