:root {
    --main-bg: #f7f9fc;
    --card-bg: #fff;
    --accent: #007bff;
    --accent-hover: #0056b3;
    --border: #e0e5ec;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --radius: 16px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--main-bg);
    min-height: 100vh;
}

h1 {
    text-align: center;
    margin: 24px 0 16px 0;
    font-size: 2.1rem;
    color: var(--accent);
    letter-spacing: 1px;
}

#container {
    display: flex;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 80vh;
    padding: 0 16px 32px 16px;
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.left-panel {
    flex: 0 0 320px;
    min-width: 280px;
    max-width: 370px;
}

.right-panel {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

/* Card-Style */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.action-buttons button {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 9px;
    background-color: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.action-buttons button.reset {
    background-color: #dc3545;
}
.action-buttons button.remove-pfand {
    background-color: #ffc107;
    color: #000;
}
.action-buttons button:hover {
    background-color: var(--accent-hover);
    opacity: 0.94;
}

/* Aktuelle Bestellung */
#receipt-section h3 {
    margin: 0 0 8px 0;
    font-size: 1.14rem;
    color: #333;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}
#receipt-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
#receipt-list li {
    background: #f6f8fa;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 5px;
    font-size: 0.97rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#receipt-list li span {
    flex: 1;
}
.delete-item-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 8px;
    padding: 0;
    line-height: 1;
    transition: background 0.2s, transform 0.1s;
}
.delete-item-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}
#total {
    font-weight: bold;
    font-size: 1.09rem;
    color: var(--accent);
    margin-top: 6px;
    padding: 8px 0 0 0;
    border-top: 1px solid var(--border);
}

/* Historie */
#history-section h3 {
    margin-bottom: 5px;
    font-size: 1.09rem;
    color: #555;
    letter-spacing: 0.5px;
}
#history-list {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 6px;
}
#history-list .history-item {
    background: #f6f8fa;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 5px;
    font-size: 0.94rem;
}

/* Button Panel (Bestellbuttons) -- jetzt wirklich rechts! */
#button-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 12px;
    min-height: 400px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-x: hidden;
}

/* Container für Warengruppen */
#artikel-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* Grid für Buttons */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    width: 100%;
}

.button-grid button {
    width: 100%;
    min-width: 80px;
    height: 46px;
    font-size: 0.9rem;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: background 0.2s, box-shadow 0.2s;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    padding: 0 8px;
    line-height: 1.1;
}


.button-grid button:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}
.button-grid button:active {
    background-color: #003366;
}

/* Warengruppen (Kategorie-Container) */
.warengruppe {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
    flex: 1 1 calc(33.333% - 12px);
    min-width: 200px;
    max-width: 100%;
    box-sizing: border-box;
}
.warengruppe:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.warengruppe h3 {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}
.warengruppe .button-grid {
    margin-top: 8px;
}
.warengruppe .button-grid button:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Responsiv für iPad Pro Landscape & MacBook */
@media (min-width: 1024px) and (max-width: 1366px) {
    #container {
        gap: 24px;
        padding: 0 12px 24px 12px;
    }
    .left-panel {
        flex: 0 0 300px;
        min-width: 260px;
        max-width: 320px;
    }
    #artikel-buttons {
        gap: 12px;
    }
    .warengruppe {
        flex: 1 1 calc(50% - 8px);
        min-width: 180px;
    }
    .button-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
    .button-grid button {
        height: 42px;
        font-size: 0.85rem;
        padding: 0 6px;
    }
    .action-buttons {
        gap: 6px;
    }
    .action-buttons button {
        padding: 8px 6px;
        font-size: 0.85rem;
    }
}

/* Responsiv für iPad & Tablets */
@media (max-width: 1024px) {
    #container {
        flex-direction: column;
        gap: 20px;
        max-width: 98vw;
        padding: 0 8px 8px 8px;
    }
    .left-panel, .right-panel {
        max-width: 100%;
        gap: 12px;
    }
    .left-panel {
        flex: none;
        min-width: auto;
    }
    #button-panel {
        padding: 12px 6px;
    }
    #artikel-buttons {
        gap: 12px;
    }
    .warengruppe {
        flex: 1 1 calc(50% - 8px);
        min-width: 150px;
    }
    .button-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .action-buttons {
        gap: 5px;
    }
    .action-buttons button {
        padding: 7px 5px;
        font-size: 0.8rem;
    }
}

@media (max-width: 700px) {
    #container {
        flex-direction: column;
        gap: 12px;
        padding: 0 4px 6px 4px;
    }
    .left-panel, .right-panel {
        max-width: 100%;
        gap: 8px;
    }
    #button-panel {
        padding: 8px 4px;
    }
    .card {
        padding: 10px 8px;
        gap: 8px;
    }
    #artikel-buttons {
        gap: 10px;
    }
    .warengruppe {
        flex: 1 1 100%;
        min-width: 100%;
    }
    .button-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 7px;
    }
    .button-grid button {
        min-width: 70px;
        height: 40px;
        font-size: 0.85rem;
    }
    .action-buttons {
        flex-wrap: wrap;
        gap: 4px;
    }
    .action-buttons button {
        padding: 6px 4px;
        font-size: 0.75rem;
    }
}
