/* ===================================
   AFFICHE QR CODE COMMERÇANT - Namespace ps-
   Document autonome (MerchantPoster.razor), A4 portrait.
   =================================== */

:root {
    --ps-green: #047857;
    --ps-green-light: #D1FAE5;
    --ps-text: #111827;
    --ps-muted: #4B5563;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #E5E7EB;
    color: var(--ps-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* --- Barre d'outils (écran uniquement) --- */
.ps-toolbar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 20px;
    background: #111827;
    color: #fff;
    font-size: 14px;
}

.ps-toolbar__back {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.ps-toolbar__hint {
    flex: 1;
    min-width: 220px;
    opacity: 0.75;
}

.ps-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: #10B981;
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.ps-btn--light {
    background: rgba(255, 255, 255, 0.14);
}

/* --- Feuille A4 --- */
.ps-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 24px auto;
    padding: 18mm 16mm 12mm;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    border-top: 10mm solid var(--ps-green);
}

.ps-header {
    text-align: center;
}

.ps-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    border-radius: 99px;
    background: var(--ps-green-light);
    color: var(--ps-green);
    font-size: 18px;
    font-weight: 700;
}

.ps-name {
    margin: 10mm 0 4mm;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 46px;
    line-height: 1.1;
}

.ps-tagline {
    margin: 0;
    font-size: 24px;
    color: var(--ps-muted);
}

/* --- QR code --- */
.ps-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10mm;
    margin: 12mm 0 10mm;
}

.ps-qr__code {
    width: 85mm;
    height: 85mm;
    padding: 3mm;
    border: 3px solid var(--ps-green);
    border-radius: 6mm;
    flex-shrink: 0;
}

    .ps-qr__code svg {
        display: block;
        width: 100%;
        height: 100%;
    }

.ps-qr__title {
    margin: 0 0 5mm;
    font-size: 32px;
    font-weight: 800;
    color: var(--ps-green);
}

.ps-qr__text ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 20px;
    line-height: 1.9;
}

.ps-qr__text i {
    color: var(--ps-green);
    margin-right: 8px;
}

/* --- Marchés --- */
.ps-markets {
    padding: 7mm 8mm;
    border-radius: 5mm;
    background: #F3F4F6;
}

    .ps-markets h2 {
        margin: 0 0 4mm;
        font-size: 20px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--ps-green);
    }

    .ps-markets ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 3mm;
        font-size: 17px;
    }

    .ps-markets li {
        display: flex;
        gap: 10px;
    }

    .ps-markets strong {
        flex: 0 0 42mm;
    }

/* --- Pied --- */
.ps-footer {
    margin-top: auto;
    padding-top: 8mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--ps-muted);
}

.ps-footer__brand {
    font-weight: 800;
    color: var(--ps-green);
}

/* --- Écran étroit : feuille mise à l'échelle --- */
@media screen and (max-width: 860px) {
    .ps-sheet {
        width: auto;
        min-height: 0;
        margin: 12px;
        padding: 24px 18px;
    }

    .ps-name {
        font-size: 32px;
    }

    .ps-qr {
        flex-direction: column;
    }

    .ps-qr__code {
        width: 70vw;
        height: 70vw;
    }

    .ps-markets li {
        flex-direction: column;
        gap: 0;
    }

    .ps-markets strong {
        flex-basis: auto;
    }
}

/* --- Impression --- */
@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    body {
        background: #fff;
    }

    .ps-toolbar {
        display: none;
    }

    .ps-sheet {
        margin: 0;
        box-shadow: none;
        width: 210mm;
        height: 297mm;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
