/* RESET DASAR */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body {
    height: 100%;
    width: 100%; /* Menambahkan ini untuk mencegah overflow horizontal */
    overflow-x: hidden; /* Mencegah scroll horizontal */
}
body {
    font-family: 'Poppins', sans-serif;
    background-color: #e6f7ea;
    background-image: url('backgroundbody.jpeg'); /* Contoh background image, sesuaikan path jika perlu */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: #34495e;
    line-height: 1.6;
}

/* LAYOUT UTAMA */
.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 120px; /* Jarak untuk footer yang fixed */
}

/* ======================================= */
/* STYLE UNTUK HEADER STANDAR (misal: DASHBOARD) */
/* ======================================= */
.standard-header {
    min-height: 70px;
    padding: 10px 20px;
    background-color: #e6f7ea;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.standard-header .header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    justify-content: flex-start;
}
.standard-header .header-content img {
    height: 50px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}
.standard-header .header-content h2 {
    font-size: 1.5em;
    color: #34495e;
    text-shadow: none;
    margin: 0;
}
.standard-header .header-content p {
    font-size: 0.85em;
    color: #555;
    text-shadow: none;
    margin: 0;
}

/* ======================================= */
/* STYLE UNTUK HEADER BANNER PROMOSI */
/* ======================================= */
.promo-banner-header {
    width: 100%;
    position: relative;
    aspect-ratio: 3 / 1;
    overflow: hidden;
    background-image: url('gambar_produk/foto_header2.jpg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #A0D8A0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* MENU */
.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    background-color: #E6F7E6;
    padding: 12px 20px;
    border-bottom: 1px solid #C8E6C9;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 12px 12px;
    margin-bottom: 0;
}
.menu button {
    background-color: #C8E6C9;
    border: 1px solid #A0D8A0;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    color: #28a745;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    flex-basis: calc(33.33% - 6.67px);
    max-width: 200px;
}
.menu button:hover {
    background-color: #BEE6BE;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

/* KONTEN UTAMA (BODY CONTENT) */
.body-content {
    flex: 1;
    padding: 25px; /* Padding untuk tampilan desktop */
    
    /* PERUBAHAN: Menggunakan gambar sebagai latar belakang */
    background-image: url('backgroundbody.jpeg'); /* Ganti 'gambar_background_anda.jpg' dengan nama file gambar Anda */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #88ff4d; /* Warna fallback jika gambar gagal dimuat */

    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.body-content h3 {
    margin-top: 0px;
    margin-bottom: 10px;
    text-align: center;
    color: #ffffff;
    font-size: 1.8em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* FOOTER */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99;
    background-color: #1a1a1a;
    color: #f0f0f0;
    text-align: center;
    padding: 15px 25px;
    font-size: 15px;
    border-top: 1px solid #333333;
    margin-top: 0;
    border-radius: 0;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.footer .social-links {
    margin-top: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
}
.footer .social-links a {
    color: #90EE90;
    font-size: 28px;
    transition: color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer .social-links a:hover {
    color: #c0ffc0;
    transform: scale(1.1);
}
.footer p {
    margin: 4px 0;
}
.footer a {
    color: #90EE90;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}
.footer a:hover {
    text-decoration: underline;
    color: #c0ffc0;
}

/* INPUT CARI */
#cariProduk {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    max-width: 450px;
    margin: 10px auto 0px auto;
    display: block;
    padding: 12px 18px;
    font-size: 17px;
    border-radius: 10px;
    border: 1px solid #a8d58c;
    background-color: #f0fff0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}
#cariProduk:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* PRODUK LIST */
.produk-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
}
.produk-item {
    border: 1px solid #d4edda;
    padding: 15px;
    min-width: 200px;
    flex-basis: 220px;
    flex-grow: 1;
    flex-shrink: 1;
    max-width: 280px;
    text-align: center;
    border-radius: 15px;
    background-color: #f7fff7;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}
.produk-item:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}
.produk-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    background-color: #f0fdf4;
    margin-bottom: 12px;
    border: 1px solid #e0ffe0;
}
.produk-item h4 {
    color: #28a745;
    margin-bottom: 8px;
    font-size: 1.2em;
}
.produk-item p {
    color: #555;
    font-size: 0.95em;
    margin-bottom: 12px;
}
.produk-item button {
    margin-top: 10px;
    padding: 10px 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.produk-item button:hover {
    background-color: #3e9442;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* FLOATING CART */
.floating-cart {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    /* PERUBAHAN: Warna latar belakang menjadi kuning */
    background-color: #FFD700; /* Warna kuning yang cerah */
    /* PERUBAHAN: Warna ikon/teks menjadi hitam */
    color: #333333; 
    font-size: 28px;
    border-radius: 50%;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    z-index: 100;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.floating-cart:hover {
    transform: translateY(-50%) translateY(-5px) scale(1.05);
    /* PERUBAHAN: Warna hover menjadi kuning yang lebih gelap */
    background-color: #EEDD82; 
}
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    font-size: 13px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

/* MODAL & OVERLAY */
.modal-jumlah, #keranjang-box, #modal-detail, #modal-pratinjau {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border: 1px solid #ccc;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    z-index: 10000;
    max-width: 450px;
    width: 90%;
    border-radius: 15px;
    overflow-y: auto;
    max-height: 90vh;
}
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
}
.modal-content {
    text-align: center;
}
.modal-content h4 {
    margin-bottom: 20px;
    color: #28a745;
    font-size: 1.3em;
}
.modal-content input {
    width: 85%;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 17px;
    border-radius: 8px;
    border: 1px solid #b3e6b3;
    background-color: #f0fff0;
    text-align: center;
}
.modal-content button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.modal-content button:hover {
    background-color: #3e9442;
    transform: translateY(-2px);
}
#keranjang-box h4 {
    margin-top: 0;
    font-size: 20px;
    text-align: center;
    border-bottom: 1px solid #d4edda;
    padding-bottom: 15px;
    color: #28a745;
    margin-bottom: 15px;
}
#keranjang-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e6f7ea;
    border-radius: 8px;
    padding: 5px;
}
#keranjang-box ul li {
    padding: 10px 0;
    border-bottom: 1px solid #f0fdf4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #444;
}
#keranjang-box ul li:last-child {
    border-bottom: none;
}
#keranjang-box .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-weight: bold;
    color: #e74c3c;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}
#keranjang-box .close-btn:hover {
    color: #c0392b;
}
.total-section {
    margin-top: 20px;
    font-size: 16px;
    border-top: 1px solid #d4edda;
    padding-top: 15px;
}
.total-section p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.total-section p strong {
    display: inline-block;
    min-width: 120px;
    color: #28a745;
    font-size: 1.1em;
}
.form-pesan {
    margin-top: 20px;
}
.form-pesan label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
    color: #34495e;
}
.form-pesan input,
.form-pesan textarea {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border-radius: 8px;
    border: 1px solid #b3e6b3;
    font-size: 15px;
    background-color: #f0fff0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-pesan input:focus,
.form-pesan textarea:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}
.form-pesan textarea {
    resize: vertical;
    min-height: 80px;
}
.btn-pesan {
    margin-top: 20px;
    width: 100%;
    background-color: #28a745;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.btn-pesan:hover {
    background-color: #38c172;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}
input::placeholder, textarea::placeholder {
    color: #8ac08a;
    opacity: 0.9;
}

/* ======================================= */
/* MEDIA QUERIES (RESPONSIVE) */
/* ======================================= */
@media (max-width: 600px) {
    /* PENYESUAIAN GLOBAL PENTING UNTUK MENCEGAH OVERFLOW */
    html, body {
        width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden; /* Properti kunci untuk mencegah scroll horizontal */
    }
    .layout {
        padding-bottom: 80px;
    }

    /* HEADER */
    .promo-banner-header {
        aspect-ratio: 3 / 1;
    }
    .standard-header {
        min-height: 50px;
        padding: 5px;
    }
    .standard-header .header-content img {
        height: 40px;
    }
    .standard-header .header-content h2 {
        font-size: 1.2em;
    }
    .standard-header .header-content p {
        font-size: 0.7em;
    }

    /* MENU */
    .menu {
        padding: 5px;
        gap: 3px;
    }
    .menu button {
        padding: 5px 8px;
        font-size: 11px;
        flex-basis: calc(50% - 1.5px);
    }
    
    /* BODY CONTENT & CARI PRODUK */
    .body-content {
        /* PENTING: Hanya body-content yang memiliki padding, agar tidak ada penumpukan */
        padding: 5px; 
        width: 100%;
        box-sizing: border-box;
    }
    .body-content h3 {
        margin-top: 0px;
        margin-bottom: 5px;
        font-size: 1.4em;
    }
    #cariProduk {
        font-size: 13px;
        padding: 8px 10px;
        margin: 5px auto 10px auto; 
        max-width: 100%;
        /* Menggunakan calc() untuk memastikan input pas dengan padding dari body-content */
        width: calc(100% - 10px); 
        display: block;
    }
    
    /* PRODUK LIST (Perbaikan Utama) */
    .produk-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        /* PENTING: Hanya gap di dalam grid, tidak ada padding lagi di sini */
        gap: 3px !important; 
        margin-top: 5px !important;
        width: 100%;
        padding: 0; /* Hapus padding agar total lebar tidak melebihi 100% */
        box-sizing: border-box;
    }
    .produk-item {
        padding: 3px;
        border-radius: 5px;
        width: auto !important;
        box-sizing: border-box; 
    }
    .produk-item img {
        max-width: 100%; 
        height: auto;
        margin-bottom: 3px; 
    }
    .produk-item h4 {
        font-size: 0.7em;
        margin-bottom: 2px;
        word-wrap: break-word; 
        overflow-wrap: break-word;
    }
    .produk-item p {
        font-size: 0.55em;
        margin-bottom: 5px;
        word-wrap: break-word; 
        overflow-wrap: break-word;
    }
    .produk-item button {
        padding: 3px 5px;
        font-size: 9px;
    }

    /* FLOATING CART */
    .floating-cart {
        right: 5px; 
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .floating-cart:hover {
        transform: translateY(-50%) translateY(-3px) scale(1.05);
    }
    .cart-badge {
        font-size: 9px;
        width: 16px;
        height: 16px;
    }

    /* MODAL */
    .modal-jumlah, #keranjang-box, #modal-detail, #modal-pratinjau {
        padding: 8px;
        font-size: 12px;
        max-width: 98%;
    }
    #keranjang-box h4 {
        font-size: 14px;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    #keranjang-box ul {
        max-height: 100px;
    }
    .total-section {
        font-size: 11px;
        padding-top: 8px;
    }
    .form-pesan label {
        font-size: 12px;
        margin-top: 5px;
    }
    .form-pesan input,
    .form-pesan textarea {
        font-size: 11px;
        padding: 5px;
    }
    .btn-pesan {
        font-size: 12px;
        padding: 6px;
        margin-top: 8px;
    }
    
    /* FOOTER */
    .footer {
        padding: 5px;
        font-size: 10px;
    }
    .footer p {
        margin: 1px 0;
    }
    .footer .social-links {
        margin: 3px 0;
        gap: 8px;
    }
    .footer .social-links a {
        font-size: 16px;
    }
}