/* =========================================
   KAESAR FARM - OPTIMIZED CSS
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Lato:wght@400;700&family=Poppins:wght@400;600;700&display=swap');

/* --- CSS VARIABLES --- */
:root {
    --primary: #82b937;
    --primary-hover: #6da32d;
    --primary-dark: #6a9a2d;
    --dark: #2c3e50;
    --bg: #f4f9f4;
    --bg-card: #f4f4f4;
    --bg-white: #ffffff;
    --text-dark: #121212;
    --text-gray: #555555;
    --text-light: #888888;
    --danger: #e74c3c;
    --warning: #ffa000;
    --accent: #2980b9;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    --font-primary: 'Poppins', sans-serif;
    
    --navbar-height: 70px;
    --section-padding: 80px 10%;
    --border-radius: 15px;
    --border-radius-lg: 25px;
    
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 40px rgba(0,0,0,0.08);
    --shadow-primary: 0 5px 15px rgba(130, 185, 55, 0.2);
}

/* --- RESET & BASE --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-white);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--font-heading);
}

/* --- NAVBAR --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background: var(--bg-white);
    border-bottom: 1px solid #eee;
    z-index: 999999;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 10%;
    max-width: 1400px;
    margin: 0 auto;
}

/* FONT LOGO SAMA DENGAN HERO - Playfair Display */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-dark);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.navbar-logo-img {
    height: 45px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    margin-left: auto;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--dark);
    margin-top: var(--navbar-height);
}

.hero-slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: background-image;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 800px;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 15px;
    line-height: 1.2;
    text-shadow: 2px 2px 12px rgba(0,0,0,0.9);
}

.hero-content p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px;
    color: #f0f0f0;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    padding: 12px 35px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

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

/* --- FEATURES SECTION --- */
.features {
    padding: var(--section-padding);
    text-align: center;
}

