<?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 4
");

// 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
");
?>

<!-- Hero Section -->
<section class="new-hero-section">
    <div class="hero-background" style="background-image: url('/assets/images/hero-background.jpg');">
        <div class="hero-overlay"></div>
        <div class="hero-container">
            <div class="hero-content">
                <h1>Hugong Aparati</h1>
                <h2>Najniže cene i kompletna ponuda</h2>
                <div class="hero-buttons">
                    <a href="/category.php?category=mig-mag-aparati" class="hero-btn primary-btn">Pogledaj ponudu</a>
                    <a href="/contact.php" class="hero-btn secondary-btn">Kontaktirajte nas</a>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Features Section -->
<section class="features-section">
    <div class="container">
        <div class="features-grid">
            <div class="feature-item">
                <div class="feature-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">
                        <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>
                <h3>Besplatna isporuka</h3>
                <p>Za sve porudžbine na teritoriji Republike Srbije</p>
            </div>
            <div class="feature-item">
                <div class="feature-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">
                        <path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path>
                    </svg>
                </div>
                <h3>Garancija kvaliteta</h3>
                <p>24 meseca garancije na sve Hugong aparate</p>
            </div>
            <div class="feature-item">
                <div class="feature-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">
                        <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
                        <polyline points="9 22 9 12 15 12 15 22"></polyline>
                    </svg>
                </div>
                <h3>Ovlašćeni distributer</h3>
                <p>Jedini zvanični uvoznik Hugong aparata u Srbiji</p>
            </div>
            <div class="feature-item">
                <div class="feature-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">
                        <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>
                <h3>Stručna podrška</h3>
                <p>Dostupni smo za sva pitanja i konsultacije</p>
            </div>
        </div>
    </div>
</section>

<!-- Categories Section -->
<section class="categories-section">
    <div class="container">
        <h2 class="section-title">Kategorije proizvoda</h2>
        <div class="categories-grid">
            <?php foreach($featured_categories as $category): ?>
            <a href="/category.php?category=<?php echo $category['slug']; ?>" 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']; ?>">
                    <?php else: ?>
                    <img src="/assets/images/no-image.jpg" alt="<?php echo $category['name']; ?>">
                    <?php endif; ?>
                </div>
                <h3><?php echo $category['name']; ?></h3>
                <span class="category-link">Pogledaj ponudu</span>
            </a>
            <?php endforeach; ?>
        </div>
    </div>
</section>

<!-- Featured Products Section -->
<section class="featured-products">
    <div class="container">
        <h2 class="section-title">Izdvojeni proizvodi</h2>
        <div class="product-grid">
            <?php foreach($featured_products as $key => $product): ?>
            <?php if($key < 4): // Ograniči na 4 proizvoda ?>
            <div class="product-card">
                <?php if (!empty($product['sale_price'])): ?>
                <span class="product-card-badge">Akcija</span>
                <?php endif; ?>
                <div class="product-card-img">
                    <a href="/<?php echo $product['slug']; ?>">
                        <?php if (!empty($product['image'])): ?>
                        <img src="<?php echo UPLOADS_URL . '/products/' . $product['image']; ?>" alt="<?php echo $product['name']; ?>">
                        <?php else: ?>
                        <img src="/assets/images/no-image.jpg" alt="<?php echo $product['name']; ?>">
                        <?php endif; ?>
                    </a>
                </div>
                <div class="product-card-content">
                    <h3 class="product-card-title">
                        <a href="/<?php echo $product['slug']; ?>"><?php echo $product['name']; ?></a>
                    </h3>
                    <div class="product-card-price">
                        <?php if (!empty($product['sale_price'])): ?>
                        <span class="card-price-regular"><?php echo format_price($product['sale_price']); ?></span>
                        <span class="card-price-old"><?php echo format_price($product['price']); ?></span>
                        <?php else: ?>
                        <span class="card-price-regular"><?php echo format_price($product['price']); ?></span>
                        <?php endif; ?>
                    </div>
                    <a href="/<?php echo $product['slug']; ?>" class="product-card-button">Detaljnije</a>
                </div>
            </div>
            <?php endif; ?>
            <?php endforeach; ?>
        </div>
        <div class="view-all-btn-container">
            <a href="/svi-proizvodi" class="view-all-btn">Pogledaj sve proizvode</a>
        </div>
    </div>
