<?php
require_once 'includes/header.php';

// Dohvatanje featured kategorija
$featured_categories = get_rows("
    SELECT c.*, 
    (SELECT COUNT(*) FROM product_categories pc JOIN products p ON pc.product_id = p.id WHERE pc.category_id = c.id AND p.status = 'active') as product_count,
    (SELECT image FROM product_images pi JOIN products p ON pi.product_id = p.id JOIN product_categories pc ON p.id = pc.product_id 
     WHERE pc.category_id = c.id AND p.status = 'active' ORDER BY pi.sort_order ASC LIMIT 1) as image
    FROM categories c
    WHERE c.parent_id IS NULL
    ORDER BY c.name ASC
    LIMIT 4
");

// Dohvatanje featured proizvoda
$featured_products = get_rows("
    SELECT p.*, 
    (SELECT image FROM product_images pi WHERE pi.product_id = p.id ORDER BY pi.sort_order ASC LIMIT 1) as image,
    (SELECT name FROM categories c JOIN product_categories pc ON c.id = pc.category_id WHERE pc.product_id = p.id LIMIT 1) as category_name
    FROM products p
    WHERE p.status = 'active'
    ORDER BY p.id DESC
    LIMIT 8
");

// Dohvatanje proizvoda na akciji
$sale_products = get_rows("
    SELECT p.*, 
    (SELECT image FROM product_images pi WHERE pi.product_id = p.id ORDER BY pi.sort_order ASC LIMIT 1) as image,
    (SELECT name FROM categories c JOIN product_categories pc ON c.id = pc.category_id WHERE pc.product_id = p.id LIMIT 1) as category_name
    FROM products p
    WHERE p.status = 'active' AND p.sale_price IS NOT NULL AND p.sale_price > 0
    ORDER BY (p.price - p.sale_price) / p.price DESC
    LIMIT 6
");

// Dohvatanje svedočenja korisnika (recenzije)
$testimonials = get_rows("
    SELECT r.*, p.name as product_name, p.slug as product_slug
    FROM reviews r
    JOIN products p ON r.product_id = p.id
    WHERE r.status = 'approved' AND r.rating >= 4
    ORDER BY r.created_at DESC
    LIMIT 3
");

// Dohvatanje najpopularnijih proizvoda
$popular_products = get_rows("
    SELECT p.*, 
    (SELECT image FROM product_images pi WHERE pi.product_id = p.id ORDER BY pi.sort_order ASC LIMIT 1) as image,
    (SELECT name FROM categories c JOIN product_categories pc ON c.id = pc.category_id WHERE pc.product_id = p.id LIMIT 1) as category_name
    FROM products p
    WHERE p.status = 'active'
    ORDER BY p.rating_count DESC, p.rating_sum DESC
    LIMIT 4
");
?>

<!-- SEO strukturirani podaci -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "name": "Hugong Aparati - Profesionalni aparati za zavarivanje",
  "url": "https://hugong-aparati.rs/",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://hugong-aparati.rs/search?q={search_term_string}",
    "query-input": "required name=search_term_string"
  },
  "description": "Hugong aparati za zavarivanje - originalni inverterski aparati sa garancijom. Najpovoljnije cene i besplatna isporuka za celu Srbiju."
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Hugong Aparati",
  "url": "https://hugong-aparati.rs",
  "logo": "https://hugong-aparati.rs/uploads/hugong-logo.png",
  "contactPoint": {
    "@type": "ContactPoint",
    "telephone": "+381658065065",
    "contactType": "customer service",
    "availableLanguage": "Serbian"
  },
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "Oškara Davičа 2",
    "addressLocality": "Kragujevac",
    "postalCode": "34000",
    "addressCountry": "RS"
  }
}
</script>

<!-- Hero Section -->
<section class="hero-section">
    <div class="hero-slider">
        <div class="hero-slide active" style="background-image: url('/assets/images/hero-bg-1.jpg')">
            <div class="hero-content">
                <div class="hero-badge">Originalni proizvodi</div>
                <h1 class="hero-title">HUGONG aparati za zavarivanje</h1>
                <p class="hero-subtitle">Dokazan kvalitet po pristupačnim cenama.</p>
                <div class="hero-buttons">
                    <a href="/aparati-za-varenje.php" class="btn-primary">Pogledaj sve aparate</a>
                    <!--<a href="tel:+381658065065" class="btn-outline">Pozovi nas</a>-->
                </div>
                <div class="hero-benefits">
                    <div class="hero-benefit">
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
                            <polyline points="22 4 12 14.01 9 11.01"></polyline>
                        </svg>
                        <span>Garancija 25 meseci</span>
                    </div>
                    <div class="hero-benefit">
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <rect x="1" y="3" width="15" height="13"></rect>
                            <polygon points="16 8 20 8 23 11 23 16 16 16 16 8"></polygon>
                            <circle cx="5.5" cy="18.5" r="2.5"></circle>
                            <circle cx="18.5" cy="18.5" r="2.5"></circle>
                        </svg>
                        <span>Besplatna isporuka</span>
                    </div>
                </div>
            </div>
        </div>
        <!--<div class="hero-slide" style="background-image: url('/assets/images/hero-bg-2.jpg')">-->
        <!--    <div class="hero-content">-->
        <!--        <div class="hero-badge">IGBT tehnologija</div>-->
        <!--        <h1 class="hero-title">Profesionalni aparati za zavarivanje</h1>-->
        <!--        <p class="hero-subtitle">Ušteda energije, pouzdanost i trajnost u svim uslovima rada</p>-->
        <!--        <div class="hero-buttons">-->
        <!--            <a href="/o-hugong-brendu" class="btn-primary">O Hugong brendu</a>-->
        <!--            <a href="/kontakt" class="btn-outline">Kontaktirajte nas</a>-->
        <!--        </div>-->
        <!--        <div class="hero-benefits">-->
        <!--            <div class="hero-benefit">-->
        <!--                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">-->
        <!--                    <path d="M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path>-->
        <!--                </svg>-->
        <!--                <span>Garantovano najniža cena</span>-->
        <!--            </div>-->
        <!--            <div class="hero-benefit">-->
        <!--                <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">-->
        <!--                    <path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path>-->
        <!--                </svg>-->
        <!--                <span>Servis i rezervni delovi</span>-->
        <!--            </div>-->
        <!--        </div>-->
        <!--    </div>-->
        <!--</div>-->
        <!--<div class="hero-controls">-->
        <!--    <button class="hero-prev" aria-label="Prethodni slide">-->
        <!--        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">-->
        <!--            <polyline points="15 18 9 12 15 6"></polyline>-->
        <!--        </svg>-->
        <!--    </button>-->
        <!--    <div class="hero-dots">-->
        <!--        <span class="dot active" data-slide="0"></span>-->
        <!--        <span class="dot" data-slide="1"></span>-->
        <!--    </div>-->
        <!--    <button class="hero-next" aria-label="Sledeći slide">-->
        <!--        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">-->
        <!--            <polyline points="9 18 15 12 9 6"></polyline>-->
        <!--        </svg>-->
        <!--    </button>-->
        <!--</div>-->
    </div>
</section>

<!-- Advantages Section -->
<section class="advantages-section">
    <div class="container">
        <div class="advantages-grid">
            <div class="advantage-item">
                <div class="advantage-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
                        <polyline points="22 4 12 14.01 9 11.01"></polyline>
                    </svg>
                </div>
                <div class="advantage-content">
                    <h3>Garancija kvaliteta</h3>
                    <p>25 meseci garancije na sve Hugong aparate</p>
                </div>
            </div>
            <div class="advantage-item">
                <div class="advantage-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <rect x="1" y="3" width="15" height="13"></rect>
                        <polygon points="16 8 20 8 23 11 23 16 16 16 16 8"></polygon>
                        <circle cx="5.5" cy="18.5" r="2.5"></circle>
                        <circle cx="18.5" cy="18.5" r="2.5"></circle>
                    </svg>
                </div>
                <div class="advantage-content">
                    <h3>Brza isporuka</h3>
                    <p>Besplatna isporuka za sve porudžbine u Srbiji</p>
                </div>
            </div>
            <div class="advantage-item">
                <div class="advantage-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path>
                    </svg>
                </div>
                <div class="advantage-content">
                    <h3>Najniže cene</h3>
                    <p>Garantovano najpovoljnije cene uz Price Match garanciju</p>
                </div>
            </div>
            <div class="advantage-item">
                <div class="advantage-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>
                    </svg>
                </div>
                <div class="advantage-content">
                    <h3>Stručna podrška</h3>
                    <p>Tehnička podrška i servis na teritoriji Srbije</p>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Price Match Banner -->
<section class="price-match-banner">
    <div class="container">
        <div class="price-match-content">
            <div class="price-match-icon">
                <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <path d="M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path>
                </svg>
            </div>
            <div class="price-match-text">
                <h3>Price Match Garancija!</h3>
                <p>Našli ste Hugong aparate po nižoj ceni? Mi ćemo ponuditi još povoljniju i plus dodatni bonus!</p>
            </div>
            <a href="#" class="price-match-link" data-toggle="modal" data-target="#priceMatchModal">Saznaj više</a>
        </div>
    </div>
</section>


<!-- Featured Categories -->
<section id="featured-categories" class="categories-section">
    <div class="container">
        <div class="section-header">
            <h2 class="section-title">Kategorije aparata za zavarivanje</h2>
            <p class="section-subtitle">Pronađite idealno rešenje za vaše zavarivačke potrebe</p>
        </div>
<div class="categories-grid">
    <?php foreach($featured_categories as $category): ?>
    <div class="category-card">
        <div class="category-image">
            <?php if (!empty($category['image'])): ?>
            <img src="<?php echo UPLOADS_URL . '/products/' . $category['image']; ?>" alt="<?php echo $category['name']; ?>" loading="lazy">
            <?php else: ?>
            <img src="/assets/images/no-image.jpg" alt="<?php echo $category['name']; ?>" loading="lazy">
            <?php endif; ?>
        </div>
        
        <div class="category-info">
            <h3 class="category-name"><?php echo $category['name']; ?></h3>
            <div class="category-count">
                <?php 
                // Safely display product count - fixes the undefined index error
                echo isset($category['product_count']) ? $category['product_count'] : 0; 
                ?> proizvoda
            </div>
            
            <a href="/<?php echo $category['slug']; ?>" class="category-button">
                POGLEDAJ SVE
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <polyline points="9 18 15 12 9 6"></polyline>
                </svg>
            </a>
        </div>
    </div>
    <?php endforeach; ?>
</div>
    </div>
</section>



<!-- Promotional Banner -->
<section class="promo-banner">
    <div class="container">
        <div class="promo-content">
            <div class="promo-text">
                <h2 class="promo-title">Hugong - Aparati za zavarivanje sa najboljim odnosom cene i kvaliteta</h2>
                <p class="promo-description">Više od 35 godina iskustva u proizvodnji inverterskih aparata sa IGBT tehnologijom</p>
                <ul class="promo-features">
                    <li>
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <polyline points="20 6 9 17 4 12"></polyline>
                        </svg>
                        <span>Ušteda energije do 30%</span>
                    </li>
                    <li>
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <polyline points="20 6 9 17 4 12"></polyline>
                        </svg>
                        <span>Stabilniji luk i kvalitetniji varovi</span>
                    </li>
                    <li>
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <polyline points="20 6 9 17 4 12"></polyline>
                        </svg>
                        <span>Multifunkcionalni aparati (MIG/MAG, REL, TIG)</span>
                    </li>
                </ul>
                <a href="/o-nama.php" class="btn-primary">Saznaj više o Hugong brendu</a>
            </div>
            <div class="promo-image">
                <img src="/assets/images/hugong-promo.jpg" alt="Hugong aparati za zavarivanje" loading="lazy">
            </div>
        </div>
    </div>
</section>

<!-- Sale Products Carousel -->
<?php if (!empty($sale_products)): ?>
<section class="sale-products-section">
    <div class="container">
        <div class="section-header">
            <h2 class="section-title">Najprodavaniji modeli</h2>
            <p class="section-subtitle">Pogledajte najprodavanije modele Hugong aparata</p>
        </div>
        
        <div class="recommended-products-container">
            <div class="scroll-hint left">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <polyline points="15 18 9 12 15 6"></polyline>
                </svg>
            </div>
            
            <div class="recommended-products-wrapper">
                <div class="recommended-products-scroll">
                    <?php foreach($sale_products as $sale_product): 
                        $discount_percent = round((($sale_product['price'] - $sale_product['sale_price']) / $sale_product['price']) * 100);
                    ?>
                    <div class="product-card sale-card">
                        <div class="product-discount">-<?php echo $discount_percent; ?>%</div>
                        <a href="/<?php echo $sale_product['slug']; ?>" class="card-link-overlay"></a>
                        
                        <div class="product-image">
                            <?php if (!empty($sale_product['image'])): ?>
                            <img src="<?php echo UPLOADS_URL . '/products/' . $sale_product['image']; ?>" alt="<?php echo $sale_product['name']; ?>" loading="lazy">
                            <?php else: ?>
                            <img src="/assets/images/no-image.jpg" alt="<?php echo $sale_product['name']; ?>" loading="lazy">
                            <?php endif; ?>
                        </div>
                        
                        <div class="product-details">
                            <div class="product-category"><?php echo $sale_product['category_name']; ?></div>
                            <h3 class="product-name"><?php echo $sale_product['name']; ?></h3>
                            
                            <div class="product-price sale-price">
                                <span class="price-old"><?php echo number_format($sale_product['price'], 0, ',', '.'); ?> RSD</span>
                                <span class="price-current"><?php echo number_format($sale_product['sale_price'], 0, ',', '.'); ?> RSD</span>
                            </div>
                            
                            <span class="btn-view">VIDI VIŠE <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <polyline points="9 18 15 12 9 6"></polyline>
                            </svg></span>
                        </div>
                    </div>
                    <?php endforeach; ?>
                </div>
            </div>
            
            <div class="scroll-hint right active">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <polyline points="9 18 15 12 9 6"></polyline>
                </svg>
            </div>
        </div>
        
        <div class="section-footer">
            <a href="/akcijski-modeli" class="btn-secondary">Pogledaj sve akcijske modele</a>
        </div>
    </div>
</section>
<?php endif; ?>

<!-- Features Grid -->
<section class="features-section">
    <div class="container">
        <div class="section-header">
            <h2 class="section-title">Zašto izabrati Hugong aparate?</h2>
            <p class="section-subtitle">Profesionalna oprema za zavarivanje po pristupačnim cenama</p>
        </div>
        
        <div class="features-grid">
            <div class="feature-item">
                <div class="feature-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M22 12h-4l-3 9L9 3l-3 9H2"></path>
                    </svg>
                </div>
                <div class="feature-content">
                    <h3>Napredna IGBT tehnologija</h3>
                    <p>Ušteda energije do 30% uz bolje performanse, stabilniji luk i kvalitetnije varove.</p>
                </div>
            </div>
            
            <div class="feature-item">
                <div class="feature-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>
                    </svg>
                </div>
                <div class="feature-content">
                    <h3>Kvalitet potvrđen u praksi</h3>
                    <p>35+ godina iskustva u proizvodnji i više hiljada zadovoljnih korisnika širom sveta.</p>
                </div>
            </div>
            
            <div class="feature-item">
                <div class="feature-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <polyline points="20 6 9 17 4 12"></polyline>
                    </svg>
                </div>
                <div class="feature-content">
                    <h3>Multifunkcionalni aparati</h3>
                    <p>Kombinovani MIG/MAG, REL i TIG aparati za sve vrste zavarivačkih poslova.</p>
                </div>
            </div>
            
            <div class="feature-item">
                <div class="feature-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path>
                    </svg>
                </div>
                <div class="feature-content">
                    <h3>Servisna podrška</h3>
                    <p>Kompletna tehnička podrška, servis i zagarantovani rezervni delovi u narednih 7 godina.</p>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Testimonials Section -->
<?php if(!empty($testimonials)): ?>
<section class="testimonials-section">
    <div class="container">
        <div class="section-header">
            <h2 class="section-title">Iskustva naših kupaca</h2>
            <p class="section-subtitle">Šta korisnici kažu o Hugong aparatima za zavarivanje</p>
        </div>
        
        <div class="testimonials-slider">
            <?php foreach($testimonials as $index => $testimonial): ?>
            <div class="testimonial-slide <?php echo $index === 0 ? 'active' : ''; ?>">
                <div class="testimonial-content">
                    <div class="testimonial-rating">
                        <?php for ($i = 1; $i <= 5; $i++): ?>
                            <span class="star <?php echo $i <= $testimonial['rating'] ? 'filled' : ''; ?>">★</span>
                        <?php endfor; ?>
                    </div>
                    <blockquote class="testimonial-text">"<?php echo htmlspecialchars($testimonial['comment']); ?>"</blockquote>
                    <div class="testimonial-footer">
                        <div class="testimonial-author">
                            <div class="author-name"><?php echo htmlspecialchars($testimonial['name']); ?></div>
                            <div class="author-product"><?php echo $testimonial['product_name']; ?></div>
                        </div>
                        <a href="/<?php echo $testimonial['product_slug']; ?>" class="testimonial-link">
                            <span>Vidi proizvod</span>
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <polyline points="9 18 15 12 9 6"></polyline>
                            </svg>
                        </a>
                    </div>
                </div>
            </div>
            <?php endforeach; ?>
        </div>
        
        <div class="testimonials-controls">
            <button class="testimonial-prev" aria-label="Prethodno iskustvo">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <polyline points="15 18 9 12 15 6"></polyline>
                </svg>
            </button>
            <div class="testimonial-dots">
                <?php foreach($testimonials as $index => $testimonial): ?>
                <span class="dot <?php echo $index === 0 ? 'active' : ''; ?>" data-slide="<?php echo $index; ?>"></span>
                <?php endforeach; ?>
            </div>
            <button class="testimonial-next" aria-label="Sledeće iskustvo">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <polyline points="9 18 15 12 9 6"></polyline>
                </svg>
            </button>
        </div>
    </div>
</section>
<?php endif; ?>

<!-- Brand Info Section -->
<section class="brand-section">
    <div class="container">
        <div class="brand-content">
            <div class="brand-logo">
                <img src="/uploads/hugong-logo.png" alt="Hugong logo - profesionalni aparati za zavarivanje" loading="lazy">
            </div>
            <div class="brand-info">
                <h2>Kvalitet koji govori sam za sebe</h2>
                <p>Hugong je vodeći svetski proizvođač aparata za zavarivanje, osnovan 1983. godine. Sa više od 35 godina iskustva, kompanija je razvila reputaciju pouzdanog proizvođača koji se specijalizovao za proizvodnju inverterskih aparata koristeći najnoviju IGBT tehnologiju.</p>
                <p>Hugong aparati omogućavaju poboljšane performanse, energetsku efikasnost i dugotrajnost, nudeći profesionalna rešenja po pristupačnim cenama.</p>
                <a href="/o-nama.php" class="btn-primary">Više o nama</a>
            </div>
        </div>
    </div>
</section>


<!-- Newsletter Section - Improved Desktop Design -->
<section class="newsletter-section">
    <div class="container">
        <div class="newsletter-card">
            <div class="newsletter-left">
                <h2>Budite u toku sa najnovijim ponudama</h2>
                
                <ul class="newsletter-features">
                    <li>
                        <span class="check-icon">
                            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#f6cc00" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
                                <polyline points="22 4 12 14.01 9 11.01"></polyline>
                            </svg>
                        </span>
                        <span>Ekskluzivni popusti samo za pretplatnike</span>
                    </li>
                    <li>
                        <span class="check-icon">
                            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#f6cc00" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
                                <polyline points="22 4 12 14.01 9 11.01"></polyline>
                            </svg>
                        </span>
                        <span>Najnoviji modeli i tehnologije</span>
                    </li>
                    <li>
                        <span class="check-icon">
                            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#f6cc00" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
                                <polyline points="22 4 12 14.01 9 11.01"></polyline>
                            </svg>
                        </span>
                        <span>Saveti za odabir idealnog aparata</span>
                    </li>
                </ul>
            </div>
            
            <div class="newsletter-right">
                <div class="signup-content">
                    <p class="signup-text">Prijavite se na našu mailing listu i prvi saznajte za akcije i nove modele aparata za zavarivanje</p>
                    
                    <form class="signup-form" action="/subscribe.php" method="post">
                        <div class="form-group">
                            <input type="email" name="email" placeholder="Vaša email adresa" required>
                            <button type="submit" class="signup-button">Prijavi me</button>
                        </div>
                        <p class="privacy-note">Vaš email nikada nećemo deliti sa trećim licima. Možete se odjaviti u bilo kom trenutku.</p>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Contact CTA Section -->
<section class="contact-cta-section">
    <div class="container">
        <div class="contact-cta-container">
            <div class="contact-cta-content">
                <div class="cta-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <circle cx="12" cy="12" r="10"></circle>
                        <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
                        <line x1="12" y1="17" x2="12.01" y2="17"></line>
                    </svg>
                </div>
                <div class="cta-text">
                    <h2>Imate pitanja o Hugong aparatima?</h2>
                    <p>Naš stručni tim je tu da vam pomogne u odabiru idealnog aparata za vaše potrebe</p>
                </div>
            </div>
            <div class="contact-cta-buttons">
                <a href="tel:+381658065065" class="phone-button">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>
                    </svg>
                    <span>Pozovite nas</span>
                </a>
                <a href="/kontakt" class="contact-button">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path>
                        <polyline points="22,6 12,13 2,6"></polyline>
                    </svg>
                    <span>Pišite nam mejl</span>
                </a>
            </div>
        </div>
    </div>
</section>


<div class="modal fade price-match-modal" id="priceMatchModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Price Match Garancija</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <p class="price-match-intro">Pronašli ste Hugong aparate po nižoj ceni? Mi ćemo ponuditi još povoljniju cenu!</p>
                
                <div class="price-match-steps">
                    <h6>Kako funkcioniše Price Match?</h6>
                    <ul>
                        <li>Pronađite isti model kod konkurencije po nižoj ceni</li>
                        <li>Pošaljite nam dokaz (link, fotografiju, predračun)</li>
                        <li>Mi ćemo vam ponuditi još bolju cenu</li>
                    </ul>
                </div>

                <div class="price-match-actions">
                    <a href="tel:+381658065065" class="btn btn-primary">Pozovite nas</a>
                    <a href="mailto:info@hugong-aparati.rs" class="btn btn-secondary">Pišite nam</a>
                </div>
            </div>
        </div>
    </div>
</div>


<style>
/* Enhanced Homepage Styles for index.php */
:root {
    --primary: #f6cc00;
    --primary-light: #fff8e1;
    --primary-dark: #e6b900;
    --secondary: #333333;
    --text: #333333;
    --text-light: #757575;
    --border: #e0e0e0;
    --success: #4CAF50;
    --success-light: #e8f5e9;
    --danger: #f44336;
    --danger-light: #ffebee;
    --background: #f8f8f8;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --radius: 8px;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 600px;
    overflow: hidden;
    margin-bottom: 60px;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.hero-slide.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 8%;
    transform: translateY(-50%);
    max-width: 550px;
    color: white;
    margin-top: -50px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--primary);
    color: var(--secondary);
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.hero-title {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
    color:white;
}

.hero-subtitle {
    font-size: 18px;
    margin-bottom: 25px;
    opacity: 0.9;
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: var(--primary);
    color: var(--secondary);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 8px;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: var(--secondary);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: transparent;
    color: white;
    border: 2px solid white;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 8px;
}

.btn-outline:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: white;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: white;
    color: var(--secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 8px;
}

.btn-secondary:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.hero-benefits {
    display: flex;
    gap: 20px;
}

.hero-benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.hero-benefit svg {
    color: var(--primary);
}

.hero-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 2;
}

.hero-prev, .hero-next {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.2);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-prev:hover, .hero-next:hover {
    background-color: var(--primary);
    color: var(--secondary);
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: var(--primary);
}

/* Advantages Section */
.advantages-section {
    padding: 0 0 60px;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.advantage-item {
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px 20px;
    transition: all 0.3s ease;
    height: 100%;
}

.advantage-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.advantage-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.advantage-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--secondary);
}

