/* =============================================================================
   CCB Partners Slider — CSS
   Zéro dépendance JS (hors navigation minimale)
   Compatible FlyingPress / LiteSpeed Cache
   ============================================================================= */

/* ── Variables par défaut (surchargées par Elementor via selectors) ──────── */
.ccb-ps-track {
    --ccb-slides-per-view: 3;
    --ccb-gap: 24px;
}

/* ── Wrapper global ──────────────────────────────────────────────────────── */
.ccb-ps-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Viewport : masque le débordement ───────────────────────────────────── */
.ccb-ps-viewport {
    overflow: hidden;
    width: 100%;
}

/* ── Track : la bande qui se translate ──────────────────────────────────── */
.ccb-ps-track {
    display: flex;
    gap: var(--ccb-gap);
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* ── Slides ──────────────────────────────────────────────────────────────── */
.ccb-ps-slide {
    /* Largeur calculée pour afficher N slides avec gaps */
    flex: 0 0 calc(
        (100% - (var(--ccb-slides-per-view) - 1) * var(--ccb-gap))
        / var(--ccb-slides-per-view)
    );
    min-width: 0; /* évite les dépassements flexbox */
}

/* ── Carte ───────────────────────────────────────────────────────────────── */
.ccb-ps-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

/* ── Image ───────────────────────────────────────────────────────────────── */
.ccb-ps-image-wrap {
    width: 100%;
    padding: 12px 16px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.ccb-ps-image-wrap.align-left  { justify-content: flex-start; }
.ccb-ps-image-wrap.align-right { justify-content: flex-end; }

.ccb-ps-image {
    width: 100px;
    height: 50px;
    object-fit: contain;
    display: block;
}

/* ── Corps texte ─────────────────────────────────────────────────────────── */
.ccb-ps-body {
    flex: 1 1 auto;
    padding: 8px 16px 8px;
}

.ccb-ps-desc {
    font-size: 0.9rem;
    color: #555555;
    line-height: 1.6;
    margin: 0;
}

.ccb-ps-desc p { margin: 0 0 6px; }
.ccb-ps-desc p:last-child { margin-bottom: 0; }

/* ── Footer / bouton CTA ─────────────────────────────────────────────────── */
.ccb-ps-footer {
    display: flex;
    justify-content: center;
    padding: 8px 16px 14px;
    flex-shrink: 0;
}

.ccb-ps-cta {
    display: inline-block;
    padding: 10px 24px;
    background-color: #e8572a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background-color 0.2s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.ccb-ps-cta:hover {
    background-color: #c94520;
    color: #ffffff;
    transform: scale(1.08);
    text-decoration: none;
}

.ccb-ps-cta:focus-visible {
    outline: 3px solid #e8572a;
    outline-offset: 3px;
}

/* ── Flèches ─────────────────────────────────────────────────────────────── */
.ccb-ps-arrow {
    position: absolute;
    top: 50%;
    z-index: 10;
    transform: translateY(calc(-50% - 20px)); /* -20px ≈ moitié dots */
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e8572a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.ccb-ps-arrow:hover {
    background-color: #c94520;
    transform: translateY(calc(-50% - 20px)) scale(1.08);
}

.ccb-ps-arrow:focus-visible {
    outline: 3px solid #e8572a;
    outline-offset: 2px;
}

.ccb-ps-arrow svg {
    fill: #ffffff;
    pointer-events: none;
    flex-shrink: 0;
}

.ccb-ps-prev {
    left: -20px;
}
.ccb-ps-next {
    right: -20px;
}

.ccb-ps-arrow[disabled],
.ccb-ps-arrow.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Points de navigation ────────────────────────────────────────────────── */
.ccb-ps-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0;
}

.ccb-ps-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #cccccc;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.25s ease, transform 0.25s ease, width 0.25s ease;
    flex-shrink: 0;
}

.ccb-ps-dot.is-active {
    background-color: #e8572a;
    transform: scale(1.3);
    width: 24px;
    border-radius: 5px;
}

.ccb-ps-dot:focus-visible {
    outline: 3px solid #e8572a;
    outline-offset: 2px;
}

/* ── État "no-arrows" si 1 seule slide ───────────────────────────────────── */
.ccb-ps-wrapper[data-total="1"] .ccb-ps-arrow,
.ccb-ps-wrapper[data-total="1"] .ccb-ps-dots {
    display: none;
}

/* =============================================================================
   RESPONSIVE — tablette (≤1024px) — Elementor override via CSS var
   ============================================================================= */
@media (max-width: 1024px) {
    .ccb-ps-prev { left: -12px; }
    .ccb-ps-next { right: -12px; }
}

/* =============================================================================
   RESPONSIVE — mobile (≤767px)
   ============================================================================= */
@media (max-width: 767px) {
    .ccb-ps-prev { left: 0; }
    .ccb-ps-next { right: 0; }

    .ccb-ps-arrow {
        width: 32px;
        height: 32px;
    }

    .ccb-ps-body {
        padding: 12px 16px 8px;
    }

    .ccb-ps-footer {
        padding: 8px 16px 16px;
    }
}

/* ── Elementor Editor : viewport overflow visible pour voir les flèches ──── */
.elementor-editor-active .ccb-ps-viewport {
    overflow: visible;
}

/* ── Animation réduite (accessibilité) ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ccb-ps-track   { transition: none; }
    .ccb-ps-card,
    .ccb-ps-image,
    .ccb-ps-cta,
    .ccb-ps-arrow,
    .ccb-ps-dot     { transition: none; }
}
