/* ============================================
   COMPARATEUR IMMOBILIER — Elite Luxe
   ============================================ */

/* Bouton sur les cartes */
.btn-compare {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(7, 13, 27, 0.85);
    color: #cbd5e1;
    border: 1px solid rgba(212, 175, 55, 0.35);
    backdrop-filter: blur(6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.25s;
    padding: 0;
}
.btn-compare:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: #d4af37;
    color: #d4af37;
    transform: scale(1.1);
}
.btn-compare.active {
    background: linear-gradient(135deg, #d4af37, #b45309);
    color: #070d1b;
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
}
.btn-compare.active i::before {
    content: "\f00c"; /* fa-check */
}
.btn-compare.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Décaler les badges existants pour laisser la place au bouton */
.bien-card-image .bien-badge-action {
    top: 14px;
    left: 58px; /* décalé à droite du bouton */
}

/* ============================================
   BARRE FLOTTANTE
   ============================================ */
#compareBar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #0b142a 0%, #111d3b 100%);
    border-top: 2px solid #d4af37;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9998;
    padding: 14px 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
    animation: slideUpBar 0.3s ease-out;
}
@keyframes slideUpBar {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
#compareBar.visible { display: flex; }

#compareBar .cb-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
#compareBar .cb-title {
    color: #f5d76e;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
#compareBar .cb-count {
    background: #d4af37;
    color: #070d1b;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
}

#compareBar .cb-thumbs {
    display: flex;
    gap: 8px;
}
#compareBar .cb-thumb {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: #070d1b;
    border: 1px solid #233a70;
    position: relative;
    flex-shrink: 0;
}
#compareBar .cb-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#compareBar .cb-thumb .cb-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f87171;
    color: #fff;
    border: 1px solid #0b142a;
    font-size: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s;
}
#compareBar .cb-thumb .cb-remove:hover {
    transform: scale(1.2);
    background: #dc2626;
}

#compareBar .cb-right {
    display: flex;
    gap: 10px;
    align-items: center;
}
#compareBar .cb-btn {
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    white-space: nowrap;
}
#compareBar .cb-btn-primary {
    background: linear-gradient(135deg, #d4af37, #b45309);
    color: #070d1b;
}
#compareBar .cb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    color: #070d1b;
    text-decoration: none;
}
#compareBar .cb-btn-primary.disabled {
    opacity: 0.5;
    pointer-events: none;
}
#compareBar .cb-btn-clear {
    background: transparent;
    border: 1px solid #233a70;
    color: #94a3b8;
}
#compareBar .cb-btn-clear:hover {
    border-color: #f87171;
    color: #f87171;
}

@media (max-width: 767px) {
    #compareBar { padding: 12px 14px; }
    #compareBar .cb-title { font-size: 12.5px; }
    #compareBar .cb-thumb { width: 40px; height: 40px; }
    #compareBar .cb-btn { padding: 8px 14px; font-size: 12px; }
}

/* ============================================
   PAGE COMPARATEUR
   ============================================ */
