/* assets/css/menu.css - FINAL FIXED SPACING & COMPACT CARD */

/* 1. SETUP HALAMAN */
.menu-page main {
    min-height: 50vh;
    padding-bottom: 50px; /* Tambah padding bawah biar lega */
}

/* 2. HEADER GAMBAR */
#home.hero-slider-container {
    height: 91vh; 
    min-height: 400px;
}

/* 3. FILTER SECTION (FIX JARAK RAPAT) */
.body-filter-container {
    padding: 60px 0 40px; /* Padding atas/bawah diperbesar */
    text-align: center;
}

/* Judul "Kategori Menu" */
.section-title-large {
    font-size: 2.2rem; 
    margin-bottom: 35px !important; /* Jarak ke tombol filter lebih jauh */
}

.filter-buttons {
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    flex-wrap: wrap;
    margin-bottom: 20px; /* Jarak tambahan ke grid produk */
}

.nav-filter {
    padding: 12px 30px; /* Tombol sedikit lebih besar */
    border: 1px solid #ddd; border-radius: 50px;
    background: white; color: #333; font-weight: 600; cursor: pointer;
    transition: 0.3s; text-decoration: none; font-family: 'Montserrat', sans-serif;
}
.nav-filter:hover, .nav-filter.active {
    background: #800000; color: white; border-color: #800000;
    box-shadow: 0 4px 10px rgba(128, 0, 0, 0.2);
}

/* 4. MENU GRID */
.menu-container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    margin-top: 20px; /* Jarak ekstra dari filter ke kartu */
}
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 35px; /* Jarak antar kartu lebih renggang */
    justify-items: center;
}

/* 5. MENU CARD (FIX KOSONG BAGIAN BAWAH) */
.menu-card-item {
    background: white;
    width: 100%;
    border-radius: 15px; /* Lebih rounded */
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
    
    display: flex; 
    flex-direction: column;
    /* KUNCI: Jangan pakai fixed height, pakai min-height secukupnya */
    min-height: auto; 
    height: 100%; /* Agar sesama kartu di satu baris tingginya sama */
}

.menu-card-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(128, 0, 0, 0.15);
    border-color: #ffdce0;
}

/* Gambar */
.menu-card-image {
    width: 100%;
    height: 220px; /* Gambar sedikit lebih tinggi biar proporsional */
    background-color: #f9f9f9;
    flex-shrink: 0;
    position: relative;
}

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

/* Body Kartu */
.menu-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Isi ruang tersisa */
    background: white;
}

.menu-card-title {
    font-size: 1.15rem; 
    font-weight: 700; 
    color: #333;
    margin-bottom: 8px; 
    line-height: 1.3;
    
    /* Batasi 2 baris */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3rem; /* Menjaga tinggi judul konsisten */
}

.menu-card-stock {
    font-size: 0.85rem; 
    color: #888; 
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee; /* Garis pemisah halus */
}

/* Harga */
.menu-card-price {
    font-size: 1.3rem; 
    color: #800000; 
    font-weight: 800;
    margin-bottom: 15px;
}

/* Footer Tombol (Mengisi kekosongan) */
.menu-card-actions {
    margin-top: auto; /* Dorong ke paling bawah */
    display: flex;
    flex-direction: column; 
    gap: 10px; /* Jarak antar tombol */
}

