::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--slate-900); }
::-webkit-scrollbar-thumb { background: var(--slate-700); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-600); }


.search-wrap {
  position: relative;
  margin: 0 0 2.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--slate-400);
  pointer-events: none;
  transition: color var(--dur-normal);
}

.search-wrap:focus-within .search-icon { color: var(--indigo-400); }

.search-input {
  display: block;
  width: 100%;
  padding: 1rem 1rem 1rem 2.75rem;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: var(--radius-lg);
  background: rgba(30, 41, 59, 0.5);
  color: #fff;
  font-size: 1rem;
  font-family: var(--font);
  line-height: 1.25;
  transition: background-color var(--dur-normal), border-color var(--dur-normal);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder { color: var(--slate-500); }

.search-input:focus {
  outline: none;
  background: var(--slate-800);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.filter-wrap {
  position: relative;
}

.filter-wrap::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3rem;
  background: linear-gradient(to right, transparent, var(--slate-900));
  pointer-events: none;
}

.filter-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.filter-bar::-webkit-scrollbar { display: none; }

@media (min-width: 768px) {
  .filter-wrap::after { display: none; }
  .filter-bar {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--slate-800);
  padding-bottom: 1rem;
}

.results-count {
  color: var(--slate-400);
  font-weight: 500;
  font-size: 0.875rem;
}

.results-count strong { color: #fff; font-weight: 500; }

.bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-select {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: var(--radius-md);
  color: var(--slate-400);
  font-size: 0.8125rem;
  font-family: var(--font);
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  min-height: 36px;
}

.sort-select:focus { outline: 2px solid var(--indigo-400); outline-offset: 2px; }

.clear-btn {
  font-size: 0.875rem;
  color: var(--indigo-400);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  transition: color var(--dur-normal);
}

.clear-btn:hover { color: var(--indigo-300); }
.clear-btn svg { width: 1rem; height: 1rem; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(30, 41, 59, 0.4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(51, 65, 85, 0.5);
  position: relative;
  transition: border-color var(--dur-normal), box-shadow var(--dur-normal);
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.card-body { padding: 1rem; flex-grow: 1; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.375rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 400;
  background: rgba(51, 65, 85, 0.35);
  color: var(--slate-400);
  pointer-events: none;
  user-select: none;
}

/* Category badge colors injected dynamically from categories.json at load time */

.offer-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.offer-free { background: rgba(74, 222, 128, 0.1); color: #4ade80; }
.offer-discount { background: rgba(251, 191, 36, 0.1); color: #fbbf24; }
.offer-credits { background: rgba(96, 165, 250, 0.1); color: #60a5fa; }
.offer-trial { background: rgba(167, 139, 250, 0.1); color: #a78bfa; }

.free-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.06);
  color: #4ade80;
  cursor: pointer;
  transition: background-color var(--dur-normal), border-color var(--dur-normal), box-shadow var(--dur-normal);
  white-space: nowrap;
  flex-shrink: 0;
}

.free-toggle:hover { background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.5); }

.free-toggle[aria-pressed="true"] {
  background: rgba(74, 222, 128, 0.18);
  border-color: #4ade80;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35);
}

.card-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  transition: color var(--dur-normal);
}

.card:hover .card-name { color: #c7d2fe; text-decoration: underline; text-underline-offset: 3px; }

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-link::before {
  content: '';
  position: absolute;
  inset: 0;
}

.card-desc {
  color: var(--slate-400);
  font-size: 0.875rem;
  line-height: 1.5;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.75rem;
  position: relative;
  z-index: 1;
}

.tag {
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--slate-500);
  background: rgba(30, 41, 59, 0.8);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(51, 65, 85, 0.5);
  cursor: pointer;
  transition: color var(--dur-normal), border-color var(--dur-normal);
}

.tag:hover {
  color: var(--indigo-300);
  border-color: var(--slate-500);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empty {
  text-align: center;
  padding: 6rem 1rem;
  background: rgba(30, 41, 59, 0.3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-700);
}

.empty h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.empty p { color: var(--slate-400); }


.skeleton {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.skeleton-card {
  height: 180px;
  background: rgba(30, 41, 59, 0.4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(51, 65, 85, 0.5);
  animation: pulse 1.5s ease-in-out infinite;
}

@media (min-width: 768px) {
  .grid, .skeleton { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid, .skeleton { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .grid, .skeleton { grid-template-columns: repeat(4, 1fr); }
}
