/**
 * App-QR-Code-Box
 * Wird auf Customer-Hauptseite (Filter-Sidebar) und Partner-Dashboard verwendet.
 *
 * Theme-Farben kommen aus /css/theme-variables.css (pro Country):
 *   --theme-primary, --theme-secondary, --brand-primary-dark
 *
 * CSP-konform: keine inline styles, kein externes JS, keine CDNs.
 */

.app-qr-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    text-align: center;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
}

/* Schutz: Bootstrap-Grid-Spalte mit dieser Box darf nicht durch Box-Overflow brechen */
.dashboard-sidebar-col {
    min-width: 0;
}

.app-qr-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}

.app-qr-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--theme-primary, #E87722) 14%, white);
    color: var(--theme-primary, #E87722);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.app-qr-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--theme-secondary, #1a5276);
    line-height: 1.25;
}

.app-qr-subtitle {
    font-size: 0.82rem;
    color: #555;
    margin: 0 0 16px;
    line-height: 1.45;
}

/* === QR-Code-Grid === */
.app-qr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
    align-items: stretch;
}

.app-qr-item {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #fafbfc;
    min-width: 0;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.app-qr-item:hover,
.app-qr-item:focus-visible {
    border-color: var(--theme-primary, #E87722);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    outline: none;
}

.app-qr-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-qr-image {
    width: 100%;
    height: 100%;
    display: block;
}

/* === Store-Buttons (nur Logo, kein Text) === */
.app-qr-store-button {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #ffffff;
    font-family: inherit;
    flex-shrink: 0;
}

.app-qr-store-button i {
    font-size: 1.5rem;
    line-height: 1;
}

.app-qr-store-button--apple {
    background: #000000;
}

.app-qr-store-button--google {
    background: var(--theme-secondary, #1a5276);
}

.app-qr-hint {
    font-size: 0.72rem;
    color: #6c757d;
    font-style: italic;
    margin: 8px 0 0;
    line-height: 1.4;
}

/* ============================================================
 * Mobile (echte Phones, Viewport ≤ 480 px):
 * QR-Codes ausblenden — Buttons reichen, QR wäre zu klein zum Scannen
 * ============================================================ */
@media (max-width: 480px) {
    .app-qr-image-wrapper {
        display: none;
    }
    .app-qr-item {
        padding: 0;
        background: transparent;
        border: none;
    }
    .app-qr-item:hover,
    .app-qr-item:focus-visible {
        transform: none;
        box-shadow: none;
    }
    .app-qr-store-button {
        height: 52px;
    }
    .app-qr-store-button i {
        font-size: 1.7rem;
    }
    .app-qr-hint {
        display: none;
    }
}

/* ============================================================
 * Variante: in Partner-Dashboard (etwas dezenter, Card-Stil)
 * ============================================================ */
.app-qr-box--dashboard {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    text-align: left;
}

.app-qr-box--dashboard .app-qr-header {
    justify-content: flex-start;
}

.app-qr-box--dashboard .app-qr-grid {
    max-width: 420px;
}

/* ============================================================
 * Variante: Landing-Page (zentriert, größer, mehr Atmung)
 * ============================================================ */
.app-promo-section {
    margin: 56px auto 0;
    padding: 0 16px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.app-qr-box--landing {
    max-width: 560px;
    width: 100%;
    padding: 32px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.app-qr-box--landing .app-qr-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
}

.app-qr-box--landing .app-qr-title {
    font-size: 1.4rem;
}

.app-qr-box--landing .app-qr-subtitle {
    font-size: 0.95rem;
    margin-bottom: 24px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.app-qr-box--landing .app-qr-grid {
    gap: 20px;
    max-width: 480px;
    margin: 0 auto 16px;
}

.app-qr-box--landing .app-qr-item {
    padding: 14px;
    background: #ffffff;
}

.app-qr-box--landing .app-qr-store-button {
    height: 48px;
}

.app-qr-box--landing .app-qr-store-button i {
    font-size: 1.7rem;
}

.app-qr-box--landing .app-qr-hint {
    font-size: 0.85rem;
    margin-top: 14px;
}

/* Tablet (768–1024 px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .app-qr-box--landing {
        max-width: 480px;
    }
    .app-qr-box--landing .app-qr-title {
        font-size: 1.25rem;
    }
}

/* Mobile (≤ 768 px) */
@media (max-width: 768px) {
    .app-promo-section {
        margin: 32px auto 0;
        padding: 0 12px;
        box-sizing: border-box;
    }
    .app-qr-box--landing {
        padding: 22px 16px;
        max-width: 100%;
        box-sizing: border-box;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    }
    .app-qr-box--landing .app-qr-icon {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
    }
    .app-qr-box--landing .app-qr-title {
        font-size: 1.15rem;
    }
    .app-qr-box--landing .app-qr-subtitle {
        font-size: 0.85rem;
        margin-bottom: 18px;
    }
    .app-qr-box--landing .app-qr-grid {
        gap: 10px;
        max-width: 100%;
    }
    .app-qr-box--landing .app-qr-store-button {
        height: 56px;
    }
    .app-qr-box--landing .app-qr-store-button i {
        font-size: 1.85rem;
    }
}

/* Sehr schmal (≤ 380 px) — Buttons noch kompakter */
@media (max-width: 380px) {
    .app-qr-box--landing {
        padding: 18px 12px;
    }
    .app-qr-box--landing .app-qr-grid {
        gap: 8px;
    }
    .app-qr-box--landing .app-qr-store-button {
        height: 50px;
    }
}