/* Tombol Detail */
.btn-card-detail {
    width: 100%;
    padding: 10px;
    background: white;
    border: 1px solid #ccc;
    color: #666;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}
.btn-card-detail:hover {
    border-color: #333; color: #333; background: #f9f9f9;
}

/* Tombol Keranjang */
.btn-card-add {
    width: 100%;
    padding: 12px;
    background: #800000;
    border: 1px solid #800000;
    color: white;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.95rem;
    display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-card-add:hover {
    background: #600000; border-color: #600000;
    box-shadow: 0 4px 10px rgba(128, 0, 0, 0.2);
}
.btn-card-add:disabled {
    background: #ccc; border-color: #ccc; cursor: not-allowed; box-shadow: none;
}

/* --- KOTAK KATEGORI (MENU AWAL) --- */
.category-selection-grid {
    display: flex; justify-content: center; gap: 30px; flex-wrap: wrap;
    padding: 30px 0; /* Padding lebih lega */
    animation: fadeIn 0.5s ease;
}
.category-box {
    background: white; width: 300px; height: 260px;
    border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; cursor: pointer; border: 2px solid transparent;
    transition: all 0.3s ease; padding: 20px;
}
.category-box:hover {
    transform: translateY(-10px); border-color: #800000;
    box-shadow: 0 15px 40px rgba(128, 0, 0, 0.15);
}
.cat-icon {
    font-size: 3.5rem; color: #800000; margin-bottom: 20px;
    background: #fff5f5; width: 90px; height: 90px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.category-box:hover .cat-icon { background: #800000; color: white; }
.category-box h3 { font-size: 1.5rem; font-weight: 800; color: #333; margin-bottom: 10px; }
.category-box p { color: #666; font-size: 0.95rem; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- MODAL (TIDAK BERUBAH BANYAK) --- */
.product-modal-box {
    background: white; width: 90%; max-width: 900px;
    border-radius: 20px; padding: 0; position: relative;
    overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: zoomIn 0.3s ease; display: flex; 
}
.close-modal-btn {
    position: absolute; top: 15px; right: 20px;
    font-size: 2rem; color: #aaa; cursor: pointer; z-index: 10; line-height: 0.8;
}
.close-modal-btn:hover { color: #800000; }
.product-modal-content { display: flex; width: 100%; flex-direction: row; }
.modal-img-wrapper {
    flex: 1; background: #f4f4f4; min-height: 400px; display: flex; align-items: center; justify-content: center;
}
.modal-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.modal-info-wrapper { flex: 1; padding: 40px; display: flex; flex-direction: column; justify-content: center; }
#modal-title { font-size: 2rem; font-weight: 800; color: #222; margin-bottom: 10px; line-height: 1.2; }
.modal-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.badge { background: #eee; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.price-tag { font-size: 1.8rem; color: #800000; font-weight: 800; margin-bottom: 20px; }
.desc-text { font-size: 1rem; color: #555; line-height: 1.6; margin-bottom: 30px; }
.modal-actions { display: flex; flex-direction: column; gap: 15px; }
.btn-primary.full-width {
    width: 100%; padding: 15px; font-size: 1.1rem;
    background: #800000; color: white; border: none; border-radius: 10px;
    cursor: pointer; transition: 0.3s; font-weight: bold;
}
.btn-primary.full-width:hover { background: #600000; }
.btn-brochure {
    display: block; text-align: center; padding: 12px; border: 2px dashed #800000;
    color: #800000; border-radius: 10px; font-weight: 600; text-decoration: none; transition: 0.3s;
}
.btn-brochure:hover { background: #fff5f5; transform: translateY(-2px); }
@keyframes zoomIn { from {transform: scale(0.9); opacity: 0;} to {transform: scale(1); opacity: 1;} }

/* CUSTOM ALERT BOX (POP UP STOK) */
.custom-alert-box {
    background: white; width: 90%; max-width: 350px; padding: 30px 25px;
    border-radius: 20px; text-align: center; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4); animation: bounceIn 0.4s ease;
    display: flex; flex-direction: column; align-items: center; border: 2px solid #fff5f5;
}
.alert-icon-wrapper { font-size: 4rem; color: #dc3545; margin-bottom: 15px; animation: shake 0.5s ease-in-out; }
.alert-title { font-size: 1.5rem; font-weight: 800; color: #333; margin-bottom: 10px; }
.alert-msg { font-size: 0.95rem; color: #666; margin-bottom: 25px; line-height: 1.5; }
@keyframes bounceIn { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

@media (max-width: 768px) {
    .menu-grid { grid-template-columns: 1fr 1fr; gap: 15px; }
    .product-modal-content { flex-direction: column; }
    .modal-img-wrapper { height: 250px; min-height: auto; }
    .modal-info-wrapper { padding: 25px; }
    #modal-title { font-size: 1.5rem; }
    .menu-card-image { height: 160px; }
    .btn-card-add, .btn-card-detail { font-size: 0.8rem; padding: 8px; }
    .nav-filter { padding: 10px 20px; font-size: 0.9rem; }
    .section-title-large { font-size: 1.8rem; margin-bottom: 25px !important; }
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px); /* Mulai dari lebih rendah */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Terapkan ke Kartu */
.menu-card-item {
    /* ... style lama tetap ada ... */
    
    /* Tambahkan baris ini: */
    animation: cardAppear 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    
    /* Trik biar mulus: set opacity awal 0 */
    opacity: 0; 
}

/* Staggering Effect (Agar muncul berurutan seperti domino) */
.menu-card-item:nth-child(1) { animation-delay: 0.1s; }
.menu-card-item:nth-child(2) { animation-delay: 0.2s; }
.menu-card-item:nth-child(3) { animation-delay: 0.3s; }
.menu-card-item:nth-child(4) { animation-delay: 0.4s; }
.menu-card-item:nth-child(5) { animation-delay: 0.5s; }
.menu-card-item:nth-child(n+6) { animation-delay: 0.6s; } /* Sisanya barengan *