.product-actions .comparison-toggle {
  grid-column: 1 / -1;
  min-height: 2.75rem;
  border: 1px solid rgba(11, 88, 76, 0.24);
  border-radius: 999px;
  background: #f4f0e7;
  color: #0b584c;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.product-actions .comparison-toggle[aria-pressed="true"] {
  border-color: #0b584c;
  background: #0b584c;
  color: #fff;
}

.product-actions .comparison-toggle:focus-visible,
.comparison-tray button:focus-visible,
.comparison-dialog button:focus-visible {
  outline: 3px solid #f6b13c;
  outline-offset: 3px;
}

.product-actions .comparison-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.comparison-tray {
  position: fixed;
  z-index: 70;
  right: 1.25rem;
  bottom: 1.25rem;
  left: 1.25rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.35rem;
  background: rgba(8, 67, 58, 0.96);
  color: #fffaf1;
  box-shadow: 0 1.2rem 3.5rem rgba(4, 35, 30, 0.32);
  backdrop-filter: blur(14px);
}

.comparison-tray[hidden] {
  display: none;
}

.comparison-tray-heading span,
.comparison-tray-heading strong {
  display: block;
}

.comparison-tray-heading span {
  color: #f6b13c;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.comparison-tray-heading strong {
  margin-top: 0.15rem;
  white-space: nowrap;
}

.comparison-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.comparison-chips button {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 0.67rem;
  cursor: pointer;
}

.comparison-status {
  margin: 0;
  color: #d7e6df;
  font-size: 0.68rem;
  line-height: 1.3;
}

.comparison-tray-actions {
  display: flex;
  gap: 0.5rem;
}

.comparison-tray-actions button,
.comparison-dialog-header button {
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.comparison-clear {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #fff;
}

.comparison-open {
  border: 0;
  background: #f6b13c;
  color: #173f37;
}

.comparison-open:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.comparison-dialog {
  width: min(76rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 2rem;
  background: #fffaf1;
  color: #173f37;
  box-shadow: 0 2rem 6rem rgba(4, 35, 30, 0.36);
}

.comparison-dialog::backdrop {
  background: rgba(5, 38, 33, 0.75);
  backdrop-filter: blur(8px);
}

.comparison-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 2rem);
}

.comparison-dialog-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem clamp(1.2rem, 4vw, 2.4rem);
  background: #0b584c;
  color: #fff;
}

.comparison-dialog-header p,
.comparison-dialog-header h2 {
  margin: 0;
}

.comparison-dialog-header p {
  color: #f6b13c;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.comparison-dialog-header h2 {
  margin-top: 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
}

.comparison-dialog-header button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.comparison-table-wrap {
  overflow: auto;
  padding: clamp(1rem, 3vw, 2rem);
}

.comparison-table-wrap table {
  width: 100%;
  min-width: 46rem;
  border-spacing: 0;
  border-collapse: separate;
  table-layout: fixed;
}

.comparison-table-wrap caption {
  padding: 0 0 0.75rem;
  color: #69736f;
  font-size: 0.75rem;
  text-align: left;
}

.comparison-table-wrap th,
.comparison-table-wrap td {
  padding: 0.9rem;
  border-right: 1px solid #dbe5de;
  border-bottom: 1px solid #dbe5de;
  background: #fff;
  color: #435c56;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
}

.comparison-table-wrap thead th {
  background: #e3f0e8;
  color: #173f37;
}

.comparison-table-wrap tr > :first-child {
  width: 10rem;
  border-left: 1px solid #dbe5de;
  color: #173f37;
  font-weight: 800;
}

.comparison-table-wrap thead tr:first-child > * {
  border-top: 1px solid #dbe5de;
}

.comparison-table-wrap thead tr:first-child > :first-child {
  border-top-left-radius: 1rem;
}

.comparison-table-wrap thead tr:first-child > :last-child {
  border-top-right-radius: 1rem;
}

.comparison-table-wrap th strong,
.comparison-table-wrap th button {
  display: block;
}

.comparison-table-wrap th button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin-top: 0.55rem;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: #d95d45;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  cursor: pointer;
}

.comparison-value-primary,
.comparison-value-secondary {
  display: block;
}

.comparison-value-primary {
  color: #173f37;
  font-weight: 800;
}

.comparison-value-secondary {
  margin-top: 0.3rem;
  color: #69736f;
  font-size: 0.68rem;
  line-height: 1.35;
}

.comparison-dialog-footer {
  padding: 0.85rem clamp(1.2rem, 4vw, 2.4rem);
  border-top: 1px solid rgba(11, 88, 76, 0.12);
  background: #fff0ce;
  color: #5f4a25;
  font-size: 0.72rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .comparison-tray {
    right: 0.65rem;
    bottom: 5.1rem;
    left: 0.65rem;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 1.15rem;
  }

  .comparison-chips {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .comparison-status {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .comparison-tray-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .comparison-clear {
    display: none;
  }

  .comparison-dialog {
    width: 100%;
    max-height: calc(100vh - 0.5rem);
    margin: auto 0 0;
    border-radius: 1.5rem 1.5rem 0 0;
  }

  .comparison-dialog-shell {
    max-height: calc(100vh - 0.5rem);
  }

  .comparison-dialog-header h2 {
    font-size: 1.45rem;
  }

  .comparison-dialog-header button {
    min-width: 3rem;
    padding: 0 0.75rem;
  }

  .comparison-table-wrap {
    padding: 0.85rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .comparison-tray:not([hidden]) {
    animation: comparison-tray-enter 220ms ease both;
  }
}

@keyframes comparison-tray-enter {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
}
