/* Здания и ТЦ Беларуси — Чистый Кит (kitt.by/budynki/)
   Modern Web Guidance compliance: accessibility, responsive-table, tabs, defer-rendering-heavy-content, zero emojis. */

@property --fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.bw-skip {
  position: fixed;
  left: -9999px;
  top: 12px;
  z-index: 200;
}
.bw-skip:focus,
.bw-skip:focus-visible {
  left: 16px;
  top: 12px;
  background: #fff;
  color: #000;
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid #2457c6;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.bw :focus-visible,
.bw input[type="search"]:focus-visible,
.bw button:focus-visible,
.bw a:focus-visible,
.bw select:focus-visible,
.bw summary:focus-visible,
.bw [tabindex="0"]:focus-visible {
  outline: 3px solid #2457c6 !important;
  outline-offset: 3px !important;
}

.bw h1[tabindex="-1"]:focus {
  outline: none;
}

/* Minimum 24x24 CSS px interactive target size (WCAG 2.5.8) */
.bw :where(a, button, summary, select, input:not([type="checkbox"], [type="radio"])) {
  min-block-size: 24px;
  min-inline-size: 24px;
}

.bw input[type="search"],
.bw input[type="text"],
.bw select {
  font-size: max(1rem, 1em);
}

canvas[data-sn-canvas3d] {
  touch-action: pan-y;
}

/* Strictly below-the-fold heavy section rendering deferral */
.bw-deferred-sec {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 280px;
}

/* Container-queried accessible responsive data table */
.bw-table-wrap {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 80vh);
  container-type: inline-size;
  border: 1px solid var(--cw99-line, #e9e9e9);
  border-radius: 12px;
  background: #fff;
}

.bw-table-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.bw-table-wrap caption {
  text-align: left;
  padding: 12px 16px 10px;
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
  background: #f8fafc;
  border-block-end: 1px solid #e2e8f0;
}

.bw-table-wrap thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: #f8fafc;
}

.bw-table-wrap th,
.bw-table-wrap td {
  padding: 10px 14px;
  text-align: left;
  border-block-end: 1px solid #eef2f6;
  font-size: 14.5px;
  line-height: 1.4;
  vertical-align: top;
}

.bw-table-wrap tbody tr:last-child th,
.bw-table-wrap tbody tr:last-child td {
  border-block-end: 0;
}

.bw-table-wrap thead th {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  font-weight: 700;
  background: #f8fafc;
  white-space: nowrap;
}

.bw-table-wrap tbody th[scope="row"] {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: #fff;
  font-weight: 600;
  color: #0f172a;
}

