/* Compare properties — card toggle, floating tray, toast, and the /Home/Compare table page */

/* ── Card toggle icon (stacks below the favorite heart) ─────────────── */
.listing-compare-overlay {
    position: absolute;
    top: 54px;
    right: 10px;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 1px 5px rgba(0,0,0,0.18);
    cursor: pointer;
    text-decoration: none !important;
    transition: background .18s, transform .15s, box-shadow .15s;
    pointer-events: auto !important;
}
.listing-compare-overlay:hover {
    background: #fff;
    transform: scale(1.12);
    text-decoration: none !important;
}
.listing-compare-overlay i {
    font-size: 14px;
    line-height: 1;
    color: #94a3b8;
    transition: color .18s;
}
.listing-compare-overlay:hover i { color: #006aff; }
.listing-compare-overlay.is-selected {
    background: #006aff;
    box-shadow: 0 2px 8px rgba(0,106,255,.35);
}
.listing-compare-overlay.is-selected i { color: #fff; }
.listing-compare-overlay.is-selected:hover { background: #0057d1; }

/* ── Floating compare tray ───────────────────────────────────────────── */
body.has-compare-tray { padding-bottom: 84px; }
.cmp-tray {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10050;
    background: #fff;
    border-top: 1px solid #eaeff5;
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.08);
    animation: cmpTraySlideUp .22s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes cmpTraySlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.cmp-tray-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.cmp-tray-items {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.cmp-tray-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border-radius: 30px;
    background: #f8fafc;
    border: 1px solid #eaeff5;
    max-width: 190px;
}
.cmp-tray-item img,
.cmp-tray-item-noimg {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 12px;
}
.cmp-tray-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmp-tray-item-remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    transition: color .12s;
}
.cmp-tray-item-remove:hover { color: #b91c1c; }
.cmp-tray-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.cmp-tray-count {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}
.cmp-tray-clear {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 4px;
    transition: color .12s;
}
.cmp-tray-clear:hover { color: #b91c1c; }
.cmp-tray-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #006aff;
    background: #006aff;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, opacity .15s;
}
.cmp-tray-compare-btn:hover:not(:disabled) { background: #0057d1; }
.cmp-tray-compare-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.cmp-toast {
    position: fixed;
    left: 50%;
    bottom: 100px;
    transform: translate(-50%, 12px);
    z-index: 10060;
    background: #1e293b;
    color: #fff;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    opacity: 0;
    transition: opacity .22s, transform .22s;
    pointer-events: none;
}
.cmp-toast--visible { opacity: 1; transform: translate(-50%, 0); }

/* ── /Home/Compare page ──────────────────────────────────────────────── */
.cmp-page { padding: 32px 0 64px; }
.cmp-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.cmp-page-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px;
}
.cmp-page-header p { font-size: 14px; color: #64748b; margin: 0; }
.cmp-page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cmp-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.cmp-btn-primary { background: #006aff; border: 1px solid #006aff; color: #fff !important; }
.cmp-btn-primary:hover { background: #0057d1; }
.cmp-btn-secondary { background: #fff; border: 1px solid #e2e8f0; color: #475569 !important; }
.cmp-btn-secondary:hover { border-color: #94a3b8; background: #f8fafc; }

.cmp-notice {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
}

.cmp-empty {
    text-align: center;
    padding: 64px 24px;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 14px;
}
.cmp-empty i { font-size: 34px; color: #cbd5e1; margin-bottom: 14px; display: block; }
.cmp-empty h3 { font-size: 18px; font-weight: 700; color: #1e293b; margin: 0 0 6px; }
.cmp-empty p { font-size: 14px; color: #64748b; margin: 0 0 20px; }

.cmp-table-scroll {
    overflow-x: auto;
    border: 1px solid #eaeff5;
    border-radius: 14px;
    background: #fff;
}
.cmp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}
.cmp-table th, .cmp-table td {
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 18px;
    vertical-align: top;
    text-align: left;
}
.cmp-table tr:last-child th, .cmp-table tr:last-child td { border-bottom: none; }

.cmp-attr-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    min-width: 140px;
    border-right: 1px solid #eaeff5;
}

.cmp-col-head { min-width: 220px; background: #fff; }
.cmp-card-image {
    width: 100%;
    height: 130px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f5f9;
    margin-bottom: 10px;
    display: block;
}
.cmp-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.cmp-card-title { font-size: 15px; font-weight: 700; color: #1e293b; text-decoration: none !important; line-height: 1.3; }
.cmp-card-title:hover { color: #006aff; }
.cmp-card-remove {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .12s, border-color .12s;
}
.cmp-card-remove:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.cmp-view-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #006aff;
    text-decoration: none !important;
}
.cmp-view-link:hover { text-decoration: underline !important; }

.cmp-price { font-size: 15px; font-weight: 700; color: #1e293b; font-variant-numeric: tabular-nums; }
.cmp-value { font-size: 13px; color: #334155; font-variant-numeric: tabular-nums; }
.cmp-value-muted { color: #94a3b8; }

.cmp-amenities { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-amenity-tag {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 20px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
}

@media (max-width: 767px) {
    .cmp-tray-inner { padding: 10px 14px; }
    .cmp-tray-item { max-width: 130px; }
    .cmp-tray-count { display: none; }
    .cmp-page-header { align-items: flex-start; }
}
