/* =========================================================
   KB AI Real Estate – Frontend Styles
   ========================================================= */

/* ---- Wrapper ---- */
.kb-ai-re-wrap,
.kb-ai-re-detail-wrap {
    font-family: inherit;
    line-height: 1.5;
}

/* Detail page: breathing room from theme page title / entry header */
.kb-ai-re-detail-wrap {
    margin-top: 1.75rem;
    margin-bottom: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}

/* ---- Buttons ---- */
.kb-ai-re-btn-primary {
    display: inline-block;
    background: #2563eb;
    color: #fff !important;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}
.kb-ai-re-btn-primary:hover { background: #1d4ed8; }

/* ---- Filter bar ---- */
.kb-ai-re-filter-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 28px;
}
.kb-ai-re-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.kb-ai-re-filter-row input,
.kb-ai-re-filter-row select {
    flex: 1 1 150px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    min-width: 120px;
}
.kb-ai-re-amenities-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.kb-ai-re-amenity-check {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
}
.kb-ai-re-amenity-check input { margin: 0; }

/* ---- Count line ---- */
.kb-ai-re-count { color: #64748b; font-size: 14px; margin-bottom: 16px; }

/* ---- Property grid ---- */
.kb-ai-re-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ---- Property card ---- */
.kb-ai-re-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .2s, transform .2s;
}
.kb-ai-re-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

/* card image */
.kb-ai-re-card-img { position: relative; height: 200px; overflow: hidden; background: #f1f5f9; }
.kb-ai-re-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-ai-re-card-no-img { display: flex; align-items: center; justify-content: center; height: 100%; color: #94a3b8; }
.kb-ai-re-card-no-img .dashicons { font-size: 48px; width: 48px; height: 48px; }

/* status badge */
.kb-ai-re-badge {
    position: absolute;
    top: 10px; left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}
.kb-ai-re-badge-for_sale  { background: #16a34a; }
.kb-ai-re-badge-for_rent  { background: #2563eb; }
.kb-ai-re-badge-sold      { background: #dc2626; }
.kb-ai-re-badge-featured  { background: #f59e0b; top: 10px; left: auto; right: 10px; }

/* card body */
.kb-ai-re-card-body { padding: 16px; }
.kb-ai-re-card-title { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.kb-ai-re-card-title a { color: inherit; text-decoration: none; }
.kb-ai-re-card-title a:hover { color: #2563eb; }
.kb-ai-re-card-location { font-size: 13px; color: #64748b; margin: 0 0 8px; display: flex; align-items: center; gap: 4px; }
.kb-ai-re-card-price { font-size: 20px; font-weight: 800; color: #2563eb; margin: 0 0 10px; }
.kb-ai-re-card-price small { font-size: 12px; font-weight: 400; color: #64748b; }
.kb-ai-re-card-specs { display: flex; gap: 12px; font-size: 13px; color: #475569; margin-bottom: 14px; flex-wrap: wrap; }
.kb-ai-re-card-specs span { display: flex; align-items: center; gap: 4px; }
.kb-ai-re-details-btn { width: 100%; text-align: center; }

/* ---- No results ---- */
.kb-ai-re-no-results { color: #64748b; padding: 40px; text-align: center; grid-column: 1 / -1; }

/* =========================================================
   Single Property Detail Page
   ========================================================= */

/* Breadcrumb: clear separation from theme title + listing link */
.kb-ai-re-breadcrumb {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    line-height: 1.6;
}
.kb-ai-re-breadcrumb a { color: #2563eb; text-decoration: none; }
.kb-ai-re-breadcrumb a:hover { text-decoration: underline; }
.kb-ai-re-breadcrumb span { margin: 0 6px; }

/* Header: title, location, price with comfortable rhythm */
.kb-ai-re-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.kb-ai-re-detail-header > div:first-child {
    flex: 1 1 280px;
    min-width: 0;
}

.kb-ai-re-detail-title {
    font-size: clamp(1.5rem, 4vw, 1.85rem);
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.kb-ai-re-detail-location {
    font-size: 15px;
    color: #64748b;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0 0 0.25rem;
    line-height: 1.5;
}
.kb-ai-re-detail-location .dashicons {
    flex-shrink: 0;
    margin-top: 2px;
}

.kb-ai-re-detail-price-block {
    text-align: right;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.kb-ai-re-detail-price {
    display: block;
    font-size: clamp(1.5rem, 3.5vw, 1.875rem);
    font-weight: 800;
    color: #2563eb;
    line-height: 1.2;
    margin: 0;
}

/* Price row badge (not absolutely positioned here) */
.kb-ai-re-detail-price-block .kb-ai-re-badge {
    position: static;
    display: inline-block;
}

@media (max-width: 600px) {
    .kb-ai-re-detail-price-block {
        text-align: left;
        align-items: flex-start;
        width: 100%;
    }
}

/* two-column layout */
.kb-ai-re-detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 900px) {
    .kb-ai-re-detail-layout { grid-template-columns: 1fr; }
}

/* Featured image: gap from header, rounded hero */
.kb-ai-re-detail-main {
    min-width: 0;
}

.kb-ai-re-detail-featured-img {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    max-height: 520px;
    min-height: 240px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.kb-ai-re-detail-featured-img img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    display: block;
    vertical-align: middle;
}

.kb-ai-re-detail-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 1.75rem;
}
.kb-ai-re-detail-gallery a img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* video */
.kb-ai-re-detail-video { margin-bottom: 1.75rem; }
.kb-ai-re-detail-video h3 { margin-top: 0; }
.kb-ai-re-detail-video iframe {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: 10px;
}

/* sections */
.kb-ai-re-detail-section { margin-bottom: 2.25rem; }
.kb-ai-re-detail-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin: 0 0 1rem;
    line-height: 1.35;
}

.kb-ai-re-detail-description {
    font-size: 15px;
    line-height: 1.65;
    color: #334155;
}
.kb-ai-re-detail-description p { margin: 0 0 1em; }
.kb-ai-re-detail-description p:last-child { margin-bottom: 0; }

/* specs grid */
.kb-ai-re-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.kb-ai-re-spec-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}
.kb-ai-re-spec-item span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

/* amenities */
.kb-ai-re-amenities-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.kb-ai-re-amenities-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}
.kb-ai-re-amenities-list li .dashicons { color: #16a34a; }

/* map */
.kb-ai-re-map { border-radius: 10px; overflow: hidden; border: 1px solid #e2e8f0; }
.kb-ai-re-map iframe { width: 100%; height: 320px; border: none; display: block; }

/* ---- Sidebar ---- */
.kb-ai-re-detail-sidebar { display: flex; flex-direction: column; gap: 24px; }

/* sidebar boxes */
.kb-ai-re-agent-card,
.kb-ai-re-inquiry-form,
.kb-ai-re-chatbot-embed,
.kb-ai-re-sidebar-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
}
.kb-ai-re-agent-card h3,
.kb-ai-re-inquiry-form h3,
.kb-ai-re-chatbot-embed h3,
.kb-ai-re-sidebar-box h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
    line-height: 1.3;
}

/* form feedback messages */
.kb-ai-re-form-msg {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: none;
}
.kb-ai-re-form-msg.success { background: #dcfce7; color: #166534; display: block; }
.kb-ai-re-form-msg.error   { background: #fee2e2; color: #991b1b; display: block; }

.kb-ai-re-agent-name { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.kb-ai-re-agency { font-size: 13px; color: #64748b; margin: 0 0 10px; }
.kb-ai-re-agent-card p { margin: 0 0 8px; }
.kb-ai-re-agent-card p:last-of-type { margin-bottom: 0; }
.kb-ai-re-agent-card p a {
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.kb-ai-re-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25d366;
    color: #fff !important;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 10px;
}
.kb-ai-re-whatsapp-btn:hover { background: #128c7e; }

/* inquiry form */
.kb-ai-re-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
    display: block;
}
#kb-re-inquiry-msg { margin-bottom: 10px; font-size: 14px; }
#kb-re-inquiry-msg.success { color: #16a34a; }
#kb-re-inquiry-msg.error   { color: #dc2626; }

/* chatbot embed */
.kb-ai-re-chatbot-note { font-size: 13px; color: #64748b; margin: 0 0 12px; }