.section-title {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    margin-bottom: 40px;
    font-weight: 300;
    position: relative;
    padding-bottom: 15px;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.features-grid {
    display: flex;
    justify-content: space-around;
    background: var(--bg-card);
    padding: 50px 40px;
    border-radius: 40px;
    box-shadow: var(--shadow-sm);
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary);
    filter: drop-shadow(0 4px 6px rgba(141, 181, 67, 0.2));
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature-card p {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* --- PRODUCTS SECTION --- */
.products {
    padding: var(--section-padding);
    text-align: center;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid #eee;
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.product-card[data-status="habis"] {
    cursor: not-allowed;
    opacity: 0.8;
}

.product-card[data-status="habis"]:hover {
    transform: none;
    box-shadow: none;
}

.product-card[data-status="habis"] .product-image {
    filter: grayscale(1) opacity(0.7);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: block;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.product-desc {
    color: var(--text-gray);
    font-size: 0.85rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.badge-restock {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #ff9800;
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-view {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    pointer-events: none;
    width: 100%;
}

.btn-view:hover {
    background: var(--primary);
    color: white;
}

.product-card[data-status="habis"] .btn-view {
    background: #ff9800;
    color: white;
    border-color: #ff9800;
}

/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: 90px; /* TAMBAHAN: Jarak dari navbar */
}

.modal-content {
    background: white;
    width: 95%;
    max-width: 550px;
    max-height: calc(100vh - 110px); /* Kurangi tinggi agar tidak mentok navbar */
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--primary);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    border: 2px solid white;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s;
}

.close-modal:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.modal-scroll-area {
    overflow-y: auto;
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* GAMBAR MODAL - UKURAN PROPORSIONAL */
.modal-img {
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 20px auto 15px;
    border-radius: 18px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.modal-body {
    text-align: center;
    width: 100%;
    padding: 0;
}

.modal-body h3 {
    margin: 5px 0 0;
    font-size: 1.5rem;
}

#modalDesc {
    margin: 8px 0 20px;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.4;
}

/* RESPONSIVE UNTUK HP */
@media (max-width: 768px) {
    .modal {
        padding-top: 20px; /* Di HP tidak perlu jarak besar */
    }
    
    .modal-content {
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 92%;
        max-width: 100%;
    }
    
    .modal-img {
        max-width: 320px;
    }
    
    .modal-scroll-area {
        padding: 0 15px 15px;
    }
}
/* --- FIX CENTER UNIT SELECTOR --- */
.unit-selector-container {
    border: 1px dashed var(--primary);
    border-radius: var(--border-radius);
    padding: 15px;
    background: #f9fff0;
    text-align: center;
    margin: 0 auto 15px auto;
    width: 85%;
    max-width: 300px;
}

.unit-selector-container > div {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kapsul-putih {
    flex: 0 0 auto;
    min-width: 120px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    border: 1px solid var(--primary);
    background: white;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0 20px;
}

.kapsul-putih input[type="radio"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* WA Buttons */
.wa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.btn-wa-alt {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: var(--shadow-primary);
}

.btn-wa-alt:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.admin-isma {
    background: #72a331;
}

.status-dot {
    height: 8px;
    width: 8px;
    background: #25d366;
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 8px #25d366;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- FOOTER --- */
footer {
    background: #f9f9f9;
    padding: 80px 10% 30px;
    border-top: 1px solid #e0e0e0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto 50px;
}

.footer-col h4 {
    color: var(--text-dark);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
    font-family: var(--font-heading);
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
}

.footer-col ul {
    list-style: none;
    padding: 0; /* Memastikan tidak ada padding bawaan */
}

.footer-col ul li {
    margin-bottom: 12px;
    display: flex; /* Supaya ikon dan teks sejajar rapi */
    align-items: center;
    color: var(--text-gray);
}

.footer-col ul li i {
    margin-right: 10px; /* Jarak antara ikon dan teks */
    width: 20px; /* Biar ikon sejajar vertikal dengan rapi */
    text-align: center;
}

.footer-col ul li a {
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 5px; /* Efek geser sedikit saat hover agar lebih interaktif */
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Social Links - JARAK DIPERBESAR */
.social-links, .profile-social {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 15px;
}

.sosmed-link {
    width: 45px;
    height: 45px;
    background: #eee;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid #ddd;
    font-size: 1.2rem;
}

.sosmed-link.ig:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
}

.sosmed-link.tt:hover {
    background: #000;
    color: white;
    transform: translateY(-3px);
    box-shadow: 2px 2px 0 #ff0050, -2px -2px 0 #00f2ea;
}

/* --- ABOUT PAGE --- */
.about-page-container {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    background: white;
}

.about-content-detail {
    padding: 60px 5%;
    background: white;
}

.about-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto 80px;
}

.about-wrapper:last-child {
    margin-bottom: 50px;
}

.about-image {
    flex: 0 0 280px;
    width: 280px;
    height: 380px;
    position: relative;
}

.img-frame {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    animation: float 4s ease-in-out infinite;
}

.img-frame::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    z-index: 2;
    animation: shine-loop 6s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes shine-loop {
    0% { left: -75%; }
    20% { left: 125%; }
    100% { left: 125%; }
}

.img-frame:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(130, 185, 54, 0.3);
}

.profile-img-custom {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-frame:hover .profile-img-custom {
    transform: scale(1.1);
}

.about-wrapper:last-child .img-frame {
    animation-delay: 1.5s;
}

.about-wrapper:last-child .img-frame::before {
    animation-delay: 3s;
}

.about-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.title-large {
    font-size: 2.2rem;
    color: var(--primary);
    font-weight: 800;
    margin: 0 0 35px;
    position: relative;
    display: inline-block;
}

.title-large::after {
    content: "";
    position: absolute;
    left: 0;
    top: 52px;
    width: 65px;
    height: 6px;
    background: var(--primary);
    border-radius: 10px;
}

.name-large {
    font-size: 1.8rem;
    color: #333;
    font-weight: 700;
    margin: 45px 0 10px;
}

.role-large {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 15px;
}

.desc-large {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.follow-text {
    font-weight: 600;
    color: #666;
    font-size: 0.95rem;
    margin-right: 10px;
}

/* --- TOAST NOTIFICATION --- */
#custom-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(130, 185, 55, 0.95);
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 1000000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

#custom-toast::before {
    content: "\f06a";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

#custom-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* =========================================
   RESPONSIVE - MOBILE
   ========================================= */
@media (max-width: 768px) {
    :root {
        --section-padding: 40px 5%;
        --navbar-height: 60px;
    }
    
    .navbar {
        padding: 0 5%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: var(--navbar-height);
        right: 5%;
        width: 220px;
        background: white;
        flex-direction: column;
        gap: 0;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-md);
        border: 1px solid #eee;
        padding: 10px 0;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
        margin: 0;
    }
    
    .nav-links a {
        display: block;
        padding: 15px 20px;
        width: 100%;
        border-bottom: 1px solid #f9f9f9;
    }
    
    .hero {
        height: 50vh;
        min-height: 400px;
    }
    
    /* FIX BORDER RADIUS UNTUK INDEX & ABOUT */
    .hero + section,
    .features {
        margin-top: -35px;
        padding-top: 50px;
        position: relative;
        z-index: 10;
        background: white;
        border-radius: 35px 35px 0 0;
    }
    
    .about-page-container {
        margin-top: -35px !important;
        padding-top: 50px !important;
        position: relative !important;
        z-index: 10 !important;
        background: white !important;
        border-radius: 35px 35px 0 0 !important;
    }
    
    .features-grid {
        flex-direction: column;
        padding: 40px 20px;
        border-radius: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* About Page Mobile */
    .about-wrapper {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 70px;
    }
    
    .about-image {
        width: 240px;
        height: 320px;
    }
    
    .about-text {
        align-items: center;
        text-align: center;
        padding: 0 20px;
    }
    
    .title-large {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }
    
    .title-large::after {
        display: none;
    }
    
    .name-large {
        font-size: 1.4rem;
        margin: 20px 0 10px;
    }
    
    .profile-social {
        justify-content: center;
    }
    
    /* Modal Mobile */
    .modal-content {
        max-height: 80vh;
    }
    
    #custom-toast {
        width: 85%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .wa-grid {
        grid-template-columns: 1fr;
    }
    
    .unit-selector-container {
        width: 100%;
    }
}