/* Header commun prioritaire — chargé après les styles de chaque page */

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    padding-top: 70px;
}

html body > .header,
html body.dpe-improve-page > .header {
    position: fixed !important;
    top: 0 !important;
    right: auto !important;
    left: 0 !important;

    width: 100vw !important;
    max-width: 100vw !important;

    box-sizing: border-box !important;

    z-index: 10000 !important;
    transform: none !important;
    isolation: isolate;
}

/* =========================================================
   HEADER MOBILE OUEST TRANSACTIONS
   ========================================================= */

/* Éléments réservés au menu mobile */

.mobile-menu-button,
.mobile-menu-estimation,
.mobile-menu-contact,
.nav-dpe-back,
.nav-dpe-arrow {
    display: none;
}

/*
Le lien DPE est maintenant un bouton.
Ces règles lui donnent le même aspect que les liens
du menu sur ordinateur.
*/

.nav-dpe-trigger {
    padding: 0;
    border: 0;
    background: transparent;
    color: #111;

    font-family: Inter, Arial, sans-serif;
    font-size: 11px;
    line-height: normal;
    font-weight: 400;
    letter-spacing: .085em;
    text-transform: uppercase;
    white-space: nowrap;

    cursor: pointer;

    transition:
        transform .22s ease,
        color .22s ease;
}

.nav-dpe-trigger:hover {
    color: var(--gold);
    transform: scale(1.10);
}

/* Version mobile */

