/* ---------- Card compare checkbox (sits under the card buttons) ---------- */
body .um-wrapper .um-card .um-actions.um-actions {
  flex-wrap: wrap !important;
}

body .um-wrapper .um-card .um-actions .um-compare {
  order: 10;
  flex: 0 0 auto !important;
  width: 100%;
  max-width: 100%;
}

.um-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding-top: 0.15rem;
  font-size: 0.85rem;
  line-height: 1.2;
}

.um-compare-input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #004d7e;
  cursor: pointer;
}

.um-compare-label {
  margin: 0;
  color: #2d373f;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.um-compare.is-selected .um-compare-label {
  color: #004d7e;
}

.um-compare.is-disabled {
  opacity: 0.45;
}

.um-compare.is-disabled .um-compare-input,
.um-compare.is-disabled .um-compare-label {
  cursor: not-allowed;
}

/* ---------- Bottom compare bar ---------- */
.rc-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5001;
  background: #fff;
  border-top: 3px solid #004d7e;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.15);
  transform: translateY(calc(100% + 150px));
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
  font-size: 0.875rem;
}

.rc-bar.is-visible {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.3s ease, visibility 0s linear 0s;
}

body.rc-bar-open {
  padding-bottom: var(--rc-bar-space, 110px) !important;
}

.rc-bar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
}

.rc-bar-heading {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

.rc-bar-title {
  font-weight: 700;
  color: #0f172a;
}

.rc-bar-count {
  color: #64748b;
  font-size: 0.8rem;
}

.rc-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rc-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  min-height: 64px;
  padding: 0.4rem 1.9rem 0.4rem 0.4rem;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
}

.rc-slot-img {
  flex: 0 0 auto;
  width: 64px;
  height: 52px;
  object-fit: contain;
}

.rc-slot-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rc-slot-make {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.rc-slot-model {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-slot-remove,
.rc-col-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef2f6;
  color: #2d373f;
  font-size: 1rem;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
}

.rc-slot-remove:hover,
.rc-col-remove:hover {
  background: #ce2025;
  color: #fff;
}

.rc-slot-empty {
  justify-content: center;
  padding-right: 0.4rem;
  border-style: dashed;
  background: #f8fafc;
  color: #94a3b8;
}

.rc-bar-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  flex: 0 0 auto;
}

/* ---------- Buttons ---------- */
.rc-btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.rc-btn-primary {
  background: #004d7e;
  color: #fff !important;
}

.rc-btn-primary:hover,
.rc-btn-primary:focus {
  background: #ce2025;
  color: #fff !important;
}

.rc-btn-primary:disabled {
  background: #cbd5e1;
  color: #fff !important;
  cursor: not-allowed;
}

.rc-btn-secondary {
  background: #2c363d;
  color: #fff !important;
}

.rc-btn-secondary:hover,
.rc-btn-secondary:focus {
  background: #888;
  color: #fff !important;
}

.rc-btn-link {
  padding: 0.3rem 0.5rem;
  background: none;
  color: #004d7e !important;
  text-decoration: underline !important;
}

.rc-btn-link:hover {
  color: #ce2025 !important;
}

.rc-btn-block {
  display: block;
  width: 100%;
}

.rc-btn-block + .rc-btn-block {
  margin-top: 0.4rem;
}

.rc-actions {
  display: flex;
  gap: 0.4rem;
}

.rc-actions .rc-btn {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  white-space: normal;
}

@media (max-width: 575.98px) {
  .rc-actions {
    flex-direction: column;
  }
}

/* ---------- Modal ---------- */
.rc-modal {
  position: fixed;
  inset: 0;
  z-index: 60010;
  display: none;
}

.rc-modal.is-open {
  display: block;
}

body.rc-modal-open {
  overflow: hidden;
}

.rc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
}

.rc-modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: calc(100% - 2rem);
  max-width: 1000px;
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
  outline: none;
  animation: rc-rise 0.25s ease;
}

@keyframes rc-rise {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.rc-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.rc-modal-title {
  flex: 1 1 auto;
  margin: 0 !important;
  font-size: 1.2rem !important;
  font-weight: 700;
  color: #0f172a;
}

.rc-diff-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.85rem;
  color: #2d373f;
  cursor: pointer;
}

.rc-diff-toggle input {
  accent-color: #004d7e;
}

.rc-modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef2f6;
  color: #2d373f;
  font-size: 1.4rem;
  line-height: 36px;
  cursor: pointer;
}

.rc-modal-close:hover {
  background: #ce2025;
  color: #fff;
}

.rc-modal-body {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.rc-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e5e7eb;
}

/* ---------- Compare table ---------- */
.rc-table-wrap {
  overflow-x: auto;
}

.rc-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.875rem;
}

.rc-table th,
.rc-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #eef2f6;
  text-align: center;
  vertical-align: middle;
}

.rc-table .rc-th-label,
.rc-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 160px;
  background: #fff;
  color: #004d7e;
  font-weight: 700;
  text-align: left;
}

.rc-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 2px solid #e5e7eb;
}

.rc-table thead .rc-th-label {
  z-index: 3;
}

.rc-th-machine {
  position: relative;
  padding-top: 1.75rem !important;
}

.rc-machine-img {
  display: block;
  width: 100%;
  max-width: 160px;
  height: 110px;
  margin: 0 auto 0.5rem;
  object-fit: contain;
}

.rc-machine-make {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.rc-machine-model {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.rc-table tbody tr:nth-child(even) td,
.rc-table tbody tr:nth-child(even) th {
  background: #f8fafc;
}

.rc-row-diff td {
  font-weight: 600;
  color: #0f172a;
}

.rc-diff-only .rc-row-same {
  display: none;
}

.rc-row-actions td,
.rc-row-actions th {
  border-bottom: 0;
  background: #fff !important;
}

.rc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rc-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ---------- Tablet / mobile: sit above the fixed bottom nav ---------- */
@media (max-width: 991.98px) {
  .rc-bar {
    z-index: 4999;
  }

  .rc-bar-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
  }

  .rc-bar-heading {
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
    flex: 1 1 auto;
  }

  .rc-bar-actions {
    flex-direction: row;
    align-items: center;
    order: 2;
  }

  .rc-slots {
    order: 3;
    flex: 0 0 100%;
    gap: 0.4rem;
  }

  .rc-slot {
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-height: 0;
    padding: 0.35rem 0.35rem 0.4rem;
    text-align: center;
  }

  .rc-slot-img {
    width: 100%;
    height: 44px;
  }

  .rc-slot-text {
    align-items: center;
    max-width: 100%;
  }

  .rc-slot-make {
    font-size: 0.65rem;
  }

  .rc-slot-model {
    max-width: 100%;
    font-size: 0.75rem;
  }

  .rc-slot-remove {
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    line-height: 22px;
  }

  .rc-slot-empty {
    min-height: 76px;
    font-size: 0.75rem;
  }
}

@media (max-width: 575.98px) {
  .rc-modal-dialog {
    width: 100%;
    max-height: 100vh;
    height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .rc-modal-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  .rc-diff-toggle {
    order: 3;
    flex: 0 0 100%;
  }

  .rc-table {
    font-size: 0.8rem;
  }

  .rc-table .rc-th-label,
  .rc-table tbody th {
    width: 110px;
  }

  .rc-machine-img {
    height: 80px;
  }
}
