/* ==================================================================
   Строители и инвеститори - каталог (builders.html) и страница на
   строителя (view_builder.html). Работи и в базовата тема, и в Clarity:
   цветовете идват от токените на Clarity, с резервни стойности.
================================================================== */
.bp {
  --bp-accent: var(--accent, var(--brand-accent, #c8743c));
  --bp-accent-soft: color-mix(in srgb, var(--bp-accent) 9%, #ffffff);
  --bp-ink: var(--ink, #1f1b2d);
  --bp-ink-2: var(--ink-2, #4b5560);
  --bp-ink-3: var(--ink-3, #8795a0);
  --bp-line: var(--line, #e6eaed);
  --bp-paper-2: var(--paper-2, #f7f8f9);
  --bp-radius: var(--radius-lg, 16px);
  --bp-shadow: 0 1px 2px rgba(16, 24, 32, .05), 0 18px 40px -28px rgba(16, 24, 32, .5);
  padding-top: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(40px, 6vw, 88px);
  color: var(--bp-ink);
}
.bp a { text-decoration: none; }
.bp .material-icons-outlined { font-size: 1.15em; vertical-align: -.18em; }

/* ---- шапка ---- */
.bp-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: .86rem; color: var(--bp-ink-3); }
.bp-crumbs li + li::before { content: '/'; margin-right: 6px; color: var(--bp-line); }
.bp-crumbs a { color: var(--bp-ink-3); }
.bp-crumbs a:hover { color: var(--bp-accent); }
.bp-eyebrow { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--bp-accent); }
.bp-title { margin: 0 0 14px; font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); line-height: 1.05; letter-spacing: -.02em; }
.bp-lead { max-width: 640px; margin: 0; font-size: 1.08rem; line-height: 1.6; color: var(--bp-ink-2); }

/* ---- избор в каталога: по азбука / по градове / по държави ---- */
.bp-pick { display: grid; gap: 12px; margin-top: clamp(22px, 3vw, 34px); scroll-margin-top: calc(var(--header-h, 0px) + 20px); }
.bp-acc__h { margin: 0; font-size: inherit; }
.bp-acc__head { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--bp-accent); color: #fff; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; transition: background .15s ease; }
.bp-acc__head:hover { background: color-mix(in srgb, var(--bp-accent) 88%, #000); }
.bp-acc__head:focus-visible { outline: 3px solid color-mix(in srgb, var(--bp-accent) 40%, transparent); outline-offset: 2px; }
.bp-acc__head .material-icons-outlined { transition: transform .2s ease; }
.bp-acc__head[aria-expanded="false"] .material-icons-outlined { transform: rotate(-90deg); }
.bp-acc__body { padding-top: 12px; }
.bp-acc__body[hidden] { display: none !important; }
.bp-acc__body--chips { display: flex; flex-wrap: wrap; gap: 8px; }

.bp-abc { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-abc + .bp-abc { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--bp-line); }
.bp-abc__btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 40px; border-radius: 8px; background: var(--bp-paper-2);
  color: var(--bp-ink); font-weight: 700; font-size: .95rem; text-decoration: none !important; transition: background .15s ease, color .15s ease; }
a.bp-abc__btn:hover { background: var(--bp-accent-soft); color: var(--bp-accent); }
a.bp-abc__btn.is-on { background: var(--bp-accent); color: #fff; }
a.bp-abc__btn:focus-visible { outline: 2px solid var(--bp-accent); outline-offset: 2px; }
.bp-abc__btn.is-empty { color: var(--bp-ink-3); opacity: .45; cursor: default; }

.bp-acc__picked { font-weight: 600; opacity: .9; }
/* списъкът с градовете виси под лентата "По градове" - като падащо меню */
.bp-acc--city { position: relative; }
.bp-acc__body--list { padding-top: 0; }
.bp-acc__body--list .bp-select__panel { border-top: 1px solid var(--bp-accent); border-radius: 0 0 10px 10px; margin-top: -4px; padding-top: 10px; }
.bp-acc--city .bp-acc__head[aria-expanded="true"] { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.bp-select { position: relative; }
.bp-select__toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--bp-line);
  border-radius: 10px; background: #fff; color: var(--bp-ink-2); font: inherit; font-size: .95rem; text-align: left; cursor: pointer; }
.bp-select__toggle[aria-expanded="true"] { border-color: var(--bp-accent); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.bp-select__toggle[aria-expanded="true"] .material-icons-outlined { transform: rotate(180deg); }
.bp-select__panel { max-height: 360px; overflow: auto; padding: 8px 6px; border: 1px solid var(--bp-accent); border-top: 0; border-radius: 0 0 10px 10px; background: var(--bp-paper-2); }
.bp-select__panel[hidden] { display: none !important; }
.bp-check { display: flex !important; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--bp-ink-2); font-size: .95rem; }
.bp-check:hover { background: #fff; }
.bp-check input { width: 18px; height: 18px; accent-color: var(--bp-accent); flex: 0 0 auto; }
.bp-check b { color: var(--bp-ink); }

.bp-pick__status { display: flex; align-items: center; gap: 12px; margin: 2px 0 0; color: var(--bp-ink-3); font-size: .9rem; }
.bp-pick__status #bpShown { font-weight: 800; color: var(--bp-ink); }
.bp-pick__clear { border: 0; background: none; padding: 0; color: var(--bp-accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.bp-card[hidden], .bp-group[hidden], .bp-empty[hidden] { display: none !important; }

/* ---- филтри на каталога: държава и град ---- */
.bp-filters { display: grid; gap: 10px; margin-top: clamp(22px, 3vw, 34px); scroll-margin-top: calc(var(--header-h, 0px) + 20px); }
.bp-filters .bp-filter { margin: 0; }
.bp-filter__label { font-size: .88rem; font-weight: 700; color: var(--bp-ink-3); min-width: 74px; }
.bp-card__cities { display: flex; align-items: center; gap: 4px; margin: -4px 0 0; font-size: .85rem; font-weight: 600; color: var(--bp-ink-2); }
.bp-card__cities .material-icons-outlined { color: var(--bp-accent); font-size: 1rem; }

/* ---- азбука ---- */
.bp-az { position: sticky; top: var(--header-h, 0px); z-index: 20; margin: clamp(26px, 4vw, 44px) 0 8px; padding: 10px 0;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bp-line); }
.bp-az ul { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.bp-az a { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 10px;
  font-weight: 700; color: var(--bp-ink-2); transition: background .15s ease, color .15s ease; }
.bp-az a:hover, .bp-az a:focus-visible { background: var(--bp-accent-soft); color: var(--bp-accent); outline: none; }
.bp-az__count { margin-left: auto; align-self: center; font-size: .86rem; color: var(--bp-ink-3); white-space: nowrap; }

/* ---- група по буква ---- */
.bp-group { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 28px; padding: clamp(22px, 3vw, 34px) 0; border-bottom: 1px solid var(--bp-line);
  scroll-margin-top: calc(var(--header-h, 0px) + 70px); }
.bp-group:last-child { border-bottom: 0; }
.bp-letter { margin: 0; font-size: clamp(2.6rem, 2rem + 2vw, 4rem); line-height: .9; font-weight: 800; color: var(--bp-accent); opacity: .9; }
.bp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }

/* ---- карта на строител ---- */
.bp-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--bp-line); border-radius: var(--bp-radius);
  background: #fff; color: var(--bp-ink); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.bp-card:hover { transform: translateY(-3px); box-shadow: var(--bp-shadow); border-color: transparent; color: var(--bp-ink); text-decoration: none; }
.bp-card:focus-visible { outline: 2px solid var(--bp-accent); outline-offset: 3px; }
.bp-card__top { display: flex; align-items: center; gap: 14px; }
.bp-logo { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 14px; background: var(--bp-paper-2); display: flex; align-items: center; justify-content: center; padding: 10px; overflow: hidden; }
.bp-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bp-logo--empty { font-size: 2rem; font-weight: 800; color: var(--bp-ink-3); }
.bp-card__name { margin: 0; font-size: 1.12rem; line-height: 1.25; font-weight: 700; }
.bp-card__kind { display: block; margin-top: 3px; font-size: .8rem; color: var(--bp-ink-3); }
.bp-card__text { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--bp-ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bp-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--bp-line); font-size: .88rem; }
.bp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bp-accent-soft); color: var(--bp-accent); font-weight: 700; }
.bp-chip--muted { background: var(--bp-paper-2); color: var(--bp-ink-3); font-weight: 600; }
.bp-card__go { color: var(--bp-accent); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.bp-card:hover .bp-card__go .material-icons-outlined { transform: translateX(3px); }
.bp-card__go .material-icons-outlined { transition: transform .2s ease; }

.bp-empty { margin-top: 32px; padding: clamp(32px, 6vw, 64px); border: 1px dashed var(--bp-line); border-radius: var(--bp-radius); text-align: center; color: var(--bp-ink-2); }
.bp-empty .material-icons-outlined { display: block; margin: 0 auto 10px; font-size: 3rem; color: var(--bp-ink-3); }
.bp-notice { margin: 0 0 20px; padding: 12px 16px; border-radius: 12px; background: var(--bp-paper-2); color: var(--bp-ink-2); }

/* ---- страница на строителя ---- */
.bp-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center;
  padding: clamp(22px, 3.5vw, 40px); border-radius: calc(var(--bp-radius) + 6px);
  background: linear-gradient(135deg, var(--bp-accent-soft), #ffffff 62%); border: 1px solid var(--bp-line); }
.bp-hero .bp-logo { width: clamp(120px, 14vw, 180px); height: clamp(120px, 14vw, 180px); padding: 16px; background: #fff; border-radius: 20px; box-shadow: var(--bp-shadow); }
.bp-hero .bp-title { margin-bottom: 12px; }
.bp-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 20px; color: var(--bp-ink-2); }
.bp-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bp-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; font-weight: 700; border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
.bp-btn:active { transform: translateY(1px); }
.bp-btn--primary { background: var(--bp-accent); color: #fff; }
.bp-btn--primary:hover { background: color-mix(in srgb, var(--bp-accent) 85%, #000); color: #fff; }
.bp-btn--ghost { background: #fff; color: var(--bp-ink); border-color: var(--bp-line); }
.bp-btn--ghost:hover { border-color: var(--bp-accent); color: var(--bp-accent); }
.bp-btn:focus-visible { outline: 2px solid var(--bp-accent); outline-offset: 3px; }

.bp-about { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 820px; margin: clamp(30px, 5vw, 56px) 0 0; }
.bp-about h2, .bp-offers__head h2 { margin: 0 0 14px; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.bp-richtext { font-size: 1.04rem; line-height: 1.75; color: var(--bp-ink-2); }
.bp-richtext p { margin: 0 0 1em; }
.bp-richtext img { max-width: 100%; height: auto; border-radius: 12px; }
.bp-richtext a { color: var(--bp-accent); text-decoration: underline; text-underline-offset: 3px; }

.bp-offers { margin-top: clamp(36px, 6vw, 64px); scroll-margin-top: calc(var(--header-h, 0px) + 20px); }
.bp-offers__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 20px; }
.bp-offers__head h2 { margin: 0; }
.bp-offers__head a { font-weight: 700; color: var(--bp-accent); }

/* ---- бутони: акцентен (CTA към чата) и само с икона ---- */
.bp-btn--accent { background: var(--bp-ink); color: #fff; }
.bp-btn--accent:hover { background: color-mix(in srgb, var(--bp-ink) 82%, var(--bp-accent)); color: #fff; }
.bp-btn--icon { width: 46px; padding: 0; justify-content: center; font-size: 1.15rem; }

.bp-hero__stat { display: inline-flex; align-items: center; gap: 6px; font-size: .95rem; }
.bp-hero__stat b { color: var(--bp-ink); }

/* ---- градове: бутони в героя и филтър над офертите ---- */
.bp-cities, .bp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bp-cities { margin: -6px 0 20px; }
.bp-cities__label { font-size: .88rem; color: var(--bp-ink-3); margin-right: 2px; }
.bp-filter { margin: -4px 0 22px; }
.bp-city { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--bp-line);
  background: #fff; color: var(--bp-ink-2); font-size: .9rem; font-weight: 600; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.bp-city .material-icons-outlined { font-size: 1.05rem; color: var(--bp-accent); }
.bp-city:hover { border-color: var(--bp-accent); color: var(--bp-accent); text-decoration: none; }
.bp-city.is-on { background: var(--bp-accent); border-color: var(--bp-accent); color: #fff; }
.bp-city.is-on .material-icons-outlined { color: #fff; }
.bp-city:focus-visible { outline: 2px solid var(--bp-accent); outline-offset: 2px; }

/* ---- средни цени ---- */
.bp-stats { margin-top: clamp(36px, 6vw, 64px); padding: clamp(22px, 3.5vw, 36px); border-radius: calc(var(--bp-radius) + 6px); background: var(--bp-paper-2); }
.bp-stats h2 { margin: 0 0 6px; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.bp-stats__lead { margin: 0 0 22px; color: var(--bp-ink-3); font-size: .92rem; }
.bp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.bp-kpi { margin: 0; padding: 18px 20px; border-radius: var(--bp-radius); background: #fff; border: 1px solid var(--bp-line); }
.bp-kpi dt { font-size: .82rem; font-weight: 600; color: var(--bp-ink-3); text-transform: uppercase; letter-spacing: .06em; }
.bp-kpi dd { margin: 6px 0 0; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); font-weight: 800; color: var(--bp-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.bp-kpi dd small { font-size: .55em; font-weight: 600; color: var(--bp-ink-3); }
.bp-kpi--main { background: var(--bp-accent); border-color: var(--bp-accent); }
.bp-kpi--main dt, .bp-kpi--main dd, .bp-kpi--main dd small { color: #fff; }
.bp-table-wrap { margin-top: 18px; overflow-x: auto; border-radius: var(--bp-radius); border: 1px solid var(--bp-line); background: #fff; }
.bp-table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.bp-table th, .bp-table td { padding: 12px 16px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--bp-line); }
.bp-table th:first-child { text-align: left; white-space: normal; }
.bp-table thead th { font-size: .78rem; font-weight: 700; color: var(--bp-ink-3); text-transform: uppercase; letter-spacing: .05em; background: #fff; }
.bp-table tbody tr:last-child th, .bp-table tbody tr:last-child td { border-bottom: 0; }
.bp-table tbody th { font-weight: 600; color: var(--bp-ink); }

.bp-about--bottom { margin-top: clamp(30px, 5vw, 52px); }

/* ---- видео (над офертите) ---- */
.bp-video { margin-top: clamp(30px, 5vw, 52px); }
.bp-video h2, .bp-gallery h2 { margin: 0 0 14px; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.bp-video__frame { position: relative; aspect-ratio: 16 / 9; max-width: 960px; border-radius: var(--bp-radius); overflow: hidden; background: #000; box-shadow: var(--bp-shadow); }
.bp-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- галерия (най-долу) ---- */
.bp-gallery { margin-top: clamp(36px, 6vw, 64px); }
.bp-gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.bp-gallery__item { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--bp-paper-2); }
.bp-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.bp-gallery__item:hover img { transform: scale(1.04); }
.bp-gallery__item:focus-visible { outline: 2px solid var(--bp-accent); outline-offset: 3px; }
/* ---- любими: сърцето върху картата ---- */
.bp-card__link { color: inherit; text-decoration: none; }
.bp-card__link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.bp-card__link:hover { color: inherit; text-decoration: none; }
.bp-card:has(.bp-card__link:focus-visible) { outline: 2px solid var(--bp-accent); outline-offset: 3px; }
.bp-card--fav .bp-card__top { padding-right: 32px; }
.bp-fav { position: absolute; z-index: 3; top: 10px; right: 10px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--bp-line); border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--bp-ink-2); cursor: pointer; transition: transform .15s ease, color .15s ease; }
.bp-fav .material-icons-outlined { font-size: 20px; }
.bp-fav:hover { transform: scale(1.08); color: #d6336c; }
.bp-fav:focus-visible { outline: 2px solid var(--bp-accent); outline-offset: 2px; }
.bp-fav.is-active, .bp-fav-wide.is-active { color: #d6336c; }
.bp-fav-wide { cursor: pointer; }
[data-cat-fav][hidden] { display: none !important; }
.ct-fav-catalog { padding: 0; margin-top: 26px; max-width: none; }
.ct-fav-group + .ct-fav-group { margin-top: 30px; }
.ct-fav-group .bp-letter { position: static; margin: 0 0 14px; font-size: 1.35rem; line-height: 1.2; }

@media (max-width: 575.98px) { .bp-gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 6px; } }

/* ---- визитка на отговорния брокер ---- */
.bp-contact { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 3vw, 28px); align-items: center; margin-top: clamp(36px, 6vw, 64px);
  padding: clamp(20px, 3.5vw, 32px); border-radius: calc(var(--bp-radius) + 6px); border: 1px solid var(--bp-line); background: #fff; box-shadow: var(--bp-shadow);
  scroll-margin-top: calc(var(--header-h, 0px) + 20px); }
.bp-contact__photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--bp-accent-soft); }
.bp-contact h2 { margin: 0 0 6px; font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); }
.bp-contact h2 a { color: var(--bp-ink); }
.bp-contact__lead { margin: 0 0 16px; color: var(--bp-ink-2); }

@media (max-width: 767.98px) {
  .bp-contact { grid-template-columns: 1fr; }
  .bp-table th, .bp-table td { padding: 10px 12px; }
  .bp-group { grid-template-columns: 1fr; }
  .bp-letter { font-size: 2.4rem; }
  .bp-az__count { display: none; }
  .bp-hero { grid-template-columns: 1fr; text-align: left; }
  .bp-cards { grid-template-columns: 1fr; }
}
/* таблицата с цените на тесен екран: всеки тип имот става карта */
@media (max-width: 639.98px) {
  .bp-table-wrap { overflow: visible; border: 0; background: transparent; }
  .bp-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bp-table, .bp-table tbody, .bp-table tr, .bp-table th, .bp-table td { display: block; }
  .bp-table tr { margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--bp-line); border-radius: var(--bp-radius); background: #fff; }
  .bp-table tbody th { padding: 0 0 6px; border: 0; font-size: 1rem; }
  .bp-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; }
  .bp-table td::before { content: attr(data-label); color: var(--bp-ink-3); font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bp-card, .bp-card__go .material-icons-outlined, .bp-btn { transition: none; }
  .bp-card:hover { transform: none; }
}
