/* ══════════════════════════════════════════════════════════════════
   Swordis — CATEGORY page styles. Chrome (header/footer/cards/modal)
   comes from css/chrome.css; this file owns the category
   header, toolbar, filter drawer, grid extras, and their mobile rules.
   ══════════════════════════════════════════════════════════════════ */

/* ── Header block ─────────────────────────────────────────────── */
.ct-header {
  padding-top: 20px;
  padding-bottom: 24px;
}

.ct-breadcrumb {
  margin-bottom: 8px;
  padding: 0px;
}

.ct-breadcrumb a {
  color: var(--fg-secondary);
}

.ct-breadcrumb a:hover {
  color: var(--accent-600);
}

.ct-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 34px;
  line-height: 43px;
  letter-spacing: -.015em;
  color: var(--ink-900);
  margin: 0 0 12px;
}

.ct-title-q {
  color: var(--accent-600);
}

.ct-desc {
  font-size: 16px;
  line-height: 26px;
  color: var(--fg-secondary);
  max-width: 960px;
}

.ct-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.ct-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--fg-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.ct-chip:hover {
  border-color: var(--ink-800);
  color: var(--ink-900);
}

.ct-chip.is-active {
  border-color: var(--ink-900);
  color: var(--ink-900);
  font-weight: 600;
}

.ct-header-rule {
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ── Toolbar ──────────────────────────────────────────────────── */
.ct-main {
  padding-bottom: 80px;
}

.ct-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.ct-toolbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.ct-filters-btn {
  height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid var(--ink-900);
  background: var(--ink-900);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}

.ct-filters-btn:hover {
  background: var(--ink-800);
  border-color: var(--ink-800);
}

.ct-filters-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  color: var(--ink-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ct-filters-badge[hidden],
.ct-group-badge[hidden],
.ct-drawer-active[hidden] {
  display: none;
}

.ct-showing {
  font-size: 15px;
  color: var(--fg-secondary);
}

.ct-showing b {
  color: var(--ink-900);
  font-weight: 600;
}

/* Sort - button + sheet (woocommerce/global/catalog-sort.php): a dropdown under the button here,
   a bottom sheet on mobile */
.ct-sort {
  position: relative;
}

.ct-sort-btn {
  height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid var(--ink-900);
  background: #fff;
  color: var(--ink-900);
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
  transition: box-shadow .15s;
}

.ct-sort-btn:hover,
.ct-sort-btn[aria-expanded="true"] {
  box-shadow: inset 0 0 0 1px var(--ink-900);
}

.ct-sort-btn-text {
  color: var(--fg-tertiary);
}

.ct-sort-btn-text b {
  color: var(--ink-900);
  font-weight: 600;
}

/* transparent here - only catches the click outside the dropdown */
.ct-sort-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
}

.ct-sort-sheet {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(11, 19, 16, .14);
  animation: ct-fade .15s ease-out;
}

.ct-sort-backdrop[hidden],
.ct-sort-sheet[hidden] {
  display: none;
}

.ct-sort-head {
  display: none;
}

.ct-sort-list {
  padding: 4px 10px;
}

.ct-sort-opt {
  width: 100%;
  height: 51px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--ink-900);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.ct-sort-list li:last-child .ct-sort-opt {
  border-bottom: 0;
}

.ct-sort-opt .ic {
  flex-shrink: 0;
  visibility: hidden;
}

.ct-sort-opt:hover {
  color: var(--accent-500);
}

.ct-sort-opt.is-active {
  color: var(--accent-500);
}

.ct-sort-opt.is-active .ic {
  visibility: visible;
}

/* Applied chips bar */
.ct-chipbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 20px;
}

.ct-chipbar[hidden] {
  display: none;
}

.ct-chipbar-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ct-applied {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  background: var(--ink-100);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--ink-900);
}

.ct-applied button {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-tertiary);
  background: transparent;
  cursor: pointer;
}

.ct-applied button:hover {
  background: var(--ink-200);
  color: var(--ink-900);
}

.ct-clearall {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  cursor: pointer;
}

.ct-clearall:hover {
  color: var(--accent-600);
}

/* ── Grid ─────────────────────────────────────────────────────── */
.ct-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-top: 24px;
  position: relative;
  transition: filter .2s;
}

.ct-grid.is-loading {
  filter: blur(1px);
}

/* Back from a product to a grid grown with "Show more" (swordis_plp_restore_guard()): ?page=N alone stays out of
   sight, layout kept, until woo-facets-ajax.js has put the pages before it back - a spinner where the grid starts */
html.sw-plp-restoring .ct-prev {
  display: none;
}

html.sw-plp-restoring .ct-grid,
html.sw-plp-restoring .ct-next {
  visibility: hidden;
}

