:root {
    --bg-dark: #121212;
    --card-bg: rgba(30, 30, 30, 0.7);
    --coffee: #6f4e37;
    --gold: #d4af37;
    --text-white: #ffffff;
    --text-muted: #aaaaaa;
    --glass: rgba(255, 255, 255, 0.05);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Header & Gradient Logo */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 20px;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass);
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--coffee) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-top: -4px;
}

.header-actions { display: flex; gap: 15px; }
.icon-btn { background: none; border: none; color: white; cursor: pointer; }

/* Hero Section */
.hero-section {
    margin: 15px;
    height: 180px;
    border-radius: var(--radius);
    background: url('LOGO-HEADER.webp') center/cover no-repeat;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.hero-overlay h2 { font-size: 1.5rem; font-weight: 700; }
.hero-overlay p { font-size: 0.85rem; color: var(--gold); }

/* Search Bar */
.search-section { padding: 10px 20px; }
.search-wrapper input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 30px;
    border: 1px solid var(--glass);
    background: var(--card-bg);
    color: white;
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-wrapper input:focus { border-color: var(--gold); background: rgba(45,45,45,1); }

/* Category Scrolling */
.category-nav {
    display: flex;
    overflow-x: auto;
    padding: 10px 20px;
    gap: 12px;
    scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.cat-chip {
    padding: 8px 20px;
    background: var(--card-bg);
    border: 1px solid var(--glass);
    border-radius: 25px;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.cat-chip.active {
    background: var(--gold);
    color: var(--bg-dark);
    border-color: var(--gold);
    font-weight: 600;
}

/* Menu Grid & Cards */
.menu-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px;
    padding-bottom: 120px;
}

.menu-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px;
    border: 1px solid var(--glass);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.menu-card:active { transform: scale(0.97); }

.card-img-box {
    width: 100%;
    height: 120px;
    background: #252525;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.card-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s;
}

.card-img-box img.loaded { opacity: 1; }

.card-name { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.card-desc { font-size: 0.75rem; color: var(--text-muted); height: 2.2em; overflow: hidden; margin-bottom: 12px; }

.card-price-row {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-tag { color: var(--gold); font-weight: 700; font-size: 0.9rem; }
.btn-add {
    background: var(--coffee);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

/* Floating Cart FAB */
.cart-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999;
}

.cart-icon-wrapper {
    background: var(--gold);
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    position: relative;
}

.cart-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff3b30;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--gold);
}

/* Modal Checkout */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: flex-end;
}

.modal-content {
    background: #1e1e1e;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-modal { background: none; border: none; color: white; font-size: 2rem; }

.cart-items-list { overflow-y: auto; flex-grow: 1; }

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass);
}

.item-meta h4 { font-size: 0.95rem; }
.item-meta p { color: var(--gold); font-size: 0.8rem; }

.item-controls { display: flex; align-items: center; gap: 12px; }
.qty-btn { background: #333; color: white; border: none; width: 28px; height: 28px; border-radius: 6px; }

.checkout-footer { padding-top: 20px; border-top: 1px solid var(--glass); }
.driver-selection { margin-bottom: 15px; }
.driver-selection select {
    width: 100%;
    background: #2a2a2a;
    color: white;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--glass);
    margin-top: 8px;
}

.alamat-input {
    margin-bottom: 15px;
}

.alamat-input textarea {
    width: 100%;
    background: #2a2a2a;
    color: white;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--glass);
    margin-top: 8px;
    font-family: inherit;
    resize: none;
}

.total-price-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.btn-checkout {
    width: 100%;
    background: linear-gradient(135deg, var(--coffee), var(--gold));
    color: var(--bg-dark);
    padding: 16px;
    border-radius: 14px;
    border: none;
    font-weight: 800;
    cursor: pointer;
}

/* PWA Popup */
.pwa-popup {
    position: fixed;
    bottom: 30px;
    left: 20px;
    right: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--gold);
    border-radius: 20px;
    padding: 20px;
    z-index: 3000;
    display: none;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.pwa-content { display: flex; flex-direction: column; gap: 15px; }
.pwa-actions { display: flex; gap: 10px; }
.btn-pwa-main { flex: 1; background: var(--gold); border: none; padding: 10px; border-radius: 8px; font-weight: 700; }
.btn-pwa-alt { background: none; border: 1px solid var(--glass); color: white; padding: 10px; border-radius: 8px; }

@media (max-width: 600px) {
    .menu-container {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (min-width: 768px) {
    .menu-container { grid-template-columns: repeat(4, 1fr); }
    .hero-section { height: 320px; margin: 20px auto; max-width: 1200px; }
    .modal-content { border-radius: 24px; margin-bottom: 40px; }
    .modal-overlay { align-items: center; }
}