/* Hide the floating reCAPTCHA v3 icon */
.grecaptcha-badge { 
    visibility: hidden !important; 
}

/* 1. Flex wrapper for the entire gallery layout */
.woocommerce-product-gallery__wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    margin: 0 -2px !important; 
    opacity: 1 !important; 
    height: auto !important;
    max-height: none !important;
}

/* 2. Main product image wrapper (Full Width) */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:first-child {
    width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 2px !important;
    margin-bottom: 4px !important; 
    position: relative !important; 
    left: auto !important;
    top: auto !important;
    transform: none !important; 
    display: block !important;
    height: auto !important; 
}

/* 3. Gallery thumbnails wrapper (4 Columns) */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:not(:first-child) {
    width: 25% !important;      
    max-width: 25% !important;  
    flex: 0 0 25% !important;   
    padding: 2px !important;    
    box-sizing: border-box !important;
    margin: 0 !important;       
    position: relative !important; 
    left: auto !important;
    top: auto !important;
    transform: none !important; 
    opacity: 1 !important;
    display: block !important;
    height: auto !important;
}

/* 4. ALL image anchor links (Main + Thumbnails): Enforce 1:1 Square Bounding Box */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image a {
    display: block !important;
    width: 100% !important;
    position: relative !important; 
    aspect-ratio: 1 / 1 !important; /* Forces BOTH main image & thumbnails into a 1:1 square */
    overflow: hidden !important; 
    transform: none !important;
}

/* 5. ALL inner images: Scale and crop cleanly inside the square */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; 
    object-position: center !important;
    max-height: none !important;
    margin: 0 !important;
    display: block !important;
    position: relative !important; 
    transform: none !important;
}