:is(.product-selector-row-actions, .model-compare-tray, .model-compare-page) {
  --model-compare-green: #087147;
  --model-compare-ink: #192a24;
  --model-compare-muted: #485c53;
  --model-compare-line: #dbe7e1;
  --model-compare-surface: #f2f7f4;
  --model-compare-difference: #edf8f1;
  --model-compare-white: #fff;
}

.product-selector-row-actions [hidden],
.model-compare-tray[hidden],
.model-compare-tray [hidden],
.model-compare-page [hidden] {
  display: none !important;
}

.model-compare-tray-open {
  padding-bottom: calc(var(--model-compare-tray-space, 130px) + 16px + env(safe-area-inset-bottom));
}

.model-compare-toggle,
.model-compare-primary,
.model-compare-text-button,
.model-compare-icon-button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.model-compare-toggle,
.model-compare-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid var(--model-compare-line);
  border-radius: 6px;
  background: var(--model-compare-white);
  color: var(--model-compare-green);
  line-height: 1.3;
  text-decoration: none;
}

.model-compare-toggle:hover,
.model-compare-toggle[aria-pressed="true"] {
  background: var(--model-compare-difference);
  border-color: var(--model-compare-green);
}

.model-compare-primary {
  background: var(--model-compare-green);
  border-color: var(--model-compare-green);
  color: var(--model-compare-white);
}

.model-compare-primary:hover {
  background: #05603d;
  color: var(--model-compare-white);
}

.model-compare-primary:disabled {
  opacity: .5;
  cursor: default;
}

.model-compare-icon-button,
.model-compare-text-button {
  border: 0;
  background: transparent;
  color: var(--model-compare-green);
}

.model-compare-text-button {
  min-height: 38px;
  padding: 3px 6px;
}

.model-compare-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 6px;
  line-height: 1;
  font-size: 20px;
}

.model-compare-text-button:hover,
.model-compare-back:hover,
.model-compare-column-actions a:not(.model-compare-primary):hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.model-compare-icon-button:hover {
  background: var(--model-compare-difference);
}

:is(.model-compare-tray, .product-selector-row-actions, .model-compare-page) :focus-visible {
  outline: 2px solid var(--model-compare-green);
  outline-offset: 2px;
}

.model-compare-tray {
  position: fixed;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "count clear" "list open" "status status";
  align-items: center;
  column-gap: 10px;
  z-index: 200;
  inset-inline: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 920px;
  margin-inline: auto;
  padding: 8px 16px 13px;
  border: 1px solid var(--model-compare-line);
  border-radius: 10px;
  box-shadow: 0 7px 27px #18352926;
  background: var(--model-compare-surface);
  color: var(--model-compare-ink);
  font-size: 14px;
}

.model-compare-tray-count,
.model-compare-list,
.model-compare-chip {
  display: flex;
  align-items: center;
}

.model-compare-tray-count {
  grid-area: count;
  min-width: 0;
}

.model-compare-tray-panel {
  display: contents;
}

.model-compare-tray-toggle {
  display: none;
}

.model-compare-tray [data-model-compare-clear] {
  grid-area: clear;
  justify-self: end;
}

.model-compare-tray [data-model-compare-open] {
  grid-area: open;
  justify-self: end;
}

.model-compare-list {
  grid-area: list;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.model-compare-chip,
.model-compare-slot-empty {
  min-height: 36px;
  border-radius: 6px;
}

.model-compare-chip {
  padding-inline-start: 9px;
  border: 1px solid var(--model-compare-line);
  background: var(--model-compare-white);
  font-weight: 600;
  gap: 3px;
}

.model-compare-slot-empty {
  min-width: 45px;
  border: 1px dashed #bacdc1;
}

.model-compare-status {
  grid-area: status;
  margin: 5px 0 0;
  color: var(--model-compare-muted);
  font-size: 13px;
}

.model-compare-status:empty {
  display: none;
}

.model-compare-page {
  padding-block: 30px 64px;
  color: var(--model-compare-ink);
  font-size: 15px;
}

.model-compare-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--model-compare-green);
  font-weight: 600;
}

