/* Сравнение планировок по этажам — шахматка ЖК [data-floor-compare] */

.complex-chessboard-a101[data-floor-compare] .complex-chessboard-a101__header {
  align-items: center;
  gap: 12px;
  overflow: visible;
}

.floor-compare-toolbar {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-left: auto;
  /* Место под пульс, чтобы overflow диалога не срезал ореол */
  margin-bottom: -8px;
  margin-top: -8px;
  min-width: 0;
  overflow: visible;
  padding-bottom: 8px;
  padding-top: 8px;
}

.complex-chessboard-a101[data-floor-compare] .complex-chessboard-a101__dialog {
  /* Пульс кнопки выходит за header — не клипать по краю диалога сверху */
  overflow: visible;
}

.complex-chessboard-a101[data-floor-compare] .complex-chessboard-a101__body {
  border-radius: 0 0 24px 24px;
  overflow: hidden;
}

.floor-compare-toggle {
  align-items: center;
  background: #fff;
  border: 1.5px solid #e74212;
  border-radius: 999px;
  color: #e74212;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  gap: 8px;
  isolation: isolate;
  line-height: 1.2;
  min-height: 40px;
  overflow: visible;
  padding: 8px 16px;
  position: relative;
  white-space: nowrap;
  z-index: 2;
}

.floor-compare-toggle:hover,
.floor-compare-toggle:focus-visible {
  background: #fff4f0;
}

.floor-compare-toggle:hover .floor-compare-toggle__face,
.floor-compare-toggle:focus-visible .floor-compare-toggle__face {
  background: #fff4f0;
}

.floor-compare-toggle.is-active {
  background: #e74212;
  color: #fff;
}

.floor-compare-toggle.is-active .floor-compare-toggle__pulse {
  animation: none;
  display: none;
}

.floor-compare-toggle.is-active .floor-compare-toggle__face {
  background: #e74212;
}

/*
 * Пульс — реальный DOM-узел (не ::before): залитый ореол от границ.
 * __face перекрывает центр, снаружи виден расширяющийся фон.
 */
