/* ═══════════════════════════════════════════════════════════════════════
   pb-widgets.css — briques interactives génériques du PageBuilder.

   Onglets, accordéon, compteur animé, barre de progression, avant/après,
   bandeau de logos, compte à rebours. Chacune était jusqu'ici recréée à la
   main en HTML/CSS importé (donc impossible à retoucher dans l'éditeur).

   Règle de conception : SANS le runtime (pb-widgets.js absent, JS coupé, ou
   dans le canvas de l'éditeur), tout reste lisible et modifiable —
   les panneaux d'onglets s'affichent tous, le compteur montre sa valeur
   finale, la barre est remplie, l'avant/après montre les deux images.
   Le runtime ne fait qu'ajouter le comportement, jamais le contenu.

   Variables surchargeables par instance (règle #id écrite par l'éditeur) :
   --pbw-accent, --pbw-radius, --pbw-gap, --pbw-height, --pbw-speed.
   ═══════════════════════════════════════════════════════════════════════ */

.pb-w {
    --pbw-accent: #1AD598;
    --pbw-radius: 12px;
    --pbw-border: rgba(0, 0, 0, .12);
    --pbw-muted: #6b7280;
}

/* ── Onglets ──────────────────────────────────────────────────────────
   Sans JS : la liste d'onglets reste visible et TOUS les panneaux sont
   affichés (empilés), ce qui est exactement ce qu'il faut pour éditer. */
.pb-tabs { display: block; }
.pb-tabs-nav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--pbw-border); }
.pb-tabs-tab {
    appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
    padding: 10px 16px; font: inherit; font-weight: 600; color: var(--pbw-muted);
    cursor: pointer; border-radius: var(--pbw-radius) var(--pbw-radius) 0 0;
}
.pb-tabs-tab:hover { color: inherit; background: rgba(0, 0, 0, .035); }
.pb-tabs-tab[aria-selected="true"] { color: inherit; border-bottom-color: var(--pbw-accent); }
.pb-tabs-panels { padding: 20px 2px; }
.pb-tabs-panel + .pb-tabs-panel { margin-top: 18px; }
/* Le runtime prend la main : il ajoute .pb-tabs--live et masque l'inactif. */
.pb-tabs--live .pb-tabs-panel[hidden] { display: none; }
.pb-tabs--live .pb-tabs-panel + .pb-tabs-panel { margin-top: 0; }

