/**
 * Menu mobile plein écran — style Hostinger (sections, promo, footer).
 * Surcharge le drawer latéral Lonyo (app.min.css) sans modifier le thème global.
 */

@media (max-width: 991.98px) {
    .lonyo-menu-wrapper.pe-mobile-nav-drawer:not(.lonyo-body-visible) {
        pointer-events: none;
    }

    .lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible {
        pointer-events: auto;
    }

    .lonyo-menu-wrapper.pe-mobile-nav-drawer {
        background: #fff;
        transition: opacity 0.28s ease, visibility 0.28s ease;
    }

    .lonyo-menu-wrapper.pe-mobile-nav-drawer .lonyo-menu-area.pe-mobile-nav {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: none;
        height: 100%;
        left: 0 !important;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease;
        text-align: left;
        background: #fff;
    }

    .lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible .lonyo-menu-area.pe-mobile-nav {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Header */
    .pe-mobile-nav__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        min-height: 52px;
        padding:
            calc(6px + env(safe-area-inset-top, 0px))
            max(20px, env(safe-area-inset-right, 0px))
            6px
            max(20px, env(safe-area-inset-left, 0px));
        border-bottom: 1px solid rgba(20, 45, 111, 0.08);
    }

    .pe-mobile-nav__logo {
        display: inline-flex;
        align-items: center;
        line-height: 0;
        text-decoration: none;
    }

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

    .pe-mobile-nav__close.lonyo-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 10px;
        background: transparent;
        color: #142d6f;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .pe-mobile-nav__close.lonyo-menu-toggle:active {
        background: rgba(20, 45, 111, 0.06);
    }

    .pe-mobile-nav__close.lonyo-menu-toggle i {
        color: inherit;
    }

    /* Scrollable body */
    .pe-mobile-nav__scroll {
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 8px max(20px, env(safe-area-inset-right, 0px)) 20px max(20px, env(safe-area-inset-left, 0px));
    }

    /* Section labels (Hostinger-style) */
    .pe-mobile-nav__section-label {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 10px 0;
        color: #797980;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.3;
    }

    .pe-mobile-nav__section-line {
        flex: 1 1 auto;
        height: 1px;
        background: rgba(20, 45, 111, 0.12);
    }

    /* Nav links — sans bordures Lonyo */
    .pe-mobile-nav .lonyo-mobile-menu {
        overflow: visible;
        max-height: none;
        margin: 0;
        padding: 0;
        text-align: left;
    }

    .pe-mobile-nav .lonyo-mobile-menu ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .pe-mobile-nav .lonyo-mobile-menu ul li {
        border: none !important;
        list-style: none;
    }

    .pe-mobile-nav__link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0;
        color: #222225 !important;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.35;
        text-decoration: none;
        text-transform: none;
        -webkit-tap-highlight-color: transparent;
    }

    .pe-mobile-nav__link.is-active {
        color: #142d6f !important;
        font-weight: 600;
        background: transparent !important;
    }

    .pe-mobile-nav__link:active {
        opacity: 0.72;
    }

    /* Contact rows */
    .pe-mobile-nav__contact {
        display: grid;
        gap: 2px;
        margin-bottom: 8px;
    }

    .pe-mobile-nav__contact-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 0;
        color: #222225;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.35;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .pe-mobile-nav__contact-link i {
        flex-shrink: 0;
        color: #142d6f;
        font-size: 18px;
        opacity: 0.85;
    }

    .pe-mobile-nav__contact-link:active {
        opacity: 0.72;
    }

    /* Promo card */
    .pe-mobile-nav__promo {
        display: block;
        margin-top: 12px;
        padding: 16px;
        border-radius: 14px;
        background: #eef2ff;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .pe-mobile-nav__promo-title {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #142d6f;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.3;
    }

    .pe-mobile-nav__promo-title i {
        font-size: 18px;
        line-height: 1;
    }

    .pe-mobile-nav__promo-desc {
        display: block;
        margin-top: 6px;
        color: #5c6478;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.4;
    }

    .pe-mobile-nav__promo:active {
        background: #e4ebff;
    }

    /* Footer bar */
    .pe-mobile-nav__footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        gap: 12px;
        padding:
            12px max(20px, env(safe-area-inset-right, 0px))
            calc(12px + env(safe-area-inset-bottom, 0px))
            max(20px, env(safe-area-inset-left, 0px));
        border-top: 1px solid rgba(20, 45, 111, 0.1);
        background: #fff;
    }

    .pe-mobile-nav__footer-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        padding: 0;
        color: #222225;
        font-size: 15px;
        font-weight: 600;
        line-height: 1;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .pe-mobile-nav__footer-link i {
        font-size: 22px;
        line-height: 1;
        color: #142d6f;
    }

    .pe-mobile-nav__footer-link .pe-space-link__avatar {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(20, 45, 111, 0.12);
    }

    .pe-mobile-nav__footer-link:active {
        opacity: 0.72;
    }

    /* État ouvert : masquer header / bottom nav, bloquer le scroll */
    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible),
    body.pe-mobile-nav-open {
        overflow: hidden;
    }

    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .pe-mobile-header,
    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .pe-bottom-nav,
    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .pe-action-bar,
    body.pe-mobile-nav-open .pe-mobile-header,
    body.pe-mobile-nav-open .pe-bottom-nav,
    body.pe-mobile-nav-open .pe-action-bar {
        visibility: hidden;
    }

    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .lonyo-menu-wrapper.pe-mobile-nav-drawer,
    body.pe-mobile-nav-open .lonyo-menu-wrapper.pe-mobile-nav-drawer {
        z-index: 1000000;
    }

    /* Bouton hamburger → croix quand le menu est ouvert */
    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .pe-mhome-header__menu i::before,
    body.pe-mobile-nav-open .pe-mhome-header__menu i::before {
        content: "\eb99";
    }

    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .site-header .lonyo-menu-toggle span,
    body.pe-mobile-nav-open .site-header .lonyo-menu-toggle span {
        opacity: 0;
    }

    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .site-header .lonyo-menu-toggle::before,
    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .site-header .lonyo-menu-toggle::after,
    body.pe-mobile-nav-open .site-header .lonyo-menu-toggle::before,
    body.pe-mobile-nav-open .site-header .lonyo-menu-toggle::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 22px;
        height: 2px;
        margin-left: -11px;
        margin-top: -1px;
        background: #fff;
        border-radius: 2px;
    }

    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .site-header .lonyo-menu-toggle::before,
    body.pe-mobile-nav-open .site-header .lonyo-menu-toggle::before {
        transform: rotate(45deg);
    }

    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .site-header .lonyo-menu-toggle::after,
    body.pe-mobile-nav-open .site-header .lonyo-menu-toggle::after {
        transform: rotate(-45deg);
    }

    body:has(.lonyo-menu-wrapper.pe-mobile-nav-drawer.lonyo-body-visible) .site-header .lonyo-menu-toggle,
    body.pe-mobile-nav-open .site-header .lonyo-menu-toggle {
        position: relative;
    }
}
