/* AffiTable Pro - Frontend CSS v2.7.0 - Design comme concurrent */

.affitable-wrap {
    --primary: #F59E0B;
    --primary-dark: #D97706;
    --secondary: #1F2937;
    --bg-white: #FFFFFF;
    --bg-gray: #F8F9FB;
    --bg-verdict: #FEF3C7;
    --border: #E5E7EB;
    --text: #1F2937;
    --text-muted: #6B7280;
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.affitable-scroll {
    overflow-x: auto;
}

/* Desktop : on évite le scroll horizontal, on compacte plutôt les colonnes */
@media (min-width: 1025px) {
    .affitable-scroll {
        overflow-x: visible;
    }
}

.affitable {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.affitable td {
    padding: 0;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.affitable tr:last-child td {
    border-bottom: none;
}

/* =============================================================================
   COLONNE LABELS - Base
   ============================================================================= */
.affitable .cell-label {
    width: 170px;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 12px;
    color: var(--text);
    vertical-align: middle;
    border-right: 1px solid var(--border);
    background: var(--bg-white);
}

/* =============================================================================
   COLONNES PRODUITS - Base
   ============================================================================= */
.affitable .cell-product {
    text-align: center;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    padding: 12px 16px;
}

.affitable .cell-product:first-of-type {
    border-left: none;
}

/* Hover colonne - Bordure orange continue sur toute la colonne */
.affitable td.col-clickable {
    cursor: pointer;
    position: relative;
}

/* Bordures latérales gauche et droite sur toutes les cellules */
.affitable td.col-hover::before,
.affitable td.col-hover::after {
    content: '';
    position: absolute;
    top: -1px;
    bottom: -1px;
    width: 3px;
    background: var(--primary);
    pointer-events: none;
    z-index: 10;
}

.affitable td.col-hover::before {
    left: -1px;
}

.affitable td.col-hover::after {
    right: -1px;
}

/* Header (première ligne) - bordure en haut */
.affitable .row-header td.col-hover {
    box-shadow: inset 0 3px 0 var(--primary);
}

/* CTA (dernière ligne) - bordure en bas */
.affitable .row-cta td.col-hover {
    box-shadow: inset 0 -3px 0 var(--primary);
}

/* =============================================================================
   HEADER - Fond blanc, badge collé avec triangle
   ============================================================================= */
.affitable .row-header td {
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
}

.affitable .row-header .cell-label {
    background: var(--bg-white);
}

.affitable .cell-header {
    padding: 0;
}

/* Badge wrapper */
.affitable .badge-wrapper {
    position: relative;
    text-align: center;
}

.affitable .badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.affitable .badge-icon {
    height: 16px;
    width: auto;
    filter: brightness(0) invert(1);
}

.affitable .badge-text {
    /* Évite la coupure sur colonnes étroites (beaucoup de produits) */
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.15;
}

/* Triangle sous le badge */
.affitable .badge-arrow {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 10px solid;
    margin: 0 auto;
}

.affitable .product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 15px;
}

.affitable .product-img {
    display: block;
    width: 90px;
    height: 90px;
    margin: 8px auto 12px;
    object-fit: contain;
}

.affitable .product-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 2px;
}

.affitable .product-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

/* =============================================================================
   RECOMMANDATION - Fond jaune (toute la ligne)
   ============================================================================= */
.affitable .row-score td {
    background: var(--bg-verdict);
}

.affitable .row-score .cell-label {
    background: var(--bg-verdict);
    padding: 20px 16px;
    vertical-align: top;
}

.affitable .row-score .cell-label .label-text {
    display: block;
    margin-bottom: 10px;
}

.affitable .methodology-block {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.affitable .methodology-text {
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 6px;
}

.affitable .methodology-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 500;
}

.affitable .methodology-link:hover {
    text-decoration: underline;
}

.affitable .row-score .cell-product {
    padding: 20px 16px;
    background: var(--bg-verdict);
}

.affitable .score-box-large {
    display: inline-block;
    padding: 15px 25px;
    background: var(--bg-white);
    border: 2px solid var(--primary);
    border-radius: 6px;
    box-sizing: border-box;
    max-width: 100%;
}

.affitable .score-title {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 5px;
    /* Empêcher le découpage lettre par lettre en colonnes étroites */
    word-break: normal;
    overflow-wrap: normal;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.affitable .score-val {
    font-size: 42px;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
    /* Empêche le retour à la ligne sur les décimales (ex: 15,60) */
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    word-break: keep-all;
    /* Ne jamais tronquer la note (15,60 → pas de "15...") */
    overflow: visible;
    text-overflow: clip;
}

.affitable .score-divider {
    width: 50px;
    height: 1px;
    background: var(--border);
    margin: 8px auto;
}

.affitable .score-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.affitable .score-label {
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    border-radius: 3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.affitable .score-date {
    font-size: 11px;
    color: var(--text-muted);
}

.affitable .score-separator {
    color: var(--border);
}

/* =============================================================================
   DENSITÉ DESKTOP (BEAUCOUP DE PRODUITS)
   - Sans affecter le mobile
   - Compacte certains éléments (score box, CTA) pour éviter le scroll horizontal
   ============================================================================= */

@media (min-width: 1025px) {
    /* 5 à 6 produits */
    .affitable-wrap.affitable-density-medium .affitable .cell-label {
        width: 160px;
    }
    .affitable-wrap.affitable-density-medium .affitable .score-box-large {
        padding: 12px 18px;
    }
    .affitable-wrap.affitable-density-medium .affitable .score-val {
        font-size: 36px;
    }
    .affitable-wrap.affitable-density-medium .affitable .cta-btn {
        padding: 9px 18px;
        font-size: 11px;
    }

    /* 7 à 9 produits */
    .affitable-wrap.affitable-density-high .affitable .cell-label {
        width: 145px;
    }
    .affitable-wrap.affitable-density-high .affitable .score-box-large {
        padding: 10px 14px;
    }
    .affitable-wrap.affitable-density-high .affitable .score-title {
        font-size: 10px;
        letter-spacing: 0.2px;
    }
    .affitable-wrap.affitable-density-high .affitable .score-val {
        font-size: clamp(20px, 2.2vw, 30px);
    }
    .affitable-wrap.affitable-density-high .affitable .score-label {
        font-size: 9px;
        padding: 3px 8px;
    }
    .affitable-wrap.affitable-density-high .affitable .cta-btn {
        padding: 8px 12px;
        font-size: 10px;
    }

    .affitable-wrap.affitable-density-high .affitable .row-stars td {
        padding: 10px 12px;
    }
    .affitable-wrap.affitable-density-high .affitable .star {
        font-size: 14px;
    }
    .affitable-wrap.affitable-density-high .affitable .stars-num {
        font-size: 12px;
    }
    .affitable-wrap.affitable-density-high .affitable .bar {
        gap: 1px;
    }
    .affitable-wrap.affitable-density-high .affitable .bar .seg {
        width: 7px;
        height: 16px;
    }

    /* 10+ produits */
    .affitable-wrap.affitable-density-veryhigh .affitable .cell-label {
        width: 130px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .score-box-large {
        padding: 8px 12px;
        border-width: 2px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .score-title {
        font-size: 9px;
        letter-spacing: 0.15px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .score-val {
        font-size: clamp(18px, 1.9vw, 26px);
        letter-spacing: -0.3px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .score-divider {
        width: 40px;
        margin: 6px auto;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .score-label {
        font-size: 9px;
        padding: 2px 7px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .cta-btn {
        padding: 7px 10px;
        font-size: 10px;
    }

    .affitable-wrap.affitable-density-veryhigh .affitable .row-stars td {
        padding: 8px 10px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .star {
        font-size: 13px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .stars-num {
        font-size: 11px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .bar {
        gap: 1px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .bar .seg {
        width: 5px;
        height: 12px;
    }

    .affitable-wrap.affitable-density-veryhigh .affitable .badge {
        padding: 8px 10px;
        font-size: 9px;
        letter-spacing: 0.3px;
    }
    .affitable-wrap.affitable-density-veryhigh .affitable .badge-arrow {
        border-left-width: 10px;
        border-right-width: 10px;
        border-top-width: 8px;
    }
}

/* =============================================================================
   NOTRE AVIS (étoiles) - Fond blanc
   ============================================================================= */
.affitable .row-stars td {
    background: var(--bg-white);
    padding: 12px 16px;
}

.affitable .row-stars .cell-label {
    background: var(--bg-white);
}

.affitable .row-stars .cell-product {
    white-space: nowrap;
}


.affitable .row-stars .cell-product {
    background: var(--bg-white);
    white-space: nowrap;
}

.affitable .stars-box {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.affitable .star {
    font-size: 16px;
    color: #D1D5DB;
}

.affitable .star.filled {
    color: var(--primary);
}

.affitable .star.half {
    color: var(--primary);
    opacity: 0.5;
}

.affitable .stars-num {
    white-space: nowrap;
    margin-left: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

/* =============================================================================
   PROFIL ACHETEUR - Fond gris (toute la ligne)
   CAS UTILISATION - Fond gris aussi (même type)
   ============================================================================= */
.affitable .row-text td {
    padding: 12px 16px;
    background: var(--bg-gray);
}

.affitable .row-text .cell-label {
    background: var(--bg-gray);
}

.affitable .text-val {
    text-align: left;
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
}

/* =============================================================================
   LIVRAISON - Fond blanc (on utilise une classe spécifique)
   ============================================================================= */
.affitable .row-text.row-livraison td {
    background: var(--bg-white);
}

.affitable .row-text.row-livraison .cell-label {
    background: var(--bg-white);
}

/* =============================================================================
   ÉVALUATION - Fond blanc (beaucoup de texte)
   ============================================================================= */
.affitable .row-evaluation td,
.affitable .row-textarea td {
    background: var(--bg-white);
    padding: 16px;
}

.affitable .row-evaluation .cell-label,
.affitable .row-textarea .cell-label {
    background: var(--bg-white);
    vertical-align: top;
}

.affitable .row-evaluation .cell-product,
.affitable .row-textarea .cell-product {
    text-align: left;
}

.affitable .cell-label-author .label-text {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.affitable .author-in-label {
    margin-top: 6px;
}

.affitable .author-prefix {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.affitable .author-prefix strong {
    font-weight: 600;
}

.affitable .author-link {
    color: inherit;
    text-decoration: none;
}

.affitable .author-link:hover {
    text-decoration: underline;
}

.affitable .author-role {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.affitable .author-photo-small {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.affitable .textarea-val {
    font-size: 12px;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.6;
}

/* =============================================================================
   CRITÈRES - Alternance fond gris / blanc
   ============================================================================= */
.affitable .row-criteria-item td {
    padding: 10px 16px;
    background: var(--bg-white);
}

.affitable .row-criteria-item .cell-label {
    background: var(--bg-white);
    font-weight: 400;
    font-size: 11px;
    vertical-align: middle;
}

.affitable .row-criteria-item .cell-product {
    background: var(--bg-white);
    vertical-align: middle;
    text-align: center;
}

/* Lignes impaires (1, 3, 5...) avec fond gris */
.affitable .row-criteria-item:nth-of-type(odd) td {
    background: var(--bg-gray);
}

.affitable .row-criteria-item:nth-of-type(odd) .cell-label {
    background: var(--bg-gray);
}

.affitable .row-criteria-item:nth-of-type(odd) .cell-product {
    background: var(--bg-gray);
}

.affitable .bar {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    vertical-align: middle;
}

.affitable .bar .seg {
    width: 9px;
    height: 18px;
    background: var(--criteria-bar-empty, #E0E0E0);
    border-radius: 2px;
}

.affitable .bar .seg.filled {
    background: var(--criteria-bar-fill, var(--primary));
}

/* =============================================================================
   ANIMATIONS DES BARRES DE CRITÈRES
   Utilise CSS uniquement pour des performances optimales (GPU accelerated)
   ============================================================================= */

/* Durées d'animation */
.criteria-speed-fast .bar .seg { --anim-duration: 0.3s; }
.criteria-speed-normal .bar .seg { --anim-duration: 0.6s; }
.criteria-speed-slow .bar .seg { --anim-duration: 1s; }

/* État initial quand animation activée (segments remplis invisibles) */
.criteria-animated .bar .seg.filled {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
}

/* Déclenchement de l'animation quand visible */
.criteria-animated.in-view .bar .seg.filled {
    opacity: 1;
    transform: scaleX(1);
}

/* ===== ANIMATION: FILL (Remplissage progressif) ===== */
.criteria-anim-fill .bar .seg.filled {
    transition: transform var(--anim-duration, 0.6s) cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.1s ease;
}

/* Délais échelonnés pour effet progressif */
.criteria-anim-fill .bar .seg.filled:nth-child(1) { transition-delay: 0s; }
.criteria-anim-fill .bar .seg.filled:nth-child(2) { transition-delay: 0.05s; }
.criteria-anim-fill .bar .seg.filled:nth-child(3) { transition-delay: 0.1s; }
.criteria-anim-fill .bar .seg.filled:nth-child(4) { transition-delay: 0.15s; }
.criteria-anim-fill .bar .seg.filled:nth-child(5) { transition-delay: 0.2s; }
.criteria-anim-fill .bar .seg.filled:nth-child(6) { transition-delay: 0.25s; }
.criteria-anim-fill .bar .seg.filled:nth-child(7) { transition-delay: 0.3s; }
.criteria-anim-fill .bar .seg.filled:nth-child(8) { transition-delay: 0.35s; }
.criteria-anim-fill .bar .seg.filled:nth-child(9) { transition-delay: 0.4s; }
.criteria-anim-fill .bar .seg.filled:nth-child(10) { transition-delay: 0.45s; }

/* ===== ANIMATION: FADE (Fondu) ===== */
.criteria-anim-fade .bar .seg.filled {
    transform: scaleX(1);
    opacity: 0;
    transition: opacity var(--anim-duration, 0.6s) ease-out;
}

.criteria-anim-fade.in-view .bar .seg.filled {
    opacity: 1;
}

/* Délais échelonnés */
.criteria-anim-fade .bar .seg.filled:nth-child(1) { transition-delay: 0s; }
.criteria-anim-fade .bar .seg.filled:nth-child(2) { transition-delay: 0.04s; }
.criteria-anim-fade .bar .seg.filled:nth-child(3) { transition-delay: 0.08s; }
.criteria-anim-fade .bar .seg.filled:nth-child(4) { transition-delay: 0.12s; }
.criteria-anim-fade .bar .seg.filled:nth-child(5) { transition-delay: 0.16s; }
.criteria-anim-fade .bar .seg.filled:nth-child(6) { transition-delay: 0.2s; }
.criteria-anim-fade .bar .seg.filled:nth-child(7) { transition-delay: 0.24s; }
.criteria-anim-fade .bar .seg.filled:nth-child(8) { transition-delay: 0.28s; }
.criteria-anim-fade .bar .seg.filled:nth-child(9) { transition-delay: 0.32s; }
.criteria-anim-fade .bar .seg.filled:nth-child(10) { transition-delay: 0.36s; }

/* ===== ANIMATION: SCALE (Échelle / Zoom) ===== */
.criteria-anim-scale .bar .seg.filled {
    transform: scale(0);
    transform-origin: center center;
    opacity: 1;
    transition: transform var(--anim-duration, 0.6s) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.criteria-anim-scale.in-view .bar .seg.filled {
    transform: scale(1);
}

/* Délais échelonnés */
.criteria-anim-scale .bar .seg.filled:nth-child(1) { transition-delay: 0s; }
.criteria-anim-scale .bar .seg.filled:nth-child(2) { transition-delay: 0.03s; }
.criteria-anim-scale .bar .seg.filled:nth-child(3) { transition-delay: 0.06s; }
.criteria-anim-scale .bar .seg.filled:nth-child(4) { transition-delay: 0.09s; }
.criteria-anim-scale .bar .seg.filled:nth-child(5) { transition-delay: 0.12s; }
.criteria-anim-scale .bar .seg.filled:nth-child(6) { transition-delay: 0.15s; }
.criteria-anim-scale .bar .seg.filled:nth-child(7) { transition-delay: 0.18s; }
.criteria-anim-scale .bar .seg.filled:nth-child(8) { transition-delay: 0.21s; }
.criteria-anim-scale .bar .seg.filled:nth-child(9) { transition-delay: 0.24s; }
.criteria-anim-scale .bar .seg.filled:nth-child(10) { transition-delay: 0.27s; }

/* ===== ANIMATION: BOUNCE (Rebond élastique) ===== */
.criteria-anim-bounce .bar .seg.filled {
    transform: scaleY(0);
    transform-origin: bottom center;
    opacity: 1;
    transition: transform var(--anim-duration, 0.6s) cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.criteria-anim-bounce.in-view .bar .seg.filled {
    transform: scaleY(1);
}

/* Délais échelonnés */
.criteria-anim-bounce .bar .seg.filled:nth-child(1) { transition-delay: 0s; }
.criteria-anim-bounce .bar .seg.filled:nth-child(2) { transition-delay: 0.04s; }
.criteria-anim-bounce .bar .seg.filled:nth-child(3) { transition-delay: 0.08s; }
.criteria-anim-bounce .bar .seg.filled:nth-child(4) { transition-delay: 0.12s; }
.criteria-anim-bounce .bar .seg.filled:nth-child(5) { transition-delay: 0.16s; }
.criteria-anim-bounce .bar .seg.filled:nth-child(6) { transition-delay: 0.2s; }
.criteria-anim-bounce .bar .seg.filled:nth-child(7) { transition-delay: 0.24s; }
.criteria-anim-bounce .bar .seg.filled:nth-child(8) { transition-delay: 0.28s; }
.criteria-anim-bounce .bar .seg.filled:nth-child(9) { transition-delay: 0.32s; }
.criteria-anim-bounce .bar .seg.filled:nth-child(10) { transition-delay: 0.36s; }

/* Désactiver les animations si l'utilisateur préfère (accessibilité) */
@media (prefers-reduced-motion: reduce) {
    .criteria-animated .bar .seg.filled {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* =============================================================================
   PARTICULARITÉS - Fond blanc (beaucoup de texte)
   ============================================================================= */
.affitable .row-specs td {
    padding: 14px 16px;
    background: var(--bg-white);
}

.affitable .row-specs .cell-label {
    background: var(--bg-white);
}

.affitable .specs-list {
    margin: 0;
    padding: 0 0 0 16px;
    list-style: disc;
    text-align: left;
}

.affitable .specs-list li {
    padding: 2px 0;
    font-size: 11px;
    color: var(--text);
    line-height: 1.4;
}

.affitable .specs-list li strong {
    font-weight: 600;
}

/* =============================================================================
   CAS UTILISATION - Fond gris
   ============================================================================= */
/* Utilise .row-text donc déjà fond gris */

.affitable .usecase-list {
    margin: 0;
    padding: 0 0 0 16px;
    list-style: disc;
    text-align: left;
}

.affitable .usecase-list li {
    padding: 2px 0;
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
}

/* =============================================================================
   AVANTAGES / INCONVÉNIENTS - Fond blanc (beaucoup de texte)
   ============================================================================= */
.affitable .row-pros td,
.affitable .row-cons td {
    padding: 14px 16px;
    background: var(--bg-white);
}

.affitable .row-pros .cell-label,
.affitable .row-cons .cell-label {
    background: var(--bg-white);
}

.affitable .pros-list,
.affitable .cons-list {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.affitable .pros-list li,
.affitable .cons-list li {
    padding: 3px 0;
    font-size: 11px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.affitable .icon-ok,
.affitable .icon-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    border-radius: 2px;
    margin-top: 1px;
}

.affitable .icon-ok {
    background: #22C55E;
}

.affitable .icon-no {
    background: #EF4444;
}

/* =============================================================================
   AMAZON PRIME - Fond gris
   ============================================================================= */
.affitable .row-prime td {
    padding: 12px 16px;
    background: var(--bg-gray);
}

.affitable .row-prime .cell-label {
    background: var(--bg-gray);
}

.affitable .prime-yes {
    color: #22C55E;
    font-size: 12px;
    font-weight: 600;
}

.affitable .prime-no {
    color: var(--text-muted);
    font-size: 13px;
}

/* =============================================================================
   LIVRAISON - Fond blanc
   ============================================================================= */
/* row-text mais on veut fond blanc pour Livraison - géré par ID ou ordre */

/* =============================================================================
   CTA - Fond blanc
   ============================================================================= */
.affitable .row-cta td {
    background: var(--bg-white);
}

.affitable .cell-cta {
    padding: 16px;
}

.affitable .cta-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.affitable .cta-amazon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.affitable .cta-available {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.affitable .cta-logo {
    height: 16px;
}

.affitable .cta-btn {
    display: inline-block;
    padding: 10px 28px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.affitable .cta-btn:hover {
    background: var(--primary-dark);
}

/* =============================================================================
   EMPTY STATE
   ============================================================================= */
.affitable .empty {
    color: #C0C0C0;
    font-size: 12px;
}

/* =============================================================================
   DISCLAIMER
   ============================================================================= */
.affitable-disclaimer {
    text-align: center;
    padding: 15px 20px;
    margin-top: 15px;
    font-size: 11px;
    color: #6B7280;
    line-height: 1.5;
    border-top: 1px solid var(--border);
}


/* =============================================================================
   DISCLOSURE / MENTION AFFILIATION (haut du tableau)
   ============================================================================= */

.affitable-disclosure {
    --affitable-disc-bg: #EFF6FF;
    --affitable-disc-bg2: #FFFFFF;
    --affitable-disc-angle: 135deg;
    --affitable-disc-image: none;
    --affitable-disc-color: inherit;
    --affitable-disc-border: rgba(0,0,0,0.08);
    --affitable-disc-radius: 14px;
    --affitable-disc-padding: 14px;

    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 14px 0;
    padding: var(--affitable-disc-padding);
    border-radius: var(--affitable-disc-radius);
    border: 1px solid var(--affitable-disc-border);
    color: var(--affitable-disc-color);
    background: var(--affitable-disc-bg);
    box-shadow: 0 10px 22px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}

.affitable-disclosure[data-bg="gradient"] {
    background: linear-gradient(var(--affitable-disc-angle), var(--affitable-disc-bg), var(--affitable-disc-bg2));
}

.affitable-disclosure[data-bg="image"] {
    background-image: var(--affitable-disc-image);
    background-size: cover;
    background-position: center;
}

.affitable-disclosure[data-bg="image"]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.78);
    pointer-events: none;
}

.affitable-disclosure__icon,
.affitable-disclosure__content {
    position: relative;
    z-index: 1;
}

.affitable-disclosure__icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(0,0,0,0.06);
}

.affitable-disclosure__content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.affitable-disclosure__content a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.affitable-disclosure--noicon {
    gap: 0;
}

.affitable-disclosure--noicon .affitable-disclosure__icon {
    display: none;
}

.affitable-disclosure--info {
    --affitable-disc-bg: #EFF6FF;
    --affitable-disc-border: #BFDBFE;
    --affitable-disc-color: #1E3A8A;
}

.affitable-disclosure--warning {
    --affitable-disc-bg: #FFFBEB;
    --affitable-disc-border: #FDE68A;
    --affitable-disc-color: #92400E;
}

.affitable-disclosure--success {
    --affitable-disc-bg: #ECFDF5;
    --affitable-disc-border: #A7F3D0;
    --affitable-disc-color: #065F46;
}

.affitable-disclosure--neutral {
    --affitable-disc-bg: #F3F4F6;
    --affitable-disc-border: rgba(0,0,0,0.08);
    --affitable-disc-color: #111827;
}

@media (max-width: 480px) {
    .affitable-disclosure {
        padding: 12px;
        gap: 10px;
    }
    .affitable-disclosure__icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 11px;
    }
    .affitable-disclosure__content {
        font-size: 13px;
    }
}


/* =============================================================================
   RESPONSIVE MOBILE - Navigation carrousel
   ============================================================================= */

/* Boutons de navigation mobile */
.affitable-nav {
    display: none;
}

@media (max-width: 768px) {
    
    /* Conteneur principal */
    .affitable-wrap {
        position: relative;
    }
    
    /* Boutons de navigation - fixes sur les côtés, masqués par défaut */
    .affitable-nav {
        display: none;
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .affitable-nav.visible {
        display: flex;
        opacity: 1;
        pointer-events: auto;
    }
    
    .affitable-nav-prev {
        left: 5px;
    }
    
    .affitable-nav-next {
        right: 5px;
    }
    
    .affitable-nav-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(75, 85, 99, 0.9);
        border: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        font-weight: bold;
        color: #fff;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    
    .affitable-nav-btn:hover,
    .affitable-nav-btn:active {
        background: rgba(55, 65, 81, 1);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    }
    
    /* Indicateur de position */
    .affitable-indicator {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 12px 0;
    }
    
    .affitable-indicator-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #D1D5DB;
        transition: background 0.2s ease;
        cursor: pointer;
    }
    
    .affitable-indicator-dot.active {
        background: var(--primary);
    }
    
    /* Table responsive */
    .affitable-scroll {
        overflow: hidden;
    }
    
    .affitable {
        table-layout: fixed;
    }
    
    /* Colonne labels fixe */
    .affitable .cell-label {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        padding: 10px 8px;
        font-size: 10px;
        position: sticky;
        left: 0;
        z-index: 10;
    }
    
    /* Cellules produits - masquées par défaut */
    .affitable .cell-product {
        display: none;
        min-width: calc(100% - 100px);
        padding: 10px 12px;
        /* Important pour l'égalisation des hauteurs */
        box-sizing: border-box;
        vertical-align: top;
    }
    
    /* Afficher seulement le produit actif */
    .affitable .cell-product.mobile-active {
        display: table-cell;
    }
    
    /* IMPORTANT: Les lignes ne doivent pas changer de hauteur entre les produits
       La hauteur est calculée dynamiquement par JavaScript */
    .affitable tr {
        height: auto;
    }
    
    /* La cellule vide doit avoir un contenu minimum pour garder la structure */
    .affitable .cell-product:empty::before,
    .affitable .cell-product .empty {
        content: ' ';
        display: block;
        min-height: 20px;
    }
    
    /* S'assurer que le contenu ne déborde pas */
    .affitable .cell-product > * {
        max-width: 100%;
    }
    
    /* Animations de slide - déplacement simple sans opacité */
    @keyframes slideFromRight {
        from {
            transform: translateX(100%);
        }
        to {
            transform: translateX(0);
        }
    }
    
    @keyframes slideFromLeft {
        from {
            transform: translateX(-100%);
        }
        to {
            transform: translateX(0);
        }
    }
    
    .affitable .cell-product.slide-from-right {
        animation: slideFromRight 0.25s ease-out forwards;
    }
    
    .affitable .cell-product.slide-from-left {
        animation: slideFromLeft 0.25s ease-out forwards;
    }
    
    /* Header */
    .affitable .cell-header {
        padding: 0;
    }
    
    .affitable .product-img {
        width: 80px;
        height: 80px;
    }
    
    .affitable .product-title {
        font-size: 14px;
    }
    
    .affitable .product-subtitle {
        font-size: 11px;
    }
    
    /* Score */
    .affitable .score-val {
        font-size: 36px;
    }
    
    .affitable .score-box-large {
        padding: 12px 20px;
    }
    
    /* Badge */
    .affitable .badge {
        font-size: 10px;
        padding: 8px 10px;
    }
    
    /* Méthodologie */
    .affitable .methodology-block {
        font-size: 9px;
    }
    
    /* Texte */
    .affitable .text-val,
    .affitable .textarea-val {
        font-size: 11px;
    }
    
    /* Critères */
    .affitable .bar .seg {
        width: 8px;
        height: 16px;
    }
    
    /* Specs */
    .affitable .specs-list li {
        font-size: 10px;
    }
    
    /* Pros/Cons */
    .affitable .pros-list li,
    .affitable .cons-list li {
        font-size: 10px;
    }
    
    /* CTA */
    .affitable .cta-btn {
        font-size: 12px;
        padding: 10px 20px;
    }
}

/* =============================================================================
   BARRE CTA STICKY (Fixe)
   ============================================================================= */

.affitable-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #FFFFFF;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: none;
}

/* Quand visible */
.affitable-sticky-bar.visible {
    display: block !important;
}

/* Desktop: en haut */
@media (min-width: 769px) {
    .affitable-sticky-bar.sticky-desktop {
        top: 0;
    }
}

/* Mobile: en bas */
@media (max-width: 768px) {
    .affitable-sticky-bar.sticky-mobile {
        top: auto;
        bottom: 0;
    }
}

.affitable-sticky-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Lien retour */
.affitable-sticky-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6B7280;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease;
    flex-shrink: 0;
    padding: 8px 12px;
    background: #F3F4F6;
    border-radius: 6px;
    border: 1px solid #E5E7EB;
}

.affitable-sticky-back:hover {
    color: #1F2937;
    background: #E5E7EB;
}

.sticky-back-icon {
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
}

.sticky-back-text {
    font-size: 12px;
}

/* Conteneur produits */
.affitable-sticky-products {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

/* Produit individuel - carte cliquable */
.affitable-sticky-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #FFFFFF;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.affitable-sticky-product:hover {
    border-color: var(--primary, #F59E0B);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

/* Image produit */
.sticky-product-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    background: #F9FAFB;
    border-radius: 4px;
    padding: 2px;
}

/* Info produit */
.sticky-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sticky-product-title {
    font-size: 13px;
    font-weight: 600;
    color: #1F2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    line-height: 1.3;
}

.sticky-product-subtitle {
    font-size: 11px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    line-height: 1.3;
}

/* Bouton CTA */
.sticky-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: var(--primary, #F59E0B);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.sticky-cta-btn:hover {
    background: var(--primary-dark, #D97706);
    transform: translateY(-1px);
    color: #fff !important;
}

/* =============================================================================
   STICKY BAR - RESPONSIVE MOBILE
   ============================================================================= */

/* Cacher le 2ème produit sur mobile */
@media (max-width: 768px) {
    .affitable-sticky-product.sticky-desktop-only {
        display: none !important;
    }
    
    .affitable-sticky-inner {
        padding: 10px 12px;
        gap: 8px;
    }
    
    /* Cacher le lien retour sur mobile */
    .affitable-sticky-back {
        display: none;
    }
    
    .affitable-sticky-products {
        gap: 8px;
        width: 100%;
        justify-content: center;
    }
    
    .affitable-sticky-product {
        flex: 1;
        max-width: 100%;
        padding: 10px 12px;
        gap: 10px;
        min-width: 0;
    }
    
    .sticky-product-img {
        width: 40px;
        height: 40px;
    }
    
    .sticky-product-title {
        font-size: 12px;
        max-width: 140px;
    }
    
    .sticky-product-subtitle {
        display: none;
    }
    
    .sticky-cta-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
}
