/* ─────────────────────────────────────────────────────────────
   Techwish — Product Compare styles
   Consumes tokens from the theme (--tw-mint, --tw-line, etc).
   Standalone fallback values are provided so the plugin still
   looks reasonable if the child theme is disabled.
   ───────────────────────────────────────────────────────────── */

/* ───── PDP "Add to compare" toggle ───── */
.tw-compare-toggle {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tw-compare-toggle.is-active {
  border-color: var(--tw-mint, #2DCE92);
  color: var(--tw-mint-600, #1FB37C);
  background: var(--tw-mint-050, #F1FAF5);
}

/* ───── Floating dock ───── */
.tw-compare-dock {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(160%);
  z-index: var(--tw-z-dock, 30);
  max-width: 1100px;
  width: calc(100% - 48px);
  background: var(--tw-glass-900, #0E1311);
  color: #fff;
  border-radius: var(--tw-radius-lg, 18px);
  box-shadow: 0 24px 60px -20px rgba(11,15,13,.55);
  transition: transform var(--tw-dur-med, .28s) var(--tw-ease, cubic-bezier(.2,.7,.2,1)),
              opacity var(--tw-dur-med, .28s) var(--tw-ease, cubic-bezier(.2,.7,.2,1));
  opacity: 0;
  pointer-events: none;
}
.tw-compare-dock.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.tw-compare-dock__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 14px 18px;
}
.tw-compare-dock__lead {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 80px;
}
.tw-compare-dock__lead .tw-eyebrow {
  color: var(--tw-mint, #2DCE92) !important;
}
.tw-compare-dock__count {
  font-family: var(--tw-mono, ui-monospace);
  font-size: 12px;
  color: #c6d2cc;
}
.tw-compare-dock__list {
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
}
.tw-compare-dock__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  background: var(--tw-glass-700, #1B221E);
  border-radius: 999px;
  flex-shrink: 0;
  max-width: 220px;
}
.tw-compare-dock__thumb { display: block; flex-shrink: 0; }
.tw-compare-dock__thumb img {
  width: 36px; height: 36px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--tw-paper-2, #F4F7F5);
}
.tw-compare-dock__info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tw-compare-dock__name {
  color: #fff;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  max-width: 140px;
}
.tw-compare-dock__remove {
  background: transparent;
  border: 0;
  color: #98a09b;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.tw-compare-dock__remove:hover { color: #fff; }
.tw-compare-dock__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tw-compare-dock__actions .tw-btn.is-ghost {
  background: transparent;
  color: #c6d2cc;
  border-color: rgba(255,255,255,.16);
}
.tw-compare-dock__actions .tw-btn.is-ghost:hover {
  border-color: rgba(255,255,255,.4);
  color: #fff;
}

@media (max-width: 720px) {
  .tw-compare-dock__inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tw-compare-dock__list { order: 2; }
  .tw-compare-dock__actions { order: 3; }
}

/* ───── Compare page table ───── */
.tw-compare-page { padding: 48px 0 80px; }
.tw-compare-page__header { margin-bottom: 32px; }
.tw-compare-page__header .tw-eyebrow { display: inline-block; margin-bottom: 8px; }
.tw-compare-page__header .tw-lede { margin-top: 10px; }

.tw-compare-page__empty {
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed var(--tw-line, #DDE3E0);
  border-radius: var(--tw-radius-lg, 18px);
  color: var(--tw-mute, #6B7470);
}
.tw-compare-page__empty .tw-btn { margin-top: 14px; }

.tw-compare-page__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tw-compare-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 720px;
}
.tw-compare-table th,
.tw-compare-table td {
  vertical-align: top;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tw-line-soft, #ECEFED);
  text-align: left;
  font-size: 14px;
}
.tw-compare-table .tw-compare-table__rowhead {
  width: 200px;
  font-family: var(--tw-mono, ui-monospace);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tw-mute, #6B7470);
  font-weight: 500;
}
.tw-compare-table__row--image td img {
  width: 100%; max-width: 220px;
  height: auto;
  border-radius: var(--tw-radius-md, 10px);
  background: var(--tw-paper-2, #F4F7F5);
}
.tw-compare-table__row--title td a {
  font-family: var(--tw-display, sans-serif);
  font-weight: 600;
  font-size: 16px;
  color: var(--tw-ink, #0B0F0D);
  text-decoration: none;
}
.tw-compare-table__row--title td a:hover { color: var(--tw-mint-600, #1FB37C); }
.tw-compare-table__row--price td {
  font-family: var(--tw-mono, ui-monospace);
  font-weight: 600;
  font-size: 16px;
  color: var(--tw-ink, #0B0F0D);
}
.tw-compare-table__row--cart td {
  padding-top: 20px;
}
.tw-c-empty { color: var(--tw-mute-2, #98A09B); }
.tw-c-rating { font-family: var(--tw-mono, ui-monospace); color: var(--tw-mint-600, #1FB37C); }

.tw-compare-table__remove {
  background: transparent;
  border: 1px solid var(--tw-line, #DDE3E0);
  width: 28px; height: 28px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  color: var(--tw-mute, #6B7470);
  margin-left: auto;
  display: block;
}
.tw-compare-table__remove:hover {
  color: var(--tw-ink, #0B0F0D);
  border-color: var(--tw-ink, #0B0F0D);
}

.tw-compare-page__actions {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
}

/* Hide WP screen-reader text spans visually */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