.advantage-content p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background-color: var(--primary);
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

.section-footer {
    text-align: center;
    margin-top: 40px;
}

/* Categories Section */
.categories-section {
    padding: 60px 0;
    background-color: var(--background);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.category-card {
    position: relative;
    background-color: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.category-image {
    height: 200px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.05);
}

.category-content {
    padding: 20px;
    background-color: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 5px;
}

.category-count {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.category-link {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.category-card:hover .category-link {
    gap: 8px;
}

.category-link svg {
    transition: transform 0.3s ease;
}

.category-card:hover .category-link svg {
    transform: translateX(3px);
}

/* Price Match Banner */
.price-match-banner {
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
    padding: 40px 0;
    margin-bottom: 60px;
    border-top: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.price-match-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.price-match-icon {
    width: 70px;
    height: 70px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.price-match-text {
    max-width: 500px;
}

.price-match-text h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}

.price-match-text p {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.5;
}

.price-match-link {
    padding: 12px 24px;
    background-color: var(--primary);
    color: var(--secondary);
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.price-match-link:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Featured Products Section */
.featured-products-section {
    padding: 60px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.product-card {
    background-color: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-discount, .product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
}

.product-discount {
    background-color: var(--danger);
    color: white;
}

.product-badge.popular {
    background-color: var(--primary);
    color: var(--secondary);
}

.card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.product-image {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: var(--background);
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-details {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    margin-bottom: 15px;
    margin-top: auto;
}

.price-wrapper {
    display: flex;
    flex-direction: column;
}

.price-current {
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
}

.price-old {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: line-through;
}

.sale-price {
    display: flex;
    flex-direction: column;
}

.btn-view {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    background-color: var(--primary);
    color: var(--secondary);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    gap: 5px;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.product-card:hover .btn-view {
    background-color: var(--primary-dark);
}

.product-card:hover .btn-view svg {
    transform: translateX(3px);
}

.btn-view svg {
    transition: transform 0.3s ease;
}

/* Promotional Banner */
.promo-banner {
    padding: 60px 0;
    background-color: var(--background);
    margin-bottom: 60px;
}

.promo-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.promo-text {
    max-width: 500px;
}

.promo-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 15px;
    line-height: 1.2;
}

.promo-description {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
}

.promo-features {
    list-style: none;
    padding: 0;
    margin: 0 0 25px;
}

.promo-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 16px;
    color: var(--secondary);
}

.promo-features li svg {
    color: var(--success);
    margin-top: 4px;
    flex-shrink: 0;
}

.promo-image {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.promo-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Sale Products Section */
.sale-products-section {
    padding: 60px 0;
    background-color: var(--danger-light);
    margin-bottom: 60px;
}

.recommended-products-container {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 -15px;
    padding: 0 15px;
}

.recommended-products-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 10px 0;
}

.recommended-products-scroll {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 0;
}

.recommended-products-scroll::-webkit-scrollbar {
    display: none;
}

.scroll-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: var(--secondary);
}

.scroll-hint:hover {
    background-color: var(--primary);
}

.scroll-hint.active {
    opacity: 1;
}

.scroll-hint.left {
    left: 5px;
}

.scroll-hint.right {
    right: 5px;
}

.sale-card {
    flex: 0 0 280px;
    min-width: 280px;
}

/* Features Section */
.features-section {
    padding: 60px 0;
    margin-bottom: 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.feature-item {
    display: flex;
    gap: 20px;
    background-color: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-content {
    flex: 1;
}

.feature-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 10px;
}

.feature-content p {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
}

/* Testimonials Section */
.testimonials-section {
    padding: 60px 0;
    background-color: var(--background);
    margin-bottom: 60px;
}

.testimonials-slider {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.testimonial-slide {
    display: none;
}

.testimonial-slide.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.testimonial-content {
    background-color: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
}

.testimonial-rating {
    margin-bottom: 20px;
}

.star {
    font-size: 24px;
    color: #ddd;
}

.star.filled {
    color: var(--primary);
}

.testimonial-text {
    font-size: 18px;
    line-height: 1.7;
    color: var(--secondary);
    margin-bottom: 30px;
    font-style: italic;
}

.testimonial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.testimonial-author {
    text-align: left;
}

.author-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary);
}

.author-product {
    font-size: 14px;
    color: var(--text-light);
}

.testimonial-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.testimonial-link:hover {
    gap: 8px;
}

.testimonial-link:hover svg {
    transform: translateX(3px);
}

.testimonial-link svg {
    transition: transform 0.3s ease;
}

.testimonials-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.testimonial-prev, .testimonial-next {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid var(--border);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.testimonial-prev:hover, .testimonial-next:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--secondary);
}

/* Brand Section */
.brand-section {
    padding: 60px 0;
    margin-bottom: 60px;
}

.brand-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    align-items: center;
}

.brand-logo {
    text-align: center;
}

.brand-logo img {
    max-width: 100%;
    height: auto;
}

.brand-info h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 20px;
    line-height: 1.2;
}

.brand-info p {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Popular Products Section */
.popular-products-section {
    padding: 60px 0;
    background-color: var(--background);
    margin-bottom: 60px;
}

.popular-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Newsletter Section */
.newsletter-section {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
    margin-bottom: 60px;
}

.newsletter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.newsletter-info h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 15px;
    line-height: 1.2;
}

.newsletter-info p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.newsletter-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.newsletter-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--text-light);
}