</section>

<!-- Why Choose Us Section -->
<section class="why-choose-us">
    <div class="container">
        <div class="why-choose-content">
            <div class="why-choose-text">
                <h2>Zašto izabrati Hugong aparate?</h2>
                <p>Hugong je jedan od vodećih svetskih proizvođača aparata za zavarivanje, poznat po visokom kvalitetu, pouzdanosti i inovativnoj IGBT tehnologiji.</p>
                <ul class="why-choose-list">
                    <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>IGBT inverter tehnologija omogućava uštedu električne 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>Multifunkcionalni aparati (MIG/MAG, REL, TIG) za različite primene</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>Napredne funkcije poput digitalnog displeja i pulsnog zavarivanja</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>Garancija 24 meseca i ovlašćeni servis na teritoriji Srbije</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>Izuzetna vrednost za novac - profesionalni kvalitet po pristupačnim cenama</span>
                    </li>
                </ul>
                <a href="/o-hugong-aparatima" class="learn-more-btn">Saznaj više o Hugong aparatima</a>
            </div>
            <div class="why-choose-image">
                <img src="/assets/images/why-choose-hugong.jpg" alt="Hugong aparati za zavarivanje u radionici">
            </div>
        </div>
    </div>
</section>

<!-- Testimonials Section -->
<?php if(!empty($testimonials)): ?>
<section class="testimonials-section">
    <div class="container">
        <h2 class="section-title">Iskustva naših kupaca</h2>
        <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><?php echo $i <= $testimonial['rating'] ? '★' : '☆'; ?></span>
                        <?php endfor; ?>
                    </div>
                    <p class="testimonial-text">"<?php echo htmlspecialchars($testimonial['comment']); ?>"</p>
                    <div class="testimonial-author">
                        <p class="author-name"><?php echo htmlspecialchars($testimonial['name']); ?></p>
                        <p class="author-title"><?php echo $testimonial['product_name']; ?>, <?php echo date('d.m.Y.', strtotime($testimonial['created_at'])); ?></p>
                    </div>
                </div>
            </div>
            <?php endforeach; ?>
            <div class="testimonial-controls">
                <button class="prev-testimonial" 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="next-testimonial" 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>
    </div>
</section>
<?php endif; ?>

<!-- Brands Section -->
<section class="brands-section">
    <div class="container">
        <h2 class="section-title">Zašto baš Hugong?</h2>
        <div class="brands-info">
            <div class="brand-image">
                <img src="/assets/images/hugong-logo.jpg" alt="Hugong logo">
            </div>
            <div class="brand-text">
                <p>Hugong je jedan od vodećih svetskih proizvođača opreme za zavarivanje, osnovan 1983. godine. Kompanija se specijalizovala za proizvodnju inverterskih aparata za zavarivanje koristeći najnoviju IGBT tehnologiju.</p>
                <p>Sa više od 35 godina iskustva, Hugong je izgradio reputaciju pouzdanog brenda koji isporučuje profesionalne aparate visokog kvaliteta po pristupačnim cenama. Proizvodni program obuhvata MIG/MAG, TIG, REL aparate i plazma sekače.</p>
                <p>Zahvaljujući kontinuiranim inovacijama i ulaganju u razvoj, Hugong aparati danas pružaju izvanredne performance, energetsku efikasnost i dugotrajnost u najzahtevnijim uslovima rada.</p>
                <a href="/o-hugong-brendu" class="learn-more-btn">Saznaj više o brendu Hugong</a>
            </div>
        </div>
    </div>
</section>