[dir="rtl"] .model-compare-back svg {
  transform: scaleX(-1);
}

.model-compare-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0 20px;
}

.model-compare-heading h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 37px);
  line-height: 1.15;
  font-weight: 700;
}

.model-compare-subtitle,
.model-compare-error {
  margin: 8px 0 0;
  color: var(--model-compare-muted);
  line-height: 1.5;
}

.model-compare-scroll-hint {
  display: none;
}

.model-compare-units {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--model-compare-muted);
  font-weight: 600;
}

.model-compare-units select {
  min-height: 40px;
  padding: 4px 8px;
  border: 1px solid var(--model-compare-line);
  border-radius: 6px;
  background: var(--model-compare-white);
  color: var(--model-compare-ink);
  font: inherit;
}

.model-compare-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--model-compare-line);
  border-radius: 9px;
  background: var(--model-compare-white);
}

.model-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: start;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

.model-compare-table :is(th, td) {
  min-width: 145px;
  padding: 11px 14px;
  border-block-end: 1px solid var(--model-compare-line);
  line-height: 1.4;
  vertical-align: middle;
}

.model-compare-table tr > :first-child {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  min-width: 149px;
  width: 23%;
  background: #f8faf9;
  border-inline-end: 1px solid var(--model-compare-line);
  text-align: start;
}

.model-compare-table tr > :nth-child(n+3) {
  border-inline-start: 1px solid var(--model-compare-line);
}

.model-compare-table thead th,
.model-compare-table thead tr > :first-child {
  background: var(--model-compare-surface);
}

.model-compare-table tfoot :is(th, td) {
  border-block-end: 0;
}

.model-compare-table tbody td {
  text-align: end;
}

.model-compare-table th small {
  color: var(--model-compare-muted);
  font-size: 13px;
  white-space: nowrap;
}

.model-compare-column-heading,
.model-compare-column-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.model-compare-column-heading {
  justify-content: space-between;
  font-weight: 700;
}

.model-compare-column-actions {
  justify-content: flex-start;
  column-gap: 13px;
}

.model-compare-column-actions a:not(.model-compare-primary) {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--model-compare-green);
  font-weight: 600;
}

.model-compare-column-actions a {
  white-space: nowrap;
}

.model-compare-difference {
  background: var(--model-compare-difference);
  font-weight: 650;
}

@media (max-width: 767px) {
  /* Keep the existing header contact controls without covering the comparison actions. */
  :is(.model-compare-tray-open, .model-compare-view) .e-module-202208160923 {
    display: none;
  }

  .model-compare-page {
    padding-block: 16px 40px;
  }

  .model-compare-tray {
    inset-inline: 8px;
    grid-template-areas: "count open" "list list" "clear clear" "status status";
    padding: 6px 10px;
  }

  .model-compare-tray-collapsed {
    grid-template-areas: "count open" "status status";
  }

  .model-compare-tray-count [data-model-compare-count] {
    display: none;
  }

  .model-compare-tray-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-align: start;
  }

  .model-compare-tray-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  .model-compare-tray .model-compare-list {
    margin-top: 7px;
  }

  .model-compare-tray-collapsed .model-compare-minimum {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .model-compare-slot-empty {
    display: none;
  }

  .model-compare-scroll-hint {
    display: block;
    margin: 0 0 8px;
    color: var(--model-compare-muted);
    font-size: 13px;
  }

  .model-compare-table :is(th, td) {
    min-width: 124px;
    padding: 8px;
  }

  .model-compare-table tr > :first-child {
    min-width: 117px;
  }

  .model-compare-column-actions a {
    white-space: normal;
  }
}

@media (pointer: coarse) {
  :is(.model-compare-toggle, .model-compare-primary, .model-compare-icon-button, .model-compare-text-button, .model-compare-back),
  .model-compare-units select,
  .model-compare-column-actions a:not(.model-compare-primary) {
    min-height: 44px;
  }

  .model-compare-icon-button {
    min-width: 44px;
  }
}
