/* CompareSmartDevice — R3 category workspace (2026-08-29)
   Styles for the universal category workspace: active-filter bar, filter
   sidebar, density modes (cards/compact/table), compare tray. Scoped to
   .ws-* classes; no global overrides. */

.ws-activebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border, #2a2f3a);
  border-radius: 10px;
  background: var(--surface, #14171d);
}
.ws-count { margin: 0; }
.ws-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border, #2a2f3a);
  border-radius: 999px;
  font-size: 0.8rem;
  text-decoration: none;
  color: inherit;
}
.ws-chip:hover { border-color: var(--accent, #5b8cff); }
.ws-chip__x { font-weight: 700; opacity: 0.7; }
a.ws-chip__x { text-decoration: none; }
.ws-chip--clear { border-style: dashed; }

.ws-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .ws-layout { grid-template-columns: 1fr; }
}

.ws-sidebar {
  border: 1px solid var(--border, #2a2f3a);
  border-radius: 10px;
  padding: 1rem;
  background: var(--surface, #14171d);
}
.ws-sidebar__title { font-size: 1rem; margin: 0 0 0.75rem; }
.ws-filter { padding: 0.6rem 0; border-top: 1px solid var(--border, #2a2f3a); }
.ws-filter:first-of-type { border-top: 0; }
.ws-filter__label { font-size: 0.85rem; margin: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.ws-filter__help { margin: 0.15rem 0 0.4rem; }
.ws-filter__options { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.ws-option {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border, #2a2f3a);
  border-radius: 8px;
  font-size: 0.82rem;
  text-decoration: none;
  color: inherit;
  background: transparent;
}
.ws-option:hover { border-color: var(--accent, #5b8cff); }
.ws-option--on {
  border-color: var(--accent, #5b8cff);
  background: color-mix(in srgb, var(--accent, #5b8cff) 18%, transparent);
  font-weight: 600;
}
.ws-sidebar__note { margin-top: 0.75rem; }

.ws-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.ws-sortform { display: flex; align-items: center; gap: 0.5rem; }
.ws-sortform select { padding: 0.3rem 0.5rem; border-radius: 8px; }
.ws-density { display: inline-flex; border: 1px solid var(--border, #2a2f3a); border-radius: 8px; overflow: hidden; }
.ws-density__btn {
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid var(--border, #2a2f3a);
}
.ws-density__btn:last-child { border-right: 0; }
.ws-density__btn--on { background: var(--accent, #5b8cff); color: #fff; font-weight: 600; }

.ws-nonmatch { margin: 0 0 0.75rem; }

/* Compact density */
.ws-compact { display: grid; gap: 0.5rem; }
.ws-compact__card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
}
.ws-compact__card h3 { margin: 0; font-size: 1rem; }
.ws-compact__specs { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0; font-size: 0.85rem; }

/* Match reasons */
.ws-reasons { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.ws-reason {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border, #2a2f3a);
}
.ws-reason--matched { border-color: #2e7d32; color: #7cc47f; }
.ws-reason--unknown { opacity: 0.75; }
.ws-reason--not_matched { opacity: 0.55; }

/* Price */
.ws-price { font-weight: 700; }
.ws-price--card { margin: 0.4rem 0; }
.ws-price--card .text-dim { display: block; font-weight: 400; }

/* Card actions */
.ws-card__actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto; }
.ws-comparetoggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border, #2a2f3a);
  border-radius: 8px;
  font-size: 0.85rem;
  text-decoration: none;
  color: inherit;
}
.ws-comparetoggle:hover { border-color: var(--accent, #5b8cff); }
.ws-comparetoggle--on {
  border-color: var(--accent, #5b8cff);
  background: color-mix(in srgb, var(--accent, #5b8cff) 18%, transparent);
  font-weight: 600;
}
.ws-comparetoggle--full { opacity: 0.55; }

/* Table density */
.ws-tablewrap { overflow-x: auto; }
.ws-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ws-table th, .ws-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border, #2a2f3a);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.ws-table th a { color: inherit; text-decoration: none; }
.ws-table th a:hover { color: var(--accent, #5b8cff); }
.ws-table__sorted { color: var(--accent, #5b8cff); font-weight: 700; }
.ws-table__model { font-weight: 600; }

/* Gated-out section */
.ws-gated {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px dashed var(--border, #2a2f3a);
  border-radius: 10px;
}
.ws-gated h2 { font-size: 1rem; margin: 0 0 0.4rem; }
.ws-gated__list { margin: 0.5rem 0 0; padding-left: 1.2rem; }

/* Compare tray */
.ws-tray {
  position: sticky;
  bottom: 0.75rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--accent, #5b8cff);
  border-radius: 10px;
  background: var(--surface, #14171d);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.ws-tray--empty { border-style: dashed; border-color: var(--border, #2a2f3a); box-shadow: none; }
.ws-tray__items { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ws-tray p { margin: 0; }

/* SEO content below workspace */
.ws-seo { margin-top: 2.5rem; }

/* Loading state during JS fetch swaps */
#ws-root[data-ws-loading] #ws-results,
#ws-root[data-ws-loading] #ws-sidebar { opacity: 0.45; pointer-events: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
