
:root { 
    --site-footer-h: 56px;
    --action-footer-h: 90px;
}


body {
    font-family: Arial, sans-serif;
    background-color: #f4f6f9;
    margin: 0;
    padding: 0 0 calc(var(--site-footer-h) + var(--action-footer-h)) 0;
}

header .headimage {
    display: flex;
    justify-content: center;
    gap: 2em;
    padding: 1em;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

main .container {
    max-width: 1200px;
    margin: 2em auto;
    padding: 0 1em;
}
.caption {
    text-align: center;
    margin-bottom: 2em;
}
.caption h1 { margin-bottom: 0.5em; }

.button-group {
    display: flex;
    justify-content: center;
    gap: 1em;
    flex-wrap: wrap;
}

button {
    padding: 0.6em 1.3em;
    font-size: 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary { background-color: #007bff; color: white; }
.btn-secondary { background-color: #6c757d; color: white; }
.btn-success { background-color: #28a745; color: white; }
.btn-danger { background-color: #dc3545; color: white; }

.btn-invoice {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background-color: #28a745; 
    color: white;
    text-decoration: none;

    padding: 0.6em 1.2em;  
    font-size: 1em;
    border-radius: 8px;

    min-width: 140px;     
    text-align: center;

    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-invoice:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.flash {
    margin: 1em 0;
    padding: 0.8em;
    border-radius: 5px;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}
.flash.danger { background-color: #f8d7da; color: #721c24; }
.flash.warning { background-color: #fff3cd; color: #856404; }
.flash.success { background-color: #d4edda; color: #155724; }

.flash {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.flash.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.flash-close-btn {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.flash-close-btn:hover {
    opacity: 0.7;
}

.user-grid, .tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1em;
    max-height: 250px;
    overflow-y: auto;
    padding: 1em;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-bottom: 1em;
}
.tile {
    position: relative; 
    background-color: #d9eaf7;
    border-radius: 10px;
    padding: 1em;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s, border 0.15s;
    user-select: none;
}
.tile.selected { border: 3px solid #007bff; transform: scale(1.05); }
.tile.low-stock { background-color: #fff3cd; }
.tile.out-stock { background-color: #f8d7da; cursor: not-allowed; }

.tile .stock-note {
    font-size: 0.8em;
    font-weight: bold;
    color: #a33;
    margin-top: 0.5em;
}
.tile .quantity-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}


.tile.bestseller {
    background-color: #ffe680;  
    border: 2px solid #ffc107;  
}

.tile .bestseller-label {
    display: block;
    margin-top: 0.3em;
    padding: 2px 4px;
    background-color: #ffc107; 
    color: #000;
    font-weight: bold;
    font-size: 0.85em;
    border-radius: 4px;
    text-align: center;
}

#total {
    text-align: center;
    font-size: 1.4em;
    font-weight: bold;
    margin: 0.5em 0;
    padding: 0;
    background: #ffffffcc;
    border-radius: 8px;
}

input[type=password] {
    margin: 0.5em 0;
    padding: 0.5em;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}

.action-footer {
    position: fixed;
    bottom: calc(var(--site-footer-h) + 20px);
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    z-index: 20; 
    pointer-events: auto;
    background: transparent;
}

.order-footer {
    position: fixed;              
    bottom: calc(var(--site-footer-h) + 20px);
    right: 20px;                  
    
    display: flex;               
    flex-direction: row;
    align-items: center;
    gap: 12px;

    z-index: 25;                  
}

.order-footer .btn-success { 
    order: 1;
    font-size: 1.15em;
    padding: 0.8em 1.6em;
    border-radius: 10px;

    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.35);
    transition: 
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.order-footer .btn-secondary { 
    order: 2;
    font-size: 1em;
    padding: 0.6em 1.2em;
}

.order-footer .btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(40, 167, 69, 0.45);
}

.order-footer .btn-success:disabled {
    background-color: #a5d6b0;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
    transform: none;
}

.order-footer .btn-secondary.hidden {
    display: none;
}

@keyframes bestellen-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.6);
    }
    70% {
        transform: scale(1.04);
        box-shadow: 0 0 0 12px rgba(40, 167, 69, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.order-footer .btn-success.attention {
    animation: bestellen-pulse 1.6s infinite;
}

.logout-confirm {
    display: none;
    background: #fff;
    padding: 1em;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 250px;
}

.logout-confirm a {
    display: inline-block;
    margin-top: 0.5em;
    font-size: 0.9em;
    text-decoration: none;
    color: #007bff;
}
.logout-confirm a:hover { text-decoration: underline; }

.site-footer {
    background-color: #e0e0e0;
    text-align: center;
    padding: 0.6em 0;
    font-size: 0.9em;
    color: #333;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
    z-index: 10;
    pointer-events: none; 
}
.site-footer * { pointer-events: auto; }

@media (max-width: 1024px) {
    :root {
        --action-footer-h: 120px;
    }

    .order-footer {
        gap: 16px;
    }
}
