/* En-tête collant de la page vitrine du créateur (refonte du 23 oct 2026,
   gabarit « ZIC Profil Nouvelle version »).

   Logo · nom de la boutique · Marketplace (lien) · « Ouvrir ma boutique »
   (ou « Gérer ma boutique ») · panier · connexion / pastille XP + compte ·
   burger (≤ 768 px). Le tiroir mobile et son fond sont des FRÈRES du
   <header> (le backdrop-filter de l'en-tête piégerait leur position fixe) ;
   ils réutilisent les hooks de nav-drawer.js avec des classes propres.

   z-index : en-tête 70 (au-dessus des onglets collants, 60), tiroir 130 /
   140, toasts du profil 2400 (échelle du plan). */

.zh-pph {
  position: sticky;
  top: 0;
  z-index: 70;
  background: var(--pp-header-bg, rgba(11, 4, 25, 0.86));
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--pp-line, rgba(168, 85, 247, 0.18));
  color: var(--pp-ink, #fafafb);
  font-family: "DM Sans", sans-serif;
}

.zh-pph-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1160px;
  height: 63px;
  margin: 0 auto;
  padding: 0 var(--pp-gutter, 20px);
  box-sizing: border-box;
}

/* ─── Logo + nom de la boutique ─────────────────────────────────────── */
.zh-pph-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
  border-radius: 6px;
}
.zh-pph-logo-img {
  height: 24px;
  width: auto;
  display: block;
}
/* Logo ZIC thème-aware : version BLANCHE (fond sombre) vs NOIRE (fond
   clair). `data-pp-theme` = thème résolu (toujours light|dark, live via
   matchMedia) → swap CSS fiable, sans JS. */
.zh-pph-logo-img--light { display: none; }
:root[data-pp-theme="light"] .zh-pph-logo-img--dark  { display: none; }
:root[data-pp-theme="light"] .zh-pph-logo-img--light { display: block; }
/* Repli sans JS : système clair + attribut non résolu → logo noir */
@media (prefers-color-scheme: light) {
  :root:not([data-pp-theme]) .zh-pph-logo-img--dark  { display: none; }
  :root:not([data-pp-theme]) .zh-pph-logo-img--light { display: block; }
}

.zh-pph-sep {
  width: 1px;
  height: 22px;
  flex-shrink: 0;
  background: var(--pp-line, rgba(168, 85, 247, 0.18));
}

.zh-pph-shop-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--pp-font-head, "Space Grotesk", sans-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
  color: var(--pp-ink, #fafafb);
}

.zh-pph-spacer {
  flex: 1 1 auto;
  min-width: 0;
}

