/* ============================================================
   ARTISANSCI — HEADER DISSOCIÉ (desktop / mobile)
   Fichier dédié : aucune interférence avec styles-app.css
   Version 4 : mobile → correction superposition
   (topbar / menu / contenu remis dans le flux normal)
   ============================================================ */

/* ----- Bascule d'affichage ----- */
.pub-header-mobile { display: none; }

@media (max-width: 768px) {
    .pub-header-desktop { display: none !important; }
    .pub-header-mobile  { display: block !important; }
}

/* ============================================================
   1. RESET DU FLUX MOBILE (ANTI-SUPERPOSITION)
   La topbar, le header et le contenu se suivent normalement
   ============================================================ */
@media (max-width: 768px) {

    /* Topbar : retour au flux normal (ne couvre plus le menu) */
    .pub-topbar,
    .pub-topbar-inner {
        position: static !important;
        transform: none !important;
        float: none !important;
        z-index: auto !important;
    }

    /* Si le body compensait une barre fixe par un padding */
    body {
        padding-top: 0 !important;
    }

    /* Le contenu ne passe plus sous le menu */
    main {
        position: static !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        transform: none !important;
    }

    /* Aucun header ne doit être fixe/absolu sur mobile */
    .pub-header-desktop,
    .pub-header-mobile {
        float: none !important;
        transform: none !important;
    }
}

/* ============================================================
   2. HEADER MOBILE (classes phm-*)
   LOGO (gauche) | BOUTONS texte blanc (centre) | HAMBURGER (droite)
   Tous alignés, hauteur unique : 42px
   ============================================================ */
.pub-header-mobile {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    position: sticky;      /* reste collé en haut au scroll, MAIS dans le flux */
    top: 0;
    z-index: 1000;
    width: 100%;
}

.phm-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
}

/* ----- Logo mobile : zone bleue = 42px ----- */
.pub-header-mobile .pub-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 0 0 auto;
}
.pub-header-mobile .pub-logo-part1 {
    height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px 0 12px;
    background: #005fb6;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px 0 0 8px;
}
.pub-header-mobile .pub-logo-part2 {
    width: 34px;
    height: 34px;
    margin-left: -12px;
    background: #52ae32;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    flex: 0 0 auto;
}

/* ----- Boutons CENTRE : 42px, texte BLANC, largeur réduite ----- */
.phm-actions {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
}
.phm-actions .btn {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 10px;       /* texte réduit */
    font-weight: 600;
    color: #fff !important;
    white-space: nowrap;
    border: none;
    text-decoration: none;
    line-height: 1;
}
.phm-actions .btn i {
    color: #fff;
    font-size: 13px;       /* icône conservée */
}
.phm-actions .btn-green   { background: #52ae32; }
.phm-actions .btn-primary { background: #005fb6; }

/* Avatar connecté (mobile) */
.phm-actions .pub-user-dropdown { padding: 3px; background: transparent; }
.phm-actions .pub-user-avatar { width: 36px; height: 36px; font-size: 13px; }

/* ----- Hamburger DROITE : 42px ----- */
.phm-toggle {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #005fb6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}
.phm-toggle.active { background: #004a94; }

/* ----- Panneau de menu déroulant ----- */
.phm-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0,0,0,.15);
    border-top: 1px solid #e9ecef;
    z-index: 999;
}
.phm-nav.open { display: block; }
.phm-nav ul { list-style: none; margin: 0; padding: 6px 0; }
.phm-nav a {
    display: block;
    padding: 14px 20px;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Poppins', sans-serif;
}
.phm-nav li:last-child a { border-bottom: none; }
.phm-nav a:active { background: #EFF6FF; color: #005fb6; }

/* ============================================================
   3. TRÈS PETITS ÉCRANS (< 400px) : texte compact, icônes OK
   ============================================================ */
@media (max-width: 400px) {
    .phm-actions { gap: 4px; }
    .phm-actions .btn {
        padding: 0 6px;
        gap: 3px;
        font-size: 9px;
    }
    .phm-actions .btn i { font-size: 12px; }
    .pub-header-mobile .pub-logo-part1 { font-size: 14px; padding: 0 12px 0 10px; }
    .pub-header-mobile .pub-logo-part2 { width: 32px; height: 32px; }
}