/* ============================================================
   SÂM BĐS — HOMEPAGE V2
   Responsive: mobile-first, breakpoints 600px / 960px
   ============================================================ */

.sambds-section-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sambds-orange);
    margin-bottom: 4px;
}

/* ── Tab filter ─────────────────────────────────────────────── */
.sambds-tab-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.sambds-tab {
    display: inline-block;
    padding: 7px 18px;
    border-radius: 999px;
    border: 1.5px solid var(--sambds-gray-300);
    font-size: 13px;
    font-weight: 500;
    color: var(--sambds-gray-500);
    text-decoration: none;
    background: var(--sambds-white);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sambds-tab:hover {
    border-color: var(--sambds-blue-light);
    color: var(--sambds-blue-light);
}

.sambds-tab.is-active {
    background: var(--sambds-blue-dark);
    border-color: var(--sambds-blue-dark);
    color: var(--sambds-white);
}

/* ── Featured layout ─────────────────────────────────────────── */
.sambds-featured-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (min-width: 960px) {
    .sambds-featured-layout {
        grid-template-columns: 1.5fr 1fr;
        align-items: stretch;
    }
}

/* Card lớn — flex để body sát ảnh, không có khoảng trắng */
.sambds-card--featured {
    display: flex;
    flex-direction: column;
}

.sambds-card--featured .sambds-card-img-wrap {
    display: block;
    overflow: hidden;
    flex-shrink: 0;
}

.sambds-card--featured .sambds-card-img-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
}

.sambds-card--featured .sambds-card-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sambds-card--featured .sambds-card-body {
    flex: 1;
}

.sambds-card--featured .sambds-card-title a {
    font-size: 17px;
}

.sambds-card--featured .sambds-card-price {
    font-size: 18px;
}

/* Grid card nhỏ — 3 cái, bằng chiều cao tổng cột trái */
.sambds-featured-rest {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-content: stretch;
}

@media (min-width: 960px) {
    .sambds-featured-rest {
        grid-template-rows: repeat(3, 1fr);
    }
}

/* Ẩn card thứ 4 trở đi */
.sambds-featured-rest .sambds-card--small:nth-child(n+4) {
    display: none;
}

/* Card nhỏ — layout ngang */
.sambds-card--small {
    display: grid;
    grid-template-columns: 120px 1fr;
    overflow: hidden;
}

.sambds-card--small .sambds-card-img-wrap {
    display: block;
    overflow: hidden;
}

.sambds-card--small .sambds-card-img-wrap img {
    width: 100%;
    height: 100%;
    min-height: 100px;
    object-fit: cover;
    display: block;
}

.sambds-card--small .sambds-card-body {
    padding: 10px 12px;
}

.sambds-card--small .sambds-card-title {
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.sambds-card--small .sambds-card-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sambds-card--small .sambds-card-location {
    font-size: 12px;
    margin-bottom: 6px;
}

.sambds-card--small .sambds-card-specs {
    display: none;
}

.sambds-card--small .sambds-card-meta {
    margin-bottom: 4px;
}

/* Mobile: card nhỏ chuyển sang dọc */
@media (max-width: 599px) {
    .sambds-card--small {
        grid-template-columns: 1fr;
    }
    .sambds-card--small .sambds-card-img-wrap img {
        width: 100%;
        height: 140px;
        min-height: unset;
    }
}

/* Nút outline */
.sambds-btn-outline {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 6px;
    border: 2px solid var(--sambds-blue-dark);
    color: var(--sambds-blue-dark);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sambds-btn-outline:hover {
    background: var(--sambds-blue-dark);
    color: var(--sambds-white);
}

.sambds-featured-more {
    text-align: center;
    margin-top: 28px;
}

.sambds-card-btn--sm {
    font-size: 12px;
    padding: 4px 10px;
}

/* ── Vì sao chọn ─────────────────────────────────────────────── */
.sambds-section-why {
    background: var(--sambds-gray-50);
}

.sambds-why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 960px) {
    .sambds-why-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.sambds-why-card {
    background: var(--sambds-white);
    border: 1px solid var(--sambds-gray-100);
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.sambds-why-card:hover {
    box-shadow: 0 4px 16px rgba(27,79,140,0.10);
}

.sambds-why-icon {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
}

.sambds-why-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--sambds-blue-light);
    margin-bottom: 8px;
}

.sambds-why-card p {
    font-size: 13px;
    color: var(--sambds-gray-500);
    line-height: 1.6;
    margin: 0;
}

/* ── Tin tức — 3 cột đều ─────────────────────────────────────── */
.sambds-section-news {
    background: var(--sambds-white);
}

.sambds-news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 600px) {
    .sambds-news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .sambds-news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.sambds-news-card {
    background: var(--sambds-white);
    border: 1px solid var(--sambds-gray-100);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.sambds-news-card:hover {
    box-shadow: 0 4px 16px rgba(27,79,140,0.10);
}

.sambds-news-img {
    display: block;
    overflow: hidden;
    height: 180px;
    background: var(--sambds-gray-100);
}

.sambds-news-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.sambds-news-card:hover .sambds-news-img img {
    transform: scale(1.04);
}

.sambds-news-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    font-size: 13px;
    color: var(--sambds-gray-500);
    background: var(--sambds-gray-50);
}

.sambds-news-body {
    padding: 16px;
}

.sambds-news-date {
    font-size: 12px;
    color: var(--sambds-gray-500);
    display: block;
    margin-bottom: 6px;
}

.sambds-news-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--sambds-blue-dark);
    margin-bottom: 8px;
    line-height: 1.5;
}

