/* ─── Single Property Template ────────────────────────────────────────────── */

/* ── Wrap / layout ──────────────────────────────────────────────────────────── */
.sp-wrap {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────────── */
.sp-breadcrumb-bar {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    padding: 10px 0;
}
.sp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6B7280;
    flex-wrap: wrap;
}
.sp-breadcrumb a { color: #374151; }
.sp-breadcrumb a:hover { color: var(--bds-primary, #312E8D); }
.sp-breadcrumb__current { color: #9CA3AF; }

/* ── Main body ──────────────────────────────────────────────────────────────── */
.sp-body { padding: 24px 0 48px; }

.sp-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

/* ── Gallery ────────────────────────────────────────────────────────────────── */
.sp-gallery {
    border-radius: 14px;
    overflow: hidden;
    background: #F3F4F6;
    margin-bottom: 20px;
    cursor: pointer;
}
.sp-gallery__grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 200px 200px;
    gap: 3px;
}
.sp-gallery__main {
    grid-row: 1 / 3;
}
.sp-gallery__item {
    position: relative;
    overflow: hidden;
    background: #E5E7EB;
    display: block;
}
.sp-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.sp-gallery__item:hover img { transform: scale(1.04); }
.sp-gallery__item--more { position: relative; }
.sp-gallery__more-badge {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    gap: 4px;
    text-decoration: none;
    cursor: pointer;
}
.sp-gallery__more-badge svg { opacity: .9; }
.sp-gallery__no-image {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    background: #F3F4F6;
}

/* Hidden Fancybox gallery links */
.sp-gallery__hidden { display: none; }

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

/* ── Tab panels ─────────────────────────────────────────────────────────────── */
.sp-panel { display: none; }
.sp-panel.is-active { display: block; }

/* ── Overview panel ─────────────────────────────────────────────────────────── */
.sp-overview { }

.sp-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.sp-title {
    flex: 1;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin: 0;
}
.sp-save-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1.5px solid #D1D5DB;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9CA3AF;
    transition: border-color .15s, color .15s;
    margin-top: 2px;
}
.sp-save-btn:hover { border-color: #EF4444; color: #EF4444; }

.sp-address {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 16px;
}
.sp-address svg { flex-shrink: 0; color: #9CA3AF; }

.sp-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.sp-price {
    font-size: 26px;
    font-weight: 800;
    color: #EB5C23;
}
.sp-price-unit { font-size: 16px; font-weight: 600; color: #EB5C23; }
.sp-price-meta {
    font-size: 13px;
    color: #6B7280;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sp-price-meta span { display: flex; align-items: center; gap: 3px; }

.sp-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 0;
}
.sp-spec {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    min-width: 0;
}
.sp-spec__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--bds-primary-light, #EEF2FF);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bds-primary, #312E8D);
}
.sp-spec__label {
    font-size: 11px;
    color: #9CA3AF;
    margin-bottom: 2px;
}
.sp-spec__value {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Description panel ──────────────────────────────────────────────────────── */
.sp-description {
    font-size: 14.5px;
    line-height: 1.8;
    color: #374151;
    white-space: pre-wrap;
}

/* ── Map panel ──────────────────────────────────────────────────────────────── */
.sp-map-wrap {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: #F3F4F6;
}
.sp-map-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
.sp-map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #9CA3AF;
    font-size: 14px;
}

/* ── Suggestions panel (BĐS dành cho bạn) ──────────────────────────────────── */
.sp-suggest-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sp-sidebar {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sp-agent-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
}
.sp-agent__avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    background: var(--bds-primary-light, #EEF2FF);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sp-agent__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sp-agent__initials {
    font-size: 26px;
    font-weight: 700;
    color: var(--bds-primary, #312E8D);
}
.sp-agent__name {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}
.sp-agent__meta {
    font-size: 12px;
    color: #9CA3AF;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.sp-agent__phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: var(--bds-primary, #312E8D);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}
.sp-agent__phone:hover { background: #3d3bab; }
.sp-agent__phone-reveal {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: #F0FDF4;
    border: 1.5px solid #16A34A;
    color: #15803D;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 8px;
    justify-content: center;
}

/* Sidebar listing cards */
.sp-sidebar-listings { }
.sp-sidebar-listings__title {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bds-primary, #312E8D);
    display: inline-block;
}

/* ── Listing card (reused in all sections) ──────────────────────────────────── */
.sp-lcard {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
}
.sp-lcard:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }
.sp-lcard__img-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #E5E7EB;
    flex-shrink: 0;
}
.sp-lcard__img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; display: block; }
.sp-lcard:hover .sp-lcard__img { transform: scale(1.04); }
.sp-lcard__no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D1D5DB;
}
.sp-lcard__badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
}
.sp-lcard__count {
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 11px;
    border-radius: 5px;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.sp-lcard__date {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 10px;
    border-radius: 4px;
    padding: 2px 6px;
}
.sp-lcard__body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sp-lcard__type {
    font-size: 11px;
    color: #6B7280;
    background: #F3F4F6;
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-block;
    width: fit-content;
}
.sp-lcard__title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.sp-lcard__price {
    font-size: 14px;
    font-weight: 700;
    color: #EB5C23;
    margin-top: auto;
}
.sp-lcard__meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #6B7280;
    flex-wrap: wrap;
}
.sp-lcard__meta span { display: flex; align-items: center; gap: 3px; }
.sp-lcard__location { display: flex; align-items: center; gap: 3px; font-size: 11px; color: #9CA3AF; }

/* Sidebar tiny card (horizontal) */
.sp-lcard--sm {
    flex-direction: row;
    gap: 0;
}
.sp-lcard--sm .sp-lcard__img-wrap {
    width: 72px;
    height: 72px;
    aspect-ratio: unset;
    flex-shrink: 0;
}
.sp-lcard--sm .sp-lcard__body { padding: 8px 10px; }
.sp-lcard--sm .sp-lcard__title { font-size: 12px; -webkit-line-clamp: 2; }
.sp-lcard--sm .sp-lcard__price { font-size: 13px; }

/* ── Bottom sections ─────────────────────────────────────────────────────────── */
.sp-section {
    padding: 28px 0 0;
}
.sp-section__title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--bds-primary, #312E8D);
}
.sp-section__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.sp-section__grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sp-layout { grid-template-columns: 1fr; }
    .sp-sidebar { position: static; }
    .sp-specs { grid-template-columns: repeat(2, 1fr); }
    .sp-gallery__grid { grid-template-rows: 160px 160px; }
    .sp-section__grid { grid-template-columns: repeat(2, 1fr); }
    .sp-suggest-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .sp-specs { grid-template-columns: 1fr 1fr; }
    .sp-gallery__grid { grid-template-columns: 1fr; grid-template-rows: 220px; }
    .sp-gallery__main { grid-row: auto; }
    .sp-gallery__item--sm { display: none; }
    .sp-section__grid { grid-template-columns: 1fr 1fr; }
    .sp-section__grid--2 { grid-template-columns: 1fr; }
    .sp-price { font-size: 22px; }
    .sp-title { font-size: 17px; }
}

/* ── Splide slider (property sections) ──────────────────────────────────────── */
.sp-section .splide {
    position: relative;
    padding: 0 4px;
    overflow: visible;
}
.sp-section .splide__track { overflow: hidden; border-radius: 4px; }
.sp-section .splide__list { display: flex; }
.sp-section .splide__slide { flex-shrink: 0; box-sizing: border-box; }

.splide__arrows {}
.splide__arrow {
    align-items: center;
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    cursor: pointer;
    display: flex;
    height: 36px;
    justify-content: center;
    opacity: 1;
    padding: 0;
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    width: 36px;
    z-index: 2;
    transition: background .15s, border-color .15s, opacity .15s;
}
.splide__arrow--prev { left: -14px; }
.splide__arrow--next { right: -14px; }
.splide__arrow:disabled { opacity: .3; cursor: default; pointer-events: none; }
.splide__arrow:not(:disabled):hover { background: var(--bds-primary, #312E8D); border-color: var(--bds-primary, #312E8D); }
.splide__arrow svg {
    fill: #374151;
    width: 16px;
    height: 16px;
    transition: fill .15s;
    display: block;
}
.splide__arrow--prev svg { transform: scaleX(-1); }
.splide__arrow:not(:disabled):hover svg { fill: #fff; }
