/* Сравнение товаров (Figma desktop 1:7069, пустое 1:7456, mobile 1:3317 / 1:4827) */

.compare {
  padding-top: 32px;
  padding-bottom: 40px;
}

/* скрытие блоков при пустом списке — перебивает display из media-правил */
.compare__tabs[hidden],
.compare-toolbar[hidden],
.compare-cards[hidden],
.compare-table-wrap[hidden],
.compare-actions[hidden] {
  display: none !important;
}

/* --- Хлебные крошки (1:7452) --- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 19px;
  padding: 0;
  margin-bottom: 24px;
  font-weight: var(--fw-medium);
  font-size: 14px;
  line-height: 24px;
  color: var(--text-blue-dark);
}

.breadcrumbs__sep {
  font-size: 16px;
  line-height: 14px;
  color: var(--text-blue-dark);
}

/* --- Заголовок (1:7225) --- */
.compare__title {
  margin-bottom: 24px;
  font-weight: var(--fw-bold);
  font-size: 35px;
  line-height: 1;
  letter-spacing: var(--ls-base);
  color: var(--text-brown-dark);
  text-transform: uppercase;
}

/* --- Чипы категорий (1:7226) --- */
.compare__tabs {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 24px;
}

.compare-tab {
  padding: 10px 16px;
  border-radius: 4px;
  background: #f5f5f5;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #444444;
  white-space: nowrap;
}

.compare-tab.is-active {
  background: #ffd600;
  font-weight: 700;
  color: #111111;
}

/* --- Панель опций (1:7233) --- */
.compare-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--bg-gray-300);
  border-radius: 4px;
  background: #f9f9f9;
  font-family: 'Inter', sans-serif;
}

.compare-toolbar__group {
  display: flex;
  align-items: center;
  gap: 24px;
}

.compare-toolbar__opt {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.compare-toolbar__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
}

/* чекбокс «Растянуть таблицу» (1:7236) */
.compare-toolbar__box {
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid #777777;
  border-radius: 2px;
  background: var(--bg-white);
}

.compare-toolbar__input:checked + .compare-toolbar__box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #111111;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* радио «Показать отличия» / «Все характеристики» (1:7239, 1:7242) */
.compare-toolbar__radio {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid #cccccc;
  border-radius: 8px;
  background: var(--bg-white);
}

.compare-toolbar__input:checked + .compare-toolbar__radio {
  border: 5px solid #e6be00;
}

.compare-toolbar__text {
  font-weight: 500;
  font-size: 13px;
  color: #444444;
  white-space: nowrap;
}

.compare-toolbar__opt--stretch .compare-toolbar__text {
  color: var(--text-dark-900);
}

.compare-toolbar__input:checked ~ .compare-toolbar__text {
  font-weight: 600;
  color: #111111;
}

.compare-toolbar__input:focus-visible ~ .compare-toolbar__text {
  outline: 2px solid #e6be00;
  outline-offset: 2px;
}

.compare-toolbar__text-short {
  display: none;
}

/* «Очистить сравнение» (1:7244) */
.compare-toolbar__clear {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #ff3333;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: #ef4444;
  white-space: nowrap;
}

.compare-toolbar__clear:hover {
  background: rgba(255, 51, 51, 0.06);
}

.compare-toolbar__clear-short {
  display: none;
}

/* --- Карточки товаров, mobile (1:4847) — на desktop скрыты --- */
.compare-cards {
  display: none;
}

/* --- Таблица сравнения (1:7248) --- */
.compare-table-wrap__scroll {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
}

.compare-table th,
.compare-table td {
  border: 1px solid var(--bg-gray-300);
}

/* угловая ячейка «Технические параметры» (1:7250) */
.compare-table__corner {
  width: 280px;
  min-width: 280px;
  padding: 20px;
  background: #f9f9f9;
  vertical-align: middle;
}

.compare-table__corner-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.compare-table__corner-text {
  font-weight: 600;
  font-size: 12px;
  color: #777777;
  text-align: center;
}

/* шапка товара (1:7255) */
.compare-table__product {
  min-width: 220px;
  padding: 16px;
  background: var(--bg-white);
  vertical-align: top;
  font-weight: 400;
  text-align: left;
}

.is-stretched .compare-table__product {
  min-width: 320px;
}

.compare-product {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.compare-product__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.compare-product__remove {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-size: 12px;
  color: #ff3333;
}

.compare-product__remove:hover {
  text-decoration: underline;
}

.compare-product__hint {
  font-size: 11px;
  color: #777777;
}

.compare-product__image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
  padding: 8px;
}

.compare-product__image img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.compare-product__name {
  display: block;
  width: 100%;
  height: 48px;
  overflow: hidden;
  font-weight: 600;
  font-size: 13px;
  line-height: normal;
  color: #111111;
}