@media(max-width:900px) {

    body {
        padding-top: 76px;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    /* Header blanc */

    .header {
        position: fixed;
        top: 0;
        z-index: 3000;

        width: 100%;
        height: 76px;
        padding: 0 25px;

        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 0;

        background: #fff;
        border-bottom: 1px solid #ececec;
    }

    .brand {
        position: relative;
        z-index: 3002;

        display: flex;
        align-items: center;
    }

    .brand img {
        display: block;
        width: 92px;
        height: auto;
        object-fit: contain;
    }

    .header-cta {
        display: none;
    }

    /* Bouton avec les deux barres */

    .mobile-menu-button {
        position: relative;
        z-index: 3002;

        width: 42px;
        height: 42px;
        padding: 0;

        display: block !important;
        flex: 0 0 42px;

        border: 0 !important;
        border-radius: 0;
        background: transparent !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        appearance: none;
        -webkit-appearance: none;

        cursor: pointer;
    }

    .mobile-menu-button span {
        display: none !important;
    }

    .mobile-menu-button::before,
    .mobile-menu-button::after {
        content: "";
        position: absolute;
        left: 50%;
        width: 21px;
        height: 1.5px;
        background: #111;
        transform: translateX(-50%);
        transform-origin: center;
        transition: top .25s ease, transform .25s ease;
    }

    .mobile-menu-button::before {
        top: 17px;
    }

    .mobile-menu-button::after {
        top: 24px;
    }

    .mobile-menu-button.is-open::before {
        top: 21px;
        transform: translateX(-50%) rotate(45deg);
    }

    .mobile-menu-button.is-open::after {
        top: 21px;
        transform: translateX(-50%) rotate(-45deg);
    }

    /* Menu principal */

    .nav {
        position: fixed;
        z-index: 3001;

        top: 76px;
        right: 0;
        bottom: 0;
        left: 0;

        width: 100%;
        height: calc(100dvh - 76px);
        margin: 0;
        padding: 18px 28px 28px;

        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;

        overflow-x: hidden;
        overflow-y: auto;

        background: #fff;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform: translateY(-12px);

        transition:
            opacity .3s ease,
            visibility .3s ease,
            transform .3s ease;
    }

    .nav.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: translateY(0);
    }

    /* Tous les liens principaux */

    .nav > a:not(.mobile-menu-estimation) {
        width: 100%;
        min-height: 70px;
        padding: 0;

        display: flex;
        align-items: center;

        border-bottom: 1px solid rgba(18, 18, 18, .1);

        color: #111;

        font-family: "Cormorant Garamond", Georgia, serif;
font-size: 23px;
line-height: 1.15;
font-weight: 500;
letter-spacing: 0;
text-transform: none;

        transform: none;
    }

    .nav > a:not(.mobile-menu-estimation):hover {
        color: #111;
        transform: none;
    }

    /* Ligne Analyser mon DPE */

    .nav-dpe {
        position: static;

        width: 100%;
        padding: 0;

        display: block;

        border-bottom: 1px solid rgba(18, 18, 18, .1);
    }

    .nav-dpe-trigger {
        width: 100%;
        min-height: 70px;
        padding: 0;

        display: flex !important;
        align-items: center;
        justify-content: space-between;

        border: 0;
        background: transparent;
        color: #111;

        font-family: "Cormorant Garamond", Georgia, serif;
font-size: 23px;
line-height: 1.15;
font-weight: 500;
letter-spacing: 0;
text-transform: none;

        transform: none !important;
        cursor: pointer;
    }

    .nav-dpe-trigger:hover {
        color: #111;
        transform: none;
    }

    /*
    On masque l’ancienne petite flèche créée
    par le CSS de la version ordinateur.
    */

    .nav-dpe-trigger::after {
        display: none;
    }

        .nav-dpe-arrow {
        position: relative;

        width: 10px;
        height: 18px;
        margin: 0 3px 0 20px;

        display: block;
        flex: 0 0 auto;
    }

    .nav-dpe-arrow::before {
        content: "";

        position: absolute;
        top: 50%;
        left: 0;

        width: 9px;
        height: 9px;

        border-top: 2px solid #111;
        border-right: 2px solid #111;

        transform: translateY(-50%) rotate(45deg);
    }

    /* Sous-menu DPE */

    .nav-dpe .nav-dpe-menu,
    .nav-dpe:hover .nav-dpe-menu,
    .nav-dpe:focus-within .nav-dpe-menu {
        position: fixed;
        z-index: 3010;

        top: 76px;
        right: 0;
        bottom: 0;
        left: 0;

        width: 100%;
        height: calc(100dvh - 76px);
        margin: 0;
        padding: 0;

        display: block;
        overflow-y: auto;

        border: 0;
        border-radius: 0;
        background: #fff;
        box-shadow: none;

        opacity: 1;
        visibility: visible;
        pointer-events: none;

        transform: translateX(100%);

        transition: transform .32s ease;
    }

    .nav-dpe .nav-dpe-menu.is-open,
    .nav-dpe:hover .nav-dpe-menu.is-open,
    .nav-dpe:focus-within .nav-dpe-menu.is-open {
        pointer-events: auto;
        transform: translateX(0);
    }

    .nav-dpe-menu::before {
        display: none;
    }

    /* Flèche retour */

        .nav-dpe-back {
        width: 100%;
        min-height: 84px;
        padding: 0 28px;

        display: flex;
        align-items: center;
        gap: 22px;

        border: 0;
        border-bottom: 1px solid rgba(18, 18, 18, .1);
        background: #fff;
        color: #111;

        font-family: "Cormorant Garamond", Georgia, serif;
        font-size: 23px;
        line-height: 1.15;
        font-weight: 600;
        text-align: left;

        cursor: pointer;
    }

       .nav-dpe-back-arrow {
        position: relative;

        width: 12px;
        height: 18px;

        display: block;
        flex: 0 0 auto;
    }

    .nav-dpe-back-arrow::before {
        content: "";

        position: absolute;
        top: 50%;
        left: 3px;

        width: 10px;
        height: 10px;

        border-bottom: 2px solid #111;
        border-left: 2px solid #111;

        transform: translateY(-50%) rotate(45deg);
    }

    /* Choix du sous-menu */

    .nav-dpe-menu a {
        width: 100%;
        min-height: 76px;
        padding: 0 28px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        border-bottom: 1px solid rgba(18, 18, 18, .1);
        border-radius: 0;

        background: #fff;
        color: #111;

        font-family: "Cormorant Garamond", Georgia, serif;
font-size: 23px;
line-height: 1.15;
font-weight: 500;
letter-spacing: 0;
text-transform: none;

        transform: none !important;
    }

    .nav-dpe-menu a:hover {
        background: #fff;
        color: #111;
    }

    /* Bouton estimation */

    .nav .mobile-menu-estimation {
        width: 100%;
        min-height: 56px;
        margin: 30px 0 0;
        padding: 0 22px;

        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;

        border: 1px solid #111;
        border-radius: 3px;

        background: #111;
        color: #fff;

        font-family: Inter, Arial, sans-serif;
        font-size: 12px;
        line-height: 1;
        font-weight: 600;
        letter-spacing: .045em;
        text-transform: uppercase;

        transform: none;
    }

    .nav .mobile-menu-estimation span {
        font-size: 24px;
        font-weight: 300;
    }

    .nav .mobile-menu-estimation:hover {
        background: #111;
        color: #fff;
        transform: none;
    }

    /* Coordonnées */

    .mobile-menu-contact {
        padding: 25px 0 10px;

        display: flex;
        flex-direction: column;
        gap: 9px;

        text-align: center;
    }

    .mobile-menu-contact a {
        color: #555;

        font-family: Inter, Arial, sans-serif;
        font-size: 11px;
        line-height: 1.4;
        letter-spacing: .04em;
        text-transform: none;

        transform: none !important;
    }
}

/* Masquer définitivement les éléments mobiles sur PC */

@media(min-width:901px) {

    .header .mobile-menu-estimation,
    .header .mobile-menu-contact,
    .header .nav-dpe-back {
        display: none !important;
    }

}