/* ═══════════════════════════════════════════════════════════════════════════
   AVSD v2 — Ambassadeurs (voir inc/v2-ambassadeurs.php)
   1. Bloc « nos ambassadeurs »   2. Espace ambassadeur
   3. Guide des tailles en pop-up 4. Tenues de la page ambassadeur, pop-up taille
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ 1. BLOC « NOS AMBASSADEURS » ═══════════════════════════════════════ */

.v2-ambs-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 28px;
}
.v2-ambs-head .v2-h2 { margin: 6px 0 0; }

/* Deux bandeaux qui défilent en sens inverse, pause au survol.
   Chaque piste contient deux copies identiques : -50 % = une boucle. */
.v2-ambs-defile {
  display: flex; flex-direction: column; gap: 14px;
  --v2-amb-h: clamp(240px, 22vw, 320px);
}
.v2-ambs-ligne {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.v2-ambs-piste {
  list-style: none; margin: 0; padding: 0;
  display: flex; width: max-content;
  animation: v2-ambs-defile var(--v2-ambs-duree, 40s) linear infinite;
}
.v2-ambs-ligne--inverse .v2-ambs-piste { animation-direction: reverse; }
.v2-ambs-ligne:hover .v2-ambs-piste,
.v2-ambs-ligne:focus-within .v2-ambs-piste { animation-play-state: paused; }
/* Marge à droite plutôt que gap : -50 % tombe pile sur la seconde copie. */
.v2-ambs-piste > li { flex: 0 0 auto; margin-right: 14px; }
@keyframes v2-ambs-defile { to { transform: translateX(-50%); } }

.v2-amb-card {
  position: relative; display: block; overflow: hidden;
  height: var(--v2-amb-h); width: calc(var(--v2-amb-h) * .78);
  border-radius: 18px; background: var(--v2-soft);
  color: #fff; text-decoration: none;
}
.v2-amb-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.v2-amb-card:hover img,
.v2-amb-card:focus-visible img { transform: scale(1.05); }
.v2-amb-initiale {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 72px; font-weight: 800; color: var(--v2-ink-soft);
}
.v2-amb-legende {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 48px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.78));
}
.v2-amb-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.v2-amb-meta { font-size: 13px; opacity: .8; }
.v2-amb-ext  { font-size: 12.5px; font-weight: 600; margin-top: 2px; color: var(--v2-lime, #c8f000); }
a.v2-amb-card:hover .v2-amb-ext { text-decoration: underline; }

/* Mobile : les deux lignes occupent presque tout l'écran sous le titre. */
@media (max-width: 620px) {
  .v2-ambs-defile {
    gap: 10px;
    --v2-amb-h: max(220px, calc((100vh - 200px) / 2));
    --v2-amb-h: max(220px, calc((100svh - 200px) / 2));
  }
  .v2-ambs-piste > li { margin-right: 10px; }
  .v2-amb-card { border-radius: 16px; width: calc(var(--v2-amb-h) * .72); }
  .v2-ambs-head { margin-bottom: 20px; }
}

/* Sans animation : les lignes se font défiler au doigt. */
@media (prefers-reduced-motion: reduce) {
  .v2-ambs-piste { animation: none; }
  .v2-ambs-ligne { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}

/* ═══ 2. ESPACE AMBASSADEUR ══════════════════════════════════════════════ */

.v2-esp { background: var(--v2-soft); }
.v2-esp-hero { padding: clamp(36px, 6vw, 72px) 0 8px; }
.v2-esp-hero-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.v2-esp-id { display: flex; align-items: center; gap: 20px; }
.v2-esp-id .v2-h2 { margin: 4px 0 8px; }
.v2-esp-avatar {
  width: 88px; height: 88px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center; background: var(--v2-surface);
  font-size: 34px; font-weight: 800; color: var(--v2-ink-soft);
  border: 1px solid var(--v2-line);
}
.v2-esp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.v2-esp-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.v2-esp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  background: var(--v2-surface); border: 1px solid var(--v2-line); color: var(--v2-ink-soft);
}
.v2-esp-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.v2-esp-pill--ok   { color: var(--v2-lime-ink); }
.v2-esp-pill--warn { color: #9A5B00; }

.v2-esp-card {
  background: var(--v2-surface); border: 1px solid var(--v2-line);
  border-radius: 18px; padding: clamp(18px, 2.4vw, 26px);
}
.v2-esp-flash { margin: 18px 0 0; border-color: var(--v2-lime); background: color-mix(in srgb, var(--v2-lime) 14%, var(--v2-surface)); font-size: 14px; }
.v2-esp-h  { font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.v2-esp-h2 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.1; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.v2-esp-h2 em { font-style: normal; color: var(--v2-ink-soft); font-weight: 600; }
.v2-esp-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 20px; margin-bottom: 18px;
}
.v2-esp-sum { margin: 0; color: var(--v2-ink-soft); font-size: 14px; }
.v2-esp-sum strong { color: var(--v2-ink); }
.v2-esp-note { font-size: 12.5px; color: var(--v2-ink-soft); margin: 12px 0 0; }

.v2-esp-share { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.v2-esp-share:has(> :only-child) { grid-template-columns: 1fr; }
.v2-esp-copy { display: flex; gap: 8px; }
.v2-esp-copy input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px;
  border: 1px solid var(--v2-line); border-radius: 10px;
  background: var(--v2-soft); color: var(--v2-ink); font: 500 13px var(--v2-font);
}
.v2-esp-code { font-family: var(--v2-font-mono) !important; font-weight: 600 !important; letter-spacing: .04em; }

.v2-esp-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 14px;
}
.v2-esp-kpi {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--v2-surface); border: 1px solid var(--v2-line);
  border-radius: 18px; padding: 20px;
}
.v2-esp-kpi-v { font-size: clamp(30px, 3.4vw, 42px); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.v2-esp-kpi-l { font-size: 13.5px; font-weight: 600; }
.v2-esp-kpi-t { font-size: 12px; color: var(--v2-ink-soft); }

.v2-esp-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--v2-ink-soft); margin-bottom: 14px; }
.v2-esp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.v2-esp-dot--vue,  .v2-esp-bar-vue  { background: var(--v2-ink); }
.v2-esp-dot--clic, .v2-esp-bar-clic { background: var(--v2-lime); }
.v2-esp-bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.v2-esp-bar {
  flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 1px;
  border-bottom: 1px solid var(--v2-line);
}
.v2-esp-bar span { width: 45%; min-height: 0; border-radius: 3px 3px 0 0; }
.v2-esp-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--v2-ink-soft); margin-top: 6px; }

