/* Вкладки категорий на странице сравнения */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tab {
  padding: 12px 18px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 600 15px var(--font-body);
  cursor: pointer;
}
.tab:hover {
  color: var(--text);
}
.tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* Страница сравнения товаров (по образцу technical.city). Подключается только на compare.html. */

/* Цвет каждой колонки: полоски, подсветка победителя и карточки преимуществ */
.c0 {
  --col: #2f80ed;
}
.c1 {
  --col: #e8590c;
}
.c2 {
  --col: #2b9348;
}
.c3 {
  --col: #9c36b5;
}
:root[data-theme='dark'] .c0 {
  --col: #5aa2ff;
}
:root[data-theme='dark'] .c1 {
  --col: #ff8a4c;
}
:root[data-theme='dark'] .c2 {
  --col: #4cc97a;
}
:root[data-theme='dark'] .c3 {
  --col: #cf7bf0;
}

.compare-tabs {
  margin-bottom: 16px;
}
.compare-tabs__count {
  display: inline-block;
  min-width: 20px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12px;
  text-align: center;
}
.compare-tabs .tab.is-active .compare-tabs__count {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.compare-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.compare-toolbar .check input:disabled + span {
  opacity: 0.5;
}

/* Сравнение слева, аналоги справа */
.compare-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  align-items: start;
  padding-bottom: 48px;
}
.compare-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ===== Товары «VS» ===== */
.vs__row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: thin;
}
.vs__item {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 10px;
  min-width: 190px;
  padding: 12px;
  border-top: 4px solid var(--col, var(--border));
  border-radius: 10px;
  background: var(--surface-2);
}
.vs__select {
  width: 100%;
  font-size: 13px;
}
.vs__image {
  display: grid;
  place-items: center;
  position: relative;
  aspect-ratio: 10 / 7;
  border-radius: 8px;
  background: var(--photo-bg);
  overflow: hidden;
}
.vs__image img,
.vs__image .product-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
  transition: transform 0.3s;
}
.vs__image:hover img {
  transform: scale(1.04);
}
.vs__name {
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}
.vs__name:hover {
  color: var(--accent);
}
.vs__buy {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.vs__price {
  flex: 1;
  font: 700 20px var(--font-head);
}
.vs__remove {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.vs__remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.vs__sep {
  align-self: center;
  flex: none;
  font: 700 22px var(--font-head);
  color: var(--muted);
  letter-spacing: 1px;
}
.vs__sep--add {
  display: none;
}

.vs__item--add {
  justify-content: center;
  align-items: center;
  border: 2px dashed var(--border);
  background: transparent;
}
.vs__plus {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 32px;
  line-height: 1;
}

/* ===== Итог ===== */
.js-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.summary-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.summary-card h2 {
  margin: 0 0 4px;
  font-size: 22px;
}
.summary-card > .muted {
  margin: 0 0 14px;
  font-size: 13px;
}
.summary-card--hint {
  border-style: dashed;
  color: var(--muted);
  text-align: center;
}
.summary-card__verdict {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-weight: 600;
}

/* Полоска результата: название — шкала — значение */
.score {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
}
.score__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.score__track {
  height: 14px;
  border-radius: 7px;
  background: var(--surface-2);
  overflow: hidden;
}
.score__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--col) 55%, transparent);
  transform-origin: left;
  animation: bar-grow 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.score.is-best .score__bar {
  background: var(--col);
}
.score__value {
  min-width: 110px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.score__value em,
.spec-row__lead {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

@keyframes bar-grow {
  from {
    transform: scaleX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .score__bar,
  .spec-row__bar {
    animation: none;
  }
}

/* Карточки преимуществ */
.pros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.pros {
  padding: 18px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--col);
  border-radius: var(--radius);
  background: var(--surface);
}
.pros__title {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.3;
}
.pros__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.pros__list li {
  padding-left: 22px;
  position: relative;
  line-height: 1.4;
}
.pros__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--col);
  font-weight: 700;
}
.pros__list b {
  color: var(--success);
}
.pros__list .muted {
  font-size: 13px;
}
.pros .muted {
  margin: 0;
}