<!-- SEO Strukturirani podaci -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Hugong Aparati",
  "url": "https://hugong-aparati.rs",
  "logo": "https://hugong-aparati.rs/assets/images/logo.png",
  "description": "Originalni Hugong aparati za zavarivanje sa garancijom od 24 meseca i besplatnom isporukom za celu Srbiju.",
  "telephone": "<?php echo get_setting('contact_phone', '+381 65 8065 065'); ?>",
  "email": "<?php echo get_setting('contact_email', 'info@hugong-aparati.rs'); ?>"
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebSite",
  "url": "https://hugong-aparati.rs",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://hugong-aparati.rs/search.php?q={search_term_string}",
    "query-input": "required name=search_term_string"
  }
}
</script>

<!-- Dodajte novi CSS stil sa definisanim sekcijama -->
<style>
/* Hero Section Styles */
.hero-section {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    margin-bottom: 60px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/images/hero-background.jpg');
    background-size: cover;
    background-position: center;
    filter: brightness(0.7);
    z-index: 1;
}

.hero-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    padding: 0 20px;
}

.hero-content {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    padding: 50px;
    width: 100%;
    max-width: 650px;
    text-align: center;
    transition: all 0.3s ease;
}

.hero-content h1 {
    color: #0077cc;
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}

.hero-content h2 {
    color: #333;
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero-content p {
    color: #555;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.hero-btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 180px;
}

.primary-btn {
    background-color: #0077cc;
    color: white;
    border: 2px solid #0077cc;
}

.primary-btn:hover {
    background-color: #005fa3;
    border-color: #005fa3;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 119, 204, 0.3);
}

.secondary-btn {
    background-color: transparent;
    color: #0077cc;
    border: 2px solid #0077cc;
}

.secondary-btn:hover {
    background-color: rgba(0, 119, 204, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 119, 204, 0.1);
}

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

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

.feature-item {
    text-align: center;
    padding: 30px 20px;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.feature-icon {
    margin-bottom: 20px;
    color: #0077cc;
}

.feature-item h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.feature-item p {
    color: #666;
    font-size: 14px;
}

/* Categories Section */
.categories-section {
    padding: 60px 0;
    background-color: #f4f4f4;
    margin-bottom: 40px;
}

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
    text-align: center;
}

.section-title:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #0077cc;
}

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

.category-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    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: 180px;
    overflow: hidden;
}

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

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

.category-card h3 {
    padding: 15px 15px 5px;
    font-size: 18px;
    color: #333;
}

.category-link {
    padding: 0 15px 15px;
    color: #0077cc;
    font-weight: 500;
    display: flex;
    align-items: center;
    margin-top: auto;
}

.category-link:after {
    content: "→";
    margin-left: 5px;
    transition: margin-left 0.3s ease;
}

.category-card:hover .category-link:after {
    margin-left: 10px;
}

/* Featured Products Section */
.featured-products {
    padding: 60px 0;
    background-color: white;
    margin-bottom: 40px;
}

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

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

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

.product-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #f8a100;
    color: white;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 4px;
    z-index: 1;
}

.product-card-img {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    padding: 20px;
}

.product-card-img img {
    max-height: 160px;
    transition: transform 0.5s ease;
}

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

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

.product-card-title {
    font-size: 16px;
    margin-bottom: 10px;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card-title a {
    color: #333;
}

.product-card-title a:hover {
    color: #0077cc;
}

.product-card-price {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.card-price-regular {
    font-size: 18px;
    font-weight: bold;
    color: #0077cc;
}

.card-price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    margin-left: 10px;
}

.product-card-button {
    width: 100%;
    padding: 10px;
    background-color: #0077cc;
    color: white;
    border: none;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-top: auto;
}

.product-card-button:hover {
    background-color: #005fa3;
    color: white;
}

.view-all-btn-container {
    text-align: center;
    margin-top: 40px;
}

.view-all-btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: white;
    color: #0077cc;
    border: 2px solid #0077cc;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background-color: #0077cc;
    color: white;
}

/* Why Choose Us Section */
.why-choose-us {
    padding: 60px 0;
    background-color: #f4f4f4;
    margin-bottom: 40px;
}

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

