﻿/* Панель аналогов тепловизионных прицелов + облачко-предупреждение у кнопки */

.bk-tm-analogs {
  --bk-tm-accent: var(--theme-base-color, #046E9F);
  --bk-tm-ink: var(--basic_text_black, #202533);
  --bk-tm-muted: var(--secondary_text, #6b7280);
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  visibility: hidden;
  pointer-events: none;
}
.bk-tm-analogs.is-open {
  visibility: visible;
  pointer-events: auto;
}
.bk-tm-analogs__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 32, 0.18);
  opacity: 0;
  transition: opacity .24s ease;
}
.bk-tm-analogs.is-shown .bk-tm-analogs__backdrop {
  opacity: 1;
}

.bk-tm-analogs__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 2;
  width: min(420px, 94vw);
  display: flex;
  flex-direction: column;
  background: #f4f7fb;
  border-right: 1px solid rgba(4, 110, 159, 0.12);
  box-shadow: 12px 0 48px rgba(10, 22, 32, 0.18);
  transform: translateX(-104%);
  transition: transform .3s cubic-bezier(.22, .9, .28, 1);
  overscroll-behavior: contain;
}
.bk-tm-analogs.is-shown .bk-tm-analogs__panel {
  transform: translateX(0);
}
.bk-tm-analogs.is-closing .bk-tm-analogs__panel {
  transform: translateX(-104%);
}

.bk-tm-analogs__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(15, 35, 55, 0.06);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(4, 110, 159, 0.12), transparent 55%),
    linear-gradient(180deg, #fff, #f7fafc);
}
.bk-tm-analogs__kicker {
  margin: 0 0 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bk-tm-accent);
}
.bk-tm-analogs__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--bk-tm-ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.bk-tm-analogs__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #eef3f7;
  color: #334;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, color .15s ease;
}
.bk-tm-analogs__close:hover {
  background: var(--bk-tm-accent);
  color: #fff;
  transform: scale(1.05);
}

.bk-tm-analogs__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 12px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c5ced6 transparent;
  background:
    linear-gradient(180deg, rgba(244, 247, 251, 0.2), #eef3f8 40%, #eef3f8);
}
.bk-tm-analogs__body::-webkit-scrollbar { width: 4px; }
.bk-tm-analogs__body::-webkit-scrollbar-thumb {
  background: #c5ced6;
  border-radius: 999px;
}
.bk-tm-analogs__body::-webkit-scrollbar-button { display: none; }

.bk-tm-analogs__status {
  padding: 36px 18px;
  text-align: center;
  color: var(--bk-tm-muted);
  font-size: 13px;
}
.bk-tm-analogs__status[hidden] { display: none !important; }

.bk-tm-analogs__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bk-tm-analogs__list[hidden] { display: none !important; }

