/* Alvion Industry v5 add-ons (c): scroll progress strip, back-to-top button, header language switcher.
   Black + gold only (tokens from main.css); phones first; reduced motion honoured. Loaded after main.css. */

/* ---------- 1. Scroll progress strip: a 3px gold line glued to the header's bottom edge ---------- */
.progress-strip{position:fixed;left:0;right:0;top:var(--strip-top,var(--nav-h,70px));height:3px;z-index:101;pointer-events:none;--p:0;--w:100vw}
.progress-strip__bar{position:absolute;inset:0;background:var(--grad-gold,linear-gradient(90deg,#f1c85c,#d4a52a));transform:scaleX(var(--p));transform-origin:left center;will-change:transform;
  box-shadow:0 0 10px rgba(212,165,42,.45)}
.progress-strip__tip{position:absolute;top:50%;left:0;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,rgba(248,227,166,1) 0,rgba(241,200,92,.75) 28%,rgba(212,165,42,.35) 50%,transparent 72%);
  transform:translateX(calc(var(--p) * var(--w)));will-change:transform;opacity:0;transition:opacity .25s}
.progress-strip.is-live .progress-strip__tip{opacity:1}
.menu-open .progress-strip{opacity:0}

/* ---------- 2. Back to top: bottom-left, so it never meets the WhatsApp float (bottom-right) ---------- */
.totop{position:fixed;left:20px;bottom:calc(20px + var(--consent-h,0px));z-index:98;width:46px;height:46px;display:grid;place-items:center;
  border-radius:50%;border:1.5px solid var(--gold-line,rgba(212,165,42,.36));background:var(--on-ink,#0a0a0b);color:var(--gold,#d4a52a);cursor:pointer;
  box-shadow:0 8px 24px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.04);
  opacity:0;visibility:hidden;transform:translateY(14px) scale(.92);
  transition:opacity .3s ease,transform .3s ease,visibility 0s .3s,border-color .2s,color .2s,box-shadow .2s}
.totop.is-on{opacity:1;visibility:visible;transform:none;transition-delay:0s}
.totop svg{width:20px;height:20px;display:block;transition:transform .2s}
.totop:hover,.totop:focus-visible{border-color:var(--gold,#d4a52a);color:var(--gold-l,#f1c85c);box-shadow:0 10px 28px rgba(0,0,0,.55),0 0 24px rgba(212,165,42,.22)}
.totop:hover svg{transform:translateY(-2px)}
.totop:active{transform:scale(.95)}
.menu-open .totop{opacity:0;visibility:hidden;pointer-events:none}
@media (max-width:760px){
  /* above the mobile bottom bar (.mbar, measured by c.js), nudged further up while the consent banner is on screen */
  .totop{left:14px;bottom:calc(var(--mbar-h,66px) + 12px + var(--consent-h,0px))}
}

/* ---------- 3. Header language switcher: flag + name + chevron, listbox dropdown ---------- */
.lsw{position:relative;flex:none;display:inline-flex;align-items:center;font:600 .78rem/1 var(--body,system-ui,sans-serif);letter-spacing:.01em}
.lsw__btn{display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 9px 0 7px;border-radius:999px;border:1px solid var(--line-d,#36363e);
  background:var(--card,#15151a);color:var(--ink,#f4f1ea);cursor:pointer;font:inherit;letter-spacing:inherit;white-space:nowrap;transition:border-color .15s,color .15s,background .15s}
.lsw__btn:hover,.lsw__btn:focus-visible,.lsw.is-open .lsw__btn{border-color:var(--gold,#d4a52a);color:var(--gold-l,#f1c85c)}
.lsw__chev{flex:none;color:var(--mute,#b5afa3);transition:transform .18s,color .15s}
.lsw__btn:hover .lsw__chev,.lsw.is-open .lsw__chev{color:var(--gold-l,#f1c85c)}
.lsw.is-open .lsw__chev{transform:rotate(180deg)}
.lsw__flag{flex:none;display:inline-grid;place-items:center;width:16px;height:16px;border-radius:50%;overflow:hidden;box-shadow:0 0 0 1px rgba(255,255,255,.14);isolation:isolate}
.lsw__flag svg{display:block;width:16px;height:16px}
.lsw__list{position:absolute;top:calc(100% + 8px);right:0;z-index:5;min-width:172px;margin:0;padding:6px;list-style:none;
  background:linear-gradient(180deg,#15151a,#0f0f12);border:1px solid var(--gold-line,rgba(212,165,42,.36));border-radius:12px;
  box-shadow:0 18px 44px rgba(0,0,0,.6),0 0 30px rgba(212,165,42,.08)}
.lsw__list::before{content:"";position:absolute;left:10px;right:10px;top:0;height:1px;background:linear-gradient(90deg,transparent,var(--gold,#d4a52a),transparent);opacity:.7}
.lsw__list[hidden]{display:none}
.lsw__list:not([hidden]){display:block;animation:lswIn .16s ease}
@keyframes lswIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.lsw__opt{display:flex;align-items:center;gap:10px;height:40px;padding:0 10px;border-radius:8px;color:var(--ink,#f4f1ea);font-weight:600;font-size:.84rem;text-decoration:none;white-space:nowrap;
  transition:background .12s,color .12s}
.lsw__opt:hover,.lsw__opt:focus-visible,.lsw__opt.is-focus{background:var(--gold-soft,rgba(212,165,42,.14));color:var(--gold-l,#f1c85c);outline:none}
.lsw__opt.is-on{color:var(--gold-l,#f1c85c)}
.lsw__opt span{flex:1}
.lsw__tick{flex:none;color:var(--gold,#d4a52a)}
.nav .lsw{margin-left:-6px}
@media (max-width:1280px) and (min-width:981px){ .nav .lsw__name{display:none} .nav .lsw__btn{padding:0 8px 0 7px} }   /* tight desktop header: flag only */
@media (max-width:980px){
  .nav .lsw{margin-left:auto}          /* phones/tablets: sits beside the burger */
  .nav .lsw ~ .burger{margin-left:0}
}
@media (max-width:400px){ .nav .lsw__name{display:none} .nav .lsw__btn{padding:0 8px 0 7px} }
@media (prefers-reduced-motion:reduce){
  .totop,.totop svg,.lsw__btn,.lsw__chev,.lsw__opt,.progress-strip__tip{transition:none}
  .lsw__list:not([hidden]){animation:none}
}

/* flags: gold duotone so the switcher stays black + gold (no green anywhere) */
.lsw__flag{filter:grayscale(1) sepia(1) saturate(2.4) hue-rotate(-8deg) brightness(1.05)}

/* phones: back-to-top on the right (the WhatsApp float is hidden there), clear of the bottom bar */
@media (max-width:760px){.totop{left:auto;right:14px}}

/* ---------- 4. Language parity: translated labels are longer than English, so the desktop header tightens earlier ---------- */
/* de/fr/es/it: the compact header tier (short CTA, tight pills, flag-only switcher) runs up to 1440px and the wordmark goes below 1230px, so the row never wraps or pushes the CTA off-screen */
@media (min-width:981px) and (max-width:1440px){
  html:not([lang=en]) .nav{gap:12px}
  html:not([lang=en]) .logo__word small{display:none}
  html:not([lang=en]) #menu{font-size:.9rem;gap:2px}
  html:not([lang=en]) .nl{padding:10px 9px}
  html:not([lang=en]) .nd .nl{padding-right:3px}
  html:not([lang=en]) .nl::after{left:9px;right:9px}
  html:not([lang=en]) .nav__quote{padding:10px 14px}
  html:not([lang=en]) .nav__quote-l{display:none}
  html:not([lang=en]) .nav__quote-s{display:inline}
  html:not([lang=en]) .nav .lsw__name{display:none}
  html:not([lang=en]) .nav .lsw__btn{padding:0 8px 0 7px}
}
@media (min-width:981px) and (max-width:1230px){
  html:not([lang=en]) .logo__word{display:none}
}
/* English 1181-1200px: the full CTA label was 6px too wide next to a classic scrollbar */
@media (min-width:1181px) and (max-width:1200px){
  html[lang=en] .nav__quote{padding:10px 14px}
  html[lang=en] .nav__quote-l{display:none}
  html[lang=en] .nav__quote-s{display:inline}
}

/* ---------- 5. Phone card lists: .pcards is a flex wrap, so the desktop 2/3 max-width left a dead strip beside every card (worse with long German titles) ---------- */
@media (max-width:760px){
  .pcards>*,.pcards--4>*{flex:1 1 100%;max-width:none;min-width:0}
}

/* ---------- 6. Long translated labels: fact tiles and timelines never push text past the card edge ---------- */
.s-facts__k,.s-facts__v,.s-facts__n,.s-tl__k,.s-tl__v{overflow-wrap:break-word;hyphens:auto;min-width:0}
@media (max-width:520px){
  .s-facts__i{padding:12px 10px;column-gap:9px}
  .s-facts__ico{width:38px;height:38px;border-radius:10px}
  .s-facts__k{font-size:clamp(.66rem,2.7vw,.78rem)}
}
@media (max-width:520px){
  /* a 4+ step timeline cannot hold five 60px columns of German or French words: stack it like the 360px layout does */
  .s-tl:has(.s-tl__n:nth-child(4)){grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:minmax(0,1fr);gap:12px;text-align:left}
  .s-tl:has(.s-tl__n:nth-child(4))::before,.s-tl:has(.s-tl__n:nth-child(4))::after{display:none}
  .s-tl:has(.s-tl__n:nth-child(4)) .s-tl__n{grid-template-columns:var(--s-dot) minmax(0,1fr);justify-items:start;align-items:center;column-gap:12px;row-gap:2px}
  .s-tl:has(.s-tl__n:nth-child(4)) .s-tl__dot{grid-row:1 / span 2}
  .s-tl:has(.s-tl__n:nth-child(4)) .s-tl__k,.s-tl:has(.s-tl__n:nth-child(4)) .s-tl__v{grid-column:2;max-width:none}
  .s-tl:has(.s-tl__n:nth-child(4)) .s-tl__k{font-size:.95rem}
  .s-tl:has(.s-tl__n:nth-child(4)) .s-tl__v{font-size:.82rem}
  .s-tl:has(.s-tl__n:nth-child(4)) .s-tl__n:not(:last-child)::after{content:"";position:absolute;left:calc(var(--s-dot) / 2 - 1px);top:var(--s-dot);bottom:-12px;width:2px;background:repeating-linear-gradient(180deg,var(--gold-line) 0 6px,transparent 6px 12px)}
}

/* size-guide link rows: a translated guide name next to "Table →" overran the arrow link; outside English the link drops under the name */
html:not([lang=en]) .pres-rcard--row{grid-template-columns:36px minmax(0,1fr);row-gap:2px}
html:not([lang=en]) .pres-rcard--row .pres-rcard__ico{grid-row:1 / span 2}
html:not([lang=en]) .pres-rcard--row b{overflow-wrap:break-word;hyphens:auto}
html:not([lang=en]) .pres-rcard--row .link{grid-column:2;justify-self:start}

/* copy chips (NTN, message ref) wrap inside narrow cards; key-value tiles and table cells break an over-long compound instead of spilling */
.s-chip{flex-wrap:wrap;row-gap:2px}
.s-chip__k{white-space:normal}
.kv dt,.kv dd{overflow-wrap:break-word;hyphens:auto}
html:not([lang=en]) :is(dd,dt,td,th,li,summary,figcaption,label){overflow-wrap:break-word;hyphens:auto}

/* phone action bars (bottom bar + menu sheet bar): "Écrivez-nous sur WhatsApp" / "Escríbanos por WhatsApp" were clipped by the button's overflow:hidden; labels may now wrap to two lines */
@media (max-width:760px){
  .mbar .btn,.menu__bar .btn{white-space:normal;line-height:1.15;font-size:clamp(.78rem,3.5vw,.95rem);gap:6px;padding:8px 8px;min-width:0}
  .mbar .btn svg,.menu__bar .btn svg{width:18px;height:18px}
}

/* phone list cards: the title column is ~110px wide, so long compounds (Kompressionsshirts, MMA-Trainingsbekleidung) scale with the screen and break only as a last resort */
@media (max-width:760px){
  .pcard__body h2,.pcard__body h3,.post-card h2{font-size:clamp(.84rem,4.2vw,1.02rem);overflow-wrap:break-word;hyphens:auto}
  .pcard__body p,.post-card__body>p{overflow-wrap:anywhere}
}

/* touch screens: every stand-alone tap target is at least 44x44 CSS px (inline links inside running text are exempt) */
@media (pointer:coarse), (max-width:760px){
  .lsw__btn{height:44px;min-width:44px;justify-content:center}
  .pills a,.pills span,.show__link,.link,.s-badge,.foot__badge,.btn--sm,summary,.langs--foot .lang,.lang{min-height:44px}
  .pills a,.show__link,.link,.foot__badge,.langs--foot .lang,.lang{display:inline-flex;align-items:center}
  .foot__grid a,.foot__grid span{padding-top:12px;padding-bottom:12px}
  .foot__badge{padding-top:5px;padding-bottom:5px}
}