.floor-compare-toggle__pulse {
  animation: floor-compare-toggle-pulse 1.35s cubic-bezier(0.333, 0, 0.179, 1) infinite;
  background: #e74212;
  border-radius: inherit;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.floor-compare-toggle__face {
  background: #fff;
  border-radius: inherit;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

@keyframes floor-compare-toggle-pulse {
  0% {
    opacity: 0.65;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.85);
  }
}

.floor-compare-toggle__icon {
  display: inline-flex;
  position: relative;
  z-index: 2;
}

.floor-compare-toggle__label {
  position: relative;
  z-index: 2;
}

.floor-compare-finish {
  background: none;
  border: 0;
  color: #767a86;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.floor-compare-finish:hover,
.floor-compare-finish:focus-visible {
  color: #e74212;
}

.floor-compare-finish[hidden] {
  display: none;
}

.complex-chessboard-a101[data-floor-compare] .complex-chessboard-a101__body {
  min-width: 0;
}

.floor-compare-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.floor-compare-hint {
  align-items: flex-start;
  background: #fff4f0;
  border: 1px solid #f4c7b8;
  border-radius: 12px;
  color: #1b1d24;
  display: flex;
  flex-shrink: 0;
  gap: 10px;
  margin: 12px 20px 12px;
  padding: 12px 14px;
  position: relative;
  z-index: 2;
}

.floor-compare-hint[hidden] {
  display: none;
}

.floor-compare-hint__icon {
  align-items: center;
  background: #e74212;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.floor-compare-hint__text {
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
}

.floor-compare-hint__status {
  color: #93c34e;
  font-weight: bold;
}

.floor-compare-hint__close {
  background: none;
  border: 0;
  color: #767a86;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
}

.floor-compare-workspace {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.complex-chessboard-a101[data-floor-compare] .complex-chessboard-a101__board-wrap {
  flex: 1 1 auto;
}

.floor-compare-panel {
  background: #fff;
  border-left: 1px solid #e8e9eb;
  box-sizing: border-box;
  display: flex;
  flex: 0 0 400px;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  width: 400px;
}

.floor-compare-panel[hidden] {
  display: none;
}

.floor-compare-panel__head {
  display: none;
  flex-shrink: 0;
  padding: 12px 16px 0;
}

.floor-compare-back {
  align-items: center;
  background: none;
  border: 0;
  color: #e74212;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.floor-compare-back__icon {
  display: inline-flex;
  line-height: 0;
}

.floor-compare-panel__body {
  box-sizing: border-box;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 20px 28px;
}

.floor-compare-panel__intro {
  margin-bottom: 14px;
}

.floor-compare-panel__title {
  color: #1b1d24;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 6px;
}

.floor-compare-panel__subtitle {
  color: #9aa0ab;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
}

.floor-compare-base {
  align-items: start;
  background: #f2f3f5;
  border-radius: 18px;
  display: grid;
  gap: 10px 14px;
  grid-template-columns: 84px 1fr;
  margin-bottom: 20px;
  padding: 14px;
}

.floor-compare-base__plan {
  align-items: center;
  background: #fff;
  border-radius: 12px;
  display: flex;
  height: 84px;
  justify-content: center;
  overflow: hidden;
  width: 84px;
}

.floor-compare-base__plan img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.floor-compare-base__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.floor-compare-base__line {
  color: #8b909a;
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.floor-compare-base__floor {
  color: #1b1d24;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
}

.floor-compare-base__article {
  align-self: flex-start;
  background: #ebe6e1;
  border-radius: 999px;
  color: #6b6f78;
  display: inline-flex;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  padding: 5px 10px;
  width: fit-content;
}

.floor-compare-base__price {
  color: #1b1d24;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 4px 0 0;
}

.floor-compare-base__note {
  color: #767a86;
  font-size: 12px;
  grid-column: 1 / -1;
  line-height: 1.4;
  margin: 0;
}

.floor-compare-sort {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.floor-compare-sort__title {
  color: #1b1d24;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.floor-compare-sort__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.floor-compare-sort__btn {
  background: #f2f3f5;
  border: 0;
  border-radius: 999px;
  color: #1b1d24;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  min-height: 36px;
  padding: 8px 16px;
}

.floor-compare-sort__btn.is-active {
  background: #93c34e;
  color: #fff;
}

.floor-compare-note {
  color: #9aa0ab;
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
  margin: 0;
}

.floor-compare-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.floor-compare-list-title {
  color: #1b1d24;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.floor-compare-list__items {
  background: #fff;
  border: 1px solid #e8e9eb;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.floor-compare-card {
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e8e9eb;
  border-radius: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

.floor-compare-card:last-child {
  border-bottom: 0;
}

.floor-compare-card__top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.floor-compare-card__left,
.floor-compare-card__right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.floor-compare-card__right {
  align-items: flex-end;
  text-align: right;
}

.floor-compare-card__floor {
  color: #1b1d24;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
}

.floor-compare-card__meta {
  color: #9aa0ab;
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.floor-compare-card__price {
  color: #1b1d24;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
}

.floor-compare-card__diff {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
}

.floor-compare-card__diff.is-cheaper {
  color: #91c47d;
}

.floor-compare-card__diff.is-expensive {
  color: #e74212;
}

.floor-compare-card__diff.is-same {
  color: #9aa0ab;
}

.floor-compare-card__actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.floor-compare-card__open {
  align-items: center;
  background: #fff;
  border: 1.5px solid #e74212;
  border-radius: 12px;
  box-sizing: border-box;
  color: #e74212;
  cursor: pointer;
  display: inline-flex;
  flex: 1 1 auto;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
}

.floor-compare-card__open:hover,
.floor-compare-card__open:focus-visible {
  background: #fff4f0;
  color: #e74212;
}

.floor-compare-card__open.is-disabled {
  cursor: default;
  opacity: 0.5;
  pointer-events: none;
}

.floor-compare-card__use {
  align-items: center;
  background: #f2f3f5;
  border: 0;
  border-radius: 12px;
  color: #1b1d24;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 44px;
  height: 44px;
  isolation: isolate;
  justify-content: center;
  overflow: visible;
  padding: 0;
  position: relative;
  width: 44px;
  z-index: 0;
}

/*
 * Бегущие линии по контуру кнопки (SVG stroke-dash).
 * Два сегмента напротив. Мягкий слой + ядро: серый центр → прозрачные края.
 * Без blur/mask/conic — читаемо в Chrome на любом клиенте.
 */
.floor-compare-card__use-border {
  display: block;
  height: 100%;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.floor-compare-card__use-border-path {
  animation: floor-compare-use-border 5.5s linear infinite;
  fill: none;
}

.floor-compare-card__use-border-path--soft {
  animation-name: floor-compare-use-border-soft;
}

.floor-compare-card__use-border-path--opposite {
  animation-delay: -2.75s;
}

@keyframes floor-compare-use-border {
  from {
    stroke-dashoffset: -4;
  }

  to {
    stroke-dashoffset: -104;
  }
}

@keyframes floor-compare-use-border-soft {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -100;
  }
}

.floor-compare-card__use:hover,
.floor-compare-card__use:focus-visible {
  background: #e6e8eb;
  color: #1b1d24;
}

.floor-compare-card__use-icon {
  color: #1b1d24;
  display: block;
  fill: none;
  flex: 0 0 auto;
  position: relative;
  stroke: #1b1d24;
  z-index: 2;
}

.floor-compare-empty,
.floor-compare-error,
.floor-compare-loading {
  align-items: center;
  color: #5c616c;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: 220px;
  padding: 24px 12px;
  text-align: center;
}

.floor-compare-empty__icon,
.floor-compare-error__icon {
  font-size: 42px;
  line-height: 1;
}

.floor-compare-empty__title,
.floor-compare-error__title {
  color: #1b1d24;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.floor-compare-empty__text,
.floor-compare-error__text {
  font-size: 14px;
  margin: 0;
}

.floor-compare-retry {
  background: #e74212;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 28px;
}

.complex-chessboard-a101[data-floor-compare] .complex-chessboard-a101__cell {
  position: relative;
}

.complex-chessboard-a101[data-floor-compare] .complex-chessboard-a101__cell.is-compare-base {
  box-shadow: inset 0 0 0 2px #e74212;
  z-index: 2;
}

.complex-chessboard-a101[data-floor-compare] .complex-chessboard-a101__cell.is-compare-analog {
  box-shadow: inset 0 0 0 2px #6fbf40;
  z-index: 1;
}

.complex-chessboard-a101[data-floor-compare].is-compare-on .complex-chessboard-a101__cell[data-clickable="1"].is-dimmed,
.complex-chessboard-a101[data-floor-compare].is-compare-on .complex-chessboard-a101__cell[data-clickable="1"].is-filtered-out {
  cursor: pointer;
  pointer-events: auto;
}

.complex-chessboard-a101[data-floor-compare].is-compare-on .complex-chessboard-a101__board-wrap {
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
}

.complex-chessboard-a101[data-floor-compare].is-compare-on .complex-chessboard-a101__board {
  align-items: flex-start;
  justify-content: flex-start;
}

.complex-chessboard-a101[data-floor-compare].is-compare-on .complex-chessboard-a101__section-grid {
  padding-bottom: 22px;
}

@media (max-width: 991px) {
  .complex-chessboard-a101[data-floor-compare] .complex-chessboard-a101__header {
    align-items: flex-start;
    flex-wrap: wrap;
    overflow: visible;
  }

  .floor-compare-toolbar {
    flex: 1 1 100%;
    justify-content: flex-start;
    order: 3;
    width: 100%;
  }

  .floor-compare-toggle {
    font-size: 13px;
    padding: 8px 12px;
  }

  .floor-compare-hint {
    margin: 8px 12px 10px;
  }

  .floor-compare-workspace {
    position: relative;
  }

  .floor-compare-panel {
    background: #fff;
    border-left: 0;
    flex: 1 1 auto;
    inset: 0;
    position: absolute;
    width: 100%;
    z-index: 5;
  }

  .floor-compare-panel__head {
    display: block;
    padding: 12px 16px 0;
  }

  .floor-compare-panel__body {
    padding: 12px 16px 24px;
  }

  .floor-compare-panel__title {
    font-size: 20px;
  }

  .floor-compare-base {
    grid-template-columns: 76px 1fr;
    padding: 12px;
  }

  .floor-compare-base__plan {
    height: 76px;
    width: 76px;
  }

  .floor-compare-base__price {
    font-size: 22px;
  }

  .floor-compare-list__items {
    background: transparent;
    border: 0;
    border-radius: 0;
    gap: 12px;
    overflow: visible;
  }

  .floor-compare-card {
    border: 1px solid #e8e9eb;
    border-radius: 16px;
  }

  .floor-compare-card:last-child {
    border-bottom: 1px solid #e8e9eb;
  }

  .floor-compare-card__open {
    font-size: 13px;
    min-height: 42px;
  }

  .floor-compare-card__use {
    flex-basis: 42px;
    height: 42px;
    width: 42px;
  }

  /*
   * Режим результата сравнения на мобилке:
   * сайдбар/сетка раньше были visibility:hidden и продолжали занимать высоту
   * (~300px+ пустоты над панелью). Убираем их из потока и даём панели
   * занять всю оставшуюся высоту модалки.
   */
  .complex-chessboard-a101[data-floor-compare].is-compare-mobile-result .complex-chessboard-a101__body {
    overflow: hidden;
  }

  .complex-chessboard-a101[data-floor-compare].is-compare-mobile-result .complex-chessboard-a101__sidebar,
  .complex-chessboard-a101[data-floor-compare].is-compare-mobile-result .complex-chessboard-a101__board-wrap,
  .complex-chessboard-a101[data-floor-compare].is-compare-mobile-result .floor-compare-hint {
    display: none !important;
  }

  .complex-chessboard-a101[data-floor-compare].is-compare-mobile-result .floor-compare-main,
  .complex-chessboard-a101[data-floor-compare].is-compare-mobile-result .floor-compare-workspace {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .complex-chessboard-a101[data-floor-compare].is-compare-mobile-result .floor-compare-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    inset: auto;
    min-height: 0;
    position: relative;
    width: 100%;
  }

  .complex-chessboard-a101[data-floor-compare].is-compare-mobile-result .floor-compare-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .complex-chessboard-a101[data-floor-compare].is-compare-mobile-result .floor-compare-panel__title {
    overflow-wrap: anywhere;
    padding-right: 8px;
  }
}
