
function product_slide(n) {
    // Перевірка, чи є n числом і цілим
    if (!Number.isInteger(n)) {
        console.error("Невірне значення параметра n.");
        return;
    }
    // Перевірка, чи значення n в межах допустимого діапазону 1-4
    if (n < 1 || n > 4) { 
        console.error("Невірне значення параметра n.");
        return;
    }
    // Далі продовжуємо виконання функції
    let slides = document.querySelectorAll('.big');       
    for (let i = 0; i < slides.length; i++) {
        slides[i].classList.remove('big-active');
    }
    const index = n - 1;
    if (slides[index]) {
        slides[index].classList.add('big-active');
    }
}

function product_summary() {
    const summary  = document.getElementById('summary');
    const specifi  = document.getElementById('specifi');
    const tab1     = document.getElementById('tablinks_1');
    const tab2     = document.getElementById('tablinks_2');

    if (!summary || !specifi || !tab1 || !tab2) return;

    summary.style.display = 'block';
    specifi.style.display = 'none';
    tab1.style.backgroundColor = '#ccc';
    tab2.style.backgroundColor = '#f1f1f1';
}

function product_specifi() {
    const summary  = document.getElementById('summary');
    const specifi  = document.getElementById('specifi');
    const tab1     = document.getElementById('tablinks_1');
    const tab2     = document.getElementById('tablinks_2');

    if (!summary || !specifi || !tab1 || !tab2) return;

    summary.style.display = 'none';
    specifi.style.display = 'block';
    tab1.style.backgroundColor = '#f1f1f1';
    tab2.style.backgroundColor = '#ccc';
}

product_summary();
