/* ── Taxonomy Property Archive ──────────────────────────────────────────────
   Used on khu_vuc + loai_hinh_bds taxonomy pages.
   Class prefix: ta-
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Page wrapper ────────────────────────────────────────────────────────── */
.ta-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.ta-filterbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}
.ta-filterbar__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 16px 0;
}

/* Breadcrumb */
.ta-breadcrumb {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
@media (min-width: 640px) { .ta-breadcrumb { display: flex; } }
.ta-breadcrumb a { color: #6b7280; text-decoration: none; transition: color .15s; }
.ta-breadcrumb a:hover { color: #111827; }
.ta-breadcrumb span { color: #111827; font-weight: 500; }
.ta-breadcrumb__sep { color: #d1d5db; }

/* Title */
.ta-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 14px;
    line-height: 1.25;
    display: none;
}
@media (min-width: 640px) { .ta-title { display: block; } }

/* ── Filter pills row ────────────────────────────────────────────────────── */
.ta-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    /* overflow-x: auto; */
    padding-bottom: 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ta-pills::-webkit-scrollbar { display: none; }

/* Pill button */
.ta-pill-wrap { position: relative; flex-shrink: 0; }

.ta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: var(--bds-primary-light, #EEF2FF);
    color: var(--bds-primary, #312E8D);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    outline: none;
    font-family: inherit;
}
.ta-pill:hover { background: #e0e7ff; }
.ta-pill.is-active { background: var(--bds-primary, #312E8D); color: #fff; }
.ta-pill.is-active:hover { background: #3730a3; }

.ta-pill svg { flex-shrink: 0; transition: transform .2s; }
.ta-pill.dd-open svg.ta-chevron { transform: rotate(180deg); }

/* Remove X inside active pill */
.ta-pill__x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    color: inherit;
    margin-left: 2px;
    font-size: 10px;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}
.ta-pill__x:hover { background: rgba(255,255,255,.5); color: #fff; }

/* Clear filter link */
.ta-clear {
    flex-shrink: 0;
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    font-weight: 600;
    color: #374151;
    border-radius: 999px;
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
    margin-left: auto;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.ta-clear:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.ta-clear--dim { color: #9ca3af; border-color: #f3f4f6; pointer-events: none; }

/* ── Dropdown panels ─────────────────────────────────────────────────────── */
.ta-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.06);
    min-width: 200px;
    padding: 6px 0;
    overflow: hidden;
    animation: taDropIn .15s ease;
}
.ta-dropdown.is-open { display: block; }

@keyframes taDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ta-dd-item {
    display: block;
    padding: 9px 16px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background .1s;
    white-space: nowrap;
}
.ta-dd-item:hover { background: #f9fafb; color: #111827; }
.ta-dd-item.is-active { color: var(--bds-primary, #312E8D); font-weight: 600; background: var(--bds-primary-light, #EEF2FF); }

.ta-dd-divider { height: 1px; background: #f3f4f6; margin: 4px 0; }
.ta-dropdown--right { left: auto; right: 0; }

/* ── Province / type chips row ───────────────────────────────────────────── */
.ta-chips {
    display: flex;
    align-items: center;
    gap: 0;
    padding-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ta-chips::-webkit-scrollbar { display: none; }

.ta-chips__label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    margin-right: 10px;
    flex-shrink: 0;
    display: none;
}
@media (min-width: 640px) { .ta-chips__label { display: block; } }

.ta-chip {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
    margin-right: 6px;
    flex-shrink: 0;
    background: #fff;
    transition: background .12s, border-color .12s, color .12s;
}
.ta-chip:hover { background: #f3f4f6; }
.ta-chip.is-active {
    background: var(--bds-primary, #312E8D);
    border-color: var(--bds-primary, #312E8D);
    color: #fff;
}

/* ── Main body ───────────────────────────────────────────────────────────── */
.ta-body {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ── Listings column ─────────────────────────────────────────────────────── */
.ta-listings {
    flex: 1;
    min-width: 0;
}

/* Sort bar */
.ta-sortbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 12px 12px 0 0;
    padding: 0 16px;
}

.ta-tabs {
    display: flex;
    align-items: center;
}
.ta-tab {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 400;
    color: #374151;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
}
.ta-tab:hover { color: var(--bds-primary, #312E8D); }
.ta-tab.is-active { color: var(--bds-primary, #312E8D); font-weight: 600; border-bottom-color: var(--bds-primary, #312E8D); }

.ta-sortbar__right { display: flex; align-items: center; gap: 8px; }

/* Sort dropdown button */
.ta-sort-wrap { position: relative; }
.ta-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 10px;
    border: none;
    background: none;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
    transition: background .1s;
    font-family: inherit;
}
.ta-sort-btn:hover { background: #f3f4f6; }
.ta-sort-btn svg { transition: transform .2s; }
.ta-sort-btn.dd-open svg { transform: rotate(180deg); }

/* Cards container */
.ta-card-list {
    background: #fff;
    border-radius: 0 0 12px 12px;
}

.ta-card + .ta-card { border-top: 1px solid #e5e7eb; }

.ta-empty {
    padding: 48px 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 15px;
    background: #fff;
    border-radius: 0 0 12px 12px;
}
.ta-empty svg { display: block; margin: 0 auto 12px; opacity: .4; }

/* ── Horizontal listing card ─────────────────────────────────────────────── */
.ta-card {
    padding: 14px 16px;
}

.ta-card__link {
    display: flex;
    gap: 14px;
    text-decoration: none;
    cursor: pointer;
}

/* Image area */
.ta-card__img-wrap {
    position: relative;
    flex-shrink: 0;
    width: 132px;
    height: 150px;
    border-radius: 14px;
    overflow: hidden;
    background: #f3f4f6;
}
@media (min-width: 768px) {
    .ta-card__img-wrap { width: 180px; height: 180px; }
}

.ta-card__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.ta-card__link:hover .ta-card__img { transform: scale(1.04); }

.ta-card__no-img {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #d1d5db;
}

/* Save / heart button */
.ta-card__save {
    position: absolute;
    top: 7px; right: 7px;
    width: 28px; height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #fff;
    padding: 0;
    transition: background .15s, transform .15s;
    z-index: 2;
}
.ta-card__save:hover { background: rgba(49,46,141,.85); transform: scale(1.1); }
.ta-card__save.is-saved { background: #ef4444; }
.ta-card__save.is-saved svg { fill: #fff; stroke: #fff; }

/* Image bottom bar */
.ta-card__img-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 100%);
    border-radius: 0 0 14px 14px;
}
.ta-card__time {
    font-size: 11px;
    color: rgba(255,255,255,.9);
    font-weight: 400;
}
.ta-card__img-count {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: rgba(255,255,255,.9);
    font-weight: 600;
}

/* Card body (right side) */
.ta-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

.ta-card__top { min-width: 0; }

.ta-card__type {
    display: inline-block;
    font-size: 12px;
    color: #16a34a;
    font-weight: 500;
    margin-bottom: 3px;
}

.ta-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin: 0 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.ta-card__link:hover .ta-card__title { color: var(--bds-primary, #312E8D); }
@media (min-width: 640px) { .ta-card__title { font-size: 16px; } }

.ta-card__location {
    font-size: 12.5px;
    color: #6b7280;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (min-width: 640px) { .ta-card__location { -webkit-line-clamp: 2; line-clamp: 2; } }

/* Price row */
.ta-card__price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 6px;
    row-gap: 2px;
}
.ta-card__price {
    font-size: 15px;
    font-weight: 700;
    color: #ea580c;
}
.ta-card__price--contact { color: var(--bds-primary, #312E8D); }
@media (min-width: 640px) { .ta-card__price { font-size: 17px; } }

.ta-card__m2 { font-size: 13px; color: #374151; }
.ta-card__area { font-size: 13px; font-weight: 600; color: #374151; }
.ta-card__sep { color: #d1d5db; font-size: 13px; }

/* Author row */
.ta-card__author {
    display: flex;
    align-items: center;
    gap: 7px;
}
.ta-card__avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #e0e7ff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--bds-primary, #312E8D);
}
.ta-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.ta-card__author-name {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.ta-pager {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}
.ta-pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    margin: 0 3px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    background: #fff;
    transition: background .12s, border-color .12s, color .12s;
}
.ta-pager .page-numbers:hover { background: #f3f4f6; border-color: #d1d5db; }
.ta-pager .page-numbers.current { background: var(--bds-primary, #312E8D); border-color: var(--bds-primary, #312E8D); color: #fff; }
.ta-pager .page-numbers.dots { border: none; background: none; }

/* ── View toggle buttons ─────────────────────────────────────────────────── */
.ta-view-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
}
.ta-view-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: none;
    border-radius: 6px;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    transition: background .12s, color .12s;
}
.ta-view-btn:hover { background: #f3f4f6; color: #374151; }
.ta-view-btn.is-active { background: var(--bds-primary-light, #EEF2FF); color: var(--bds-primary, #312E8D); }

.ta-sort-sep {
    width: 1px; height: 20px;
    background: #e5e7eb;
    margin: 0 4px;
    flex-shrink: 0;
}

/* ── Grid view layout ────────────────────────────────────────────────────── */
.ta-card-list--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}
@media (min-width: 768px) {
    .ta-card-list--grid { grid-template-columns: repeat(3, 1fr); }
}

.ta-card-list--grid .ta-card { border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; }
.ta-card-list--grid .ta-card + .ta-card { border-top: none; }

.ta-card-list--grid .ta-card__link {
    flex-direction: column;
    gap: 0;
}
.ta-card-list--grid .ta-card__img-wrap {
    width: 100%;
    height: 160px;
    border-radius: 0;
}
@media (min-width: 640px) {
    .ta-card-list--grid .ta-card__img-wrap { height: 190px; }
}
.ta-card-list--grid .ta-card__body {
    padding: 2px 0 0;
    gap: 4px;
}
.ta-card-list--grid .ta-card__title { font-size: 13px; }
@media (min-width: 640px) {
    .ta-card-list--grid .ta-card__title { font-size: 14px; }
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.ta-sidebar {
    display: none;
    width: 260px;
    flex-shrink: 0;
}
@media (min-width: 992px) { .ta-sidebar { display: block; } }

/* Accordion */
.ta-accord {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.ta-accord__btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background .12s;
}
.ta-accord__btn:hover { background: #f9fafb; }
.ta-accord__btn svg { flex-shrink: 0; transition: transform .2s; color: #6b7280; }
.ta-accord.is-open .ta-accord__btn svg { transform: rotate(180deg); }

.ta-accord__body {
    padding: 0 16px 14px;
    display: none;
}
.ta-accord.is-open .ta-accord__body { display: block; }

/* Radio items */
.ta-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: color .12s;
    border-radius: 6px;
}
.ta-radio:hover { color: var(--bds-primary, #312E8D); }
.ta-radio.is-active { color: var(--bds-primary, #312E8D); font-weight: 600; }

.ta-radio__dot {
    width: 18px; height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: border-color .15s;
}
.ta-radio:hover .ta-radio__dot { border-color: var(--bds-primary, #312E8D); }
.ta-radio.is-active .ta-radio__dot {
    border-color: var(--bds-primary, #312E8D);
    background: var(--bds-primary, #312E8D);
}
.ta-radio.is-active .ta-radio__dot::after {
    content: '';
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
}

/* ── Term description (SEO) ─────────────────────────────────────────────── */
.ta-term-desc {
    margin-top: 28px;
    padding: 22px 24px 16px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    font-size: 14px;
    color: #374151;
    line-height: 1.75;
}

.ta-term-desc__inner {
    max-height: 96px;
    overflow: hidden;
    position: relative;
    transition: max-height .35s ease;
}
.ta-term-desc__inner::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 44px;
    background: linear-gradient(to bottom, transparent, #F9FAFB);
    pointer-events: none;
    transition: opacity .25s;
}
.ta-term-desc__inner.is-expanded {
    max-height: 9999px;
}
.ta-term-desc__inner.is-expanded::after {
    opacity: 0;
}

.ta-term-desc__toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--bds-primary, #312E8D);
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
}
.ta-term-desc__toggle:hover { opacity: .75; }
.ta-term-desc__icon { transition: transform .3s ease; }

.ta-term-desc p { margin: 0 0 12px; }
.ta-term-desc p:last-child { margin-bottom: 0; }
.ta-term-desc h2,
.ta-term-desc h3 {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 16px 0 6px;
}
.ta-term-desc h2:first-child,
.ta-term-desc h3:first-child { margin-top: 0; }
.ta-term-desc a { color: var(--bds-primary, #312E8D); }
.ta-term-desc a:hover { text-decoration: underline; }
