/* ===== Company Compare Bar ===== */
.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
  will-change: transform;
}

.compare-bar--visible {
  transform: translateY(0);
}

.compare-bar__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: #fff;
  border-top: 1px solid #d5e0ec;
  box-shadow: 0 -8px 32px rgba(16, 41, 75, 0.13);
  max-width: 1439px;
  margin: 0 auto;
}

.compare-bar__slots {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* ---- Single slot ---- */
.compare-bar__slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  max-width: 240px;
  height: 56px;
  padding: 0 36px 0 10px;
  border-radius: 8px;
  background: #f0f5fe;
  border: 1px solid #d2e0f5;
  overflow: hidden;
}

.compare-bar__slot--empty {
  border: 1.5px dashed #c0d0e5;
  background: #f7f9fc;
  justify-content: center;
  padding: 0;
}

.compare-bar__slot-logo {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 5px;
  border: 1px solid #dce8f5;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}

.compare-bar__slot-name {
  font-size: 13px;
  font-weight: 600;
  color: #10233d;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.compare-bar__slot-empty-txt {
  font-size: 13px;
  color: #8ea5bc;
}

.compare-bar__slot-remove {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: #8ea5bc;
  border-radius: 50%;
  transition:
    color 0.15s,
    background 0.15s;
}

.compare-bar__slot-remove:hover {
  color: #e03535;
  background: rgba(224, 53, 53, 0.1);
}

.compare-bar__slot-remove svg {
  display: block;
  width: 12px;
  height: 12px;
}

/* ---- Counter badge ---- */
.compare-bar__count {
  font-size: 13px;
  color: #607287;
  white-space: nowrap;
  flex: none;
}

/* ---- Action buttons ---- */
.compare-bar__actions {
  display: flex;
  gap: 10px;
  flex: none;
}

.compare-bar__btn-compare {
  height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: 7px;
  background: #2f66ec;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}

.compare-bar__btn-compare:hover {
  background: #1f54d4;
  box-shadow: 0 6px 14px rgba(47, 102, 236, 0.3);
}

.compare-bar__btn-compare:disabled {
  background: #a9bfe8;
  cursor: default;
  box-shadow: none;
}

.compare-bar__btn-clear {
  height: 44px;
  padding: 0 16px;
  border: 1px solid #d0dcea;
  border-radius: 7px;
  background: #fff;
  color: #607287;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    color 0.15s;
}

.compare-bar__btn-clear:hover {
  border-color: #e03535;
  color: #e03535;
}

/* ---- Card button state ---- */
.rating-company-card__compare--added {
  color: #1e7e4a !important;
  font-weight: 700;
}

.rating-company-card__compare--added::before {
  content: "✓ ";
}

/* ===== Compare Modal ===== */
.compare-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(10, 25, 47, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.compare-modal-backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

.compare-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(16, 41, 75, 0.22);
  max-width: 960px;
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.25s;
}

.compare-modal-backdrop--visible .compare-modal {
  transform: translateY(0);
}

.compare-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #e8eef6;
}

.compare-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #10233d;
}

.compare-modal__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #f0f4f9;
  border-radius: 50%;
  cursor: pointer;
  color: #607287;
  font-size: 18px;
  line-height: 1;
  transition:
    background 0.15s,
    color 0.15s;
}

.compare-modal__close:hover {
  background: #e03535;
  color: #fff;
}

.compare-modal__body {
  overflow-y: auto;
  padding: 24px 28px 28px;
}

/* ---- Compare table ---- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.compare-table th,
.compare-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #eef2f8;
}

.compare-table th {
  background: #f7f9fd;
  color: #607287;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  width: 140px;
}

.compare-table-head td {
  padding: 16px;
  background: #f0f5fe;
  vertical-align: middle;
}

.compare-table__company-logo {
  width: 64px;
  height: 40px;
  object-fit: contain;
  border: 1px solid #dce8f5;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
  margin-bottom: 8px;
  display: block;
}

.compare-table__company-name {
  font-size: 16px;
  font-weight: 700;
  color: #10233d;
  margin: 0 0 4px;
}

.compare-table__company-link {
  font-size: 13px;
  color: #2f66ec;
  text-decoration: underline;
}

.compare-table__rating {
  color: #f3a800;
  font-weight: 700;
}

.compare-table__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #2f66ec;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  transition: color 0.15s;
}

.compare-table__link:hover {
  color: #1f54d4;
}

/* ---- Кнопка под таблицей ---- */
.compare-modal__cta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.compare-modal__cta-btn {
  flex: none;
  height: 48px;
  padding: 0 32px;
  border: 0;
  border-radius: 8px;
  background: #2f66ec;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}

.compare-modal__cta-btn:hover {
  background: #1f54d4;
  box-shadow: 0 6px 16px rgba(47, 102, 236, 0.3);
}

.compare-modal__cta-note {
  margin: 0;
  color: #4a6a8a;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .compare-bar__inner {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 10px;
  }

  .compare-bar__slot {
    max-width: none;
  }

  .compare-bar__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .compare-bar__btn-compare {
    flex: 1;
  }
}

@media (max-width: 600px) {
  .compare-bar__slots {
    flex-direction: column;
    gap: 6px;
  }

  .compare-bar__slot {
    height: 48px;
    max-width: none;
  }

  .compare-bar__count {
    display: none;
  }

  .compare-modal__header {
    padding: 16px 20px;
  }

  .compare-modal__body {
    padding: 16px 20px 20px;
  }

  .compare-table {
    font-size: 13px;
  }

  .compare-table th {
    width: 100px;
  }

  .compare-modal__cta {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }

  .compare-modal__cta-btn {
    width: 100%;
    height: 46px;
    font-size: 15px;
  }
}