.sambds-news-title a {
    color: inherit;
    text-decoration: none;
}

.sambds-news-title a:hover {
    color: var(--sambds-blue-light);
}

.sambds-news-excerpt {
    font-size: 13px;
    color: var(--sambds-gray-500);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sambds-news-more {
    font-size: 13px;
    font-weight: 500;
    color: var(--sambds-blue-light);
    text-decoration: none;
}

.sambds-news-more:hover {
    color: var(--sambds-orange);
}

/* ── Empty ───────────────────────────────────────────────────── */
.sambds-empty {
    text-align: center;
    padding: 40px;
    color: var(--sambds-gray-500);
    font-size: 14px;
}

/* ── Honeypot ẩn hoàn toàn ───────────────────────────────────── */
.sambds-form-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ── Fix Chrome autofill vàng ────────────────────────────────── */
.sambds-cta-form input:-webkit-autofill,
.sambds-cta-form input:-webkit-autofill:hover,
.sambds-cta-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #fff inset;
    box-shadow: 0 0 0px 1000px #fff inset;
    -webkit-text-fill-color: var(--sambds-gray-900);
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Giảm khoảng cách giữa các section ─────────────────────── */
.sambds-section-featured {
    padding-bottom: 24px !important;
}

.sambds-section-why {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
}

.sambds-section-news {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
}

/* ── Xóa khoảng trắng giữa form CTA và footer ───────────────── */
.sambds-section-cta {
    margin-bottom: 0 !important;
}

.sambds-homepage {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.sambds-homepage + * {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ── Fix khoảng cách section desktop ───────────────────────── */
.sambds-section-featured {
    padding: 40px 0 20px !important;
}

.sambds-section-why {
    padding: 28px 0 !important;
}

.sambds-section-news {
    padding: 28px 0 !important;
}

.sambds-section-cta {
    margin-bottom: 0 !important;
}

/* ── Fix khoảng trắng footer — target Astra wrapper ─────────── */
.ast-separate-container .ast-article-single,
.ast-plain-container .ast-article-single,
.site-main > article,
.site-main > .page,
#content .entry-content,
.page-template-default #content {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.hentry {
    margin-bottom: 0 !important;
}

.ast-page-builder-template #content {
    padding-bottom: 0 !important;
}

/* ── Fix dòng xám giữa ảnh và chữ card nhỏ ──────────────────── */
.sambds-card--small .sambds-card-img-wrap img {
    vertical-align: bottom;
}

.sambds-card--small {
    border: 1px solid var(--sambds-gray-100);
    border-radius: 10px;
    overflow: hidden;
    background: var(--sambds-white);
}

.sambds-card--small .sambds-card-img-wrap {
    line-height: 0;
    font-size: 0;
}

/* Fix cho card lớn featured nếu cũng bị */
.sambds-card--featured {
    border: 1px solid var(--sambds-gray-100);
    border-radius: 10px;
    overflow: hidden;
    background: var(--sambds-white);
}

.sambds-card--featured .sambds-card-img-wrap {
    line-height: 0;
    font-size: 0;
}

/* ── Fix triệt để khoảng xám card nhỏ ───────────────────────── */
.sambds-card--small .sambds-card-img-wrap,
.sambds-card--featured .sambds-card-img-wrap {
    line-height: 0 !important;
    font-size: 0 !important;
    display: block !important;
    overflow: hidden !important;
    background: var(--sambds-gray-100) !important;
}

.sambds-card--small .sambds-card-img-wrap img,
.sambds-card--featured .sambds-card-img-wrap img {
    display: block !important;
    vertical-align: bottom !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Xóa gap/border giữa ảnh và body */
.sambds-card--small,
.sambds-card--featured {
    gap: 0 !important;
}

.sambds-card--small .sambds-card-body,
.sambds-card--featured .sambds-card-body {
    border-top: none !important;
}

/* Card nhỏ desktop: ảnh fill chiều cao 100% */
@media (min-width: 600px) {
    .sambds-card--small {
        grid-template-columns: 120px 1fr !important;
        grid-template-rows: 1fr !important;
    }
    .sambds-card--small .sambds-card-img-wrap {
        height: 100% !important;
        min-height: 100% !important;
    }
    .sambds-card--small .sambds-card-img-wrap img {
        position: absolute !important;
        inset: 0 !important;
    }
    .sambds-card--small .sambds-card-img-wrap {
        position: relative !important;
    }
}

/* Card nhỏ mobile: ảnh full width, không gap */
@media (max-width: 599px) {
    .sambds-card--small {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto 1fr !important;
    }
    .sambds-card--small .sambds-card-img-wrap {
        aspect-ratio: 16 / 9 !important;
        position: relative !important;
    }
    .sambds-card--small .sambds-card-img-wrap img {
        position: absolute !important;
        inset: 0 !important;
    }
}
