* {
    box-sizing: border-box;
}

.ci-jp-wrapper {
    max-width: 640px;
    margin: 40px auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    font-family: inherit;
    overflow: hidden; /* pour que le bandeau respecte les coins arrondis */
}

.ci-jp-banniere {
    margin: -24px -24px 20px;
}
.ci-jp-banniere img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
    display: block;
}

/* Variante bandeau multi-images (défilement auto, décoratif, non cliquable) */
.ci-jp-banniere-slider {
    margin: -24px -24px 20px;
}
.ci-jp-banniere-slider .ci-jp-photo-slider-track {
    aspect-ratio: 21 / 9;
    border-radius: 0;
}
.ci-jp-banniere-slider .ci-jp-carousel-arrow {
    position: absolute;
    z-index: 5;
}
.ci-jp-banniere-slider .ci-jp-photo-prev { left: 10px; }
.ci-jp-banniere-slider .ci-jp-photo-next { right: 10px; }
.ci-jp-banniere-slider {
    position: relative;
}

/* Neutralise les styles par défaut du navigateur sur <fieldset>, dont
   la fâcheuse manie de refuser de rétrécir sous la largeur de son
   contenu (min-width: min-content par défaut dans les UA stylesheets),
   ce qui provoquait le débordement du carrousel hors du cadre. */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.ci-jp-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.ci-jp-alert-error {
    background: #fdeaea;
    color: #a33;
    border: 1px solid #f0c2c2;
}

.ci-jp-step h2 {
    margin-top: 0;
}
.ci-jp-intro {
    color: #555;
    margin-bottom: 20px;
}

.ci-jp-field-group {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}
.ci-jp-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ci-jp-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}
.ci-jp-row .ci-jp-field {
    flex: 1;
}

.ci-jp-field {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ci-jp-field label {
    font-weight: 600;
    font-size: 0.9em;
}
.ci-jp-field input[type="text"],
.ci-jp-field input[type="email"],
.ci-jp-field input[type="tel"],
.ci-jp-field select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    width: 100%;
    height: 38px;
    background: #fff;
    font-family: inherit;
    box-sizing: border-box;
}

.ci-jp-date-row {
    display: flex;
    gap: 8px;
}
.ci-jp-date-row select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.ci-jp-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    border: none;
    background: #e63946;
    color: #fff;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    margin-top: 16px;
}
.ci-jp-btn:hover {
    opacity: 0.9;
}
.ci-jp-prev {
    background: #f1f1f1;
    color: #333;
}
.ci-jp-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.ci-jp-consent-block {
    background: #f8f8f8;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.ci-jp-consent-choice {
    display: flex;
    gap: 24px;
    margin-top: 10px;
}
.ci-jp-consent-choice label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ci-jp-partners-cmp h3 {
    margin-bottom: 4px;
}
.ci-jp-cmp-note {
    color: #666;
    font-size: 0.9em;
    margin-top: 0;
}

.ci-jp-theme-group {
    margin-bottom: 20px;
}
.ci-jp-theme-group h4 {
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
    margin-bottom: 8px;
}
.ci-jp-annonceur-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ci-jp-annonceur-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    flex-wrap: wrap;
}
.ci-jp-annonceur-nom {
    font-weight: 600;
    flex: 1 0 140px;
}
.ci-jp-annonceur-politique {
    font-size: 0.85em;
    color: #888;
    text-decoration: underline;
}
.ci-jp-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    cursor: pointer;
}

.ci-jp-legal-mentions {
    font-size: 0.8em;
    color: #888;
    margin-top: 20px;
}
.ci-jp-legal-mentions a {
    color: inherit;
    text-decoration: underline;
}
.ci-jp-legal-mentions a:hover {
    color: #333;
}

