.woocommerce-product-gallery,
.woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery .flex-viewport,
.woocommerce-product-gallery .woocommerce-product-gallery__image,
.woocommerce div.product div.images,
.product-images,
.woodmart-product-gallery,
.woodmart-product-gallery .wd-carousel-inner,
.wd-gallery-images,
.wd-product-images,
.product-image-summary .woocommerce-product-gallery {
    position: relative !important;
}

/* Keep the buttons as an overlay on the product image, not below it. */
.wc3dpv-buttons {
    position: absolute !important;
    right: 18px !important;
    bottom: 18px !important;
    z-index: 10000 !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    pointer-events: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wc3dpv-icon-button {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;
    max-width: 54px !important;
    max-height: 54px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.18) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 9px !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.wc3dpv-icon-button img {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    display: block !important;
}

.wc3dpv-modal {display: none; position: fixed; inset: 0; z-index: 999999;}
.wc3dpv-modal.is-active {display: block;}
.wc3dpv-overlay {position: absolute; inset: 0; background: rgba(0,0,0,.72);}
.wc3dpv-dialog {position: relative; width: min(92vw, 1100px); height: min(82vh, 760px); margin: 6vh auto 0; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 16px 60px rgba(0,0,0,.35);}
.wc3dpv-close {position: absolute; top: 12px; right: 14px; z-index: 5; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(0,0,0,.78); color: #fff; font-size: 28px; line-height: 40px; cursor: pointer;}
.wc3dpv-viewer {display: block; width: 100%; height: 100%; min-height: 420px; background: #f8f8f8;}
.wc3dpv-loading {display:flex; align-items:center; justify-content:center; width:100%; height:100%; font-size:18px; color:#333;}
.wc3dpv-error {position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); max-width:80%; text-align:center; color:#333; font-size:16px; background:#fff; padding:16px 20px; border:1px solid #ddd; border-radius:8px;}
body.wc3dpv-lock {overflow: hidden;}
.wc3dpv-ar-help {position:absolute; left:50%; bottom:22px; transform:translateX(-50%); max-width:90%; text-align:center; color:#333; font-size:14px; background:#fff; padding:12px 16px; border:1px solid #ddd; border-radius:8px; box-shadow:0 4px 18px rgba(0,0,0,.12);}

@media (max-width: 640px) {
    .wc3dpv-buttons {right: 12px !important; bottom: 12px !important; gap: 8px !important;}
    .wc3dpv-icon-button {width: 48px !important; height: 48px !important; min-width:48px !important; min-height:48px !important; max-width:48px !important; max-height:48px !important;}
    .wc3dpv-icon-button img {width:30px !important; height:30px !important;}
    .wc3dpv-dialog {width:94vw; height:78vh; margin-top:10vh;}
}
