/*---------- Product Information Tabs ----------*/

var productTabs = document.querySelector('.product-info .product-info-tabs'); // Tabs container

// Handle tab clicks
productTabs.addEventListener('click', function (e) {

    // Check if a non-active tab button was clicked
    if (e.target.classList.contains('info-btn') && !e.target.classList.contains('active')) {

        var target = e.target.getAttribute('data-target'); // Get target content selector

        // Update active tab button
        productTabs.querySelector('.active').classList.remove('active');
        e.target.classList.add('active');

        var productSection = document.querySelector('.product-info'); // Product info container

        // Update active content section
        productSection.querySelector('.product-info-gallery.active').classList.remove('active');
        productSection.querySelector(target).classList.add('active');
    }

});
