/* Menu Container */
.menu-container {
    max-width: 1200px;
    margin: 80px auto 2rem;
    padding: 2rem;
}

.customer-info {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.info-group {
    flex: 1;
}

.info-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.info-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.info-group input[readonly] {
    background: #f5f5f5;
}

.menu-section {
    margin-bottom: 2rem;
}

.menu-section h2 {
    color: var(--primary);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.5rem;
}

.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px)); /* CHANGED: batasi lebar kartu agar tidak melebar */
    justify-content: center; /* CHANGED: kartu tidak memaksakan penuh container */
    gap: 0.9rem;
}

@media (max-width: 1200px) {
    .menu-items {
        grid-template-columns: repeat(auto-fit, minmax(160px, 200px)); /* CHANGED: ukuran kartu sedikit mengecil */
    }
}

@media (max-width: 900px) {
    .menu-items {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.85rem;
        padding: 0 1rem 0.75rem 1rem;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 1rem;
        justify-content: flex-start;
    }

    .menu-items::-webkit-scrollbar {
        height: 8px;
    }

    .menu-items::-webkit-scrollbar-thumb {
        background: rgba(66, 42, 28, 0.45);
        border-radius: 99px;
    }

    .menu-items {
        -webkit-overflow-scrolling: touch;
    }

    .menu-card {
        flex: 0 0 200px;
        min-width: 200px;
        max-width: 200px;
        width: auto;
        scroll-snap-align: start;
    }
}

@media (max-width: 680px) {
    .menu-card {
        flex: 0 0 170px;
        min-width: 170px;
        max-width: 170px;
    }
}

@media (max-width: 520px) {
    .menu-card {
        flex: 0 0 150px;
        min-width: 150px;
        max-width: 150px;
    }
}

.menu-card {
    background: white;
    border-radius: 12px;
    padding: 0.95rem; /* CHANGED: padding lebih ringkas */
    max-width: 220px; /* CHANGED: lebar maksimum kartu */
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.menu-card:hover {
    transform: translateY(-3px);
}

.menu-card.sold-out, .menu-card.coming-soon {
    opacity: 0.6;
    background: #e0e0e0;
}

.price {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.temp-selector {
    display: flex;
    gap: 0.5rem;
    margin: 0.8rem 0;
}

.temp-btn {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid var(--primary);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.temp-btn.cold.active {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
}

.temp-btn.hot.active {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.qty-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.8rem 0;
}

.qty-selector button {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

.btn-add-to-cart {
    width: 100%;
    padding: 0.3rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-to-cart:hover:not(:disabled) {
    background: var(--primary-dark);
}

.badge-sold, .badge-coming {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
}

.badge-sold { background: var(--danger); color: white; }
.badge-coming { background: #ff9800; color: white; }

/* Floating Cart */
.cart-sticky {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
}

.cart-toggle {
    background: var(--primary);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s;
    font-size: 1.5rem;
    position: relative;
}

.cart-toggle:hover {
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.cart-panel.open {
    right: 0;
}

.cart-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header .close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.cart-item-info {
    flex: 2;
}

.cart-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.cart-item-actions button {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.cart-remove {
    color: var(--danger);
    background: none !important;
}

.cart-footer {
    padding: 1rem;
    border-top: 2px solid #eee;
}

.cart-footer p {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.cart-footer button {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    max-width: 500px;
    width: 90%;
    padding: 2rem;
    border-radius: 12px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0 1rem;
}

.btn-danger {
    flex: 1;
    background: var(--danger);
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-success {
    flex: 1;
    background: var(--success);
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-close {
    width: 100%;
    padding: 0.5rem;
    background: #ccc;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Gambar Menu */

.menu-gambar {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    background: #f0f0f0;
    margin-bottom: 0.8rem;  /* ← jarak ke teks */
}

.menu-gambar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-card {
    background: white;
    border-radius: 12px;
    padding: 0.8rem;  /* ← kurangi padding */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

@media (max-width: 768px) {
    .menu-container {
        padding: 1rem;
        margin-top: 100px; /* 🔴 CHANGED: memberi ruang untuk navbar */
    }
    .customer-info {
        flex-direction: column;
        gap: 1rem;
    }
    .customer-info .info-group {
        width: 100%;
    }
    .menu-items {
        grid-template-columns: repeat( auto-fit, minmax(180px, 1fr) ); /* 🔴 CHANGED: lebih fleksibel */
    }
    .menu-card {
        padding: 1rem;
    }
    .cart-sticky {
        right: 12px;
        bottom: 12px;
    }
    .cart-toggle {
        width: 52px;
        height: 52px;
        font-size: 1.35rem;
    }
    .cart-panel {
        width: 100%;
        right: -100%;
        max-width: 420px;
    }
    .menu-card {
        padding: 0.95rem;
    }
    .cart-header {
        padding: 1.2rem;
    }
    .cart-footer {
        padding: 0.9rem;
    }
    .cart-footer button {
        padding: 0.9rem;
    }
    .modal-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .menu-container {
        margin-top: 90px;
        padding: 0.9rem;
    }
    .menu-items {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* CHANGED: tampilkan 2 kolom pada hp */
    }
    .menu-card {
        padding: 0.85rem;
    }
    .menu-items {
        grid-template-columns: 1fr;
    }
    .cart-toggle {
        width: 48px;
        height: 48px;
    }
    .cart-badge {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }
}