.bk-tm-card {
  position: relative;
  display: block;
  padding: 0;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 35, 55, 0.07);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 8px 20px rgba(15, 35, 55, 0.04);
  transition: border-color .18s ease, box-shadow .2s ease, transform .18s ease;
  overflow: hidden;
}
.bk-tm-card.is-stock {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 8px 20px rgba(15, 35, 55, 0.04),
    inset 0 0 0 1px rgba(34, 160, 107, 0.08);
}
.bk-tm-card.is-order {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 8px 20px rgba(15, 35, 55, 0.04),
    inset 0 0 0 1px rgba(26, 115, 232, 0.06);
}
.bk-tm-card:hover {
  border-color: rgba(4, 110, 159, 0.28);
  box-shadow: 0 14px 30px rgba(4, 110, 159, 0.12);
  transform: translateY(-2px);
}
.bk-tm-card.is-best {
  border-color: rgba(4, 110, 159, 0.22);
}
.bk-tm-card__best {
  display: block;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #046E9F;
  background: linear-gradient(90deg, rgba(4, 110, 159, 0.12), rgba(4, 110, 159, 0.03));
  border-bottom: 1px solid rgba(4, 110, 159, 0.08);
}
.bk-tm-card__main {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
}
.bk-tm-card__media {
  position: relative;
  flex: 0 0 88px;
  width: 88px;
}
.bk-tm-card__img {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 25%, #fff, #eef3f8 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(15, 35, 55, 0.05);
}
.bk-tm-card__img img {
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
}
.bk-tm-card__ph {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #dbe4ee;
}
.bk-tm-card__ring {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background:
    radial-gradient(closest-side, #fff 68%, transparent 70% 100%),
    conic-gradient(#1f9d66 calc(var(--p) * 1%), #e5ebf1 0);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(15, 35, 55, 0.12);
  border: 2px solid #fff;
}
.bk-tm-card__ring span {
  font-size: 11px;
  font-weight: 800;
  color: #0b6e4f;
  line-height: 1;
}
.bk-tm-card__ring small {
  font-size: 8px;
  font-weight: 700;
}
.bk-tm-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 5px;
}
.bk-tm-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bk-tm-card__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 650;
  color: #567;
  white-space: nowrap;
}
.bk-tm-card__status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa8b5;
  box-shadow: 0 0 0 3px rgba(154, 168, 181, 0.18);
}
.bk-tm-card__status.is-stock { color: #0b6e4f; }
.bk-tm-card__status.is-stock i {
  background: #22a06b;
  box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.16);
}
.bk-tm-card__status.is-order { color: #1a5fb4; }
.bk-tm-card__status.is-order i {
  background: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}
.bk-tm-card__brand {
  font-size: 11px;
  font-weight: 650;
  color: var(--bk-tm-muted);
  letter-spacing: 0.02em;
}
.bk-tm-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.bk-tm-card__tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.bk-tm-card__tag.is-twin {
  color: #046e9f;
  background: rgba(4, 110, 159, 0.1);
}
.bk-tm-card__tag.is-deal {
  color: #0b6e4f;
  background: rgba(11, 110, 79, 0.12);
}
.bk-tm-card__tag.is-upgrade {
  color: #8a5a00;
  background: rgba(200, 140, 20, 0.14);
}
.bk-tm-card__tag.is-similar {
  color: #5b6572;
  background: rgba(107, 114, 128, 0.12);
}
.bk-tm-card__name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--bk-tm-ink);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bk-tm-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.bk-tm-card__spec {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid rgba(15, 35, 55, 0.05);
  font-size: 11px;
  font-weight: 700;
  color: #243447;
  white-space: nowrap;
}
.bk-tm-card__spec em {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a8898;
}
.bk-tm-card__meta {
  font-size: 11px;
  color: #7a8898;
  line-height: 1.35;
}
.bk-tm-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed rgba(15, 35, 55, 0.08);
}
.bk-tm-card__price {
  font-size: 16px;
  font-weight: 800;
  color: var(--bk-tm-ink);
  letter-spacing: -0.02em;
}
.bk-tm-card__price.is-empty {
  font-size: 12px;
  font-weight: 650;
  color: #7a8898;
}
.bk-tm-card__go {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--bk-tm-accent);
  border-radius: 999px;
  padding: 6px 11px;
  transition: transform .15s ease, filter .15s ease;
}
.bk-tm-card:hover .bk-tm-card__go {
  filter: brightness(1.06);
  transform: translateX(1px);
}

/* —— мягкое свечение контура + чуть внутрь кнопки —— */
@keyframes bkGenBtnBlinkGreen {
  0%, 100% {
    box-shadow:
      inset 0 0 10px 2px rgba(34, 160, 107, 0.14),
      0 0 8px 1px rgba(34, 160, 107, 0.16);
  }
  50% {
    box-shadow:
      inset 0 0 16px 4px rgba(34, 160, 107, 0.28),
      0 0 12px 3px rgba(34, 160, 107, 0.28);
  }
}
@keyframes bkGenBtnBlinkRed {
  0%, 100% {
    box-shadow:
      inset 0 0 10px 2px rgba(220, 60, 60, 0.14),
      0 0 8px 1px rgba(220, 60, 60, 0.16);
  }
  50% {
    box-shadow:
      inset 0 0 16px 4px rgba(220, 60, 60, 0.26),
      0 0 12px 3px rgba(220, 60, 60, 0.26);
  }
}

button.bk-tm-analogs-btn.bk-tm-hint--stock.is-hint-live {
  animation: bkGenBtnBlinkGreen 1.45s ease-in-out infinite !important;
  border-color: rgba(34, 160, 107, 0.38) !important;
}
button.bk-tm-analogs-btn.bk-tm-hint--order.is-hint-live {
  animation: bkGenBtnBlinkRed 1.45s ease-in-out infinite !important;
  border-color: rgba(220, 60, 60, 0.36) !important;
}
button.bk-tm-analogs-btn.is-analogs-open {
  animation: none !important;
  box-shadow: 0 8px 22px rgba(4, 110, 159, 0.18) !important;
  border-color: rgba(4, 110, 159, 0.45) !important;
}

