/* General Styles */
:root {
    --primary-color: #28a745; /* Hijau Antasari */
    --secondary-color: #007bff; /* Biru */
    --text-color-dark: #333;
    --text-color-light: #f8f9fa;
    --bg-light: #f8f9fa;
    --bg-dark: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color-dark);
    background-color: var(--bg-light);
    scroll-behavior: smooth;
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color-dark);
    margin-bottom: 1rem;
}

h1 { font-size: 2.8em; }
h2 { font-size: 2.2em; text-align: center; margin-bottom: 2rem; }
h3 { font-size: 1.6em; }

a {
    text-decoration: none;
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 20px;
    margin: 40px 0;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
    cursor: pointer;
}

.btn.primary {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border: 2px solid var(--primary-color);
}

.btn.primary:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.btn.secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn.secondary:hover {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    transform: translateY(-2px);
}

.btn.btn-small {
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 25px;
}

/* Navbar Styles */
.navbar {
    background-color: rgba(255, 255, 255, 0.95); /* Sedikit transparan agar hero section terlihat */
    padding: 15px 20px;
    position: absolute; /* Posisikan di atas hero section */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100; /* Pastikan di atas konten lain */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: var(--border-radius); /* Sesuaikan dengan border-radius section */
    margin: 20px; /* Sesuaikan dengan margin hero section */
    max-width: calc(100% - 40px); /* Kurangi 2x margin */
    box-sizing: border-box; /* Pastikan padding tidak menambah lebar */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px; /* Sesuai dengan container utama */
    margin: 0 auto;
    padding: 0; /* Hapus padding default container di sini */
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-nav {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.navbar-nav li a {
    color: var(--text-color-dark);
    font-weight: 600;
    font-size: 1.05em;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.navbar-nav li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.navbar-nav li a:hover::after,
.navbar-nav li a.active::after {
    width: 100%;
}

.navbar-nav li a:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.8em;
    color: var(--text-color-dark);
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    position: relative; /* Penting untuk posisi absolut video */
    height: 70vh; /* Adjust as needed */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-light);
    text-align: center;
    /* Hapus atau ganti background-image ini */
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)); /* Biarkan overlay gradasi */
    border-radius: var(--border-radius);
    margin: 20px;
    box-shadow: var(--box-shadow);
    overflow: hidden; /* Ensure content stays within bounds */
}

/* Gaya untuk Video Background */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Memastikan video menutupi seluruh area tanpa terdistorsi */
    z-index: -1; /* Tempatkan video di belakang konten */
}


.hero-content {
    z-index: 1; /* Make sure content is above background overlay and video */
    max-width: 800px;
    padding: 20px;
}

.hero-content h1 {
    color: inherit;
    margin-bottom: 15px;
    font-size: 3.5em;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.3em;
    margin-bottom: 30px;
}

.hero-cta .btn {
    margin: 0 10px;
}

/* Product Highlight Section */
.product-highlight {
    text-align: center;
}