html.sw-plp-restoring .ct-grid::before {
  content: "";
  position: absolute;
  top: 56px;
  left: 50%;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  border: 2px solid var(--ink-200);
  border-top-color: var(--ink-900);
  animation: ct-spin .8s linear infinite;
  visibility: visible;
}

.sw-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  animation: ct-spin .8s linear infinite;
  display: inline-block;
}

@keyframes ct-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Video testimonial cell (matches the prototype's CategoryVideoCell) - stretches to the height of the
   product cards in its row instead of setting it (a taller tile would stretch those cards) */
.ct-video {
  position: relative;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ct-video-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 240px;
  background: linear-gradient(160deg, #1c2a26 0%, #0b1310 100%);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
  box-shadow: 0 10px 30px -14px rgba(217, 117, 71, .45), 0 1px 4px rgba(0, 0, 0, .15);
  transition: transform .2s ease, box-shadow .2s ease;
}

.ct-video:hover .ct-video-stage {
  transform: translateY(-2px);
  box-shadow: 0 16px 42px -14px rgba(217, 117, 71, .6), 0 3px 8px rgba(0, 0, 0, .2);
}

.ct-video-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 35% 40%, rgba(255, 255, 255, .1), transparent 60%);
  pointer-events: none;
}

.ct-video-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 110px;
  z-index: 1;
  background: linear-gradient(to bottom,
      rgba(11, 19, 16, .72) 0%,
      rgba(11, 19, 16, .55) 28%,
      rgba(11, 19, 16, .34) 52%,
      rgba(11, 19, 16, .16) 74%,
      rgba(11, 19, 16, .05) 90%,
      rgba(11, 19, 16, 0) 100%);
  pointer-events: none;
}

.ct-video-flag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  color: #f5c77a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8), 0 0 14px rgba(0, 0, 0, .55);
}

.ct-video-flag .ct-video-flag-ic {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}

.ct-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ct-video-play span {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  color: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
}

.ct-video-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 12px 12px;
  color: #fff;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, 0) 100%);
}

.ct-video-author {
  font-size: 15px;
  font-weight: 600;
  line-height: 19px;
  letter-spacing: -.005em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

.ct-video-role {
  display: block;
  font-size: 12px;
  line-height: 15px;
  color: rgba(255, 255, 255, .82);
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

.ct-video .story-thumb-poster {
  opacity: .85;
}

/* Hover preview (main.js [stories]): .is-playing - a muted <video> over the poster, set once it has a
   frame; .is-vt-playing - its video is playing in the modal */
.ct-video.is-playing .story-thumb-video,
.ct-video.is-playing .story-thumb-poster {
  opacity: 1;
}

.ct-video-play,
.ct-video-caption {
  transition: opacity .2s ease;
}

.ct-video.is-playing .ct-video-play,
.ct-video.is-playing .ct-video-caption,
.ct-video.is-vt-playing .ct-video-play {
  opacity: 0;
}

/* Empty state */
.ct-empty {
  padding: 64px 0 40px;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

.ct-empty-ic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink-100);
  color: var(--fg-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.ct-empty-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-900);
  margin-bottom: 8px;
}

.ct-empty-sub {
  font-size: 15px;
  line-height: 24px;
  color: var(--fg-secondary);
  margin-bottom: 20px;
  text-wrap: pretty;
}

/* Show more */
.ct-more {
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ct-more-btn {
  min-width: 260px;
  height: 52px;
  padding: 0 32px;
  border: 1px solid var(--ink-900);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-900);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 160ms ease, color 160ms ease;
}

.ct-more-btn:hover,
.ct-more-btn.is-loading {
  background: var(--ink-900);
  color: #fff;
}

.ct-more-btn.is-loading {
  cursor: wait;
}

.ct-more-note {
  font-size: 14px;
  color: var(--fg-tertiary);
}

/* ── Filter drawer ────────────────────────────────────────────── */
.ct-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(11, 19, 16, .22);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: ct-fade .2s ease-out;
}

.ct-drawer-backdrop[hidden] {
  display: none;
}

@keyframes ct-fade {
  from {
    opacity: 0;
  }
}

.ct-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 61;
  width: min(440px, 90vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 20px 0 60px rgba(0, 0, 0, .14);
  border-right: 1px solid var(--border-strong);
  animation: ct-slide .26s cubic-bezier(.2, .8, .2, 1);
}

.ct-drawer[hidden] {
  display: none;
}

@keyframes ct-slide {
  from {
    transform: translateX(-100%);
  }
}

.ct-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  /* the same scrollbar gutter as .ct-drawer-body, so the close icon lines up with the group chevrons
     whether the browser's scrollbar takes up room (desktop) or overlays (touch) */
  overflow: hidden;
  scrollbar-gutter: stable;
}

.ct-drawer-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink-900);
}