@container (width < 600px) {
  .bw-table-wrap table,
  .bw-table-wrap thead,
  .bw-table-wrap tbody,
  .bw-table-wrap tr,
  .bw-table-wrap th,
  .bw-table-wrap td {
    display: block;
  }

  .bw-table-wrap thead {
    display: none;
  }

  .bw-table-wrap tbody tr {
    margin: 10px;
    border: 1px solid #dce3ee;
    border-radius: 10px;
    background: #fff;
  }

  .bw-table-wrap tbody th[scope="row"] {
    position: sticky;
    inset-block-start: 0;
    inset-inline-start: auto;
    z-index: 2;
    background: #f1f5f9;
    border-block-end: 1px solid #e2e8f0;
  }

  .bw-table-wrap td:nth-child(2)::before { content: var(--label-2, "") ": "; font-weight: 600; color: #475569; }
  .bw-table-wrap td:nth-child(3)::before { content: var(--label-3, "") ": "; font-weight: 600; color: #475569; }
  .bw-table-wrap td:nth-child(4)::before { content: var(--label-4, "") ": "; font-weight: 600; color: #475569; }
  .bw-table-wrap td:nth-child(5)::before { content: var(--label-5, "") ": "; font-weight: 600; color: #475569; }
  .bw-table-wrap td:nth-child(6)::before { content: var(--label-6, "") ": "; font-weight: 600; color: #475569; }
}

/* Single-row horizontal scrolling filter tabs with non-color-only active indicator */
.mw-tabs-row,
.by-tabs-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  gap: 8px;
  padding-block: 4px 8px;
  scroll-snap-type: inline proximity;
  scroll-padding-inline: 2.5rem;
  scrollbar-width: thin;
  --fade-size: 2.2rem;
  --fade-dir: right;
  --fade-start-pos: 0;
  --fade-end-pos: 100%;
}

@supports (animation-timeline: scroll()) {
  .mw-tabs-row,
  .by-tabs-row {
    mask:
      linear-gradient(black, black) no-clip subtract,
      linear-gradient(to var(--fade-dir), black, transparent) var(--fade-start-pos) 0 / var(--fade-start) 100% no-repeat no-clip,
      linear-gradient(to var(--fade-dir), transparent, black) var(--fade-end-pos) 0 / var(--fade-end) 100% no-repeat no-clip;
    animation: by-reveal-fade-start linear both, by-hide-fade-end linear both;
    animation-timeline: scroll(self inline);
    animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
  }
}

@keyframes by-reveal-fade-start {
  to { --fade-start: var(--fade-size); }
}

@keyframes by-hide-fade-end {
  from { --fade-end: var(--fade-size); }
}

.mw-tab,
.by-tab {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 38px;
  min-inline-size: 38px;
  padding: 7px 14px 9px;
  border-radius: 999px;
  border: 1px solid #d5deec;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.mw-tab:hover,
.by-tab:hover {
  border-color: var(--cw99-blue, #2457c6);
  color: var(--cw99-blue, #2457c6);
  text-decoration: none;
}

.mw-tab.is-active,
.mw-tab[aria-pressed="true"],
.mw-tab[aria-selected="true"],
.by-tab.is-active,
.by-tab[aria-pressed="true"],
.by-tab[aria-selected="true"] {
  background: var(--cw99-blue, #2457c6);
  border-color: var(--cw99-blue, #2457c6);
  color: #fff;
}

.mw-tab.is-active::after,
.mw-tab[aria-pressed="true"]::after,
.mw-tab[aria-selected="true"]::after,
.by-tab.is-active::after,
.by-tab[aria-pressed="true"]::after,
.by-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 12px 3px;
  border-block-end: 3px solid currentColor;
}

/* Belarus Metro & Transit Badges */
.by-metro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}
.by-metro-badge--m1 { background: #d9232e; }
.by-metro-badge--m2 { background: #0067b1; }
.by-metro-badge--m3 { background: #1b9e3e; }
.by-metro-badge--metro { background: #2457c6; }

.by-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2fc;
  color: #1e40af;
  white-space: nowrap;
}

.by-route-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.by-route-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
}

/* PVZ & Post Brand Pills */
.by-pvz-brand {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.by-pvz-brand--wb { background: #f5f0ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.by-pvz-brand--ozon { background: #eff6ff; color: #005bff; border: 1px solid #bfdbfe; }
.by-pvz-brand--evropochta { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.by-pvz-brand--21vek { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.by-pvz-brand--belpochta { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.by-pvz-brand--default { background: #f8fafc; color: #334155; border: 1px solid #cbd5e1; }

/* 2GIS Building Cards Grid */
.by-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.by-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px;
  background: #fafafa;
  border: 1px solid var(--cw99-line, #e9e9e9);
  border-radius: var(--cw99-r, 12px);
}

.by-card h3 {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.by-card-meta {
  font-size: 14px;
  color: var(--cw99-muted, #5b6472);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.by-mall-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  margin-top: 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
}

.by-mall-banner-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.by-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.by-spec-box {
  padding: 14px 16px;
  background: #fafafa;
  border: 1px solid var(--cw99-line, #e9e9e9);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.by-spec-label {
  font-size: 13px;
  color: var(--cw99-muted, #5b6472);
}

.by-spec-val {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

/* Quiet Minimalist «Чистый Кит» Cleaning Card */
.by-kitt-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 24px;
  padding: 20px 24px;
  background: #fafafa;
  border: 1px solid var(--cw99-line, #e9e9e9);
  border-radius: var(--cw99-r-lg, 16px);
}

.by-kitt-left {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 680px;
}

.by-kitt-left .hs-ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #eef2fc;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin: 0;
}

.by-kitt-prices {
  font-size: 15px;
  color: #1e293b;
  margin-top: 4px;
}

.by-kitt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--cw99-yellow, #ffc73b);
  color: #000 !important;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none !important;
  white-space: nowrap;
}

.by-kitt-btn:hover {
  background: var(--cw99-yellow-soft, #ffea84);
}

.by-regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.by-region-card {
  padding: 18px 20px;
  background: #fafafa;
  border: 1px solid var(--cw99-line, #e9e9e9);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.by-pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.by-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-block-size: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dce3ee;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.by-pill-link:hover {
  border-color: #2457c6;
  color: #2457c6;
  text-decoration: none;
}

.by-hero-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  max-width: 720px;
  position: relative;
}

.by-hero-search-input-wrap {
  position: relative;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
}

.by-hero-search-input-wrap svg {
  position: absolute;
  left: 15px;
  color: #64748b;
  pointer-events: none;
}

.by-hero-search input[type="search"] {
  width: 100%;
  min-height: 50px;
  padding: 0 16px 0 44px;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 16px;
}

.by-hero-search button[type="submit"] {
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  border: 0;
  background: #2457c6;
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
}

.by-hero-search button[type="submit"]:hover {
  background: #1c47a6;
}

.by-hero-search .bw-suggest {
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  width: 100%;
}
