/* Hide default WooCommerce gallery completely */
.woocommerce-product-gallery { display: none !important; }

/* Custom gallery styles */
.rg-layout-wrapper { display: block; }
.rg-gallery-wrapper { margin-bottom: 2em; opacity: 0; animation: rg-fade-in 0.5s forwards; }
@keyframes rg-fade-in { to { opacity: 1; } }
.rg-gallery-container { position: relative; width: 100%; }
.rg-gallery-main-wrapper { position: relative; }
.rg-gallery-main-view { 
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch; scrollbar-width: none; 
    aspect-ratio: var(--aspect-ratio, 4 / 3); border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); border: 1px solid #eee; 
}
.rg-gallery-main-view::-webkit-scrollbar { display: none; }
.rg-gallery-slide { flex: 0 0 100%; scroll-snap-align: start; }
.rg-gallery-main-image { width: 100%; height: 100%; object-fit: contain; display: block; }
.rg-gallery-nav { 
    position: absolute; top: 50%; transform: translateY(-50%); 
    background: rgba(255,255,255,0.9); border: 1px solid #ddd; 
    border-radius: 50%; width: 40px; height: 40px; font-size: 20px; 
    cursor: pointer; display: flex; align-items: center; 
    justify-content: center; transition: all 0.2s ease; z-index: 10; 
}
.rg-gallery-nav:hover { background-color: #fff; transform: translateY(-50%) scale(1.1); }
.rg-gallery-prev { left: 10px; }
.rg-gallery-next { right: 10px; }
.rg-gallery-thumbnails { 
    display: flex; gap: 10px; justify-content: center; 
    flex-wrap: wrap; margin-top: 15px; 
}
.rg-gallery-thumbnail { 
    width: 80px; aspect-ratio: 4/3; border: 2px solid transparent; 
    border-radius: 6px; cursor: pointer; overflow: hidden; 
    transition: all 0.2s ease; 
}
.rg-gallery-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.rg-gallery-thumbnail:hover { border-color: #ccc; }
.rg-gallery-thumbnail.active { 
    border-color: var(--ast-global-color-0, #0073e6); 
    box-shadow: 0 0 8px rgba(0,115,230,0.5); 
}

/* Desktop layout */
@media (min-width: 769px) {
    .single-product div.product .rg-layout-wrapper { 
        display: flex; gap: 4%; align-items: flex-start; 
    }
    .single-product div.product .rg-gallery-wrapper { 
        width: 43%; flex: 0 0 43%; 
    }
    .single-product div.product .rg-layout-wrapper > .summary { 
        width: 53%; flex: 0 0 53%; margin-top: 0 !important; 
    }
    .rg-gallery-thumbnail {
        width: 96px; /* Approx 20% larger */
    }
}
