/* ─── Homepage – BanNha888 ───────────────────────────────────────────────────
   Relies on BDS CSS variables loaded from the Vue bundle (main.css).
   ─────────────────────────────────────────────────────────────────────────── */

/* ─── Container ─────────────────────────────────────────────────────────────── */
.hp-container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hp-hero {
    background: linear-gradient(135deg, #1a1460 0%, #312E8D 45%, #4a3fa3 70%, #2d5986 100%);
    padding: 64px 16px 80px;
    position: relative;
    /* overflow: hidden; */
    text-align: center;
}
.hp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,.05) 0%, transparent 50%),
                      radial-gradient(circle at 80% 30%, rgba(255,255,255,.04) 0%, transparent 40%);
    pointer-events: none;
}
.hp-hero__title {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 36px;
    text-shadow: 0 2px 16px rgba(0,0,0,.35);
    letter-spacing: -.5px;
    position: relative;
    z-index: 1;
}

/* ─── Search Bar ─────────────────────────────────────────────────────────────── */
.hp-search {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 999px;
    padding: 6px 6px 6px 20px;
    gap: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    max-width: 860px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.hp-search__text {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
    min-width: 0;
}
.hp-search__icon { color: #9CA3AF; flex-shrink: 0; }
.hp-search__input {
    border: none;
    outline: none;
    font-size: 14px;
    color: #111827;
    background: transparent;
    width: 100%;
}
.hp-search__input::placeholder { color: #9CA3AF; }
.hp-search__sep {
    width: 1px;
    height: 28px;
    background: #E5E7EB;
    flex-shrink: 0;
    margin: 0 4px;
}
/* Custom dropdown (replaces <select>) */
.hp-search__dd { position: relative; flex-shrink: 0; }
.hp-search__dd-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
    font-family: inherit;
}
.hp-search__dd-trigger > svg:first-child { color: #9CA3AF; flex-shrink: 0; }
.hp-search__dd-chevron { color: #9CA3AF; transition: transform .2s; flex-shrink: 0; }
.hp-search__dd.is-open .hp-search__dd-chevron { transform: rotate(180deg); }
.hp-search__dd-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}
.hp-search__dd.is-open .hp-search__dd-panel { display: block; }
.hp-search__dd-item {
    padding: 8px 12px;
    font-size: 13px;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: background .1s;
    white-space: nowrap;
}
.hp-search__dd-item:hover { background: var(--bds-primary-light, #EEF2FF); color: var(--bds-primary, #312E8D); }
.hp-search__dd-item.is-selected { background: var(--bds-primary-light, #EEF2FF); color: var(--bds-primary, #312E8D); font-weight: 600; }

.hp-search__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    background: var(--bds-primary, #312E8D);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: background .15s;
    font-family: inherit;
}
.hp-search__btn:hover { background: var(--bds-primary-dark, #231D7A); }

/* ─── Sections ───────────────────────────────────────────────────────────────── */
.hp-section { padding: 52px 0; background: #fff; }
.hp-section--gray { background: #F3F4F6; }
.hp-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}
.hp-section__title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.hp-more-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    color: var(--bds-primary, #312E8D);
    text-decoration: none;
}
.hp-more-link:hover { text-decoration: underline; }
.hp-section__footer { text-align: center; margin-top: 32px; }

/* ─── Listing Grid ───────────────────────────────────────────────────────────── */
.hp-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.hp-empty {
    text-align: center;
    padding: 48px 0;
    color: #6B7280;
    font-size: 15px;
}

/* ─── Listing Card ───────────────────────────────────────────────────────────── */
.hp-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s;
}
.hp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    text-decoration: none;
    color: inherit;
}
.hp-card__img-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #F3F4F6;
}
.hp-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.hp-card:hover .hp-card__img { transform: scale(1.04); }
.hp-card__no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #D1D5DB;
}
.hp-card__time {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,.52);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
}
.hp-card__img-meta {
    position: absolute;
    bottom: 8px;
    right: 8px;
}
.hp-card__img-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0,0,0,.52);
    color: #fff;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 4px;
}
.hp-card__fav {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,.88);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: color .15s, background .15s;
    padding: 0;
}
.hp-card__fav:hover,
.hp-card__fav.is-saved { color: #EF4444; background: #fff; }
.hp-card__body { padding: 10px 12px 13px; }
.hp-card__title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}
.hp-card__type {
    font-size: 11px;
    color: #6B7280;
    margin: 0 0 5px;
}
.hp-card__price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 5px;
}
.hp-card__price { font-size: 13px; font-weight: 700; color: var(--bds-primary, #312E8D); }
.hp-card__price--contact { color: #DC2626; }
.hp-card__pm2, .hp-card__area { font-size: 11px; color: #6B7280; }
.hp-card__sep { font-size: 11px; color: #9CA3AF; }
.hp-card__location {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #6B7280;
    margin: 0;
}

/* ─── Property-type tabs ─────────────────────────────────────────────────────── */
.hp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #E5E7EB;
    overflow-x: auto;
    margin-bottom: 24px;
    scrollbar-width: none;
}
.hp-tabs::-webkit-scrollbar { display: none; }
.hp-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    text-decoration: none;
}
.hp-tab:hover { color: var(--bds-primary, #312E8D); }
.hp-tab.is-active {
    color: var(--bds-primary, #312E8D);
    border-color: var(--bds-primary, #312E8D);
    font-weight: 600;
}

/* ─── Province Grid ──────────────────────────────────────────────────────────── */
.hp-provinces {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 12px;
}
.hp-prov {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    aspect-ratio: 16 / 9;
    transition: transform .15s;
}
.hp-prov:first-child  { grid-column: 1;     grid-row: 1; }
.hp-prov:nth-child(2) { grid-column: 2;     grid-row: 1; }
.hp-prov:nth-child(3) { grid-column: 3;     grid-row: 1 / span 2; aspect-ratio: unset; }
.hp-prov:nth-child(4) { grid-column: 1;     grid-row: 2; }
.hp-prov:nth-child(5) { grid-column: 2;     grid-row: 2; }
.hp-prov:hover { transform: scale(1.015); }
.hp-prov__img {
    position: absolute;
    inset: 0;
    border-radius: 12px;
}
.hp-prov__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.08) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px 16px;
    border-radius: 12px;
}
.hp-prov__name  { font-size: 20px; font-weight: 700; color: #fff; margin: 0; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.hp-prov__count { font-size: 12px; color: rgba(255,255,255,.82); margin: 3px 0 0; }

/* ─── About section ──────────────────────────────────────────────────────────── */
.hp-about { padding: 52px 0; background: #fff; }
.hp-about__inner { max-width: 860px; }
.hp-about__title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
    line-height: 1.4;
}
.hp-about__text {
    font-size: 14px;
    line-height: 1.75;
    color: #6B7280;
    overflow: hidden;
    max-height: 78px;
    transition: max-height .35s ease;
}
.hp-about__text.is-expanded { max-height: 600px; }
.hp-about__text p { margin: 0 0 12px; }
.hp-about__text p:last-child { margin-bottom: 0; }
.hp-about__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--bds-primary, #312E8D);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0 0;
}
.hp-about__toggle svg { transition: transform .2s; }
.hp-about__toggle.is-expanded svg { transform: rotate(180deg); }

/* ─── Province image ─────────────────────────────────────────────────────────── */
.hp-prov__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ─── Type listing sections (Splide) ─────────────────────────────────────────── */
.hp-type-section { padding: 48px 0; background: #fff; 
    .splide{
        position: relative;
    }
}
.hp-type-section + .hp-type-section { padding-top: 0; }
.hp-type-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}
.hp-type-section__title { font-size: 20px; font-weight: 700; color: #111827; margin: 0; }
.hp-type-section__more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bds-primary, #312E8D);
    text-decoration: none;
}
.hp-type-section__more:hover { text-decoration: underline; }
.hp-type-section .splide__track { overflow: visible; }
.hp-type-section .splide { overflow: hidden; }
.hp-type-section .hp-card { min-width: 0; }
.hp-type-section .splide__arrow {
    background: #fff;
    border: 1px solid #E5E7EB;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background .15s, border-color .15s, opacity .15s;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    &.splide__arrow--prev{
        left: 10px;
        transform: translateY(-50%) rotate(180deg);
    }
    &.splide__arrow--next{
        right: 10px;
    }
}
.hp-type-section .splide__arrow:hover { background: var(--bds-primary-light, #EEF2FF); border-color: var(--bds-primary, #312E8D); }
.hp-type-section .splide__arrow:disabled { opacity: 0.35; cursor: default; }
.hp-type-section .splide__arrow svg { fill: #374151; width: 14px; height: 14px; flex-shrink: 0; }
.hp-card__fav.is-saved svg { fill: currentColor; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .hp-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .hp-hero__title { font-size: 30px; margin-bottom: 28px; }
    .hp-search { flex-wrap: wrap; border-radius: 16px; padding: 12px; gap: 8px; }
    .hp-search__sep { display: none; }
    .hp-search__text { width: 100%; padding: 0; }
    .hp-search__dd { width: calc(50% - 4px); }
    .hp-search__dd-trigger { width: 100%; padding: 6px 10px; }
    .hp-search__dd-panel { left: 0; transform: none; }
    .hp-search__btn { width: 100%; justify-content: center; border-radius: 12px; }
    .hp-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .hp-provinces { grid-template-columns: repeat(2, 1fr); grid-template-rows: unset; }
    .hp-prov { grid-column: unset !important; grid-row: unset !important; aspect-ratio: 16 / 9 !important; }
}
@media (max-width: 520px) {
    .hp-hero { padding: 48px 16px 60px; }
    .hp-section { padding: 36px 0; }
    .hp-section__title { font-size: 18px; }
    .hp-provinces { grid-template-columns: 1fr 1fr; gap: 8px; }
    .hp-prov__name { font-size: 16px; }
}
