/* ============================================================
   COMPARATEUR TOPDEALS — Styles autonomes
   ============================================================ */

.ab-compare-modal[hidden] { display: none !important; }

.ab-compare-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ab-compare-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, .68);
    backdrop-filter: blur(3px);
}

.ab-compare-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1120px, 100%);
    max-height: 90vh;
    overflow: hidden;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
    animation: abCompareEnter .2s ease-out;
}
@keyframes abCompareEnter {
    from { /*opacity: 0;*/ transform: translateY(10px) scale(.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ab-compare-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding: 22px 25px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.ab-compare-eyebrow {
    color: #d7520d;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}
.ab-compare-header h2 {
    margin: 7px 0 4px;
    color: #171717;
    font-size: 23px;
    font-weight: 800;
}
.ab-compare-header p {
    margin: 0;
    color: #737373;
    font-size: 13px;
}
.ab-compare-close {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: #333;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.ab-compare-close:hover { background: #fee2e2; color: #b91c1c; }

/* Contenu — seul le tableau scrolle */
.ab-compare-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ab-compare-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 12px 24px 0;
    flex-shrink: 0;
    background: #fff;
}
.ab-compare-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #52525b;
    cursor: pointer;
}
.ab-compare-switch input { accent-color: #d7520d; width: 16px; height: 16px; }

.ab-compare-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    margin: 12px 24px 0;
    border: 1px solid #eee;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
}

.ab-compare-table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    text-align: left;
}
.ab-compare-table th,
.ab-compare-table td {
    padding: 13px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
    overflow-wrap: anywhere;
}
.ab-compare-table thead th {
    z-index: 3;
    width: 25%;
    min-width: 160px;
    background: #fafafa;
    vertical-align: top;
    box-shadow: inset 0 -1px 0 #eee;
}
.ab-compare-table thead th.ab-compare-criterion {
    left: 0;
    z-index: 4;
    width: 130px;
    min-width: 130px;
    vertical-align: middle;
}
.ab-compare-table tbody th {
   /* position: sticky;*/
    left: 0;
    z-index: 2;
    width: 130px;
    min-width: 130px;
    color: #52525b;
    background: #fafafa;
    font-weight: 700;
    box-shadow: inset -1px 0 0 #eee;
}
.ab-compare-table .ab-compare-current { background: #fff7ed; }
.ab-compare-table tbody tr:last-child th,
.ab-compare-table tbody tr:last-child td { border-bottom: 0; }
.ab-compare-table tr > *:last-child { border-right: 0; }

.ab-compare-image {
    display: block;
    width: 100%;
    height: 100px;
    margin-bottom: 10px;
    border-radius: 7px;
    object-fit: cover;
    background: #fff;
}
.ab-compare-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 7px;
    border-radius: 5px;
    background: #ffedd5;
    color: #c2410c;
    font-size: 10px;
    font-weight: 800;
}
.ab-compare-product-title {
    color: #222;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}
.ab-compare-price {
    color: #d7520d;
    font-size: 15px;
    white-space: normal;
}
.ab-compare-best {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    padding: 2px 7px;
    border-radius: 5px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 800;
}
.ab-compare-missing { color: #c4c4cc; font-size: 16px; }

.ab-cell-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    line-height: 1.5;
}
.ab-cell-clamp.open { -webkit-line-clamp: unset; display: block; }

/* Filtre « différences uniquement » */
.ab-compare-modal.only-diff tr.ab-row[data-diff="0"] { display: none; }

/* Extras */
.ab-extra { display: none; }
.ab-compare-table.show-extra .ab-extra { display: table-row; }
.ab-extra-toggle td {
    padding: 0 !important;
    background: #fafafa;
    text-align: center;
}
.ab-extra-toggle button {
    width: 100%;
    padding: 11px;
    border: 0;
    background: none;
    color: #d7520d;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}
.ab-extra-toggle button:hover { background: #fff7ed; }

/* Lien « Voir l'offre » */
.ab-compare-view {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #d7520d;
    font-weight: 700;
    font-size: 12.5px;
    text-decoration: none;
}
.ab-compare-view:hover { text-decoration: underline; }
.ab-compare-here {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
}

/* Footer */
.ab-compare-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 24px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}
.ab-compare-footer > span { color: #737373; font-size: 12px; }
.ab-compare-footer > span i { color: #16a34a; margin-right: 4px; }
.ab-compare-done {
    padding: 10px 20px;
    border: 0;
    border-radius: 8px;
    background: #d7520d;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.ab-compare-done:hover { background: #b8450b; }

/* Bouton « Comparer » (sur la carte) */
.ab-compare-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #d7520d;
    border: 1px solid #d7520d;
    border-radius: 8px;
    padding: .2rem .4rem;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transition: all .15s ease;
}
.ab-compare-trigger:hover { color: #fff; background: #d7520d; }

/* Responsive */
@media (max-width: 600px) {
    .ab-compare-modal { padding: 0; align-items: flex-end; }
    .ab-compare-dialog {
        width: 100%;
        max-height: 92dvh;
        border-radius: 18px 18px 0 0;
    }
    .ab-compare-header { padding: 17px 16px; }
    .ab-compare-header h2 { font-size: 19px; }
    .ab-compare-toolbar { padding: 10px 14px 0; }
    .ab-compare-scroll { margin: 10px 14px 0; }
    .ab-compare-footer { padding: 12px; }
    .ab-compare-footer > span { max-width: 65%; line-height: 1.5; }
    .ab-compare-trigger { padding: 8px 10px; font-size: 12px; }
}

    .ab-compare-trigger-card { opacity: 1; transform: none; }
