.panel-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #444;
    font-size: 0.9rem;
}

.panel-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.3; }

.list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #111;
    border: 1px solid #1e1e1e;
    border-radius: 10px;
    padding: 0.85rem 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    animation: listItemIn 0.2s ease;
}

@keyframes listItemIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

.list-item.checked { opacity: 0.4; }
.list-item.checked .list-item-name { text-decoration: line-through; }

.list-item-check {
    width: 24px;
    height: 24px;
    accent-color: #a8d5a2;
    cursor: pointer;
    flex-shrink: 0;
}

.list-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    background: #0a0a0a;
    flex-shrink: 0;
    cursor: zoom-in;
    transition: opacity 0.15s;
}
.list-item-img:hover { opacity: 0.8; }

.list-item-info { flex: 1; min-width: 0; }

.list-item-name {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-meta {
    font-size: 0.76rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

.list-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.list-item-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--green);
}

.list-item-qty {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.qty-btn {
    background: #1a2a1a;
    border: 1px solid #2a4a2a;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    color: #a8d5a2;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.qty-btn:hover { background: #2a4a2a; }

.qty-value {
    font-size: 0.8rem;
    color: #888;
    min-width: 16px;
    text-align: center;
}

.list-item-delete {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 8px;
    transition: color 0.2s;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-item-delete:hover { color: #ff6b6b; }

/* ── Mobile hamburger + side drawer ── */
.hamburger-btn {
    display: none;
    background: none;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: #a8d5a2;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    position: fixed;
    left: 1rem;
    top: 1rem;
    z-index: 700;
    transition: all 0.2s;
    min-width: 44px;
    min-height: 44px;
}
.hamburger-btn:hover { background: #1a2a1a; border-color: #3a6a3a; }

.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 800;
}
.drawer-overlay.open { display: block; }

.side-drawer {
    position: fixed;
    left: -280px;
    top: 0;
    width: min(260px, 80vw);
    height: 100dvh;
    background: #0d0d0d;
    border-right: 1px solid #1e1e1e;
    z-index: 900;
    display: flex;
    flex-direction: column;
    transition: left 0.28s ease;
    padding: 0;
}
.side-drawer.open { left: 0; }

.drawer-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid #1e1e1e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #a8d5a2, #f0ebe0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.drawer-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
    padding: 0.25rem;
}
.drawer-close:hover { color: #f0ebe0; }

.drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0.75rem;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #888;
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    padding: 0.85rem 1.15rem;
    border-radius: 10px;
    transition: all 0.2s;
    border: 1px solid transparent;
    min-height: 44px;
}
.drawer-link:hover { background: #111; color: #f0ebe0; }
.drawer-link.active { background: #1a2a1a; border-color: #2a4a2a; color: #a8d5a2; }

.drawer-link-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }

@media (max-width: 768px) {
    .hamburger-btn { display: flex; align-items: center; justify-content: center; }
    header nav { display: none !important; }
    .nav-links { display: none !important; }
    body { padding-top: 3.5rem; }
    header { padding-top: 1rem !important; }
}

.list-toggle-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    background: linear-gradient(135deg, #2a4a2a, #1a3a1a);
    border: 1px solid #3a6a3a;
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    color: #a8d5a2;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 400;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    text-decoration: none;
}

.list-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(168, 213, 162, 0.15);
}

.list-badge {
    background: #a8d5a2;
    color: #0a0a0a;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Weekly money (My List button + drawer) ── */
.list-money {
    font-size: 0.75rem;
    opacity: 0.85;
    white-space: nowrap;
}
.list-money:empty { display: none; }
.list-toggle-btn.over-budget {
    background: linear-gradient(135deg, #4a2020, #3a1414);
    border-color: #8a3a3a;
    color: #f0b0b0;
}
.drawer-summary {
    padding: 1rem 1.25rem 1.5rem;
    border-top: 1px solid #1e1e1e;
    font-size: 0.85rem;
    color: #aaa;
}
.drawer-summary:empty { display: none; }
.drawer-summary-title {
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.5rem;
}
.drawer-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.2rem 0;
}
.drawer-summary-row.total { border-top: 1px solid #1e1e1e; margin-top: 0.3rem; padding-top: 0.4rem; color: #ddd; }
.drawer-summary-row.over { color: #e07070; }
.drawer-summary-note { margin-top: 0.4rem; font-size: 0.75rem; color: #e0a040; }

/* ── Phone bottom tab bar (replaces the ☰ menu and floating My List button) ── */
.bottom-nav { display: none; }

@media (max-width: 768px) {
    .bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 650;
        background: rgba(10, 10, 10, 0.96);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid #1e1e1e;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        min-height: 58px;
        padding: 0.4rem 0.2rem;
        background: none;
        border: none;
        color: #777;
        font-family: 'DM Sans', sans-serif;
        font-size: 0.68rem;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .bottom-tab.active { color: #a8d5a2; }
    .bottom-tab-icon { position: relative; display: flex; }
    .bottom-tab-badge {
        position: absolute;
        top: -5px;
        right: -10px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 9px;
        background: #a8d5a2;
        color: #0a0a0a;
        font-size: 0.62rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .bottom-tab-badge[hidden] { display: none; }
    .bottom-tab-money { font-size: 0.6rem; color: #a8d5a2; line-height: 1; }
    .bottom-tab-money:empty { display: none; }
    .bottom-tab-money.over { color: #e07070; }

    .toast { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
    /* iPhones zoom the page when you tap a field with text under 16px */
    input, select, textarea { font-size: 16px !important; }
    .list-toggle-btn { display: none !important; }
    .hamburger-btn { display: none !important; }
    body {
        padding-top: 0 !important;
        padding-bottom: calc(66px + env(safe-area-inset-bottom)) !important;
    }
}