/* ─── Actions ─────────────────────────────────────────────────────── */
.zh-pph-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 2px;
  border: 0;
  background: none;
  color: var(--pp-ink, #fafafb);
  font: 700 13.5px/1.2 "DM Sans", sans-serif;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.zh-pph-cta {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 9px 15px;
  border-radius: var(--pp-r-pill, 999px);
  background: var(--pp-cta-bg, #fafafb);
  color: var(--pp-cta-ink, #0b0419);
  font: 800 13px/1.2 "DM Sans", sans-serif;
  white-space: nowrap;
  text-decoration: none;
}

.zh-pph-icon-btn,
.zh-pph-cart,
.zh-pph-account-btn,
.zh-pph-burger {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--pp-line, rgba(168, 85, 247, 0.18));
  background: var(--pp-card, #1a0e2e);
  color: var(--pp-ink, #fafafb);
  cursor: pointer;
  box-sizing: border-box;
}
.zh-pph-cart svg,
.zh-pph-icon-btn svg,
.zh-pph-burger svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Pastille du panier (tenue à jour par landing-public-shop.js). Fond
   #E11D48 / blanc : 4,7:1. */
.zh-pph-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--pp-r-pill, 999px);
  background: #E11D48;
  color: #FFFFFF;
  border: 2px solid var(--pp-page, #0b0419);
  font: 800 10.5px/14px "DM Sans", sans-serif;
  text-align: center;
  box-sizing: content-box;
  pointer-events: none;
}
.zh-pph-cart-badge[hidden] {
  display: none !important;
}

.zh-pph-account {
  position: relative;
  flex-shrink: 0;
}
.zh-pph-account-btn {
  overflow: hidden;
  font: 800 14px/1 "Space Grotesk", sans-serif;
}
.zh-pph-account-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zh-pph-burger {
  display: none;
  border-radius: var(--pp-r-md, 12px);
}

.zh-pph-link:focus-visible,
.zh-pph-cta:focus-visible,
.zh-pph-logo:focus-visible,
.zh-pph-icon-btn:focus-visible,
.zh-pph-cart:focus-visible,
.zh-pph-account-btn:focus-visible,
.zh-pph-burger:focus-visible {
  outline: 2px solid var(--pp-accent-text, #a78bfa);
  outline-offset: 2px;
}

@media (hover: hover) {
  .zh-pph-link:hover {
    color: var(--pp-brand, #a78bfa);
  }
  .zh-pph-cta:hover {
    opacity: 0.9;
  }
  .zh-pph-icon-btn:hover,
  .zh-pph-cart:hover,
  .zh-pph-account-btn:hover,
  .zh-pph-burger:hover {
    border-color: var(--pp-line-strong, rgba(168, 85, 247, 0.32));
  }
}

/* ─── Popover compte (motif « disclosure ») ─────────────────────────── */
.zh-pph-account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - var(--pp-header-h, 64px) - 24px);
  overflow-y: auto;
  padding: 8px;
  border-radius: var(--pp-r-lg, 16px);
  border: 1px solid var(--pp-line, rgba(168, 85, 247, 0.18));
  background: var(--pp-card, #1a0e2e);
  box-shadow: var(--pp-shadow-pop, 0 18px 44px rgba(0, 0, 0, 0.55));
  color: var(--pp-ink, #fafafb);
  box-sizing: border-box;
}
.zh-pph-account-menu[hidden] {
  display: none !important;
}
.zh-pph-account-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--pp-line, rgba(168, 85, 247, 0.18));
  margin-bottom: 6px;
}
.zh-pph-account-name {
  font: 700 14px/1.3 var(--pp-font-head, "Space Grotesk", sans-serif);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zh-pph-account-handle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--pp-mut, rgba(250, 250, 251, 0.66));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zh-pph-account-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.zh-pph-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--pp-r-sm, 10px);
  background: none;
  color: var(--pp-ink, #fafafb);
  font: 600 13.5px/1.3 "DM Sans", sans-serif;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.zh-pph-account-item-ic {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  color: var(--pp-mut, rgba(250, 250, 251, 0.66));
}
.zh-pph-account-item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.zh-pph-account-item-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--pp-mut, rgba(250, 250, 251, 0.66));
}
.zh-pph-account-item--danger,
.zh-pph-account-item--danger .zh-pph-account-item-ic {
  color: var(--pp-danger, #fb7185);
}
.zh-pph-account-item:focus-visible {
  outline: 2px solid var(--pp-accent-text, #a78bfa);
  outline-offset: -2px;
}
@media (hover: hover) {
  .zh-pph-account-item:hover {
    background: color-mix(in srgb, var(--pp-ink, #fafafb) 6%, transparent);
  }
}
.zh-pph-account-prefs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
  padding: 10px 10px 6px;
  border-top: 1px solid var(--pp-line, rgba(168, 85, 247, 0.18));
}
.zh-pph-pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pp-mut, rgba(250, 250, 251, 0.66));
}

/* Pastille XP (landing-xp-pill.css) : popover sombre en thème sombre. */
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop {
  background: var(--pp-card, #1a0e2e);
  border-color: var(--pp-line, rgba(168, 85, 247, 0.18));
  color: var(--pp-ink, #fafafb);
  box-shadow: var(--pp-shadow-pop, 0 18px 44px rgba(0, 0, 0, 0.55));
}
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop-num,
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop-tier-labels strong,
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop-stat-value {
  color: var(--pp-ink, #fafafb);
}
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop-eyebrow,
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop-tier-labels,
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop-stat-label {
  color: var(--pp-mut, rgba(250, 250, 251, 0.66));
}
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop-stat {
  background: var(--pp-card-light, #231340);
}
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop-bar {
  background: rgba(168, 85, 247, 0.22);
}
:root[data-pp-theme="dark"] .zh-pph .zh-xp-pop-cta {
  background: var(--pp-cta-bg, #fafafb);
  color: var(--pp-cta-ink, #0b0419);
}

/* ─── Tiroir mobile (frère du <header>, hooks nav-drawer.js) ─────────
   Fermé : hors champ ET `visibility: hidden` (hors de l'ordre de
   tabulation, après la transition) — jamais l'attribut [hidden], que
   nav-drawer.js ne retire pas. */
.zh-pph-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: var(--pp-scrim, rgba(4, 2, 8, 0.82));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0s linear 0.22s;
}
.zh-pph-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.22s ease, visibility 0s linear 0s;
}

.zh-pph-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 140;
  width: min(340px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--pp-card, #1a0e2e);
  border-left: 1px solid var(--pp-line, rgba(168, 85, 247, 0.18));
  box-shadow: var(--pp-shadow-pop, 0 18px 44px rgba(0, 0, 0, 0.55));
  color: var(--pp-ink, #fafafb);
  font-family: "DM Sans", sans-serif;
  box-sizing: border-box;
  transform: translateX(104%);
  visibility: hidden;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.26s;
}
.zh-pph-drawer.is-open {
  transform: none;
  visibility: visible;
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0s;
}
@media (prefers-reduced-motion: reduce) {
  .zh-pph-drawer,
  .zh-pph-drawer.is-open,
  .zh-pph-backdrop,
  .zh-pph-backdrop.is-visible {
    transition: none;
  }
}

.zh-pph-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.zh-pph-drawer-close {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--pp-line, rgba(168, 85, 247, 0.18));
  background: transparent;
  color: var(--pp-ink, #fafafb);
  cursor: pointer;
}
.zh-pph-drawer-close svg {
  width: 18px;
  height: 18px;
}
.zh-pph-drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--pp-r-md, 12px);
  background: color-mix(in srgb, var(--pp-ink, #fafafb) 5%, transparent);
}
.zh-pph-drawer-user .zh-pph-account-btn {
  pointer-events: none;
}
.zh-pph-drawer-user-body {
  min-width: 0;
}
.zh-pph-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--pp-r-pill, 999px);
  background: var(--pp-cta-bg, #fafafb);
  color: var(--pp-cta-ink, #0b0419);
  font: 800 14px/1.2 "DM Sans", sans-serif;
  text-decoration: none;
}
.zh-pph-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.zh-pph-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--pp-r-sm, 10px);
  background: none;
  color: var(--pp-ink, #fafafb);
  font: 700 15px/1.2 "DM Sans", sans-serif;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
.zh-pph-drawer-link--danger {
  color: var(--pp-danger, #fb7185);
}
.zh-pph-drawer-prefs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 0 0;
  border-top: 1px solid var(--pp-line, rgba(168, 85, 247, 0.18));
}
/* Lignes Thème / Langue alignées sur les liens (même retrait de 12 px). */
.zh-pph-drawer-prefs .zh-pph-pref {
  padding: 0 12px;
}
.zh-pph-drawer-close:focus-visible,
.zh-pph-drawer-cta:focus-visible,
.zh-pph-drawer-link:focus-visible {
  outline: 2px solid var(--pp-accent-text, #a78bfa);
  outline-offset: 2px;
}
@media (hover: hover) {
  .zh-pph-drawer-link:hover {
    background: color-mix(in srgb, var(--pp-ink, #fafafb) 6%, transparent);
  }
}

/* ─── Toasts du profil (Suivre, Partager, Marketplace…) ────────────── */
.zh-pph-toasts {
  position: fixed;
  top: calc(var(--pp-header-h, 64px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2400;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 420px);
}
.zh-pph-toast {
  pointer-events: auto;
  max-width: 100%;
  padding: 12px 18px;
  border-radius: var(--pp-r-pill, 999px);
  font: 600 13px/1.35 "DM Sans", sans-serif;
  text-align: center;
  color: var(--pp-ink, #fafafb);
  background: var(--pp-card, #1a0e2e);
  border: 1px solid var(--pp-line-strong, rgba(168, 85, 247, 0.32));
  box-shadow: var(--pp-shadow-pop, 0 18px 44px rgba(0, 0, 0, 0.55));
  animation: zh-pph-toast-in 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.zh-pph-toast.is-success {
  border-color: var(--pp-success, #4ade80);
}
.zh-pph-toast.is-error {
  border-color: var(--pp-danger, #fb7185);
}
.zh-pph-toast.is-leaving {
  animation: zh-pph-toast-out 180ms ease forwards;
}
@keyframes zh-pph-toast-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes zh-pph-toast-out {
  to { opacity: 0; }
}

/* ─── Points de rupture ─────────────────────────────────────────────── */

/* Tablette : nom borné pour laisser la place aux actions. */
@media (min-width: 769px) and (max-width: 1024px) {
  .zh-pph-shop-name {
    max-width: 22vw;
  }
}

/* Ordinateur : jamais de tiroir. */
@media (min-width: 769px) {
  .zh-pph-backdrop,
  .zh-pph-drawer {
    display: none;
  }
}

/* Mobile : burger ; Marketplace, compte et connexion passent au tiroir. */
@media (max-width: 768px) {
  .zh-pph-inner {
    height: 55px;
    gap: 10px;
  }
  .zh-pph-logo-img {
    height: 22px;
  }
  .zh-pph-sep {
    height: 20px;
  }
  .zh-pph-shop-name {
    font-size: 14.5px;
  }
  .zh-pph-link,
  .zh-pph-account,
  .zh-pph-login {
    display: none;
  }
  .zh-pph-burger {
    display: inline-flex;
  }
  .zh-pph-toasts {
    top: calc(var(--pp-header-h, 56px) + 10px);
  }
}

/* Petit mobile : le CTA passe aussi au tiroir. */
@media (max-width: 599px) {
  .zh-pph-cta {
    display: none;
  }
}

/* Très petit : le nom de la boutique s'efface (la vitrine le porte). */
@media (max-width: 360px) {
  .zh-pph-sep,
  .zh-pph-shop-name {
    display: none;
  }
}

/* Téléphone en paysage : l'en-tête ne colle plus (seuls les onglets
   collent), hauteur réduite. */
@media (max-height: 500px) and (orientation: landscape) {
  .zh-pph {
    position: relative;
  }
  .zh-pph-inner {
    height: 51px;
  }
  .zh-pph-toasts {
    top: 12px;
  }
}

/* Cibles tactiles ≥ 44 px. */
@media (pointer: coarse) {
  .zh-pph-icon-btn,
  .zh-pph-cart,
  .zh-pph-account-btn,
  .zh-pph-burger {
    width: 44px;
    height: 44px;
  }
  .zh-pph-cta,
  .zh-pph-link,
  .zh-pph-account-item {
    min-height: 44px;
  }
  /* Logo (image de 24 px de haut) : centré dans 44 × 44. */
  .zh-pph-logo {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
}