.compare-product__article {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #777777;
}

.compare-product__copy {
  display: flex;
  flex-shrink: 0;
}

.compare-product__price {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #111111;
}

.compare-product__buy {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* счётчик количества (1:7271) */
.compare-counter {
  display: flex;
  align-items: stretch;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid #cccccc;
  border-radius: 4px;
  overflow: hidden;
}

.compare-counter__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  font-weight: 600;
  font-size: 14px;
  color: #444444;
}

.compare-counter__value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  border-left: 1px solid var(--bg-gray-300);
  border-right: 1px solid var(--bg-gray-300);
  font-weight: 700;
  font-size: 13px;
  color: #111111;
}

/* кнопка «В корзину» (1:7280) */
.compare-product__cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  height: 38px;
  border-radius: 4px;
  background: #ffd600;
  font-weight: 700;
  font-size: 13px;
  color: #111111;
  white-space: nowrap;
}

.compare-product__cart:hover {
  background: var(--yellow-cc);
}

/* строки характеристик (1:7343) */
.compare-table__label {
  width: 280px;
  min-width: 280px;
  padding: 16px;
  font-weight: 600;
  font-size: 13px;
  color: #444444;
  text-align: left;
  vertical-align: top;
}

.compare-table__value {
  min-width: 220px;
  padding: 16px;
  font-weight: 400;
  font-size: 13px;
  color: #111111;
  vertical-align: top;
}

.is-stretched .compare-table__value {
  min-width: 320px;
}

.compare-table__row:nth-child(even) {
  background: #f9f9f9;
}

/* жёлтая подсветка отличий (1:7353) */
.compare-table__row.is-diff {
  background: #fffde7;
}

.compare-table__row.is-diff .compare-table__value {
  font-weight: 700;
}

.compare-table__row.is-hidden {
  display: none;
}

.compare-table__label-short {
  display: none;
}

/* --- Кнопки низа (1:7443) --- */
.compare-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  font-family: 'Inter', sans-serif;
}

.compare-actions__continue {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--text-dark-900);
  border-radius: 4px;
  background: var(--bg-white);
  font-weight: 700;
  font-size: 14px;
  color: #111111;
  white-space: nowrap;
}

.compare-actions__continue:hover {
  background: #f9f9f9;
}

.compare-actions__clear {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #ff3333;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: #ef4444;
  white-space: nowrap;
}

.compare-actions__clear:hover {
  background: rgba(255, 51, 51, 0.06);
}

.compare-actions__clear-full {
  display: none;
}

/* --- Пустое состояние (1:7613) --- */
.compare-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 80px 40px;
  border: 1px solid var(--bg-gray-300);
  border-radius: 8px;
  background: #f9f9f9;
  text-align: center;
}

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

.compare-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border: 1px solid var(--bg-gray-300);
  border-radius: 40px;
  background: var(--bg-white);
}

.compare-empty__title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #111111;
}

.compare-empty__text {
  max-width: 560px;
  margin-top: -12px; /* gap 12 между заголовком и текстом (1:7617) */
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #777777;
}

.compare-empty__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 4px;
  background: #ffd600;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #111111;
}

.compare-empty__btn:hover {
  background: var(--yellow-cc);
}

/* ================= Планшет ================= */
@media (max-width: 1023px) {
  .compare {
    padding-top: 24px;
  }
}