.newsletter-benefits li svg {
    color: var(--primary);
    margin-top: 4px;
    flex-shrink: 0;
}

.newsletter-form-wrapper {
    background-color: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.newsletter-form .form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.newsletter-form input {
    flex: 1;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(246, 204, 0, 0.1);
}

.form-disclaimer {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

/* Contact CTA */
.contact-cta {
    padding: 60px 0;
    background-color: var(--secondary);
    color: white;
    margin-bottom: 0;
}

.cta-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.cta-text {
    max-width: 600px;
}

.cta-text h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.cta-text p {
    font-size: 16px;
    opacity: 0.8;
}

.cta-buttons {
    display: flex;
    gap: 15px;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .advantages-grid, 
    .categories-grid,
    .products-grid,
    .popular-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-section {
        height: 500px;
        margin-bottom:15px;
    }
    
    .hero-title {
        font-size: 36px;
        color:white;
    }
}

@media (max-width: 992px) {
    .advantages-grid, 
    .categories-grid,
    .products-grid,
    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .promo-content,
    .brand-content,
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .brand-logo {
        text-align: center;
        margin: 0 auto;
    }
    
    .hero-section {
        height: 450px;
    }
    
    .hero-title {
        font-size: 32px;
        color: white;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .hero-content {
        left: 5%;
        max-width: 90%;
    }
    
    .price-match-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cta-content {
        flex-direction: column;
        text-align: center;
    }
    
    .testimonial-text {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .advantages-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .categories-grid,
    .products-grid,
    .popular-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .hero-section {
        height: 400px;
    }
    
    .hero-title {
        font-size: 28px;
        color:white;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .hero-content {
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
    }
    
    .hero-benefits {
        justify-content: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-slide::before {
        background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%);
    }
    
    .sale-card {
        min-width: 260px;
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
    }
    
    .feature-icon {
        margin: 0 auto 15px;
    }
    
    .testimonial-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .testimonial-author {
        text-align: center;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .advantages-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-section {
        height: 500px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-benefits {
        flex-direction: column;
        align-items: center;
    }
    
    .newsletter-form .form-group {
        flex-direction: column;
    }
    
    .price-match-link {
        width: 100%;
        text-align: center;
    }
    
    .testimonial-text {
        font-size: 14px;
    }
}

Improved Newsletter Section
Let me help you improve that newsletter section. The current implementation looks basic and doesn't match the quality of the rest of your site. Here's an enhanced version that maintains your content but with a much better design:
htmlCopy<!-- Newsletter Section - Improved Design -->
<section class="newsletter-section">
    <div class="container">
        <div class="newsletter-wrapper">
            <div class="newsletter-content">
                <h2>Budite u toku sa najnovijim ponudama</h2>
                <p>Prijavite se na našu mailing listu i prvi saznajte za akcije i nove modele aparata za zavarivanje</p>
                
                <ul class="newsletter-benefits">
                    <li>
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
                            <polyline points="22 4 12 14.01 9 11.01"></polyline>
                        </svg>
                        <span>Ekskluzivni popusti samo za pretplatnike</span>
                    </li>
                    <li>
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
                            <polyline points="22 4 12 14.01 9 11.01"></polyline>
                        </svg>
                        <span>Najnoviji modeli i tehnologije</span>
                    </li>
                    <li>
                        <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
                            <polyline points="22 4 12 14.01 9 11.01"></polyline>
                        </svg>
                        <span>Saveti za odabir idealnog aparata</span>
                    </li>
                </ul>
            </div>
            
            <div class="newsletter-form-container">
                <form action="/subscribe.php" method="post" class="newsletter-form">
                    <div class="form-input-group">
                        <input type="email" name="email" placeholder="Vaša email adresa" required>
                        <button type="submit" class="subscribe-btn">Prijavi me</button>
                    </div>
                    <p class="form-disclaimer">Vaš email nikada nećemo deliti sa trećim licima. Možete se odjaviti u bilo kom trenutku.</p>
                </form>
            </div>
        </div>
    </div>
</section>

/* Newsletter Section - Improved Styles */
.newsletter-section {
    padding: 70px 0;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
    position: relative;
    margin-bottom: 60px;
}

.newsletter-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/images/pattern-light.png');
    background-size: 200px;
    opacity: 0.05;
    pointer-events: none;
}

.newsletter-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

.newsletter-content {
    flex: 1;
    padding: 40px;
}

.newsletter-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 15px;
    line-height: 1.3;
}

.newsletter-content p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.6;
}

.newsletter-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.newsletter-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    font-size: 15px;
    color: var(--secondary);
}

.newsletter-benefits li svg {
    flex-shrink: 0;
    color: var(--primary);
}

.newsletter-form-container {
    flex: 1;
    padding: 40px;
    background: linear-gradient(135deg, #f9f9f9 0%, #f1f1f1 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.newsletter-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-input-group {
    display: flex;
    margin-bottom: 15px;
}

.form-input-group input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid #ddd;
    border-radius: 6px 0 0 6px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.form-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(246, 204, 0, 0.1);
}

.subscribe-btn {
    padding: 0 24px;
    background-color: var(--primary);
    color: var(--secondary);
    border: none;
    border-radius: 0 6px 6px 0;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscribe-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.form-disclaimer {
    font-size: 12px;
    color: #888;
    text-align: center;
    line-height: 1.5;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .newsletter-wrapper {
        flex-direction: column;
    }
    
    .newsletter-content, 
    .newsletter-form-container {
        padding: 30px;
    }
}

@media (max-width: 576px) {
    .newsletter-section {
        padding: 40px 0;
    }
    
    .newsletter-content h2 {
        font-size: 22px;
    }
    
    .form-input-group {
        flex-direction: column;
    }
    
    .form-input-group input {
        width: 100%;
        border-radius: 6px;
        margin-bottom: 10px;
    }
    
    .subscribe-btn {
        width: 100%;
        padding: 12px;
        border-radius: 6px;
    }
}

/* Newsletter Section Improved Styles */
.newsletter-section {
    padding: 60px 0;
    background-color: #fff8e1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.newsletter-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    overflow: hidden;
}

.newsletter-left {
    flex-basis: 40%;
    padding: 40px;
    background-color: #ffffff;
}

.newsletter-left h2 {
    font-size: 28px;
    font-weight: 700;
    color: #333333;
    margin-bottom: 30px;
    line-height: 1.2;
}

.newsletter-features {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.newsletter-features li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    font-size: 16px;
    color: #555555;
}

.check-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.newsletter-right {
    flex-basis: 60%;
    padding: 40px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.signup-content {
    max-width: 480px;
}

.signup-text {
    font-size: 18px;
    line-height: 1.6;
    color: #555555;
    margin-bottom: 25px;
}

.signup-form .form-group {
    display: flex;
    margin-bottom: 15px;
}

.signup-form input[type="email"] {
    flex-grow: 1;
    height: 54px;
    padding: 0 20px;
    border: 1px solid #dddddd;
    border-radius: 6px 0 0 6px;
    font-size: 16px;
    color: #333333;
    outline: none;
    transition: border-color 0.3s;
}

.signup-form input[type="email"]:focus {
    border-color: #f6cc00;
    box-shadow: 0 0 0 3px rgba(246, 204, 0, 0.1);
}

.signup-button {
    min-width: 140px;
    height: 54px;
    background-color: #f6cc00;
    color: #333333;
    border: none;
    border-radius: 0 6px 6px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.signup-button:hover {
    background-color: #e6b900;
    transform: translateY(-2px);
}

.privacy-note {
    font-size: 13px;
    color: #888888;
    margin-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .newsletter-card {
        flex-direction: column;
    }
    
    .newsletter-left, 
    .newsletter-right {
        flex-basis: 100%;
    }
    
    .signup-content {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .newsletter-left,
    .newsletter-right {
        padding: 30px 20px;
    }
    
    .signup-form .form-group {
        flex-direction: column;
    }
    
    .signup-form input[type="email"] {
        width: 100%;
        border-radius: 6px;
        margin-bottom: 10px;
    }
    
    .signup-button {
        width: 100%;
        border-radius: 6px;
    }
}

/* Enhanced Contact CTA Section Styles */
.contact-cta-section {
    padding: 80px 0;
    background-color: #333333;
    position: relative;
    overflow: hidden;
}

.contact-cta-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/images/pattern-dark.png');
    opacity: 0.05;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.contact-cta-container {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border-radius: 16px;
    padding: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-cta-content {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    max-width: 60%;
}

.cta-icon {
    background-color: rgba(246, 204, 0, 0.1);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f6cc00;
    flex-shrink: 0;
}

.cta-text h2 {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 15px;
    line-height: 1.2;
}

.cta-text p {
    color: #bbb;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
}

.contact-cta-buttons {
    display: flex;
    gap: 20px;
}

.phone-button, .contact-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 25px;
    height: 60px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.phone-button {
    border: 2px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.phone-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.contact-button {
    background-color: #f6cc00;
    color: #333333;
    border: 2px solid #f6cc00;
}

.contact-button:hover {
    background-color: #ffda3e;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive styles */
@media (max-width: 1100px) {
    .contact-cta-container {
        flex-direction: column;
        text-align: center;
        padding: 40px 30px;
    }
    
    .contact-cta-content {
        flex-direction: column;
        max-width: 100%;
        margin-bottom: 30px;
    }
    
    .cta-icon {
        margin: 0 auto 20px;
    }
    
    .contact-cta-buttons {
        width: 100%;
        max-width: 600px;
    }
    
    .phone-button, .contact-button {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .contact-cta-section {
        padding: 50px 0;
    }
    
    .contact-cta-buttons {
        flex-direction: column;
    }
    
    .cta-text h2 {
        font-size: 28px;
    }
    
    .cta-text p {
        font-size: 16px;
    }
}


.price-match-modal .modal-dialog {
    max-width: 400px;
}

.price-match-modal .modal-content {
    border-radius: 12px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.price-match-modal .modal-header {
    background-color: #f6cc00;
    color: #333;
    padding: 15px;
    border-bottom: none;
    position: relative;
}

.price-match-modal .modal-title {
    font-weight: bold;
    font-size: 18px;
}

.price-match-modal .close {
    color: #333;
    opacity: 0.7;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.price-match-modal .close:hover {
    opacity: 1;
}

.price-match-modal .modal-body {
    padding: 25px;
    text-align: center;
}

.price-match-modal .price-match-intro {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.price-match-modal .price-match-steps h6 {
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.price-match-modal .price-match-steps ul {
    list-style-type: none;
    padding: 0;
    margin-bottom: 25px;
}

.price-match-modal .price-match-steps ul li {
    padding: 10px;
    background-color: #f9f9f9;
    margin-bottom: 10px;
    border-radius: 8px;
    color: #666;
}

.price-match-modal .price-match-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-match-modal .btn-primary,
.price-match-modal .btn-secondary {
    padding: 12px;
    border-radius: 8px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.price-match-modal .btn-primary {
    background-color: #f6cc00;
    color: #333;
    border: none;
}

.price-match-modal .btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: none;
}

.price-match-modal .btn-primary:hover {
    background-color: #e6b900;
}

.price-match-modal .btn-secondary:hover {
    background-color: #e0e0e0;
}

.modal {
    background-color: rgba(0, 0, 0, 0.5);
}

.price-match-modal .modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 15px;
}

.price-match-modal .modal-content {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    margin: auto;
}

.price-match-modal .modal-header {
    background-color: #f6cc00;
    color: #333;
    padding: 15px;
    border-bottom: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.price-match-modal .close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    opacity: 0.7;
    padding: 0;
    margin: 0;
}

.price-match-modal .modal-body {
    padding: 25px;
    text-align: center;
}

.price-match-modal .price-match-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-match-modal .btn-primary,
.price-match-modal .btn-secondary {
    padding: 12px;
    border-radius: 8px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    width: 100%;
}

.price-match-modal .btn-primary {
    background-color: #f6cc00;
    color: #333;
    border: none;
}

.price-match-modal .btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    border: none;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .price-match-modal .modal-dialog {
        padding: 10px;
    }

    .price-match-modal .modal-content {
        max-width: 95%;
        margin: auto;
    }

    .price-match-modal .modal-body {
        padding: 20px 15px;
    }

    .price-match-modal .price-match-steps ul li {
        padding: 8px;
        font-size: 14px;
    }
}



</style>


<script>
document.addEventListener('DOMContentLoaded', function() {
    // Hero Slider 
    const heroSlides = document.querySelectorAll('.hero-slide');
    const heroDots = document.querySelectorAll('.hero-dots .dot');
    const prevButton = document.querySelector('.hero-prev');
    const nextButton = document.querySelector('.hero-next');
    
    let currentSlide = 0;
    const totalSlides = heroSlides.length;
    
    function showSlide(index) {
        heroSlides.forEach(slide => slide.classList.remove('active'));
        heroDots.forEach(dot => dot.classList.remove('active'));
        
        heroSlides[index].classList.add('active');
        heroDots[index].classList.add('active');
        currentSlide = index;
    }
    
    function nextSlide() {
        let newIndex = (currentSlide + 1) % totalSlides;
        showSlide(newIndex);
    }
    
    function prevSlide() {
        let newIndex = (currentSlide - 1 + totalSlides) % totalSlides;
        showSlide(newIndex);
    }
    
    // Set up event listeners
    if (prevButton) prevButton.addEventListener('click', prevSlide);
    if (nextButton) nextButton.addEventListener('click', nextSlide);
    
    heroDots.forEach((dot, index) => {
        dot.addEventListener('click', () => {
            showSlide(index);
        });
    });
    
    // Auto-rotate slides
    let slideInterval = setInterval(nextSlide, 6000);
    
    // Pause auto-rotation when hovering over the slider
    const heroSection = document.querySelector('.hero-section');
    
    if (heroSection) {
        heroSection.addEventListener('mouseenter', () => {
            clearInterval(slideInterval);
        });
        
        heroSection.addEventListener('mouseleave', () => {
            slideInterval = setInterval(nextSlide, 6000);
        });
    }
    
    // Smooth scroll for anchor links
    const scrollLinks = document.querySelectorAll('.scroll-to');
    
    scrollLinks.forEach(link => {
        link.addEventListener('click', function(e) {
            e.preventDefault();
            
            const targetId = this.getAttribute('href');
            const targetElement = document.querySelector(targetId);
            
            if (targetElement) {
                window.scrollTo({
                    top: targetElement.offsetTop - 100,
                    behavior: 'smooth'
                });
            }
        });
    });
    
    // Testimonials Slider
    const testimonialSlides = document.querySelectorAll('.testimonial-slide');
    const testimonialDots = document.querySelectorAll('.testimonial-dots .dot');
    const testimonialPrev = document.querySelector('.testimonial-prev');
    const testimonialNext = document.querySelector('.testimonial-next');
    
    let currentTestimonial = 0;
    const totalTestimonials = testimonialSlides.length;
    
    function showTestimonial(index) {
        testimonialSlides.forEach(slide => slide.classList.remove('active'));
        testimonialDots.forEach(dot => dot.classList.remove('active'));
        
        testimonialSlides[index].classList.add('active');
        testimonialDots[index].classList.add('active');
        currentTestimonial = index;
    }
    
    function nextTestimonial() {
        let newIndex = (currentTestimonial + 1) % totalTestimonials;
        showTestimonial(newIndex);
    }
    
    function prevTestimonial() {
        let newIndex = (currentTestimonial - 1 + totalTestimonials) % totalTestimonials;
        showTestimonial(newIndex);
    }
    
    // Set up event listeners for testimonials
    if (testimonialPrev) testimonialPrev.addEventListener('click', prevTestimonial);
    if (testimonialNext) testimonialNext.addEventListener('click', nextTestimonial);
    
    testimonialDots.forEach((dot, index) => {
        dot.addEventListener('click', () => {
            showTestimonial(index);
        });
    });
    
    // Auto-rotate testimonials
    let testimonialInterval = setInterval(nextTestimonial, 8000);
    
    // Pause auto-rotation when hovering over the testimonials
    const testimonialsSection = document.querySelector('.testimonials-slider');
    
    if (testimonialsSection) {
        testimonialsSection.addEventListener('mouseenter', () => {
            clearInterval(testimonialInterval);
        });
        
        testimonialsSection.addEventListener('mouseleave', () => {
            testimonialInterval = setInterval(nextTestimonial, 8000);
        });
    }
    
    // Horizontal scroll for sale products
    const scrollContainer = document.querySelector('.recommended-products-scroll');
    const leftHint = document.querySelector('.scroll-hint.left');
    const rightHint = document.querySelector('.scroll-hint.right');
    
    if (scrollContainer && leftHint && rightHint) {
        // Show/hide scroll hints
        scrollContainer.addEventListener('scroll', function() {
            const maxScroll = scrollContainer.scrollWidth - scrollContainer.clientWidth;
            
            if (scrollContainer.scrollLeft > 10) {
                leftHint.classList.add('active');
            } else {
                leftHint.classList.remove('active');
            }
            
            if (scrollContainer.scrollLeft < maxScroll - 10) {
                rightHint.classList.add('active');
            } else {
                rightHint.classList.remove('active');
            }
        });
        
        // Scroll left/right on hint click
        leftHint.addEventListener('click', function() {
            scrollContainer.scrollBy({
                left: -600,
                behavior: 'smooth'
            });
        });
        
        rightHint.addEventListener('click', function() {
            scrollContainer.scrollBy({
                left: 600,
                behavior: 'smooth'
            });
        });
    }
});
</script>

<?php require_once 'includes/footer.php'; ?>