.vton-overlay-wrapper {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 90;
}

/* Adjust position when sale badge exists */
.sale .vton-overlay-wrapper {
    top: 45px !important; /* Adjust based on your theme's sale badge height */
}

/* Adjust position when Wishlist exists */
.yith-wcwl-add-to-wishlist + .vton-overlay-wrapper,
.tinvwl-above_thumb-add-to-cart + .vton-overlay-wrapper {
    top: 45px !important;
}

/* If both sale and wishlist exist */
.sale .yith-wcwl-add-to-wishlist + .vton-overlay-wrapper,
.sale .tinvwl-above_thumb-add-to-cart + .vton-overlay-wrapper {
    top: 80px !important;
}

.vton-button {
    background: #fff;
    border: none;
    box-sizing: content-box;
    border-radius: 100%;
    cursor: pointer;
    font-size: 2em;
    height: 36px;
    padding: 0;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.vton-button:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.vton-button svg {
    width: 24px;
    height: 24px;
    stroke: #333;
}

.vton-button svg text {
    fill: #333;
    stroke: none;
}

.vton-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 8px;
}

.vton-button:hover .vton-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vton-modal {
    display: none;
    position: fixed;
    z-index: 9999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
}

.vton-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #fff;
}

.vton-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    z-index: 1;
}

.vton-close {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 9999;
    color: #000;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.5);
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

.vton-close:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Cart button styles */
.vton-cart-wrapper {
    margin-top: 15px;
    width: 100%;
    clear: both;
}

.vton-cart-button {
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.8em !important;
    padding: 15px !important;
    line-height: 1.4 !important;
}

.vton-cart-button svg {
    width: 36px;
    height: 36px;
    stroke: currentColor;
}

.vton-cart-button svg text {
    font-family: Arial, sans-serif;
    font-weight: bold;
    stroke: none;
}

/* Fix for FlexSlider */
.woocommerce-product-gallery .flex-viewport {
    overflow: visible !important;
}

/* Ensure overlay is above gallery controls */
.woocommerce-product-gallery__wrapper {
    position: relative !important;
}

/* Match the existing icon's z-index */
.woocommerce-product-gallery__trigger {
    z-index: 99999;
}

/* Ensure our button doesn't interfere with the existing icon */
.woocommerce-product-gallery__trigger + .vton-overlay-wrapper {
    margin-right: 10px;
}
