/* ==========================================================================
   Profil web — en-tête MOBILE dédié (≤ 768px), même disposition que l'app :
   barre haute (retour | Suivre réduit + boutons), photo à gauche avec @nom au
   milieu de la photo et étoiles dessous, puis boutons d'action + stats sur la
   même ligne. La version PC (.profile-header) n'est pas modifiée : elle est
   seulement masquée sous 768px. Sélecteurs préfixés .pfm- (aucun conflit).
   ========================================================================== */

/* Bloc mobile caché sur PC */
.pfm-header {
  display: none;
}

@media (max-width: 768px) {
  /* Bascule : en-tête mobile visible, en-tête PC masqué (mobile seulement) */
  .pfm-header {
    display: block;
    --pfm-avatar: 64px;
    --pfm-name-h: 22px;
    padding: 0 0 10px;
    background: var(--bg-color, #fff);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
  }
  .profile-header {
    display: none;
  }

  /* Barre haute : retour à gauche, Suivre + boutons à droite */
  .pfm-header .pfm-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0 6px;
  }
  .pfm-header .pfm-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-color, #111827);
    text-decoration: none;
    font-size: 18px;
  }
  .pfm-header .pfm-top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  /* Boutons ronds de la barre haute (menu, modifier, publier, marketplace) */
  .pfm-header .profile-icon-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
    flex-shrink: 0;
  }

  /* Bouton Suivre / Client réduit (même logique JS : .profile-follow-btn + data-profile-id) */
  .pfm-header .pfm-follow {
    min-height: 0;
    height: auto;
    padding: 3px 12px;
    border-radius: 14px;
    border: 1.5px solid #2563eb;
    background: #fff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    flex-shrink: 0;
  }
  .pfm-header .pfm-follow.profile-follow-btn--active {
    background: #2563eb;
    color: #fff;
  }
  .pfm-header .pfm-follow.profile-follow-btn--pending {
    opacity: .65;
  }

  /* Bannière du profil : pleine largeur (annule le padding de 14px du conteneur), ratio 3:1 comme dans l'app */
  .pfm-header .pfm-banniere {
    margin: 0 -14px;
    aspect-ratio: 3 / 1;
    background-color: #e5e7eb;
    background-size: cover;
    background-position: center;
  }
  /* Avec bannière : la photo remonte sur la bannière d'autant que le décalage du @nom,
     donc le bas de la bannière tombe exactement au début du @nom */
  .pfm-header .pfm-hero--banniere {
    margin-top: calc(-1 * ((var(--pfm-avatar) + 4px) / 2 - var(--pfm-name-h) / 2));
  }
  .pfm-header .pfm-hero--banniere .pfm-avatar {
    position: relative;
    z-index: 1;
    border-color: #fff;
  }

  /* Ligne photo + identité : @nom calé au milieu vertical de la photo, presque collé */
  .pfm-header .pfm-hero {
    display: flex;
    align-items: flex-start;
    gap: 4px;
  }
  .pfm-header .pfm-avatar {
    width: var(--pfm-avatar);
    height: var(--pfm-avatar);
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    object-fit: cover;
    flex-shrink: 0;
    margin: 0;
    background: #f3f4f6;
  }
  .pfm-header .pfm-identity {
    flex: 1;
    min-width: 0;
    padding-top: calc((var(--pfm-avatar) + 4px) / 2 - var(--pfm-name-h) / 2);
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  /* @nom + badge + PRO */
  .pfm-header .pfm-name-line {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: var(--pfm-name-h);
    min-width: 0;
  }
  .pfm-header .pfm-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-color, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .pfm-header .pfm-name-line .badge {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
  .pfm-header .pfm-pro {
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 10px;
    flex-shrink: 0;
  }

  /* Étoiles sous le nom */
  .pfm-header .pfm-stars {
    display: flex;
    justify-content: flex-start;
    gap: 1px;
    line-height: 1;
    font-size: 13px;
  }
  .pfm-header .pfm-stars span {
    font-size: 13px;
  }

  /* Ligne pleine largeur : boutons d'action à gauche, stats à droite */
  .pfm-header .pfm-actions-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
  }
  .pfm-header .pfm-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  /* Boutons d'action carrés (WhatsApp, précommande, signaler, notifications) */
  .pfm-header .pfm-action-btn {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    font-size: 16px;
    text-decoration: none;
  }
  .pfm-header .pfm-action-btn--whatsapp i {
    color: #25d366;
  }
  .pfm-header .pfm-action-btn--muted i {
    color: #9ca3af;
  }

  /* Stats produits | clients | suivies (compactes) */
  .pfm-header .pfm-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .pfm-header .pfm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color, #111827);
  }
  .pfm-header .pfm-stat-num {
    font-size: 13px;
    font-weight: 800;
  }
  .pfm-header .pfm-stat-label {
    font-size: 10px;
    color: #6b7280;
  }
  .pfm-header .pfm-stat-divider {
    width: 1px;
    height: 18px;
    background: #d1d5db;
  }

  /* Bio courte sous la ligne actions / stats */
  .pfm-header .pfm-bio {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: #6b7280;
  }
}
