/*Yoga Febrianto Aritonang (240304089)*/
/*Thabita Isabela Simatupang (240304087)*/
/*Daniel Parlindungan Simbolon (240304076)*/ 

:root {
    --primary: #6b4f3f;
    --secondary: #ada4a4;
    --dark: #4f7f52;
    --light: #fdffff;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

/* --- NAVIGATION --- */
nav {
    background: var(--primary);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px #0000001a;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%; 
}

nav .logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap; 
    
    /* Tambahan agar gambar dan teks sejajar rapi */
    display: flex;
    align-items: center; 
    gap: 10px; 
}

nav .logo img {
    height: 45px; /* Sesuaikan ukuran logo */
    width: auto;
    object-fit: contain;
    background: transparent; /* Pastikan background transparan */
    display: block;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    padding: 5px 10px;
    display: inline-block;
}

nav ul li a:hover {
    color: var(--dark);
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
}

/* --- HERO SECTION (SLIDESHOW) --- */
.hero {
    position: relative; /* Penting: Menjadi wadah untuk slide absolut */
    height: 60vh;
    min-height: 300px; 
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    overflow: hidden; /* Mencegah gambar keluar dari kotak */
    padding: 0 20px;
    width: 100%;
    background: #333; /* Warna dasar jika gambar belum muat */
}

/* Gambar Slide */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0; /* Tersembunyi secara default */
    transition: opacity 1s ease-in-out; /* Efek transisi halus 1 detik */
    z-index: 1;
}

/* Slide yang Aktif (Muncul) */
.hero-slide.active {
    opacity: 1;
}

/* Lapisan Gelap di atas Gambar (Agar teks terbaca) */
.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Hitam transparan 50% */
}

/* Konten Teks di Atas Slide */
.hero-content {
    position: relative;
    z-index: 2; /* Harus lebih tinggi dari slide */
    max-width: 800px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    word-wrap: break-word; 
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* --- LAYOUT UTILS --- */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 20px;
    flex: 1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px;
    align-items: start; 
}

/* --- CARDS --- */
.card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
}

/* GAMBAR PRODUK: Tetap rapi, tidak gepeng, fokus tengah-atas */
.card img {
    width: 100%;
    height: 220px; 
    object-fit: cover; 
    object-position: center top; 
    background-color: #f0f0f0; 
    border-bottom: 1px solid #eee;
}

.card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.card-price {
    font-weight: bold;
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: auto;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    background: var(--primary);
    border: none;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
}

.btn:hover {
    background: var(--secondary);
}

.btn-danger { background: #e73c3c; }
.btn-success { background: #27ae60; }
.btn-secondary { background: #7f8c8d; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

/* --- FORMS --- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* --- TABLES --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    min-width: 600px; 
}

.table th,
.table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.table th {
    background: var(--dark);
    color: white;
}

/* --- ADMIN LAYOUT --- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--dark);
    color: white;
    padding: 20px;
    flex-shrink: 0;
}

.sidebar a {
    display: block;
    color: #bbb;
    padding: 10px;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 5px;
}

.sidebar a:hover,
.sidebar a.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.main-content {
    flex: 1;
    padding: 20px;
    background: #f4f4f4;
    overflow-x: hidden;
}

/* =========================================
   MEDIA QUERIES (TAMPILAN HP)
   ========================================= */

@media screen and (max-width: 900px) {
    
    nav {
        flex-direction: column !important;
        align-items: center !important;
        padding: 15px 10px !important;
        height: auto !important;
    }

   nav .logo {
        flex-direction: column; /* Logo gambar di atas teks */
        margin-bottom: 15px;
        gap: 5px;
    }

    nav ul {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    nav ul li {
        width: 100% !important;
    }

    nav ul li a {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 12px !important;
        background-color: rgba(255, 255, 255, 0.15) !important;
        border-radius: 8px !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
    }
    
    nav ul li a.btn {
        margin: 0 !important;
        background-color: var(--dark) !important;
        border: none !important;
    }

    .container {
        padding: 0 15px !important;
    }

    .grid {
        grid-template-columns: 1fr !important; 
    }

    .admin-wrapper {
        flex-direction: column !important;
    }
    
    .sidebar {
        width: 100% !important;
        text-align: center !important;
    }

    .sidebar a {
        display: inline-block !important;
        margin: 5px !important;
    }

     @media screen and (max-width: 900px) {
            /* 1. Header Container: Logo Atas, Menu Bawah */
            nav {
                display: flex !important;
                flex-direction: column !important; /* Logo di atas menu */
                height: auto !important;
                padding: 10px 5% !important;
                align-items: center !important;
            }

            /* 2. Logo Center & Rapi */
            nav .logo {
                margin-bottom: 10px !important;
                width: 100% !important;
                text-align: center !important;
                font-size: 1.4rem !important;
                white-space: normal !important;
            }

            /* 3. Menu Navigasi: BERSAMPINGAN (ROW) */
            nav ul {
                display: flex !important;
                flex-direction: row !important; /* Tetap menyamping */
                justify-content: center !important; /* Posisi tengah */
                flex-wrap: wrap !important; /* Turun baris jika layar terlalu sempit */
                width: 100% !important;
                gap: 8px !important; /* Jarak antar tombol lebih rapat */
            }

            nav ul li {
                width: auto !important; /* Lebar menyesuaikan teks */
                display: inline-block !important;
                margin: 0 !important;
            }

            nav ul li a {
                display: inline-block !important;
                width: auto !important;
                text-align: center !important;
                padding: 6px 12px !important; /* Ukuran tombol pas di HP */
                background: rgba(255,255,255,0.2) !important; /* Kotak transparan halus */
                border-radius: 5px !important;
                font-size: 0.85rem !important; /* Font sedikit lebih kecil agar muat */
                border: 1px solid rgba(255,255,255,0.3) !important;
            }

            /* 4. Grid Produk 1 Kolom */
            .grid {
                grid-template-columns: 1fr !important;
            }
        }