        :root {
            --primary: #B5126C;
            --secondary: #900e55;
            --bg: #f4f7f6;
            --text: #333;
            --card-bg: #fff;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg);
            color: var(--text);
            margin: 0;
            padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
            display: flex;
            justify-content: center;
            -webkit-tap-highlight-color: transparent;
        }
        .container {
            width: 100%;
            max-width: 600px;
            background: var(--card-bg);
            padding: 20px;
            min-height: 100vh;
            box-sizing: border-box;
            position: relative;
        }

        .top-nav {
            display: flex;
            justify-content: flex-end;
            margin-bottom: 20px;
            padding-top: max(10px, env(safe-area-inset-top));
        }

        #cart-btn {
            background: var(--primary);
            color: white;
            padding: 10px 18px;
            border-radius: 25px;
            font-weight: bold;
            font-size: 15px;
            border: none;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: transform 0.2s ease;
        }

        .header {
            text-align: center;
            margin-bottom: 30px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .logo {
            max-width: 200px;
            height: auto;
            margin-bottom: 15px;
            cursor: pointer;
        }
        h1 { color: var(--primary); margin: 0; font-size: 24px; font-weight: 800; }
        p.subtitle { color: #666; margin-top: 5px; font-size: 14px; }

        .upload-area {
            border: 2px dashed var(--primary);
            border-radius: 12px;
            padding: 30px 20px;
            text-align: center;
            background: #fdf2f8;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .upload-row {
            background: #fff;
            border-radius: 8px;
            padding: 15px;
            box-shadow: 0 2px 4px rgba(181,18,108,0.1);
            position: relative;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: background-color 0.2s;
        }

        .upload-row:active { transform: scale(0.98); background: #f8f9fa; }

        .upload-row input[type="file"] {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            opacity: 0;
            cursor: pointer;
            z-index: 10;
        }

        .upload-icon { font-size: 24px; }
        .upload-text { font-size: 16px; font-weight: bold; color: var(--primary); margin: 0; }
        .upload-row.gallery .upload-text { color: #555; }
        .upload-row.gallery { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

        #preview-container { display: none; margin-top: 20px; text-align: center; }
        #preview-image { max-width: 100%; max-height: 300px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); object-fit: contain; }

        .btn-container { text-align: center; margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
        button { background-color: var(--primary); color: white; border: none; padding: 16px; font-size: 18px; border-radius: 12px; font-weight: bold; width: 100%; box-shadow: 0 4px 6px rgba(181,18,108,0.2); cursor: pointer; box-sizing: border-box; }
        button:active:not(:disabled) { background-color: var(--secondary); transform: scale(0.98); }
        button:disabled { background-color: #ccc; box-shadow: none; }
        .btn-outline { background-color: transparent; color: var(--primary); border: 2px solid var(--primary); box-shadow: none; }
        .btn-outline:active:not(:disabled) { background-color: #fdf2f8; }

        .btn-danger { background-color: transparent; color: #dc3545; border: 2px solid #dc3545; box-shadow: none; margin-top: 15px; }
        .btn-danger:active:not(:disabled) { background-color: #f8d7da; }

        .loader { display: none; border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 20px auto; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        #result-container { display: none; margin-top: 20px; border-top: 2px solid #eee; padding-top: 20px; }
        .result-title { margin: 0 0 5px 0; font-size: 20px; color: var(--primary); font-weight: bold; line-height: 1.3; }
        .info-box { background: #f8f9fa; padding: 15px; border-radius: 10px; border-left: 5px solid var(--primary); margin-bottom: 15px; }
        .info-box span { display: block; font-size: 12px; color: #666; text-transform: uppercase; margin-bottom: 5px; }
        .info-box strong { font-size: 20px; color: var(--text); }
        .order-section { background: #fdf2f8; padding: 20px; border-radius: 12px; margin-top: 20px; text-align: center; border: 1px solid #f8bbd0; }
        .quantity-wrapper { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 20px; }
        .quantity-wrapper label { font-size: 18px; font-weight: bold; color: var(--primary); }
        .quantity-wrapper input { width: 80px; padding: 12px; font-size: 20px; text-align: center; border: 2px solid #ccc; border-radius: 8px; }

        .variant-section {
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
            text-align: left;
            transition: all 0.3s ease;
        }

        .variant-section.warning-mode {
            background: #fff3cd;
            border: 2px solid #ffeeba;
        }

        .variant-section.success-mode {
            background: #e8f5e9;
            border: 1px solid #c8e6c9;
        }

        .variant-section label {
            font-size: 14px; font-weight: bold; display:block; margin-bottom: 8px;
        }

        .warning-mode label { color: #856404; }
        .success-mode label { color: #2e7d32; font-weight: normal; font-size: 13px; }

        .variant-section select {
            width: 100%; padding: 12px; border-radius: 8px; font-size: 16px; background: #fff;
        }

        .warning-mode select { border: 2px solid #856404; }
        .success-mode select { border: 1px solid #81c784; color: #2e7d32; }

        .not-found-banner { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; padding: 15px; border-radius: 10px; margin-bottom: 20px; text-align: center; font-weight: bold; display: none; }
        .error { color: #dc3545; background: #f8d7da; padding: 15px; border-radius: 10px; margin-top: 20px; display: none; text-align: left; font-size: 14px; word-wrap: break-word; }

        #cart-view { display: none; }
        .cart-item { background: #fff; border: 1px solid #ddd; border-radius: 10px; padding: 15px; margin-bottom: 15px; display: flex; align-items: flex-start; gap: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
        .cart-item-img { width: 60px; height: 60px; object-fit: contain; border-radius: 8px; border: 1px solid #eee; flex-shrink: 0; }
        .cart-item-details { flex-grow: 1; min-width: 0; }
        .cart-item-title { margin: 0 0 4px 0; font-size: 15px; font-weight: bold; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .cart-item-nr { margin: 0 0 4px 0; font-size: 12px; color: #666; }
        .cart-item-qty { margin: 0; font-size: 14px; font-weight: bold; }
        .cart-item-price { margin: 0 0 6px 0; font-size: 15px; font-weight: bold; color: #28a745; }
        .cart-item-qty-row { display: flex; align-items: center; gap: 6px; margin: 4px 0 0 0; }
        .cart-qty-btn { width: 30px; height: 30px; border-radius: 6px; border: 1px solid #ccc; background: #f5f5f5 !important; font-size: 18px; font-weight: bold; color: #333; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; min-width: 30px; box-shadow: none !important; }
        .cart-qty-btn:active { background: #e0e0e0 !important; }
        .cart-qty-input { width: 50px; height: 30px; text-align: center; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; font-weight: bold; -moz-appearance: textfield; }
        .cart-qty-input::-webkit-outer-spin-button, .cart-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .cart-qty-label { font-size: 13px; color: #666; }
        .cart-staffel-hint { margin: 6px 0 0 0; padding: 4px 8px; background: #fff3cd; border-radius: 6px; font-size: 12px; color: #856404; line-height: 1.3; }
        .cart-summary { background: #f8f9fa; border: 2px solid #ddd; border-radius: 10px; padding: 15px; margin-top: 5px; }
        .cart-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 14px; color: #333; }
        .cart-summary-total { border-top: 2px solid var(--primary); padding-top: 8px; margin-top: 6px; font-size: 17px; font-weight: bold; color: var(--primary); }
        .cart-summary-note { font-size: 12px; color: #888; font-style: italic; padding-top: 4px; }
        .cart-item-delete { background: none !important; border: none !important; font-size: 24px; color: #dc3545; padding: 0 5px; box-shadow: none !important; width: auto; min-width: 0; flex-shrink: 0; cursor: pointer; }
        .empty-cart-msg { text-align: center; color: #888; padding: 40px 20px; font-size: 16px; }

        #multi-product-list > div:active { transform: scale(0.98); background: #f8f9fa !important; }

        .cart-header-container {
            display: flex;
            align-items: center;
            border-bottom: 2px solid #eee;
            padding-bottom: 10px;
            margin-bottom: 20px;
        }

        .cart-header-container h2 {
            color: var(--primary);
            margin: 0;
            flex-grow: 1;
        }

        .cart-logo-small {
            height: 30px;
            cursor: pointer;
        }


/* Versteckt den Hinweis, wenn die App als PWA über das Icon geöffnet wird */
@media all and (display-mode: standalone) {
    #install-instructions {
        display: none !important;
    }
}
@media all and (display-mode: fullscreen) {
    #install-instructions {
        display: none !important;
    }
}

/* PWA Install Banner */
#pwa-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    padding: 0 12px max(12px, env(safe-area-inset-bottom)) 12px;
    pointer-events: none;
}
#pwa-banner.visible {
    display: block;
}
#pwa-banner-inner {
    pointer-events: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.15);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}
#pwa-banner-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
}
#pwa-banner-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.45;
    color: #222;
}
#pwa-banner-text strong {
    display: block;
    font-size: 15px;
    color: #BD0068;
    margin-bottom: 3px;
}
#pwa-banner-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border: 1.5px solid #BD0068;
    border-radius: 50%;
    background: #fff;
    color: #BD0068;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    box-sizing: content-box;
    margin: -9px -9px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#pwa-banner-btn {
    background: #BD0068;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
/* Pfeil unten mittig, zeigt auf Safari Share-Button */
#pwa-banner-arrow {
    display: none;
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 10px solid #fff;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    max-width: 500px;
    margin: 0 auto;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    z-index: 100000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.toast.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}
.toast.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Scan-Historie */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.history-item:last-child { border-bottom: none; }
.history-name { color: var(--text); flex: 1; }
.history-nr { color: var(--primary); font-weight: 600; margin-left: 8px; white-space: nowrap; }