.product-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.product-card {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    padding: 30px;
    max-width: 380px;
    text-align: center;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-card img {
    max-width: 100%;
    height: 300px; /* Atur tinggi tetap untuk semua gambar */
    object-fit: contain; /* Memastikan gambar sepenuhnya terlihat tanpa terpotong dan mempertahankan rasio aspeknya */
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.product-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.product-card p {
    font-size: 0.95em;
    margin-bottom: 20px;
}

.product-features {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    text-align: left;
}

.product-features li {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #555;
}

.product-features li i {
    color: var(--primary-color);
    margin-right: 8px;
    width: 20px;
    text-align: center;
}


/* Testimonials Section */
.testimonials {
    text-align: center;
    background-color: var(--bg-light);
}

.testimonial-carousel {
    position: relative;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto 20px auto;
}

.testimonial-item {
    display: none; /* Hidden by default */
    padding: 30px;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    font-style: italic;
    font-size: 1.1em;
    text-align: center;
}

.testimonial-item.active {
    display: block; /* Shown when active */
}

.testimonial-item p {
    margin-bottom: 15px;
}

.testimonial-item .author {
    font-weight: 600;
    font-style: normal;
    color: var(--primary-color);
}

.carousel-nav {
    text-align: center;
}

.dot {
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
    cursor: pointer;
}

.dot.active {
    background-color: var(--primary-color);
}

/* Fertilizer Calculator Section */
.fertilizer-calculator {
    text-align: center;
}

.calculator-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 2rem;
}

.calculator-form, .calculator-result {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    background-color: #fff;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    text-align: left;
}

.calculator-form .form-group {
    margin-bottom: 20px;
}

.calculator-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.calculator-form select,
.calculator-form input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.calculator-form button {
    width: 100%;
    margin-top: 10px;
}

.calculator-result h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.calculator-result p {
    margin-bottom: 10px;
}

.calculator-result .result-cta {
    margin-top: 20px;
    display: block; /* Ensure it takes full width when shown */
}

/* Alternatif Distributor List */
.distributor-list-alt {
    text-align: center;
}

.distributor-controls {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.distributor-controls input[type="text"],
.distributor-controls select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    min-width: 200px;
    flex-grow: 1;
    max-width: 300px;
    font-size: 1em;
}

.distributor-results {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.distributor-item-alt { /* Class baru untuk kartu distributor alternatif */
    background-color: #fff;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: left;
    transition: transform 0.2s ease;
}

.distributor-item-alt:hover {
    transform: translateY(-5px);
}

.distributor-item-alt h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.distributor-item-alt p {
    font-size: 0.9em;
    margin-bottom: 8px;
    color: #555;
}

.distributor-item-alt p i {
    margin-right: 8px;
    color: var(--primary-color);
}

.distributor-item-alt .btn-small {
    margin-top: 15px;
    width: auto; /* Override default button width */
}

.no-results {
    grid-column: 1 / -1; /* Menjangkau semua kolom */
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 30px 0;
}

.distributor-contact-info {
    margin-top: 60px;
    background-color: var(--bg-light);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.distributor-contact-info h3 {
    color: var(--text-color-dark);
    margin-bottom: 15px;
}

.fade-scroll {
    opacity: 0;
    transform: translateY(20px); /* Mulai sedikit di bawah */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out; /* Transisi yang lembut */
    will-change: opacity, transform; /* Optimalisasi performa */
}

.fade-scroll.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Tambahan: Pastikan hero-section di awal tidak memiliki opacity 0 */
/* Atau setel opacity 1 di sini agar terlihat langsung saat load */
.hero-section.fade-scroll {
    opacity: 1; /* Hero section langsung terlihat saat halaman dimuat */
    transform: translateY(0);
}


/* Responsive Navbar */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap; /* Izinkan wrapping */
    }

    .navbar-brand {
        flex-grow: 1; /* Biarkan brand mengambil ruang yang tersisa */
    }

    .menu-toggle {
        display: block; /* Show on small screens */
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
        text-align: center;
        background-color: rgba(255, 255, 255, 0.98);
        
        border-top: none; /* Awalnya tidak ada border */
        padding: 0; /* Awalnya tidak ada padding */
        
        max-height: 0; /* Sembunyikan secara default */
        overflow: hidden;
        transition: max-height 0.3s ease-out, padding 0.3s ease-out; /* Tambahkan transisi untuk padding */
    }

    .navbar-nav.active {
        max-height: 300px; /* Tampilkan saat aktif */
        
        border-top: 1px solid #eee; /* Terapkan border saat aktif */
        padding: 20px 0; /* Terapkan padding saat aktif */
    }

    .navbar-nav li {
        margin: 10px 0;
    }

    .navbar-nav li a {
        font-size: 1.2em;
        padding: 10px 0;
        display: block; /* Agar seluruh area bisa diklik */
    }

    /* --- PERUBAHAN DI SINI (untuk Hero Section) --- */
    .hero-section {
        padding-top: 100px; /* Berikan jarak dari atas agar tidak menabrak navbar */
        /* Anda bisa menyesuaikan nilai 100px ini sesuai kebutuhan */
    }
    /* --- AKHIR PERUBAHAN --- */
}


/* Existing Responsive Styles (keep them, but make sure no conflicts) */
@media (max-width: 768px) {
    h1 { font-size: 2.2em; }
    h2 { font-size: 1.8em; }
    .hero-content p { font-size: 1em; }
    .hero-cta {
        flex-direction: column;

        gap: 15px; 
      
    }
    .hero-cta .btn {
        margin-top: 5px;
        width: 80%; /* Make buttons wider on small screens */
    }

    .product-card {
        padding: 20px;
    }

    .calculator-form, .calculator-result {
        min-width: unset;
        width: 100%;
    }

    /* .map-controls dihapus karena tidak lagi menggunakan Google Maps */
    /* .map-controls {
        flex-direction: column;
        gap: 10px;
    }
    .map-controls input[type="text"],
    .map-controls button {
        width: 100%;
        max-width: unset;
    } */
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.8em; }
    .hero-content p { font-size: 0.9em; }
    .product-grid {
        flex-direction: column;
        align-items: center;
    }
    .product-card {
        width: 90%;
    }
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    color: var(--text-color-light);
    padding: 30px 20px;
    text-align: center;
    border-radius: var(--border-radius);
    margin: 20px;
    box-shadow: var(--box-shadow);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.social-links a {
    color: var(--text-color-light);
    font-size: 1.5em;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}