/* =============================================================================
   EN-TÊTE DU SITE (toutes les pages) — balisage <header class="ph">
   -----------------------------------------------------------------------------
   Chargé EN DERNIER dans chaque page. Tout est préfixé « ph- » pour ne pas
   entrer en collision avec les anciennes règles de styles.css.

   Ordinateur : en haut de page, l'en-tête d'origine (transparent, liens
   blancs). Dès qu'on défile, il devient une barre blanche dépolie
   complète. Un petit point sous le lien signale la page en cours.
   Mobile / tablette (≤ 1024 px) : boutons Accueil, Appeler, Menu et
   Instagram en haut ; la barre blanche arrive au défilement (js/header.js).
   ========================================================================== */

:root {
    --ph-navy: #003366;
    --ph-blue: #668ECB;
    --ph-ink: #0d1b2a;
    --ph-muted: #5b6b7c;
    --ph-ease: cubic-bezier(.3, .8, .3, 1);
    --ph-bar-h: 68px;
}

/* Les anciennes feuilles (presentation.css, pages.css, pvcarme.css) donnent
   un fond marine à l'en-tête au défilement : on les neutralise ici. */
header.ph,
header.ph.is-scrolled,
body.pp-scrolled header.ph,
body.pv-scrolled header.ph {
    background: transparent;
    box-shadow: none;
    border: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

header.ph {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 84px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    z-index: 999999999999;
    transition: height .35s var(--ph-ease), background-color .35s ease, box-shadow .35s ease;
}

/* ------------------------------------------------------------------ Logo */
.ph-logo {
    flex: none;
    display: block;
    line-height: 0;
}

.ph-logo img {
    width: 100px;
    height: auto;
    max-height: 50px;
    object-fit: contain;
    transition: transform .3s ease;
}

.ph-logo:hover img { transform: scale(1.5); }

/* ------------------------------------------------------------ Navigation */
.ph-nav {
    display: flex;
    align-items: center;
    margin: 0 auto;
}

.ph-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .5rem 1rem;
    border: 0;
    background: none;
    color: #fff;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, .8);
    cursor: pointer;
    white-space: nowrap;
    transition: color .3s ease, transform .3s ease, font-size .35s var(--ph-ease), text-shadow .3s ease;
}

.ph-link:hover,
.ph-dd.is-open .ph-dd-btn { color: var(--ph-blue); }

/* grossissement d'origine, seulement sur la photo */
header.ph:not(.ph-scrolled) .ph-link:hover,
header.ph:not(.ph-scrolled) .ph-dd.is-open .ph-dd-btn { transform: scale(1.2); }

/* Page en cours : un petit point discret sous le lien */
.ph-link.is-current::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    border-radius: 50%;
    background: #b9d2f3;
    box-shadow: 0 0 6px rgba(0, 0, 0, .35);
    transition: background-color .3s ease, box-shadow .3s ease;
}

.ph-dd-btn.is-current::after { margin-left: -10px; } /* centré sous le texte, pas sous la flèche */

.ph-chev {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .3s ease;
}

.ph-dd.is-open .ph-chev { transform: rotate(180deg); }

/* ------------------------------------------------------ Partie droite */
.ph-right {
    flex: none;
    display: flex;
    align-items: center;
    gap: .9rem;
}

.ph-ig {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #fff;
    transition: color .3s ease, transform .3s ease;
}

.ph-ig svg {
    width: 36px;
    height: 36px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, .6));
    transition: width .35s var(--ph-ease), height .35s var(--ph-ease), filter .3s ease;
}

.ph-ig:hover {
    color: var(--ph-blue);
    transform: scale(1.2);
}

.ph-cta {
    display: inline-flex;
    align-items: center;
    background-color: #fff;
    color: #000;
    padding: .8rem 2rem;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    border-radius: 12px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .3s ease, color .3s ease, transform .3s ease, box-shadow .3s ease, padding .35s var(--ph-ease), font-size .35s var(--ph-ease);
}

.ph-cta:hover {
    background-color: var(--ph-blue);
    color: #fff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, .3);
}

/* ------------------------------ Etat « défilé » : barre blanche complète */
header.ph.ph-scrolled,
body.pp-scrolled header.ph.ph-scrolled,
body.pv-scrolled header.ph.ph-scrolled {
    height: 72px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 1px 0 rgba(0, 51, 102, .08), 0 10px 30px rgba(0, 30, 60, .08);
}

header.ph.ph-scrolled .ph-link {
    color: var(--ph-navy);
    font-size: 1rem;
    text-shadow: none;
}

header.ph.ph-scrolled .ph-link:hover,
header.ph.ph-scrolled .ph-dd.is-open .ph-dd-btn { color: var(--ph-blue); }