.why-choose-text h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.why-choose-text p {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.8;
}

.why-choose-list {
    list-style-type: none;
    padding: 0;
    margin-bottom: 30px;
}

.why-choose-list li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.why-choose-list li svg {
    color: #28a745;
    min-width: 20px;
    margin-right: 15px;
}

.learn-more-btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #0077cc;
    color: white;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.learn-more-btn:hover {
    background-color: #005fa3;
    color: white;
}

.why-choose-image img {
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
}

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

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

.testimonial-slide {
    display: none;
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
    max-width: 600px;
    text-align: center;
}

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

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

.testimonial-rating {
    color: #f8a100;
    font-size: 24px;
    margin-bottom: 15px;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 16px;
}

.testimonial-author {
    margin-top: 20px;
}

.author-name {
    font-weight: bold;
    margin-bottom: 0;
}

.author-title {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

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

.prev-testimonial, .next-testimonial {
    background-color: #f0f0f0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    transition: background-color 0.3s ease;
}

.prev-testimonial:hover, .next-testimonial:hover {
    background-color: #e0e0e0;
}

.testimonial-dots {
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: #0077cc;
}

/* Brands Section */
.brands-section {
    padding: 60px 0;
    background-color: #f4f4f4;
    margin-bottom: 40px;
}

.brands-info {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: center;
}

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

.brand-image img {
    max-width: 80%;
    border-radius: 8px;
}

.brand-text p {
    margin-bottom: 20px;
    line-height: 1.8;
}

/* Responzivan dizajn */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .brands-info {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        height: 400px;
    }
    
    .hero-content {
        padding: 30px;
        max-width: 90%;
    }
    
    .hero-content h1 {
        font-size: 30px;
    }
    
    .hero-content h2 {
        font-size: 22px;
    }
    
    .desktop-only {
        display: none;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .why-choose-content {
        grid-template-columns: 1fr;
    }
    
    .why-choose-image {
        order: -1; /* Slika iznad teksta na mobilnim uređajima */
    }
}

@media (max-width: 576px) {
    .hero-section {
        height: 300px;
    }
    
    .hero-content {
        padding: 20px;
    }
    
    .hero-content h1 {
        font-size: 24px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    .features-grid,
    .categories-grid,
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-item {
        padding: 20px 15px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .testimonial-slide {
        padding: 20px;
    }
}
</style>

<!-- JavaScript za testimonial slider -->
<script>
document.addEventListener('DOMContentLoaded', function() {
    // Testimonial slider funkcionalnost
    const slides = document.querySelectorAll('.testimonial-slide');
    const dots = document.querySelectorAll('.testimonial-dots .dot');
    const prevBtn = document.querySelector('.prev-testimonial');
    const nextBtn = document.querySelector('.next-testimonial');
    
    let currentSlide = 0;
    const slideCount = slides.length;
    
    function showSlide(n) {
        // Sakrij sve slajdove
        slides.forEach(slide => {
            slide.classList.remove('active');
        });
        
        // Deaktiviraj sve tačke
        dots.forEach(dot => {
            dot.classList.remove('active');
        });
        
        // Prikaži odabrani slajd
        slides[n].classList.add('active');
        dots[n].classList.add('active');
        
        // Ažuriraj trenutni slajd
        currentSlide = n;
    }
    
    function nextSlide() {
        showSlide((currentSlide + 1) % slideCount);
    }
    
    function prevSlide() {
        showSlide((currentSlide - 1 + slideCount) % slideCount);
    }
    
    // Event listeneri za kontrole
    if (prevBtn) {
        prevBtn.addEventListener('click', prevSlide);
    }
    
    if (nextBtn) {
        nextBtn.addEventListener('click', nextSlide);
    }
    
    // Event listeneri za tačkice
    dots.forEach((dot, index) => {
        dot.addEventListener('click', () => {
            showSlide(index);
        });
    });
    
    // Auto rotacija svakih 5 sekundi
    setInterval(nextSlide, 5000);
});
</script>

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