.v2-esp-table-wrap { padding: 0; overflow-x: auto; }
.v2-esp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.v2-esp-table th, .v2-esp-table td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--v2-line); vertical-align: top; }
.v2-esp-table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--v2-ink-soft); font-weight: 700; }
.v2-esp-table tbody tr:last-child td { border-bottom: 0; }
.v2-esp-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.v2-esp-empty p { margin: 0; color: var(--v2-ink-soft); }

.v2-esp-tenues {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.v2-esp-tenue { display: flex; align-items: center; gap: 14px; padding: 12px; }
.v2-esp-tenue img { width: 64px; height: 80px; object-fit: cover; border-radius: 10px; background: var(--v2-soft); }
.v2-esp-tenue div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.v2-esp-tenue span { color: var(--v2-ink-soft); font-size: 13px; }

.v2-esp-help { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.v2-esp-help p { margin: 0; font-size: 14px; }

@media (max-width: 900px) {
  .v2-esp-kpis  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2-esp-share { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .v2-esp-id { gap: 14px; }
  .v2-esp-avatar { width: 64px; height: 64px; font-size: 26px; }
  .v2-esp-bars { gap: 1px; height: 110px; }
  /* Tableau des commandes → cartes empilées */
  .v2-esp-table thead { display: none; }
  .v2-esp-table, .v2-esp-table tbody, .v2-esp-table tr, .v2-esp-table td { display: block; }
  .v2-esp-table tr { padding: 12px 16px; border-bottom: 1px solid var(--v2-line); }
  .v2-esp-table tbody tr:last-child { border-bottom: 0; }
  .v2-esp-table td { padding: 3px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .v2-esp-table td::before { content: attr(data-l); color: var(--v2-ink-soft); font-size: 12.5px; text-align: left; }
  .v2-esp-table .num { text-align: right; }
}

html[data-theme="nuit"] .v2-esp-pill--warn { color: #F2B45A; }

/* ═══ 3. GUIDE DES TAILLES EN POP-UP ════════════════════════════════════ */

.v2-guide {
  position: fixed; inset: 0; z-index: 10050;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.v2-guide[hidden] { display: none; }
.v2-guide-backdrop { position: absolute; inset: 0; background: rgba(10,10,12,.72); backdrop-filter: blur(3px); }
.v2-guide-box {
  position: relative; width: 100%; max-width: 820px; height: min(88vh, 860px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.v2-guide-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 12px 22px; border-bottom: 1px solid #E8E8E4;
  font: 700 15px 'Plus Jakarta Sans', system-ui, sans-serif; color: #222;
}
.v2-guide-close {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: #F2F2EF; color: #222; font-size: 22px; line-height: 1;
}
.v2-guide-close:hover { background: #222; color: #fff; }
.v2-guide-box iframe { flex: 1; width: 100%; border: 0; background: #fff; }
html.v2-guide-open, html.v2-guide-open body { overflow: hidden; }

@media (max-width: 620px) {
  .v2-guide { padding: 0; }
  .v2-guide-box { max-width: none; height: 100%; border-radius: 0; }
}

/* Le guide affiché dans la pop-up : seulement l'outil. */
body.v2-embed .v2-preview-bar,
body.v2-embed .v2-annonce,
body.v2-embed .v2-header,
body.v2-embed .v2-drawer,
body.v2-embed .v2-footer,
body.v2-embed .v2-skip,
body.v2-embed .v2-search,
body.v2-embed .wa-widget,
body.v2-embed .page-hero,
body.v2-embed .page-main > section.section-alt,
body.v2-embed .final-cta-section,
body.v2-embed #cookieBanner,
body.v2-embed .cookie-banner { display: none !important; }
body.v2-embed .page-main { padding-top: 0 !important; margin-top: 0 !important; }
body.v2-embed .page-main > section:first-of-type { padding-top: 20px !important; }

/* ═══ 4. TEAM STORE ══════════════════════════════════════════════════════ */

/* Sans min-width:0, un fieldset s'élargit à son contenu : le tableau des
   tailles poussait la modale de /team-store/ hors de l'écran. */
body.v2-theme .ts-modal .ts-fieldset{min-width:0}

/* ═══ 4 bis. TENUES DE LA PAGE AMBASSADEUR + POP-UP TAILLE ═══════════════ */

.v2-tenue { margin-top: 26px; }
.v2-tenue h3 { font-size: 20px; margin: 0 0 14px; color: var(--text); }
.v2-tenue-imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.v2-tenue-imgs button {
  display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 18px; background: #fff; cursor: zoom-in;
}
.v2-tenue-imgs img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
/* Image trop étroite ou trop large pour le 4:5 : entière plutôt que coupée */
.v2-tenue-imgs .is-entier img { object-fit: contain; }
.v2-tenue-imgs button:hover img,
.v2-tenue-imgs button:focus-visible img { transform: scale(1.04); }
.v2-tenue-btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 64px; margin-top: 16px; padding: 0 24px; border-radius: 999px;
  background: #C8F135; color: #111 !important; font-size: 19px; font-weight: 800;
  text-decoration: none; transition: transform .2s, box-shadow .2s;
}
.v2-tenue-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(200,241,53,.8); }

@media (max-width: 620px) {
  /* 3 images glissées au doigt, la suivante dépasse pour le montrer */
  .v2-tenue-imgs {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 74%;
    overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px;
  }
  .v2-tenue-imgs button { scroll-snap-align: start; }
}

.v2-taille { position: fixed; inset: 0; z-index: 10040; display: flex; align-items: center; justify-content: center; padding: 16px; }
.v2-taille[hidden] { display: none; }
.v2-taille-fond { position: absolute; inset: 0; background: rgba(6,6,8,.86); backdrop-filter: blur(4px); }
.v2-taille-box {
  position: relative; box-sizing: border-box; width: 100%; max-width: 440px; max-height: 100%;
  display: flex; flex-direction: column;
  padding: 30px; border-radius: 22px; background: #131319; color: #f0f0f2;
  border: 1px solid rgba(255,255,255,.13);
}
.v2-taille.is-guide .v2-taille-box { max-width: 960px; height: 100%; padding: 18px; }
.v2-taille-close {
  position: absolute; top: 12px; right: 12px; z-index: 1; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: inherit; font-size: 22px; line-height: 1; cursor: pointer;
}
.v2-taille-close:hover { background: rgba(255,255,255,.16); }
.v2-taille-choix h2 { margin: 0 34px 6px 0; font-size: 24px; line-height: 1.2; color: inherit; }
.v2-taille-tenue { margin: 0 0 22px; font-size: 14px; color: rgba(240,240,242,.6); }
.v2-taille-go, .v2-taille-aide, .v2-taille-retour {
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: 52px; padding: 8px 20px; border-radius: 999px;
  font-family: inherit; font-size: 15px; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer;
}
.v2-taille-go { width: 100%; background: #C8F135; color: #111 !important; border: 0; }
.v2-taille-aide { width: 100%; margin-top: 10px; background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.25); }
.v2-taille-aide:hover, .v2-taille-retour:hover { border-color: #C8F135; color: #C8F135; }
.v2-taille-guide { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 12px; }
.v2-taille-guide[hidden] { display: none; }
.v2-taille-guide strong { padding: 8px 44px 0 4px; font-size: 16px; }
.v2-taille-guide iframe { flex: 1; min-height: 0; width: 100%; border: 0; border-radius: 12px; background: #fff; }
.v2-taille-pied { display: flex; gap: 10px; }
.v2-taille-retour { flex: 0 0 auto; background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.25); }
.v2-taille-pied .v2-taille-go { flex: 1; width: auto; }

@media (max-width: 620px) {
  .v2-taille { padding: 0; align-items: flex-end; }
  .v2-taille-box { border-radius: 20px 20px 0 0; padding: 24px 18px; }
  .v2-taille.is-guide .v2-taille-box { padding: 12px; border-radius: 0; }
  .v2-taille-go, .v2-taille-retour { font-size: 14px; padding: 8px 14px; }
}

/* Pop-up photo */
.v2-lb{position:fixed;inset:0;z-index:10050;display:flex;align-items:center;justify-content:center;padding:56px 16px;background:rgba(6,6,8,.92);backdrop-filter:blur(6px)}
.v2-lb[hidden]{display:none}
.v2-lb img{max-width:min(1100px,100%);max-height:100%;object-fit:contain;border-radius:12px;display:block}
.v2-lb button{position:absolute;width:44px;height:44px;border-radius:50%;border:0;background:rgba(255,255,255,.1);color:#fff;font-size:24px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.v2-lb button:hover{background:#C8F135;color:#111}
.v2-lb-close{top:14px;right:14px}
.v2-lb-prev{left:14px;top:50%;transform:translateY(-50%)}
.v2-lb-next{right:14px;top:50%;transform:translateY(-50%)}
.v2-lb-prev[hidden],.v2-lb-next[hidden]{display:none}
@media(max-width:620px){.v2-lb-prev,.v2-lb-next{top:auto;bottom:14px;transform:none}}

/* Aperçus des tenues (Team Store + pages ambassadeurs) : glissement plus vif,
   rythme : fin de inc/v2-ambassadeurs.php. .no-anim (0,2,0) garde la main. */
body .ts-car-track{transition-duration:.5s}

/* ═══ 5. PAGES AMBASSADEURS — tokens ════════════════════════════════════
   ambassadeur.css (parent) a été écrit pour un site sombre par défaut :
   ses cartes supposent --fg-rgb blanc et --bg-rgb noir, et html.amb-light
   ne redéfinit que --bg / --text. La v2 étant claire par défaut, on remet
   ces deux triplets à ce qu'il attend, et les couleurs nuit en mode sombre.
   Le mode suit celui du site (inc/v2-ambassadeurs.php, section 7). */

body.v2-theme .amb-page {
  --fg-rgb: 255,255,255;
  --bg-rgb: 10,10,12;
}
html:not(.amb-light) body.v2-theme .amb-page {
  --bg:       #0a0a0c;
  --surface:  #111116;
  --surface2: #18181e;
  --text:     #f0f0f2;
  --text-rgb: 240,240,242;
  --muted:    rgba(240,240,242,.5);
  --border:   rgba(255,255,255,.08);
  --border2:  rgba(255,255,255,.14);
  --shadow-k: 1;
  color: var(--text);
}
html.amb-light body.v2-theme .amb-page {
  --text-rgb: 19,19,22;
  color: var(--text);
}
/* Titres : la v2 les force en --v2-ink ; sur ces pages, la couleur du mode. */
body.v2-theme .amb-page :is(h1, h2, h3) { color: var(--text); }