.ct-drawer-active {
  color: var(--fg-tertiary);
  font-size: 15px;
  font-family: var(--font-ui);
  font-weight: 400;
}

.ct-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-900);
  background: transparent;
  /* the 16px icon to the padding edge, like the 16px .ct-group-chev below it */
  margin-right: -10px;
}

.ct-drawer-close:hover {
  background: var(--ink-100);
}

.ct-drawer-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 8px 24px 24px;
}

.ct-drawer-foot {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.ct-drawer-clear {
  flex: 1;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-900);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.ct-drawer-clear:hover {
  background: var(--bg-muted);
}

.ct-drawer-apply {
  flex: 2;
  height: 44px;
}

/* Filter groups (accordion) */
.ct-group {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.ct-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
  background: transparent;
  cursor: pointer;
}

.ct-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-900);
}

.ct-group-badge {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--ink-900);
  /* round for one digit, a pill for two (like .ct-filters-badge) */
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ct-group-chev {
  color: var(--fg-tertiary);
  transition: transform .2s;
}

.ct-group.is-open .ct-group-chev {
  transform: rotate(180deg);
}

.ct-group-body {
  display: none;
  max-height: 275px;
  /* room for the selected color swatch's ring (box-shadow) - a scrolling group clips it - with the
     options kept in line with the group title */
  padding-left: 4px;
  margin-left: -4px;
}

/* Only a group whose options overflow scrolls on its own and keeps the wheel. The others are no scroll
   container at all, so over them the wheel always scrolls the filter panel - with overflow-y: auto and
   'contain' on every group, a short one like Battle Ready swallowed it
   (.is-scrollable: woo-facets-ajax.js syncGroupScroll()) */
.ct-group-body.is-scrollable {
  overflow-y: auto;
  -ms-scroll-chaining: none;
  overscroll-behavior: contain;
}

.ct-group-body::-webkit-scrollbar {
  width: 16px;
}

/* .ct-group-body::-webkit-scrollbar-track {
  background: #eaeaea;
} */

.ct-group-body::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 10px;

  /* The trick: Add a transparent border to act as padding */
  border: 4px solid transparent;

  /* Tell the background color to stay inside the fake padding */
  background-clip: padding-box;
}

.ct-group-body::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

.ct-group.is-open .ct-group-body {
  display: block;
}

/* Checkbox rows */
.ct-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
}

.ct-check input {
  display: none;
}

.ct-box {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background .12s, border-color .12s;
}

.ct-box .ic {
  opacity: 0;
}

.ct-check input:checked+.ct-box {
  background: var(--ink-900);
  border-color: var(--ink-900);
}

.ct-check input:checked+.ct-box .ic {
  opacity: 1;
}

.ct-check-label {
  font-size: 15px;
  color: var(--ink-800);
}

.ct-check input:checked~.ct-check-label {
  color: var(--ink-900);
  font-weight: 500;
}

.ct-check-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--fg-tertiary);
}

/* Color swatches — swatch circle left, label inline right */
.ct-swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.ct-swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, .08);
  transition: box-shadow .12s;
}

.ct-swatch.is-on .ct-swatch-dot,
.ct-check input:checked+.ct-swatch .ct-swatch-dot {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--accent-600);
}

.ct-swatch-label {
  font-size: 14px;
  color: var(--ink-800);
}

.ct-swatch.is-on .ct-swatch-label,
.ct-check input:checked+.ct-swatch .ct-swatch-label {
  color: var(--ink-900);
  font-weight: 600;
}

/* Price dual-range slider */
.ct-range {
  position: relative;
  height: 24px;
  margin-top: 6px;
}

.ct-range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: var(--ink-200);
  border-radius: 2px;
}

.ct-range-fill {
  position: absolute;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: var(--ink-900);
  border-radius: 2px;
}

.ct-range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  pointer-events: none;
}

.ct-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--ink-900);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  cursor: grab;
}

.ct-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--ink-900);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  cursor: grab;
}

.ct-range-vals {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--fg-secondary);
  margin-top: 8px;
}

