/* listings.css — phần riêng của trang. Thành phần dùng chung ở assets/css/rbnd-app.css */

/* =========================================================================
 *  Popup "Bất động sản có thể bạn quan tâm"  (rbnd-suggest-popup.js)
 * =========================================================================
 *  Khung do JS dựng, nên ở đây chỉ có kiểu dáng. Huy hiệu tin xác thực và
 *  huy hiệu VIP dùng lại .badge-verified / .badge-vip của rbnd-app.css —
 *  hai chỗ hiển thị cùng một thứ thì phải trông giống nhau.
 * ====================================================================== */

.sgp-overlay {
    position: fixed;
    inset: 0;
    /* Trên thanh so sánh (1040), thanh mạo danh (1080) và toast SweetAlert
       (1060); vẫn dưới nút báo lỗi vì nút đó phải bấm được trong mọi cảnh. */
    z-index: 1090;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: sgp-fade .18s ease-out;
}

/* Khóa cuộn nền: không khóa thì cuộn chuột lại lăn trang phía sau */
body.sgp-lock { overflow: hidden; }

.sgp-dialog {
    background: #fff;
    border-radius: var(--rbnd-radius);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
    width: 100%;
    max-width: 920px;
    max-height: 88vh;
    overflow: auto;
    padding: 22px 24px 18px;
    position: relative;
    animation: sgp-rise .2s ease-out;
}

.sgp-dialog:focus { outline: none; }

.sgp-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f1f3f5;
    color: var(--rbnd-muted);
    font-size: 1rem;
    cursor: pointer;
}
.sgp-close:hover { background: #e9ecef; color: #212529; }

.sgp-title { font-size: 1.15rem; margin: 0 34px 6px 0; }

.sgp-sub {
    font-size: .88rem;
    color: var(--rbnd-muted);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.sgp-chip {
    background: #eef4ff;
    color: var(--rbnd-primary);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: .8rem;
    font-weight: 600;
}

.sgp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.sgp-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--rbnd-border);
    border-radius: var(--rbnd-radius);
    overflow: hidden;
    text-decoration: none;
    color: #212529;
    background: #fff;
    transition: border-color .15s, transform .15s;
}
.sgp-card:hover {
    border-color: var(--rbnd-primary);
    transform: translateY(-2px);
    color: #212529;
}

.sgp-card__media { position: relative; display: block; }
.sgp-card__media img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}

.sgp-card__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sgp-card__title {
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.35;
    /* Hai dòng là đủ nhận ra tin; dài hơn thì các thẻ cao thấp lệch nhau */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sgp-card__meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .85rem; }
.sgp-card__meta .price { color: var(--rbnd-danger); font-weight: 700; }
.sgp-card__meta .ppm   { color: var(--rbnd-muted); }

.sgp-card__addr {
    font-size: .8rem;
    color: var(--rbnd-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sgp-foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

@keyframes sgp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sgp-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Người bật "giảm chuyển động" trong hệ điều hành thường bị chóng mặt vì
   hiệu ứng trượt — tôn trọng lựa chọn đó. */
@media (prefers-reduced-motion: reduce) {
    .sgp-overlay, .sgp-dialog { animation: none; }
    .sgp-card { transition: none; }
    .sgp-card:hover { transform: none; }
}

@media (max-width: 575.98px) {
    .sgp-overlay { padding: 0; align-items: flex-end; }
    .sgp-dialog  { max-height: 92vh; border-radius: var(--rbnd-radius) var(--rbnd-radius) 0 0; padding: 18px 16px 14px; }
    .sgp-grid    { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .sgp-foot    { justify-content: space-between; }
}

/* =========================================================================
 *  Bài viết SEO của danh mục (templates/partials/category-seo.php)
 * ====================================================================== */
.category-seo { margin: 32px 0 12px; padding: 24px; background: #fff; border: 1px solid var(--rbnd-border); border-radius: var(--rbnd-radius); }
.category-seo > h2 { font-size: 1.35rem; margin: 0 0 14px; line-height: 1.35; }
.category-seo__body { line-height: 1.75; color: #343a40; position: relative; }
.category-seo__body h3 { font-size: 1.12rem; margin: 22px 0 8px; }
.category-seo__body h4 { font-size: 1rem; margin: 18px 0 6px; }
.category-seo__body p { margin: 0 0 12px; }
.category-seo__body ul, .category-seo__body ol { padding-left: 1.3rem; margin: 0 0 12px; }
.category-seo__body img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }
.category-seo__body blockquote { border-left: 4px solid var(--rbnd-primary); margin: 12px 0; padding: 6px 14px; background: #f6f9ff; }
.category-seo__body.is-collapsed { max-height: 420px; overflow: hidden; }
.category-seo__body.is-collapsed::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px;
    background: linear-gradient(rgba(255,255,255,0), #fff); pointer-events: none;
}
.category-seo__more { display: flex; align-items: center; gap: 6px; margin: 10px auto 0; padding: 8px 18px; border: 1px solid var(--rbnd-border); border-radius: 999px; background: #fff; color: var(--rbnd-primary); font-weight: 500; cursor: pointer; }
.category-seo__more:hover { background: #f0f6ff; }
.category-seo__more.is-open i { transform: rotate(180deg); }
.category-seo__faq { margin-top: 26px; }
.category-seo__faq h3 { font-size: 1.12rem; margin: 0 0 10px; }
.category-seo__faq details { border: 1px solid var(--rbnd-border); border-radius: 8px; margin-bottom: 8px; background: #fbfcfd; }
.category-seo__faq summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; position: relative; padding-right: 40px; }
.category-seo__faq summary::-webkit-details-marker { display: none; }
.category-seo__faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; color: var(--rbnd-muted); }
.category-seo__faq details[open] summary::after { content: "\2212"; }
.category-seo__answer { padding: 0 16px 14px; line-height: 1.7; color: #495057; }
@media (max-width: 575.98px) {
    .category-seo { padding: 16px; margin-top: 24px; }
    .category-seo > h2 { font-size: 1.18rem; }
}