header.ph.ph-scrolled .ph-link.is-current::after {
    background: var(--ph-blue);
    box-shadow: none;
}

header.ph.ph-scrolled .ph-ig { color: var(--ph-navy); }

header.ph.ph-scrolled .ph-ig svg {
    width: 26px;
    height: 26px;
    filter: none;
}

header.ph.ph-scrolled .ph-ig:hover {
    color: var(--ph-blue);
    transform: scale(1.1);
}

header.ph.ph-scrolled .ph-cta {
    background: var(--ph-navy);
    color: #fff;
    padding: .65rem 1.6rem;
    font-size: 1rem;
}

header.ph.ph-scrolled .ph-cta:hover {
    background: var(--ph-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 51, 102, .25);
}

/* --------------------------------------------- Menu « Nos prestations » */
.ph-dd { position: relative; }

.ph-pop {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 400px;
    padding-top: 16px;
    transform: translate(-50%, 8px);
    opacity: 0;
    visibility: hidden;
    /* petit délai à la fermeture : le menu ne disparaît pas si la souris
       déborde une fraction de seconde */
    transition: opacity .2s ease .12s, transform .2s ease .12s, visibility 0s linear .32s;
    z-index: 5;
}

.ph-dd.is-open .ph-pop {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

.ph-card {
    position: relative;
    background: #fff;
    border-radius: 22px;
    padding: 8px;
    border: 1px solid rgba(0, 51, 102, .06);
    box-shadow: 0 26px 60px rgba(0, 20, 40, .28);
    text-shadow: none;
}

.ph-card::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    background: #fff;
    transform: rotate(45deg);
    border-radius: 3px;
}

.ph-pi,
.ph-mrow {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr 18px;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 15px;
    color: var(--ph-ink);
    text-decoration: none;
    text-align: left;
    transition: background-color .2s ease;
}