/* ── Tablet (721–1024px): 3 products per row for more breathing room ── */
@media (min-width: 721px) and (max-width: 1024px) {
  .ct-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

/* ── Mobile (≤720px) ──────────────────────────────────────────── */
@media (max-width: 720px) {
  .ct-header {
    padding-top: 14px;
    padding-bottom: 0;
  }

  .ct-breadcrumb,
  .ct-breadcrumb p {
    font-size: 12px;
    line-height: 16px;
  }

  .ct-breadcrumb {
    gap: 4px;
    margin-bottom: 12px;
  }

  .ct-breadcrumb .separator {
    width: 10px;
    height: 10px;
  }

  .ct-title {
    font-size: 20px;
    line-height: 26px;
    margin-bottom: 8px;
  }

  .ct-title-q {
    color: var(--accent-600);
  }

  .ct-desc {
    font-size: 13px;
    line-height: 18px;
  }

  .ct-chips {
    margin-top: 16px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  /* touch screens swipe the row - no scrollbar */
  @media (hover: none) {
    .ct-chips {
      scrollbar-width: none;
    }

    .ct-chips::-webkit-scrollbar {
      display: none;
    }
  }

  /* mouse - a thin scrollbar shows while the row is hovered. Its track is always there, just
     transparent, so showing it doesn't push the row's content around */
  @media (hover: hover) {
    .ct-chips {
      scrollbar-width: thin;
      scrollbar-color: transparent transparent;
    }

    .ct-chips:hover {
      scrollbar-color: var(--fg-tertiary) transparent;
    }

    /* Safari (no scrollbar-color) */
    .ct-chips::-webkit-scrollbar {
      height: 6px;
    }

    .ct-chips::-webkit-scrollbar-thumb {
      border-radius: 3px;
      background: transparent;
    }

    .ct-chips:hover::-webkit-scrollbar-thumb {
      background: var(--fg-tertiary);
    }
  }

  .ct-chip {
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
    color: var(--ink-800);
    flex: 0 0 auto;
  }

  .ct-chip .ic {
    display: none;
  }

  .ct-chip.is-active {
    background: var(--ink-900);
    border-color: var(--ink-900);
    color: #fff;
  }

  .ct-header-rule {
    margin-top: 8px;
  }

  /* row 1: Filter (left) + sort (right); row 2: "Showing 24 of 73 swords".
     Not sticky (dev brief task 25): it stays at the top of the list and scrolls away with the page. Still
     positioned with a z-index, so it is the stacking context .is-sort-open lifts above the site header */
  .ct-toolbar {
    position: relative;
    z-index: 15;
    background: #fff;
    padding: 10px 0;
    gap: 10px;
    flex-wrap: wrap;
  }

  /* above the site header (z-index 20) while the sort sheet inside it is open */
  .ct-toolbar.is-sort-open {
    z-index: 70;
  }

  .ct-toolbar-left {
    display: contents;
  }

  .ct-sort {
    order: 2;
    margin-left: auto;
  }

  .ct-wide-only {
    display: none;
  }

  .ct-filters-btn {
    flex-shrink: 0;
    height: 32px;
    padding: 0 16px;
    gap: 7px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
  }

  .ct-filters-btn .ic {
    width: 12px;
    height: 12px;
  }

  .ct-filters-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 11px;
  }

  .ct-showing {
    order: 3;
    flex-basis: 100%;
    font-size: 13px;
  }

  .ct-showing .ct-wide-only {
    display: inline;
  }

  .ct-sort-btn {
    height: 32px;
    padding: 0 12px;
    gap: 6px;
    border-radius: 6px;
    font-size: 13px;
  }

  .ct-sort-btn:hover {
    box-shadow: none;
  }

  .ct-sort-btn[aria-expanded="true"] {
    box-shadow: inset 0 0 0 1px var(--ink-900);
  }

  .ct-sort-btn .ic {
    width: 13px;
    height: 13px;
  }

  /* Sort sheet: bottom sheet over a dimmed page */
  .ct-sort-backdrop {
    z-index: 60;
    background: rgba(0, 0, 0, .45);
    animation: ct-fade .2s ease-out;
  }

  .ct-sort-sheet {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 61;
    width: auto;
    max-height: 86vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
    border: 0;
    border-radius: 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .12);
    animation: ct-sheet .3s cubic-bezier(.2, .8, .2, 1);
  }

  .ct-sort-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 59px;
    /* the list's 10px + the option's 4px - the title and the close icon line up with the
       option labels and the check icons */
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
  }

  .ct-sort-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    color: var(--ink-900);
  }

  .ct-sort-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    color: var(--fg-secondary);
    cursor: pointer;
    /* the 16px icon to the padding edge */
    margin-right: -10px;
  }

  .ct-sort-opt:hover:not(.is-active) {
    color: var(--ink-900);
  }

  .ct-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 16px;
  }

  /* Video cell: fit the flag on one line */
  .ct-video-flag {
    font-size: 9.5px;
    letter-spacing: .07em;
    gap: 5px;
  }

  .ct-video-flag .ct-video-flag-ic {
    width: 15px;
    height: 15px;
  }

  .ct-more {
    padding-top: 32px;
  }

  .ct-more-btn {
    width: 100%;
  }

  /* Drawer becomes a full-screen sheet sliding up */
  .ct-drawer {
    right: 0;
    width: 100%;
    border-right: 0;
    animation: ct-sheet .3s cubic-bezier(.2, .8, .2, 1);
  }

  @keyframes ct-sheet {
    from {
      transform: translateY(100%);
    }
  }
}