.cmp-page { padding: 30px 15px 80px; }
.cmp-hero {
    background: linear-gradient(135deg, #0b142a 0%, #1a1f3a 100%);
    border: 1px solid #233a70;
    border-radius: 20px;
    padding: 35px 30px;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cmp-hero::before {
    content: "";
    position: absolute; top: -50%; right: -20%;
    width: 60%; height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12), transparent 60%);
    border-radius: 50%;
}
.cmp-hero h1 {
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}
.cmp-hero h1 i { color: #d4af37; }
.cmp-hero p { color: #94a3b8; font-size: 14px; margin: 0; position: relative; z-index: 1; }

.cmp-empty {
    text-align: center;
    padding: 80px 30px;
    background: #0f1c3f;
    border: 1px dashed #233a70;
    border-radius: 16px;
}
.cmp-empty i { font-size: 64px; color: #d4af37; opacity: 0.4; margin-bottom: 20px; display: block; }
.cmp-empty h3 { color: #f5d76e; margin-bottom: 10px; }
.cmp-empty p { color: #94a3b8; max-width: 500px; margin: 0 auto 20px; }
.cmp-empty .btn-gold {
    background: linear-gradient(135deg, #d4af37, #b45309);
    color: #070d1b; border: none;
    padding: 11px 26px; border-radius: 30px;
    font-weight: 700; font-size: 13px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    text-decoration: none;
    transition: all 0.3s;
}
.cmp-empty .btn-gold:hover { transform: translateY(-2px); color: #070d1b; text-decoration: none; }

/* Tableau comparatif */
.cmp-wrap {
    overflow-x: auto;
    background: #0f1c3f;
    border: 1px solid #233a70;
    border-radius: 16px;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}
.cmp-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}
.cmp-table th,
.cmp-table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #1e2d55;
    font-size: 13.5px;
}
.cmp-table thead th {
    background: linear-gradient(135deg, #0b142a 0%, #111d3b 100%);
    color: #f5d76e;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 11.5px;
    text-align: center;
    border-bottom: 2px solid #d4af37;
    padding: 20px 16px 16px;
    position: relative;
}
.cmp-table thead th:first-child {
    text-align: left;
    background: transparent;
    border-bottom: 2px solid #d4af37;
    width: 180px;
}

.cmp-thumb-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #233a70;
    background: #0a1428;
}
.cmp-thumb-titre {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cmp-thumb-ref {
    font-family: monospace;
    font-size: 10px;
    color: #d4af37;
    letter-spacing: 1px;
}
.cmp-thumb-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(7, 13, 27, 0.9);
    border: 1px solid #f87171;
    color: #f87171;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
}
.cmp-thumb-remove:hover {
    background: #f87171;
    color: #fff;
}

.cmp-row-label {
    color: #94a3b8;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(7, 13, 27, 0.4);
}
.cmp-table tbody td {
    text-align: center;
    color: #e2e8f0;
}
.cmp-table tbody td:first-child {
    text-align: left;
    color: #94a3b8;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cmp-value-gold {
    color: #f5d76e;
    font-weight: 700;
    font-size: 15px;
}
.cmp-value-dash {
    color: #64748b;
    font-style: italic;
}
.cmp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cmp-badge.disponible     { background: rgba(52,211,153,.15); color: #34d399; }
.cmp-badge.sous_compromis { background: rgba(251,191,36,.15); color: #fbbf24; }
.cmp-badge.vendu          { background: rgba(248,113,113,.15); color: #f87171; }
.cmp-badge.loue           { background: rgba(96,165,250,.15); color: #60a5fa; }
.cmp-badge.meuble         { background: rgba(52,211,153,.15); color: #34d399; }
.cmp-badge.non_meuble     { background: rgba(148,163,184,.15); color: #94a3b8; }

.cmp-equip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}
.cmp-equip-chip {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #f5d76e;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.cmp-actions-row td {
    padding: 20px 16px;
    border-bottom: none;
}
.cmp-btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #d4af37, #b45309);
    color: #070d1b;
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s;
}
.cmp-btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    color: #070d1b;
    text-decoration: none;
}

/* Footer fixe du comparateur */
.cmp-footer-bar {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.cmp-footer-bar .btn-clear-all {
    background: transparent;
    border: 1px solid #233a70;
    color: #94a3b8;
    padding: 11px 24px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.cmp-footer-bar .btn-clear-all:hover {
    border-color: #f87171;
    color: #f87171;
    text-decoration: none;
}

/* Skeleton comparaison */
.cmp-skeleton {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.cmp-skeleton-item {
    background: #0f1c3f;
    border: 1px solid #1e2d55;
    border-radius: 16px;
    padding: 20px;
    min-height: 400px;
}
.cmp-skel-line {
    background: linear-gradient(90deg, #1a2540 0%, #233a70 50%, #1a2540 100%);
    background-size: 200% 100%;
    animation: shimmerCmp 1.5s infinite;
    border-radius: 6px;
    height: 12px;
    margin-bottom: 12px;
}
@keyframes shimmerCmp { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.cmp-skel-line.img { height: 140px; margin-bottom: 20px; }
.cmp-skel-line.short { width: 40%; }
.cmp-skel-line.med { width: 70%; }