/* ================= Mobile (1:3317 / 1:4827) ================= */
@media (max-width: 767px) {
  .compare {
    padding-top: 16px;
    padding-bottom: 32px;
  }

  /* хлебные крошки (1:4829) */
  .breadcrumbs {
    gap: 6px;
    margin-bottom: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 11px;
    line-height: normal;
    letter-spacing: normal;
    color: #6b7280;
  }

  .breadcrumbs__sep {
    font-size: 11px;
    line-height: normal;
    color: #6b7280;
  }

  .breadcrumbs__current {
    font-weight: 600;
    color: var(--text-dark-900);
  }

  /* заголовок (1:4833) */
  .compare__title {
    margin-bottom: 16px;
    font-size: 24px;
    line-height: normal;
    letter-spacing: normal;
    color: var(--text-dark-900);
  }

  /* чипы (1:4834): активный — чёрный */
  .compare__tabs {
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .compare__tabs::-webkit-scrollbar {
    display: none;
  }

  .compare-tab {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
  }

  .compare-tab.is-active {
    background: var(--text-dark-900);
    color: var(--bg-white);
  }

  /* панель опций (1:4837) */
  .compare-toolbar {
    flex-wrap: wrap;
    row-gap: 8px;
    margin-bottom: 16px;
    padding: 8px 0;
    border: none;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    background: none;
  }

  .compare-toolbar__group {
    gap: 12px;
  }

  /* индикаторы — текстовые маркеры «[•] / [ ]», как в макете (1:4842) */
  .compare-toolbar__opt {
    gap: 0;
  }

  .compare-toolbar__box,
  .compare-toolbar__radio {
    display: none;
  }

  .compare-toolbar__input[type="radio"] ~ .compare-toolbar__text::before {
    content: '[ ] ';
  }

  .compare-toolbar__input[type="radio"]:checked ~ .compare-toolbar__text::before {
    content: '[\2022] ';
  }

  .compare-toolbar__text {
    font-size: 12px;
    color: #6b7280;
  }

  .compare-toolbar__opt--stretch .compare-toolbar__text {
    font-weight: 600;
    color: var(--text-dark-900);
  }

  .compare-toolbar__input:checked ~ .compare-toolbar__text {
    font-weight: 700;
    color: var(--text-dark-900);
  }

  .compare-toolbar__text-full {
    display: none;
  }

  .compare-toolbar__text-short {
    display: inline;
  }

  .compare-toolbar__clear {
    padding: 0;
    border: none;
    font-size: 12px;
  }

  .compare-toolbar__clear:hover {
    background: none;
  }

  .compare-toolbar__clear-full {
    display: none;
  }

  .compare-toolbar__clear-short {
    display: inline;
  }

  /* карточки товаров с горизонтальным скроллом (1:4847) */
  .compare-cards {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    font-family: 'Inter', sans-serif;
  }

  .compare-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    flex: 0 0 280px;
    min-width: 0;
    max-width: 280px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-white);
    scroll-snap-align: start;
  }

  .compare-card__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 120px;
    border-radius: 6px;
    background: var(--bg-gray-50);
  }

  .compare-card__image img {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    object-fit: contain;
  }

  .compare-card__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .compare-card__name {
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-dark-900);
  }

  .compare-card__article {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #6b7280;
  }

  .compare-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .compare-card__price {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dark-900);
  }

  /* мобильный счётчик (1:4859) */
  .compare-stepper {
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 4px;
    background: #f3f4f6;
  }

  .compare-stepper__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-dark-900);
  }

  .compare-stepper__btn--minus {
    color: #6b7280;
  }

  .compare-stepper__value {
    padding: 0 8px;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-dark-900);
  }

  .compare-card__cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    border-radius: 6px;
    background: #ffd600;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-dark-900);
  }

  .compare-card__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    font-weight: 500;
    font-size: 11px;
    color: #ef4444;
  }

  /* таблица характеристик (1:4896) */
  .compare-table-wrap {
    margin-bottom: 0;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
  }

  .compare-table__head {
    display: none;
  }

  .compare-table th,
  .compare-table td {
    border: none;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
  }

  .compare-table__row:last-child .compare-table__label,
  .compare-table__row:last-child .compare-table__value {
    border-bottom: none;
  }

  .compare-table__value:last-child {
    border-right: none;
  }

  .compare-table__label {
    position: sticky;
    left: 0;
    width: 110px;
    min-width: 110px;
    padding: 12px;
    background: #fbfbfc;
    font-size: 11px;
    color: #6b7280;
  }

  .compare-table__row:nth-child(even) .compare-table__label {
    background: #f3f4f6;
  }

  .compare-table__label-full {
    display: none;
  }

  .compare-table__label-short {
    display: inline;
  }

  .compare-table__value,
  .is-stretched .compare-table__value {
    width: 120px;
    min-width: 120px;
    padding: 12px;
    font-weight: 500;
    font-size: 11px;
    color: var(--text-dark-900);
  }

  .compare-table__row:nth-child(even) {
    background: var(--bg-white);
  }

  .compare-table__row.is-diff {
    background: #fffce0;
  }

  /* кнопки низа (1:4967) */
  .compare-actions {
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
  }

  .compare-actions__continue {
    justify-content: center;
    width: 100%;
    height: 44px;
    padding: 0;
    border: 1.5px solid var(--text-dark-900);
    border-radius: 8px;
    color: var(--text-dark-900);
  }

  .compare-actions__continue img {
    display: none;
  }

  .compare-actions__clear {
    padding: 8px;
    border: none;
    text-decoration: underline;
  }

  .compare-actions__clear img {
    display: none;
  }

  .compare-actions__clear:hover {
    background: none;
  }

  .compare-actions__clear-short {
    display: none;
  }

  .compare-actions__clear-full {
    display: inline;
  }

  /* пустое состояние */
  .compare-empty {
    gap: 20px;
    padding: 48px 20px;
  }

  .compare-empty__title {
    font-size: 20px;
  }

  .compare-empty__text {
    margin-top: -8px;
  }

  .compare-empty__btn {
    width: 100%;
  }
}