/* ===== Format 1 écran (cartes de choix) ===== */
.ci-jp-single-step h1 {
    font-size: 1.5em;
    margin-bottom: 6px;
}
.ci-jp-choice-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.ci-jp-choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border: 2px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-size: 0.85em;
    transition: border-color 0.15s;
}
.ci-jp-choice-card input {
    display: none;
}
.ci-jp-choice-card img {
    width: 100%;
    max-height: 70px;
    object-fit: cover;
    border-radius: 6px;
}
.ci-jp-choice-card:has(input:checked) {
    border-color: #e63946;
    background: #fff5f5;
}

/* ===== Variante carrousel des cartes de choix ===== */
.ci-jp-choice-carousel-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    max-width: 100%;
}
.ci-jp-choice-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 4px;
    flex: 1;
    min-width: 0; /* essentiel : sans ça, un flex-item refuse de rétrécir sous la largeur de son contenu et déborde du cadre au lieu de scroller */
    max-width: calc(4 * 130px + 3 * 10px); /* n'affiche que ~4 cartes, le reste défile */
    -webkit-overflow-scrolling: touch;
}
.ci-jp-choice-carousel .ci-jp-choice-card {
    flex: 0 0 130px;
    scroll-snap-align: start;
}
.ci-jp-choice-carousel::-webkit-scrollbar {
    height: 6px;
}
.ci-jp-choice-carousel::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}
.ci-jp-carousel-arrow {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 1.3em;
    line-height: 1;
    cursor: pointer;
    color: #333;
}
.ci-jp-carousel-arrow:hover {
    background: #f5f5f5;
}

/* ===== Diaporama photo (une image à la fois) + liste de choix texte ===== */
.ci-jp-photo-slider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 16px;
}
.ci-jp-photo-slider-track {
    flex: 1;
    min-width: 0;
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    background: #f2f2f2;
}
.ci-jp-photo-slide {
    display: block;
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
}
.ci-jp-photo-slide.active {
    opacity: 1;
    visibility: visible;
}
.ci-jp-photo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ci-jp-photo-slide span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    color: #fff;
    padding: 30px 16px 10px;
    font-weight: 700;
    font-size: 0.95em;
}
.ci-jp-produit-liste {
    justify-content: center;
}
.ci-jp-produit-liste label {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
}
.ci-jp-produit-liste label:has(input:checked) {
    border-color: #e63946;
    background: #fff5f5;
    color: #e63946;
    font-weight: 600;
}

/* ===== Variante "hero" : grand carrousel en tête de page, remplace le bandeau ===== */
.ci-jp-hero-carousel-wrap {
    margin: -24px -24px 20px;
    padding: 16px 50px;
    background: #fafafa;
}
.ci-jp-hero-carousel {
    max-width: none; /* le hero peut occuper toute la largeur dispo, pas de limite à 4 cartes */
    gap: 14px;
}
.ci-jp-hero-carousel .ci-jp-hero-card {
    flex: 0 0 220px;
    padding: 0;
    border-width: 3px;
    overflow: hidden;
}
.ci-jp-hero-carousel .ci-jp-hero-card img {
    max-height: none;
    height: 160px;
    border-radius: 0;
    margin: 0;
}
.ci-jp-hero-carousel .ci-jp-hero-card span {
    padding: 10px 8px;
    font-size: 0.95em;
}
@media (max-width: 600px) {
    .ci-jp-hero-carousel-wrap {
        padding: 12px 40px;
    }
    .ci-jp-hero-carousel .ci-jp-hero-card {
        flex-basis: 170px;
    }
    .ci-jp-hero-carousel .ci-jp-hero-card img {
        height: 120px;
    }
}

.ci-jp-delai-choice {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 8px;
}
.ci-jp-field:has(> .ci-jp-delai-choice) > label,
.ci-jp-field:has(> .ci-jp-produit-liste) > label {
    text-align: center;
}
.ci-jp-delai-choice label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.ci-jp-consent-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85em;
    color: #555;
    margin: 10px 0;
    cursor: pointer;
}
.ci-jp-consent-line input {
    margin-top: 3px;
}