.ph-pi:hover,
.ph-pi:focus-visible { background: #f1f5fa; }

.ph-pi-ic {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #eaf1fb;
    color: var(--ph-navy);
    display: grid;
    place-items: center;
    transition: background-color .25s ease, color .25s ease;
}

.ph-pi-ic svg,
.ph-arr {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ph-pi-ic svg { width: 21px; height: 21px; }

.ph-pi:hover .ph-pi-ic,
.ph-pi.is-current .ph-pi-ic,
.ph-mrow.is-current .ph-pi-ic {
    background: var(--ph-navy);
    color: #fff;
}

.ph-pi b,
.ph-mrow b {
    display: block;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ph-navy);
}

.ph-pi small {
    display: block;
    font-size: 12.5px;
    color: var(--ph-muted);
    line-height: 1.35;
}

.ph-arr {
    width: 16px;
    height: 16px;
    color: var(--ph-blue);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .25s ease, transform .25s ease;
}

.ph-pi:hover .ph-arr,
.ph-pi.is-current .ph-arr {
    opacity: 1;
    transform: none;
}

.ph-link:focus-visible,
.ph-cta:focus-visible,
.ph-ig:focus-visible,
.ph-pi:focus-visible,
.ph-mrow:focus-visible,
.ph-mob a:focus-visible,
.ph-mob button:focus-visible {
    outline: 2px solid var(--ph-blue);
    outline-offset: 2px;
}

/* ============================================================================
   MOBILE / TABLETTE : barre blanche fixe en haut + menu qui descend
   ========================================================================= */
.ph-mob,
.ph-menu,
.ph-dim { display: none; }

@media (max-width: 1024px) {
    header.ph,
    header.ph.ph-scrolled,
    body.pp-scrolled header.ph,
    body.pv-scrolled header.ph,
    body.pp-scrolled header.ph.ph-scrolled,
    body.pv-scrolled header.ph.ph-scrolled {
        height: var(--ph-bar-h);
        padding: 0 8px;
        gap: 0;
        border-bottom: 1px solid transparent;
    }

    /* au départ transparent, la barre blanche arrive au défilement */
    header.ph.ph-scrolled,
    body.pp-scrolled header.ph.ph-scrolled,
    body.pv-scrolled header.ph.ph-scrolled {
        background: rgba(255, 255, 255, .88);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        backdrop-filter: blur(20px) saturate(180%);
        border-bottom-color: rgba(0, 51, 102, .08);
        box-shadow: 0 8px 26px rgba(0, 30, 60, .08);
    }


    /* sur mobile, pas de logo : 4 boutons clairs sur toute la largeur */
    .ph-logo,
    .ph-nav,
    .ph-right { display: none; }

    /* Certaines animations d'apparition (pages-v2.css) décalent brièvement
       des images hors de l'écran : le téléphone élargissait alors la page. */
    html, body { overflow-x: clip; }

    .ph-mob {
        flex: 1;
        display: grid;
        grid-template-columns: 48px 1fr 1fr 48px;
        justify-items: center;
        align-items: center;
        gap: 8px;
        max-width: 560px;
        margin: 0 auto;
    }

    .ph-mb,
    .ph-mcall,
    .ph-burger {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 48px;
        padding: 0;
        border: 0;
        background: none;
        font: 700 16px/1 'Poppins', sans-serif;
        letter-spacing: .01em;
        text-decoration: none;
        white-space: nowrap;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: transform .15s ease, color .3s ease;
    }

    .ph-mb:active,
    .ph-mcall:active,
    .ph-burger:active { transform: scale(.94); }

    .ph-mob svg {
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* Tous les boutons du haut : sans cadre, comme les icônes Accueil et
       Instagram d'origine. Blancs avec une ombre sur la photo, bleu marine
       sur la barre blanche. */
    .ph-mb,
    .ph-mcall,
    .ph-burger {
        color: #fff;
        text-shadow: 0 1px 6px rgba(0, 20, 40, .55);
    }

    header.ph.ph-scrolled .ph-mb,
    header.ph.ph-scrolled .ph-mcall,
    header.ph.ph-scrolled .ph-burger {
        color: var(--ph-navy);
        text-shadow: none;
    }

    .ph-mb span { display: none; }

    .ph-mob .ph-mb svg {
        width: 30px;
        height: 30px;
        stroke-width: 1.9;
        filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, .55));
        transition: filter .3s ease;
    }

    header.ph.ph-scrolled .ph-mob .ph-mb svg { filter: none; }

    /* Appeler : bouton complet blanc sur la photo, bleu marine au défilement */
    .ph-mob .ph-mcall {
        height: 44px;
        gap: 9px;
        padding: 0 18px 0 6px;
        border-radius: 999px;
        background: #fff;
        color: var(--ph-navy);
        text-shadow: none;
        box-shadow: 0 6px 18px rgba(0, 20, 40, .25);
        transition: transform .15s ease, background-color .35s ease, color .35s ease, box-shadow .35s ease;
    }

    header.ph.ph-scrolled .ph-mob .ph-mcall {
        background: var(--ph-navy);
        color: #fff;
        box-shadow: 0 6px 16px rgba(0, 51, 102, .3);
    }

    .ph-mcall-ic {
        display: grid;
        place-items: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--ph-navy);
        color: #fff;
        line-height: 0;
        transition: background-color .35s ease;
    }

    header.ph.ph-scrolled .ph-mcall-ic { background: var(--ph-blue); }

    .ph-mob .ph-mcall-ic svg { width: 17px; height: 17px; stroke-width: 2.1; }

    /* les petites ondes du combiné vibrent de temps en temps */
    .ph-mcall-ic .ph-wave { animation: ph-ring 3.2s ease-in-out infinite; transform-origin: 30% 70%; }
    .ph-mcall-ic .ph-wave + .ph-wave { animation-delay: .12s; }

    @keyframes ph-ring {
        0%, 70%, 100% { opacity: 1; }
        78%           { opacity: .25; }
        86%           { opacity: 1; }
        92%           { opacity: .25; }
    }

    /* Menu : trois traits (qui deviennent une croix) + le mot */
    .ph-burger-ic {
        position: relative;
        width: 26px;
        height: 18px;
        filter: drop-shadow(0 1px 4px rgba(0, 20, 40, .5));
    }

    header.ph.ph-scrolled .ph-burger-ic { filter: none; }

    .ph-burger-ic i {
        position: absolute;
        left: 0;
        height: 2.5px;
        border-radius: 3px;
        background: currentColor;
        transition: transform .35s var(--ph-ease), width .35s var(--ph-ease), opacity .2s ease, top .35s var(--ph-ease);
    }

    .ph-burger-ic i:nth-child(1) { top: 0;       width: 26px; }
    .ph-burger-ic i:nth-child(2) { top: 7.75px;  width: 17px; }
    .ph-burger-ic i:nth-child(3) { top: 15.5px;  width: 22px; }

    .ph-burger[aria-expanded="true"] .ph-burger-ic i:nth-child(1) { top: 7.75px; width: 24px; transform: rotate(45deg); }
    .ph-burger[aria-expanded="true"] .ph-burger-ic i:nth-child(2) { opacity: 0; width: 0; }
    .ph-burger[aria-expanded="true"] .ph-burger-ic i:nth-child(3) { top: 7.75px; width: 24px; transform: rotate(-45deg); }

    /* --- voile + menu --- */
    .ph-dim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 18, 36, .4);
        opacity: 0;
        transition: opacity .3s ease;
        z-index: 2147483610;
    }

    .ph-dim[hidden] { display: none; }
    .ph-dim.is-on { opacity: 1; }

    .ph-menu {
        display: block;
        position: fixed;
        top: var(--ph-bar-h);
        left: 0;
        right: 0;
        max-width: 560px;
        margin: 0 auto;
        max-height: calc(100vh - var(--ph-bar-h) - 16px);
        max-height: calc(100dvh - var(--ph-bar-h) - 16px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 12px 12px 10px;
        background: #fff;
        border-radius: 0 0 26px 26px;
        box-shadow: 0 24px 50px rgba(0, 20, 40, .22);
        font-family: 'Poppins', sans-serif;
        transform: translateY(calc(-100% - var(--ph-bar-h) - 20px));
        visibility: hidden;
        transition: transform .45s var(--ph-ease), visibility 0s linear .45s;
        z-index: 2147483620;
    }

    .ph-menu.is-open {
        transform: none;
        visibility: visible;
        transition: transform .45s var(--ph-ease), visibility 0s;
    }

    /* apparition en cascade des lignes */
    .ph-menu > * {
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity .35s ease, transform .35s var(--ph-ease);
    }

    .ph-menu.is-open > * { opacity: 1; transform: none; }
    .ph-menu.is-open > :nth-child(2) { transition-delay: .04s; }
    .ph-menu.is-open > :nth-child(3) { transition-delay: .08s; }
    .ph-menu.is-open > :nth-child(4) { transition-delay: .12s; }
    .ph-menu.is-open > :nth-child(5) { transition-delay: .16s; }

    /* L'entreprise / PVC Armé : blocs bien délimités */
    .ph-mrow {
        background: #f3f7fc;
        border: 1px solid #dfe7f1;
        margin-bottom: 6px;
    }

    .ph-mrow b { font-size: 16px; }
    .ph-mrow .ph-pi-ic { background: #fff; box-shadow: 0 1px 3px rgba(0, 30, 60, .08); }
    .ph-mrow .ph-arr { opacity: 1; transform: none; }
    .ph-mrow:active { background: #e8eff8; }
    .ph-mrow.is-current { background: #e8eff8; border-color: #c9d8ea; }

    /* PVC Armé : mis en avant */
    .ph-mrow[data-ph="pvcarme"] {
        background: linear-gradient(135deg, #e3edfa 0%, #d3e2f6 100%);
        border-color: #b3c9e6;
        box-shadow: 0 4px 14px rgba(0, 51, 102, .1);
    }

    .ph-mrow[data-ph="pvcarme"] .ph-pi-ic {
        background: var(--ph-navy);
        color: #fff;
    }

    .ph-mrow[data-ph="pvcarme"] .ph-arr { color: var(--ph-navy); }

    .ph-mlabel {
        margin: 12px 12px 6px;
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: .12em;
        text-transform: uppercase;
        color: #4a5b6f;
    }

    /* Prestations : cartes blanches sur fond bleu gris, bien séparées */
    .ph-mlist {
        display: grid;
        gap: 5px;
        padding: 6px;
        border-radius: 20px;
        background: #e6edf6;
        margin-bottom: 6px;
    }

    .ph-mlist .ph-pi {
        grid-template-columns: 40px 1fr 18px;
        padding: 9px 10px;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 1px 3px rgba(0, 30, 60, .08);
    }

    .ph-mlist .ph-pi:active { background: #f1f5fa; }
    .ph-mlist .ph-pi-ic { width: 40px; height: 40px; border-radius: 12px; background: #eaf1fb; }
    .ph-mlist .ph-pi:hover .ph-pi-ic { background: #eaf1fb; color: var(--ph-navy); }
    .ph-mlist .ph-pi.is-current { box-shadow: inset 0 0 0 1.5px var(--ph-navy); }
    .ph-mlist .ph-pi.is-current .ph-pi-ic { background: var(--ph-navy); color: #fff; }
    .ph-mlist .ph-pi small { color: #52647a; }
    .ph-mlist .ph-arr { opacity: 1; transform: none; }

    .ph-mcontact {
        display: block;
        margin: 8px 0 2px;
        padding: 10px;
        text-align: center;
        font-size: 13.5px;
        color: var(--ph-muted);
        text-decoration: none;
    }

    .ph-mcontact strong { color: var(--ph-navy); }
}


@media (prefers-reduced-motion: reduce) {
    .ph-menu, .ph-menu > *, .ph-pop, header.ph { transition-duration: .01s !important; }
    .ph-mcall-ic .ph-wave { animation: none; }
}
