/**
 * Header mobile Prowash — isolé du thème Lonyo / desktop.
 * Chargé en dernier (après mobile.css) pour éviter les régressions de cascade.
 */
@media (max-width: 767.98px) {
    .pe-mobile-header.pe-mhome-header {
        position: sticky;
        top: 0;
        z-index: 120;
        width: 100%;
        background: #fff;
        border-bottom: 1px solid rgba(20, 45, 111, 0.08);
        box-shadow: 0 4px 18px rgba(20, 45, 111, 0.04);
        padding-top: env(safe-area-inset-top, 0px);
        isolation: isolate;
    }

    .pe-mobile-header .pe-mhome-header__inner {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 8px;
        row-gap: 0;
        flex-wrap: nowrap !important;
        width: 100%;
        max-width: 100%;
        min-height: 52px;
        margin: 0;
        padding:
            6px
            max(12px, env(safe-area-inset-right, 0px))
            6px
            max(12px, env(safe-area-inset-left, 0px));
        box-sizing: border-box;
    }

    .pe-mobile-header .pe-mhome-header__logo {
        display: inline-flex !important;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        line-height: 0;
        text-decoration: none;
    }

    .pe-mobile-header .pe-mhome-header__logo img {
        display: block;
        height: 28px;
        width: auto;
        max-width: min(128px, 40vw);
        object-fit: contain;
    }

    .pe-mobile-header .pe-mhome-header__actions {
        display: inline-flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        min-width: 0;
        flex-shrink: 0;
    }

    .pe-mobile-header .pe-header-cart-btn,
    .pe-mobile-header .pe-mhome-header__menu.lonyo-menu-toggle,
    .pe-mobile-header .pe-mobile-header__account {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 0;
        border-radius: 11px;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    .pe-mobile-header .pe-header-cart-btn {
        border: 1px solid rgba(20, 45, 111, 0.12);
        background: #f4f7ff;
        color: #142d6f;
        font-size: 20px;
    }

    .pe-mobile-header .pe-header-cart-btn:active {
        background: #e8efff;
    }

    .pe-mobile-header .pe-mhome-header__menu.lonyo-menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin: 0;
        border: 1px solid rgba(20, 45, 111, 0.12);
        background: #f4f7ff;
        color: #142d6f;
        font-size: 21px;
        line-height: 1;
        cursor: pointer;
    }

    .pe-mobile-header .pe-mhome-header__menu.lonyo-menu-toggle:active {
        background: #e8efff;
    }

    .pe-mobile-header .pe-mobile-header__account {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        max-width: none;
        border: 1px solid rgba(20, 45, 111, 0.08);
        background: #f4f7ff;
        color: #142d6f;
        font-size: 13px;
        font-weight: 700;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
        overflow: hidden;
    }

    .pe-mobile-header .pe-mobile-header__account:active {
        background: #e8efff;
    }

    .pe-mobile-header .pe-mobile-header__account-icon {
        font-size: 20px;
        line-height: 1;
        flex-shrink: 0;
    }

    .pe-mobile-header .pe-mobile-header__account .pe-space-link__avatar {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #fff;
        flex-shrink: 0;
    }

    .pe-mobile-header .pe-mobile-header__account .pe-space-link__label,
    .pe-mobile-header .pe-mobile-header__account-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 88px;
    }

    .pe-mobile-header .pe-mobile-header__account.pe-space-link--avatar {
        width: auto;
        min-width: 40px;
        max-width: 132px;
        padding: 4px 10px 4px 4px;
        border-radius: 999px;
    }

    /* Très petits écrans : icônes seules pour gagner de la place */
    @media (max-width: 420px) {
        .pe-mobile-header .pe-mobile-header__account:not(.pe-space-link--avatar) .pe-mobile-header__account-text,
        .pe-mobile-header .pe-mobile-header__account:not(.pe-space-link--avatar) .pe-space-link__label {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .pe-mobile-header .pe-mobile-header__account:not(.pe-space-link--avatar) .pe-mobile-header__account-icon {
            margin: 0;
        }

        .pe-mobile-header .pe-mobile-header__account.pe-space-link--avatar {
            max-width: 40px;
            padding: 4px;
        }

        .pe-mobile-header .pe-mobile-header__account.pe-space-link--avatar .pe-space-link__label {
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
        }
    }
}