/* ===== Tunnel 2 écrans (boutons accepter/refuser) ===== */
.ci-jp-tunnel2 h1 {
    font-size: 1.4em;
    margin: 4px 0 2px;
}
.ci-jp-kicker {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75em;
    color: #888;
    font-weight: 700;
    margin-bottom: 2px;
}
.ci-jp-progress {
    display: flex;
    gap: 6px;
    margin: 16px 0 24px;
}
.ci-jp-progress-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #eee;
}
.ci-jp-progress-bar.active {
    background: #e63946;
}
.ci-jp-section-title {
    text-transform: uppercase;
    font-size: 0.75em;
    font-weight: 700;
    color: #888;
    letter-spacing: 0.04em;
    margin: 20px 0 10px;
}
.ci-jp-radio-pill {
    flex: 1;
    text-align: center;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.ci-jp-radio-pill input {
    display: none;
}
.ci-jp-radio-pill:has(input:checked) {
    border-color: #e63946;
    background: #fff5f5;
}
/* Taille des champs texte : gérée par la règle .ci-jp-field plus haut */
.ci-jp-btn-cta {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 10px;
    border: none;
    border-radius: 8px;
    background: #b3312c;
    color: #fff;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
}
.ci-jp-btn-cta:hover {
    opacity: 0.92;
}
.ci-jp-precedent {
    text-align: center;
    margin-top: 14px;
}
.ci-jp-precedent a {
    color: #666;
    font-size: 0.9em;
    text-decoration: none;
}

@media (max-width: 600px) {
    .ci-jp-row {
        flex-direction: column;
    }
    .ci-jp-date-row {
        flex-direction: row;
        gap: 6px;
    }
    .ci-jp-date-row select {
        padding: 8px 4px;
        font-size: 0.9em;
    }
}

.ci-jp-merci {
    text-align: center;
    padding: 60px 24px;
}
.ci-jp-liste-partenaires h1 {
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .ci-jp-carousel-arrow {
        display: none; /* le swipe tactile suffit sur mobile */
    }
}

/* ======================================================
 * CMP interactive par annonceur (partenaires.php, mode pid)
 * ====================================================== */
.ci-cmp-wrapper {
    max-width: 760px;
    margin: 0 auto 100px;
    padding: 24px;
}
.ci-cmp-wrapper h1 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.ci-cmp-theme {
    margin-bottom: 20px;
}
.ci-cmp-theme-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    cursor: pointer;
    font-size: 1em;
}
.ci-cmp-chevron {
    color: #2266cc;
    transition: transform 0.15s;
}
.ci-cmp-theme.collapsed .ci-cmp-chevron {
    transform: rotate(-90deg);
}
.ci-cmp-theme-title {
    font-weight: 700;
    flex: 1;
    text-align: left;
}
.ci-cmp-theme-count {
    color: #888;
    font-size: 0.9em;
}
.ci-cmp-theme.collapsed .ci-cmp-theme-body {
    display: none;
}

.ci-cmp-card {
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 16px;
    margin: 14px 0;
    transition: border-color 0.15s;
}
.ci-cmp-card.ci-cmp-undecided {
    border-color: #e63946;
}
.ci-cmp-card.ci-cmp-decided {
    border-color: #ddd;
}
.ci-cmp-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ci-cmp-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}
.ci-cmp-nom {
    font-weight: 700;
    flex: 1;
}
.ci-cmp-hint {
    color: #e63946;
    font-size: 0.85em;
    margin: 8px 0;
}
.ci-cmp-card.ci-cmp-decided .ci-cmp-hint {
    display: none;
}

.ci-cmp-toggle {
    display: inline-flex;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}
.ci-cmp-toggle button {
    border: none;
    background: #f5f5f5;
    padding: 6px 16px;
    font-weight: 700;
    font-size: 0.85em;
    cursor: pointer;
    color: #999;
}
.ci-cmp-toggle-non.active {
    background: #eee;
    color: #333;
}
.ci-cmp-toggle-oui.active {
    background: #2ecc71;
    color: #fff;
}