/* ── Accordéon (natif <details>, aucun JS) ────────────────────────── */
.pb-acc { display: grid; gap: var(--pbw-gap, 10px); }
.pb-acc-item {
    border: 1px solid var(--pbw-border); border-radius: var(--pbw-radius);
    background: rgba(255, 255, 255, .6); overflow: hidden;
}
.pb-acc-item > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; font-weight: 650; cursor: pointer; list-style: none;
}
.pb-acc-item > summary::-webkit-details-marker { display: none; }
.pb-acc-item > summary::after {
    content: ""; width: 10px; height: 10px; flex: 0 0 auto;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px); transition: transform .25s ease;
}
.pb-acc-item[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.pb-acc-body { padding: 0 18px 16px; line-height: 1.65; }

/* ── Compteur animé ───────────────────────────────────────────────────
   Sans JS, le nombre final est déjà dans le DOM (accessible + SEO). */
.pb-counter { display: grid; gap: 6px; text-align: center; }
.pb-counter-value { font-size: clamp(28px, 4vw, 44px); font-weight: 800; line-height: 1; }
.pb-counter-label { font-size: .95rem; color: var(--pbw-muted); }

/* ── Barre de progression ─────────────────────────────────────────── */
.pb-progress { display: grid; gap: 8px; }
.pb-progress-head { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; }
.pb-progress-track { height: var(--pbw-height, 10px); border-radius: 999px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.pb-progress-bar {
    height: 100%; width: var(--pbw-value, 60%); border-radius: inherit;
    background: var(--pbw-accent); transition: width var(--pbw-speed, 1.1s) cubic-bezier(.3, .8, .3, 1);
}
/* Le runtime part de 0 puis relâche à l'entrée dans l'écran. */
.pb-progress--live .pb-progress-bar { width: 0; }
.pb-progress--live.pb-progress--in .pb-progress-bar { width: var(--pbw-value, 60%); }

/* ── Avant / après ────────────────────────────────────────────────────
   Sans JS : les deux images sont visibles (l'« après » sur la moitié). */
.pb-ba { position: relative; overflow: hidden; border-radius: var(--pbw-radius); isolation: isolate; }
.pb-ba img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pb-ba-after {
    position: absolute; inset: 0;
    clip-path: inset(0 0 0 var(--pbw-split, 50%));
}
.pb-ba-handle {
    position: absolute; top: 0; bottom: 0; left: var(--pbw-split, 50%);
    width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
    pointer-events: none;
}
.pb-ba-handle::after {
    content: ""; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px;
    transform: translate(-50%, -50%); border-radius: 50%; background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
.pb-ba-range {
    position: absolute; inset: auto 0 12px; width: calc(100% - 24px); margin: 0 12px;
    accent-color: var(--pbw-accent);
}
.pb-ba-label {
    position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px;
    background: rgba(11, 25, 41, .72); color: #fff; font-size: .78rem; font-weight: 600;
}
.pb-ba-label--before { left: 12px; }
.pb-ba-label--after { right: 12px; }

/* ── Bandeau de logos (100 % CSS) ─────────────────────────────────── */
.pb-marquee { overflow: hidden; position: relative; }
.pb-marquee-track {
    display: flex; align-items: center; gap: var(--pbw-gap, 48px); width: max-content;
    animation: pb-marquee-scroll var(--pbw-speed, 26s) linear infinite;
}
.pb-marquee:hover .pb-marquee-track { animation-play-state: paused; }
.pb-marquee-item { flex: 0 0 auto; font-weight: 700; color: var(--pbw-muted); font-size: 1.05rem; }
.pb-marquee-item img { max-height: var(--pbw-height, 42px); width: auto; }
@keyframes pb-marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
/* Le défilement est décoratif : on l'arrête si l'utilisateur le demande. */
@media (prefers-reduced-motion: reduce) {
    .pb-marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
}
/* Dans le canvas de l'éditeur, l'animation ferait fuir les blocs sous la souris. */
.pb-editor-canvas .pb-marquee-track { animation: none; }

/* ── Édition : tout doit rester atteignable dans le canvas ────────────
   Le canvas n'exécute pas pb-widgets.js. Un accordéon replié y cacherait
   son texte (impossible à modifier, le clic servant à sélectionner) : on
   déplie tout côté éditeur seulement. Le site garde le pli natif. */
.pb-editor-canvas .pb-acc-item > *:not(summary) {
    display: block !important;
    /* Chrome replie un <details> ferme via content-visibility (sur les enfants
       ou sur ::details-content selon la version) : display seul ne suffit pas. */
    content-visibility: visible !important;
}
.pb-editor-canvas .pb-acc-item::details-content { content-visibility: visible !important; }
.pb-editor-canvas .pb-ba-range { pointer-events: none; }

/* ── Compte à rebours ─────────────────────────────────────────────── */
.pb-countdown { display: flex; flex-wrap: wrap; gap: var(--pbw-gap, 14px); justify-content: center; }
.pb-countdown-cell {
    min-width: 74px; padding: 12px 14px; text-align: center;
    border: 1px solid var(--pbw-border); border-radius: var(--pbw-radius);
    background: rgba(255, 255, 255, .6);
}
.pb-countdown-num { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pb-countdown-unit { display: block; margin-top: 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pbw-muted); }
.pb-countdown-over { font-weight: 700; }

/* ── Vidéo en fenêtre (lightbox) ──────────────────────────────────── */
.pb-video { position: relative; display: block; border-radius: var(--pbw-radius); overflow: hidden; }
.pb-video img { display: block; width: 100%; height: auto; }
.pb-video-play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 74px; height: 74px; border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(255, 255, 255, .92); box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
}
.pb-video-play::after {
    content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
    border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #0B1929;
}
.pb-video-modal {
    position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
    background: rgba(3, 8, 15, .88); padding: 24px;
}
.pb-video-modal[hidden] { display: none !important; }
.pb-video-modal iframe, .pb-video-modal video { width: min(1100px, 100%); aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.pb-video-close {
    position: absolute; top: 18px; right: 22px; width: 42px; height: 42px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .16); color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
