:root {
  --cmp-ico-compare: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3v18M15 3v18M3 9h6M15 9h6M3 15h6M15 15h6'/%3E%3C/svg%3E");
}

.auto-add-compare {
  position: absolute;
  z-index: 6;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition:
    background-color 0.2s ease,
    transform 0.15s ease;
  --cmp-ico-size: 22px;
  top: 58px;
  right: 12px;
  display: block;
}

.auto-add-compare::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #111;
  -webkit-mask: var(--cmp-ico-compare) center / var(--cmp-ico-size) var(--cmp-ico-size) no-repeat;
  mask: var(--cmp-ico-compare) center / var(--cmp-ico-size) var(--cmp-ico-size) no-repeat;
}

.auto-add-compare::after {
  content: "";
  position: absolute;
  inset: -6px;
}

.auto-item-descr {
  --fav-right: 10px;
  --fav-size: 24px;
  --btn-gap: 8px;
}

.auto-item-descr .auto-add-compare {
  width: 28px;
  height: 28px;
  top: 6px;
  right: calc(var(--fav-right) + var(--fav-size) + var(--btn-gap));
  --cmp-ico-size: 18px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.product-right {
  --fav-right: 14px;
  --fav-size: 40px;
  --btn-gap: 8px;
}

.product-right > .auto-add-compare {
  top: 14px;
  right: calc(var(--fav-right) + var(--fav-size) + var(--btn-gap));
  z-index: 11;
}

@media (hover: hover) {
  .auto-add-compare:hover {
    transform: scale(1.06);
  }
}

.auto-add-compare:active {
  transform: scale(0.94);
}

.auto-add-compare.in-compare {
  background-color: #111;
}
.auto-add-compare.in-compare::before {
  background: #fff;
}

.auto-add-compare:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.car-link-compare {
  position: relative;
}

.car-link-compare__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #d32f2f;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.car-link-compare__count.is-hidden {
  display: none;
}

.header-compare {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #111;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

@media (hover: hover) {
  .header-compare:hover {
    opacity: 0.7;
  }
}

.header-compare::before {
  content: "";
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--cmp-ico-compare) center / contain no-repeat;
  mask: var(--cmp-ico-compare) center / contain no-repeat;
}

.header-compare .car-link-compare__count {
  position: absolute;
  top: 0;
  right: -4px;
  min-width: 16px;
  height: 16px;
  font-size: 11px;
}

.header-compare:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
  border-radius: 8px;
}

.te-compare-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1300;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: #1c2733;
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  animation: teCmpToastIn 0.2s ease;
}

@keyframes teCmpToastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auto-add-compare {
    transition: none;
  }
  .auto-add-compare:hover,
  .auto-add-compare:active {
    transform: none;
  }
  .header-compare {
    transition: none;
  }
  .te-compare-toast {
    animation: none;
  }
}