.ci-cmp-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}
.ci-cmp-pill {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.8em;
    color: #444;
}

.ci-cmp-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    font-size: 0.85em;
    color: #555;
    margin: 10px 0;
}
.ci-cmp-details-label {
    color: #999;
    font-size: 0.85em;
    font-weight: 700;
}

.ci-cmp-politique {
    font-size: 0.85em;
    text-decoration: underline;
    color: #2266cc;
}

.ci-cmp-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    padding: 14px 24px;
    z-index: 50;
}
.ci-cmp-footer-warning {
    color: #e63946;
    font-size: 0.85em;
    margin: 0 0 10px;
    text-align: center;
}
.ci-cmp-footer-warning.ci-cmp-ok {
    display: none;
}
.ci-cmp-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.ci-cmp-btn-outline {
    padding: 10px 18px;
    border-radius: 20px;
    border: 1px solid #333;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
}
.ci-cmp-btn-valider {
    padding: 10px 22px;
    border-radius: 20px;
    border: none;
    background: #1d1d1f;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.ci-cmp-btn-valider:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .ci-cmp-footer-actions {
        justify-content: center;
    }
}

/* ======================================================
 * Modales CMP (email/SMS et téléphone) sur formulaire 1 page
 * ====================================================== */
.ci-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ci-modal-box {
    background: #fff;
    border-radius: 14px;
    max-width: 780px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    position: relative;
}
.ci-cmp-in-modal {
    max-width: none;
    margin: 0;
    padding: 24px;
    padding-bottom: 110px; /* place pour le footer sticky */
}
.ci-cmp-in-modal h2 {
    font-size: 1.3em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}
.ci-cmp-legal-intro {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 20px;
}
.ci-cmp-in-modal .ci-cmp-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 -24px -24px;
    border-radius: 0 0 14px 14px;
}
.ci-cmp-btn-text {
    background: none;
    border: none;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9em;
    margin-right: auto;
}

@media (max-width: 600px) {
    .ci-modal-box {
        max-height: 95vh;
    }
    .ci-cmp-in-modal {
        padding: 16px;
        padding-bottom: 130px;
    }
    .ci-cmp-in-modal .ci-cmp-footer {
        margin: 0 -16px -16px;
    }
}

/* ======================================================
 * Footer du site
 * ====================================================== */
.ci-site-footer {
    margin-top: 40px;
    padding: 24px 20px 100px; /* padding-bottom pour laisser la place au bandeau cookies */
    border-top: 1px solid #eee;
    background: #fafafa;
}
.ci-site-footer-inner {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    color: #888;
    font-size: 0.8em;
}
.ci-site-footer-societe {
    margin-bottom: 10px;
}
.ci-site-footer-societe a {
    color: #888;
}
.ci-site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    margin-bottom: 10px;
}
.ci-site-footer-links a,
.ci-site-footer-link-btn {
    color: #666;
    text-decoration: underline;
    font-size: 1em;
}
.ci-site-footer-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.ci-site-footer-copyright {
    color: #aaa;
}

/* ======================================================
 * Bandeau cookies
 * ====================================================== */
.ci-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: #1d1d1f;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.2);
}
.ci-cookie-banner-text {
    max-width: 560px;
    font-size: 0.85em;
    line-height: 1.4;
}
.ci-cookie-banner-text p {
    margin: 0;
}
.ci-cookie-banner-text a {
    color: #fff;
    text-decoration: underline;
}
.ci-cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.ci-cookie-btn-outline {
    padding: 9px 18px;
    border-radius: 20px;
    border: 1px solid #fff;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
}
.ci-cookie-btn-accept {
    padding: 9px 18px;
    border-radius: 20px;
    border: none;
    background: #e63946;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9em;
}
@media (max-width: 600px) {
    .ci-cookie-banner {
        flex-direction: column;
        text-align: center;
    }
}
