
    /* ============================================================
       CATEGORIES PAGE – WORLD-CLASS PROFESSIONAL REDESIGN
       ============================================================ */

    /* ── Page Hero ── */
    .cat-hero {
      background: var(--bg2);
      border-bottom: 1px solid var(--border);
      padding: 3.5rem 0 2.5rem;
      position: relative;
      overflow: hidden;
    }
    .cat-hero::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse 80% 60% at 60% 0%, rgba(124,58,237,0.13) 0%, transparent 70%);
      pointer-events: none;
    }
    .cat-hero-inner {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 1.25rem;
    }
    .cat-hero .breadcrumb {
      display: flex; align-items: center; gap: 0.5rem;
      font-size: 0.8rem; color: var(--text-muted);
    }
    .cat-hero .breadcrumb a { color: var(--primary); font-weight: 600; }
    .cat-hero h1 {
      font-size: clamp(2rem, 4vw, 2.8rem);
      font-weight: 900; line-height: 1.12;
      letter-spacing: -1px;
      margin: 0;
    }
    .cat-hero p {
      color: var(--text-muted);
      font-size: 1rem;
      max-width: 480px;
      margin: 0;
    }

    /* Stats row */
    .cat-hero-stats {
      display: flex; gap: 2rem; flex-wrap: wrap;
      padding-top: 0.5rem;
    }
    .cat-hero-stat {
      display: flex; align-items: center; gap: 0.55rem;
    }
    .cat-hero-stat .stat-icon {
      width: 36px; height: 36px;
      background: rgba(124,58,237,0.12);
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1rem;
      flex-shrink: 0;
    }
    .cat-hero-stat .stat-txt strong {
      display: block; font-size: 1.05rem; font-weight: 800; color: var(--text); line-height: 1.1;
    }
    .cat-hero-stat .stat-txt span {
      font-size: 0.73rem; color: var(--text-muted); font-weight: 500;
    }

    /* ── Sticky Toolbar ── */
    .cat-toolbar {
      position: sticky;
      top: var(--header-h);
      z-index: 90;
      background: rgba(15,15,26,0.96);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      padding: 0.85rem 0;
      transition: background 0.3s;
    }
    [data-theme="light"] .cat-toolbar { background: rgba(248,249,255,0.96); }
    .cat-toolbar-inner {
      display: flex; align-items: center; gap: 1rem;
      flex-wrap: wrap;
    }

    /* Search */
    .cat-search {
      display: flex; align-items: center; gap: 0.5rem;
      background: var(--card);
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 0.45rem 0.45rem 0.45rem 1rem;
      min-width: 260px; flex: 1; max-width: 340px;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .cat-search:focus-within {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
    }
    .cat-search i { color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }
    .cat-search input {
      flex: 1; border: none; background: transparent;
      font-family: 'Sora', sans-serif; font-size: 0.88rem;
      color: var(--text); outline: none;
    }
    .cat-search input::placeholder { color: var(--text-muted); }
    .cat-search-btn {
      background: var(--primary); color: #fff; border: none;
      border-radius: 7px; padding: 0.4rem 0.85rem;
      font-family: 'Sora', sans-serif; font-size: 0.8rem;
      font-weight: 700; cursor: pointer; white-space: nowrap;
      transition: opacity 0.2s;
    }
    .cat-search-btn:hover { opacity: 0.85; }

    /* Filter pills */
    .cat-filters {
      display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center;
      flex: 1;
    }
    .cat-filters-label {
      font-size: 0.75rem; font-weight: 700;
      color: var(--text-muted); white-space: nowrap;
      text-transform: uppercase; letter-spacing: 0.5px;
    }
    .cat-pill {
      padding: 0.38rem 0.9rem; border-radius: 7px;
      border: 1.5px solid var(--border);
      background: transparent; color: var(--text-muted);
      font-family: 'Sora', sans-serif; font-size: 0.8rem;
      font-weight: 600; cursor: pointer; transition: all 0.18s;
      white-space: nowrap;
    }
    .cat-pill:hover { border-color: var(--primary); color: var(--primary); }
    .cat-pill.active {
      background: var(--primary); color: #fff; border-color: var(--primary);
    }

    /* View toggle */
    .view-toggle {
      display: flex; gap: 0.25rem; margin-left: auto; flex-shrink: 0;
    }
    .view-btn {
      width: 34px; height: 34px; border-radius: 7px;
      border: 1.5px solid var(--border); background: transparent;
      color: var(--text-muted); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.85rem; transition: all 0.18s;
    }
    .view-btn.active, .view-btn:hover {
      background: var(--primary); color: #fff; border-color: var(--primary);
    }

    /* ── Categories Main Section ── */
    .cats-section { padding: 2.5rem 0 5rem; }

    /* ─── GRID VIEW ─── */
    .cats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1.25rem;
    }
    .cats-grid.list-mode {
      grid-template-columns: 1fr;
      gap: 0.75rem;
    }

    /* Category Card */
    .cat-card {
      background: var(--card);
      border: 1.5px solid var(--border);
      border-radius: 16px;
      overflow: hidden;
      transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
      display: flex; flex-direction: column;
    }
    .cat-card:hover {
      border-color: var(--primary);
      box-shadow: 0 12px 40px rgba(124,58,237,0.18);
      transform: translateY(-3px);
    }

    /* Card header band */
    .cat-card-header {
      padding: 1.4rem 1.4rem 1rem;
      display: flex; align-items: flex-start; gap: 1rem;
    }
    .cat-icon-wrap {
      width: 56px; height: 56px; flex-shrink: 0;
      border-radius: 14px;
      background: rgba(124,58,237,0.1);
      border: 1.5px solid rgba(124,58,237,0.2);
      display: flex; align-items: center; justify-content: center;
      font-size: 2rem;
      transition: background 0.2s, transform 0.2s;
    }
    .cat-card:hover .cat-icon-wrap {
      background: rgba(124,58,237,0.18);
      transform: scale(1.07);
    }
    .cat-card-info { flex: 1; min-width: 0; }
    .cat-card-name {
      font-size: 1rem; font-weight: 800;
      color: var(--text); margin-bottom: 0.3rem; line-height: 1.2;
    }
    .cat-meta-row {
      display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    }
    .cat-badge-count {
      display: inline-flex; align-items: center; gap: 0.3rem;
      background: rgba(124,58,237,0.1); color: var(--primary);
      padding: 0.15rem 0.6rem; border-radius: 6px;
      font-size: 0.72rem; font-weight: 700;
    }
    .cat-sub-count {
      font-size: 0.75rem; color: var(--text-muted); font-weight: 500;
    }

    /* Divider */
    .cat-card-divider {
      height: 1px; background: var(--border); margin: 0 1.4rem;
    }

    /* Subcategories inside card */
    .cat-subcats {
      padding: 1rem 1.4rem;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.45rem;
      flex: 1;
    }
    .cat-sub-item {
      display: flex; align-items: center; gap: 0.45rem;
      padding: 0.5rem 0.7rem;
      background: var(--bg);
      border: 1.5px solid var(--border);
      border-radius: 9px;
      text-decoration: none;
      color: var(--text-muted);
      font-size: 0.8rem; font-weight: 600;
      transition: all 0.18s;
      line-height: 1.2;
    }
    .cat-sub-item:hover {
      background: var(--primary);
      color: #fff;
      border-color: var(--primary);
      transform: translateY(-2px);
      box-shadow: 0 4px 14px rgba(124,58,237,0.3);
    }
    .cat-sub-item .sub-emoji { font-size: 1rem; flex-shrink: 0; }
    .cat-sub-item .sub-label { flex: 1; }
    .cat-sub-item .sub-arr {
      font-size: 0.6rem; opacity: 0;
      transition: opacity 0.18s;
    }
    .cat-sub-item:hover .sub-arr { opacity: 1; }

    /* "Show more" hidden subs */
    .cat-sub-item.hidden-sub { display: none; }
    .cat-card.expanded .cat-sub-item.hidden-sub { display: flex; }

    /* Card Footer */
    .cat-card-footer {
      padding: 0.9rem 1.4rem;
      border-top: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
      gap: 0.75rem;
    }
    .cat-expand-btn {
      display: flex; align-items: center; gap: 0.35rem;
      font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
      background: none; border: none; cursor: pointer;
      font-family: 'Sora', sans-serif; transition: color 0.18s;
      padding: 0;
    }
    .cat-expand-btn:hover { color: var(--primary); }
    .cat-expand-btn i { font-size: 0.7rem; transition: transform 0.25s; }
    .cat-card.expanded .cat-expand-btn i { transform: rotate(180deg); }

    .cat-browse-btn {
      display: inline-flex; align-items: center; gap: 0.4rem;
      padding: 0.42rem 1rem; border-radius: 8px;
      background: rgba(124,58,237,0.1);
      color: var(--primary);
      font-size: 0.8rem; font-weight: 700;
      text-decoration: none;
      border: 1.5px solid rgba(124,58,237,0.25);
      transition: all 0.18s;
    }
    .cat-browse-btn:hover {
      background: var(--primary); color: #fff; border-color: var(--primary);
    }

    /* ─── LIST VIEW ─── */
    .cats-grid.list-mode .cat-card {
      flex-direction: row; align-items: stretch;
      border-radius: 12px;
    }
    .cats-grid.list-mode .cat-card-header {
      align-items: center;
      flex-shrink: 0; width: 260px;
      border-right: 1px solid var(--border);
      padding: 1rem 1.25rem;
    }
    .cats-grid.list-mode .cat-card-divider { display: none; }
    .cats-grid.list-mode .cat-subcats {
      flex: 1; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      padding: 1rem 1.25rem; align-content: start;
    }
    .cats-grid.list-mode .cat-card-footer {
      border-top: none; border-left: 1px solid var(--border);
      flex-direction: column; justify-content: center;
      width: 120px; flex-shrink: 0; padding: 1rem;
    }
    .cats-grid.list-mode .cat-expand-btn { display: none; }

    /* ── No Results ── */
    .cats-empty {
      display: none; grid-column: 1/-1;
      text-align: center; padding: 5rem 2rem;
      color: var(--text-muted);
    }
    .cats-empty i { font-size: 3rem; margin-bottom: 1rem; display: block; color: var(--primary); opacity: 0.4; }
    .cats-empty h3 { font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--text); }

    /* ── Section heading ── */
    .cats-section-label {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem;
    }
    .cats-section-label h2 {
      font-size: 1.25rem; font-weight: 800;
    }
    .cats-count-badge {
      background: var(--card); border: 1.5px solid var(--border);
      color: var(--text-muted); padding: 0.3rem 0.85rem;
      border-radius: 50px; font-size: 0.78rem; font-weight: 600;
    }

    /* ── Responsive ── */
    @media (max-width: 900px) {
      .cats-grid.list-mode .cat-card { flex-direction: column; }
      .cats-grid.list-mode .cat-card-header { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
      .cats-grid.list-mode .cat-card-footer { width: 100%; flex-direction: row; border-left: none; border-top: 1px solid var(--border); }
      .cats-grid.list-mode .cat-expand-btn { display: flex; }
    }
    @media (max-width: 768px) {
      .cats-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
      .cat-toolbar-inner { gap: 0.7rem; }
      .cat-search { min-width: 200px; }
      .cat-hero-stats { gap: 1.25rem; }
      .view-toggle { display: none; }
    }
    @media (max-width: 520px) {
      .cats-grid { grid-template-columns: 1fr; gap: 0.85rem; }
      .cat-subcats { grid-template-columns: 1fr 1fr; }
      .cat-hero h1 { font-size: 1.7rem; }
      .cat-filters { gap: 0.3rem; }
      .cat-pill { font-size: 0.73rem; padding: 0.3rem 0.7rem; }
    }
  