/* облачко в body (fixed), чтобы не резало overflow родителей */
.bk-tm-hint {
  position: fixed;
  z-index: 2147482900;
  width: min(230px, 68vw);
  padding: 11px 30px 11px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e9ef;
  box-shadow: 0 12px 28px rgba(10, 22, 32, 0.16);
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px) scale(0.96);
  transition: opacity .25s ease, transform .25s cubic-bezier(.22, .9, .28, 1);
}
.bk-tm-hint.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}
.bk-tm-hint--stock { border-color: rgba(34, 160, 107, 0.45); }
.bk-tm-hint--order { border-color: rgba(220, 60, 60, 0.45); }
.bk-tm-hint__arrow {
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #e5e9ef;
  border-top: 1px solid #e5e9ef;
  transform: translateY(-50%) rotate(45deg);
}
.bk-tm-hint--stock .bk-tm-hint__arrow { border-color: rgba(34, 160, 107, 0.45); }
.bk-tm-hint--order .bk-tm-hint__arrow { border-color: rgba(220, 60, 60, 0.45); }
.bk-tm-hint__close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #f1f4f7;
  color: #445;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.bk-tm-hint__close:hover { background: #e4eaef; }
.bk-tm-hint__title {
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: #202533;
}
.bk-tm-hint--stock .bk-tm-hint__title { color: #0b6e4f; }
.bk-tm-hint--order .bk-tm-hint__title { color: #b42318; }
.bk-tm-hint__text {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #5b6572;
}

@media (max-width: 900px) {
  .bk-tm-analogs__panel {
    width: min(100vw, 100%);
  }
  .bk-tm-hint__arrow {
    right: auto;
    left: 24px;
    top: -6px;
    border-right: 0;
    border-bottom: 0;
    border-left: 1px solid #e5e9ef;
    border-top: 1px solid #e5e9ef;
  }
}

/* сравнение ТТХ при наведении — компактный и чистый вид */
.bk-an-cmp {
  position: fixed;
  z-index: 2147483100;
  display: flex;
  flex-direction: column;
  width: min(420px, 92vw);
  max-height: min(480px, calc(100vh - 24px));
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 35, 55, 0.08);
  box-shadow: 0 18px 40px rgba(10, 22, 32, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(5px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  overflow: hidden;
}
.bk-an-cmp.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.bk-an-cmp__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px 12px;
  border-bottom: 1px solid rgba(15, 35, 55, 0.06);
}
.bk-an-cmp__title {
  font-size: 13px;
  font-weight: 700;
  color: #1a2230;
  letter-spacing: -0.01em;
}
.bk-an-cmp__stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.bk-an-cmp__stats span {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.2;
}
.bk-an-cmp__stats .is-up {
  color: #0b6e4f;
  background: rgba(11, 110, 79, 0.1);
}
.bk-an-cmp__stats .is-down {
  color: #b42318;
  background: rgba(180, 35, 24, 0.1);
}
.bk-an-cmp__stats .is-neutral {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.1);
}
.bk-an-cmp__list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.bk-an-cmp__list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.bk-an-cmp__diffs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bk-an-cmp__row {
  display: grid;
  grid-template-columns: minmax(88px, 0.85fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f9fb;
  border: 1px solid transparent;
}
.bk-an-cmp__row.is-up {
  background: rgba(11, 110, 79, 0.045);
  border-color: rgba(11, 110, 79, 0.08);
}
.bk-an-cmp__row.is-down {
  background: rgba(180, 35, 24, 0.04);
  border-color: rgba(180, 35, 24, 0.08);
}
.bk-an-cmp__name {
  font-size: 12px;
  font-weight: 700;
  color: #2a3342;
  line-height: 1.25;
}
.bk-an-cmp__pair {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
}
.bk-an-cmp__a {
  color: #8a94a3;
  text-decoration: line-through;
  text-decoration-color: rgba(138, 148, 163, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bk-an-cmp__b {
  color: #151b28;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bk-an-cmp__to {
  flex: 0 0 10px;
  width: 10px;
  height: 1.5px;
  background: #c9d1db;
  position: relative;
}
.bk-an-cmp__to::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid #c9d1db;
  border-top: 1.5px solid #c9d1db;
  transform: translateY(-50%) rotate(45deg);
}
.bk-an-cmp__pill {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.bk-an-cmp__pill.is-up {
  color: #0b6e4f;
  background: rgba(11, 110, 79, 0.12);
}
.bk-an-cmp__pill.is-down {
  color: #b42318;
  background: rgba(180, 35, 24, 0.12);
}
.bk-an-cmp__pill.is-diff {
  color: #4b5563;
  background: rgba(75, 85, 99, 0.1);
}
.bk-an-cmp__empty {
  padding: 18px 8px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}
.bk-an-cmp__same {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 35, 55, 0.06);
}
.bk-an-cmp__same-head {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #8a94a3;
  letter-spacing: 0.02em;
}
.bk-an-cmp__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bk-an-cmp__tag {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #5b6572;
  background: #f1f4f7;
  border: 1px solid rgba(15, 35, 55, 0.04);
}

@media (max-width: 900px) {
  .bk-an-cmp {
    width: min(100vw - 16px, 420px);
  }
  .bk-an-cmp__row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .bk-an-cmp__pill {
    justify-self: start;
  }
}
