@font-face {
  font-family: "LocalNazanin";
  src: local("B Nazanin"), local("BNazanin"), local("Nazanin");
  font-display: swap;
}

:root {
  --font-main: "LocalNazanin", "B Nazanin", "Nazanin", Tahoma, serif;
  --red-950: #641017;
  --red-800: #991b1b;
  --red-700: #bd1f25;
  --red-50: #fff1f2;
  --bg: #f6f7f9;
  --surface: #fff;
  --surface-2: #fbfbfc;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --shadow: 0 22px 55px rgba(15,23,42,.12);
  --shadow-sm: 0 8px 22px rgba(15,23,42,.07);
  --container: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  direction: rtl;
  min-height: 100vh;
  font-family: var(--font-main);
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(220,38,38,.10), transparent 34%),
    linear-gradient(180deg, #fff 0, var(--bg) 420px);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.container {
  width: min(var(--container), calc(100% - 28px));
  margin-inline: auto;
}

.category-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(229,231,235,.92);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(15,23,42,.05);
}

.header-inner {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--red-700), var(--red-950));
  font-size: 24px;
  font-weight: 900;
}

.brand strong,
.brand small { display: block; }

.brand strong { font-size: 24px; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 14px; margin-top: 3px; }

.header-search {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f1f2f4;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  padding: 0 15px;
}

.header-search:focus-within {
  background: #fff;
  border-color: rgba(189,31,37,.34);
  box-shadow: 0 0 0 4px rgba(189,31,37,.08);
}

.header-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
}

.theme-toggle,
.login-btn,
.primary-btn,
.outline-btn {
  min-height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  white-space: nowrap;
  font-weight: 900;
}

.theme-toggle,
.login-btn,
.outline-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.login-btn {
  color: var(--red-800);
}

.primary-btn {
  border: 1px solid var(--red-700);
  background: var(--red-700);
  color: #fff;
  box-shadow: 0 14px 28px rgba(189,31,37,.20);
}

.category-hero {
  padding: 42px 0 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: stretch;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 12px;
}

.breadcrumb a { color: var(--red-800); font-weight: 900; }

.eyebrow {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(189,31,37,.16);
  background: var(--red-50);
  color: var(--red-800);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 900;
}

.category-hero h1 {
  margin: 12px 0 0;
  color: var(--text);
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.15;
  letter-spacing: -.04em;
}

.category-hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 21px;
}

.category-summary {
  border: 1px solid rgba(189,31,37,.14);
  background: linear-gradient(135deg, #fff, var(--red-50));
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 2px;
}

.category-summary strong {
  color: var(--red-800);
  font-size: 48px;
  line-height: 1;
}

.category-summary span {
  font-weight: 900;
}

.category-summary small {
  color: var(--muted);
}

.category-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-bottom: 54px;
}

.category-sidebar,
.category-content {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
}

.category-sidebar {
  position: sticky;
  top: 96px;
  padding: 16px;
}

.category-sidebar h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-list a {
  min-height: 48px;
  border: 1px solid var(--line);
  background: #fff;
  color: #374151;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
}

.category-list a:hover,
.category-list a.is-active {
  background: var(--red-50);
  border-color: rgba(189,31,37,.24);
  color: var(--red-800);
}

.category-content {
  padding: 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.toolbar strong,
.toolbar span {
  display: block;
}

.toolbar strong {
  font-size: 24px;
}

.toolbar span {
  color: var(--muted);
  font-size: 15px;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-card,
.job-card,
.resume-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  color: inherit;
  overflow: hidden;
  transition: .16s ease;
}

.product-card:hover,
.job-card:hover,
.resume-card:hover {
  transform: translateY(-3px);
  border-color: rgba(189,31,37,.24);
  box-shadow: var(--shadow);
}

.product-card {
  min-height: 174px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
}

.product-thumb {
  border-left: 1px solid var(--line);
  background: linear-gradient(135deg, var(--red-50), #eef2f7);
  display: grid;
  place-items: center;
  font-size: 46px;
  position: relative;
}

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--red-800);
  border: 1px solid rgba(189,31,37,.14);
  padding: 2px 8px;
  font-size: 13px;
}

.product-body,
.job-card,
.resume-card {
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: space-between;
}

.product-body h3,
.job-card h3,
.resume-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.4;
}

.meta,
.job-card p,
.resume-card p {
  color: var(--muted);
  margin: 0;
}

.price,
.job-salary {
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
}

.card-action {
  color: var(--red-800);
  font-weight: 900;
}

.job-tags,
.resume-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.job-tags span,
.resume-tags span {
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  padding: 3px 9px;
  font-size: 14px;
}

.resume-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--red-700), var(--red-950));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
}

.empty-state {
  border: 1px dashed rgba(189,31,37,.30);
  background: var(--red-50);
  border-radius: 24px;
  padding: 28px;
  text-align: center;
}

.empty-state strong {
  display: block;
  font-size: 26px;
}

.empty-state p {
  color: var(--muted);
}

.category-footer {
  padding: 28px 0 34px;
  background: #0b1220;
  color: #e5e7eb;
  text-align: center;
}

.category-footer strong {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  padding: 8px 16px;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  --bg: #0b1220;
  --surface: #121a2a;
  --surface-2: #172033;
  --text: #f8fafc;
  --muted: #aab4c5;
  --line: rgba(148,163,184,.24);
  background: linear-gradient(180deg, #0b1220, #111827);
  color: var(--text);
}

html[data-theme="dark"] .category-header,
html[data-theme="dark"] .category-sidebar,
html[data-theme="dark"] .category-content,
html[data-theme="dark"] .category-summary,
html[data-theme="dark"] .category-list a,
html[data-theme="dark"] .product-card,
html[data-theme="dark"] .job-card,
html[data-theme="dark"] .resume-card,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .login-btn,
html[data-theme="dark"] .outline-btn {
  background: rgba(18,26,42,.95);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="dark"] .header-search {
  background: rgba(15,23,42,.90);
  border-color: var(--line);
}

html[data-theme="dark"] input {
  color: var(--text);
}

html[data-theme="dark"] .product-thumb,
html[data-theme="dark"] .avatar {
  background: linear-gradient(135deg, rgba(189,31,37,.22), rgba(30,41,59,.84));
}

html[data-theme="dark"] .category-list a:hover,
html[data-theme="dark"] .category-list a.is-active,
html[data-theme="dark"] .eyebrow {
  background: rgba(189,31,37,.18);
  border-color: rgba(248,113,113,.30);
  color: #fecaca;
}

html[data-theme="dark"] .badge,
html[data-theme="dark"] .job-tags span,
html[data-theme="dark"] .resume-tags span {
  background: rgba(15,23,42,.90);
  color: var(--muted);
}

html[data-theme="dark"] .card-action,
html[data-theme="dark"] .login-btn,
html[data-theme="dark"] .breadcrumb a {
  color: #fecaca;
}

@media (max-width: 920px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-bottom: 10px;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .login-btn {
    display: none;
  }

  .hero-grid,
  .category-layout {
    grid-template-columns: 1fr;
  }

  .category-sidebar {
    position: static;
  }

  .category-list {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .category-list a {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }

  .brand small {
    display: none;
  }

  .brand strong {
    font-size: 20px;
  }

  .theme-toggle .theme-text {
    display: none;
  }

  .theme-toggle,
  .primary-btn {
    min-width: 42px;
    width: 42px;
    padding: 0;
  }

  .primary-btn {
    font-size: 0;
  }

  .primary-btn::after {
    content: "+";
    font-size: 26px;
  }

  .category-hero {
    padding-top: 26px;
  }

  .listing-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-columns: 116px 1fr;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* V21: better responsive category page + small count display */
.category-summary {
  min-height: 128px;
  align-content: center;
  gap: 5px;
}

.category-summary.compact-count {
  padding: 16px 18px;
}

.category-summary.compact-count small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.mini-count {
  display: inline-flex;
  width: fit-content;
  align-items: baseline;
  gap: 6px;
  border: 1px solid rgba(189,31,37,.14);
  background: #fff;
  border-radius: 999px;
  padding: 5px 11px;
}

.category-summary.compact-count strong {
  color: var(--red-800);
  font-size: 22px;
  line-height: 1;
}

.category-summary.compact-count span {
  color: #374151;
  font-size: 14px;
  font-weight: 900;
}

.category-summary.compact-count em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.category-content {
  min-width: 0;
}

.category-sidebar {
  min-width: 0;
}

.listing-grid {
  align-items: stretch;
}

@media (max-width: 1080px) {
  .header-inner {
    grid-template-columns: auto minmax(220px, 1fr);
    grid-template-areas:
      "brand actions"
      "search search";
    gap: 10px;
    padding: 10px 0;
  }

  .brand {
    grid-area: brand;
  }

  .header-search {
    grid-area: search;
  }

  .header-actions {
    grid-area: actions;
    justify-self: end;
  }

  .category-hero {
    padding-top: 28px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .category-summary.compact-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: auto;
    border-radius: 20px;
  }

  .category-layout {
    grid-template-columns: 1fr;
  }

  .category-sidebar {
    position: static;
    border-radius: 22px;
    padding: 12px;
  }

  .category-sidebar h2 {
    margin-bottom: 8px;
    font-size: 20px;
  }

  .category-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .category-list a {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 18px, var(--container));
  }

  .category-header {
    position: sticky;
  }

  .header-inner {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "search search";
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    font-size: 21px;
  }

  .brand strong {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 19px;
  }

  .brand small {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .login-btn {
    display: none;
  }

  .theme-toggle {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .theme-toggle .theme-text {
    display: none;
  }

  .primary-btn {
    width: 40px;
    min-width: 40px;
    padding: 0;
    font-size: 0;
  }

  .primary-btn::after {
    content: "+";
    font-size: 25px;
    line-height: 1;
  }

  .header-search {
    min-height: 42px;
    border-radius: 999px;
    padding-inline: 12px;
  }

  .category-hero {
    padding: 22px 0 14px;
  }

  .breadcrumb {
    font-size: 14px;
    flex-wrap: wrap;
  }

  .eyebrow {
    font-size: 14px;
  }

  .category-hero h1 {
    font-size: 33px;
    letter-spacing: -.025em;
  }

  .category-hero p {
    font-size: 17px;
    margin-bottom: 0;
  }

  .category-summary.compact-count {
    padding: 12px;
    border-radius: 18px;
  }

  .mini-count {
    padding: 4px 9px;
  }

  .category-summary.compact-count strong {
    font-size: 18px;
  }

  .category-summary.compact-count span {
    font-size: 12px;
  }

  .category-summary.compact-count em {
    display: none;
  }

  .category-layout {
    gap: 14px;
    padding-bottom: 36px;
  }

  .category-content {
    padding: 12px;
    border-radius: 22px;
  }

  .toolbar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .toolbar strong {
    font-size: 20px;
  }

  .toolbar span {
    font-size: 13px;
  }

  .toolbar .outline-btn {
    min-height: 38px;
    font-size: 14px;
    padding: 6px 11px;
  }

  .listing-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-card {
    min-height: 154px;
    grid-template-columns: 104px minmax(0, 1fr);
    border-radius: 20px;
  }

  .product-thumb {
    font-size: 36px;
  }

  .badge {
    top: 8px;
    right: 8px;
    font-size: 11px;
    padding: 1px 7px;
  }

  .product-body,
  .job-card,
  .resume-card {
    padding: 12px;
    gap: 5px;
  }

  .product-body h3,
  .job-card h3,
  .resume-card h3 {
    font-size: 18px;
    line-height: 1.45;
  }

  .meta,
  .job-card p,
  .resume-card p {
    font-size: 13px;
  }

  .price,
  .job-salary {
    font-size: 17px;
  }

  .job-tags span,
  .resume-tags span {
    font-size: 12px;
    padding: 2px 8px;
  }

  .avatar {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    font-size: 20px;
  }

  .empty-state {
    padding: 20px 12px;
    border-radius: 20px;
  }

  .empty-state strong {
    font-size: 21px;
  }

  .category-footer {
    padding: 22px 0;
  }
}

@media (max-width: 380px) {
  .brand strong {
    max-width: 100px;
  }

  .product-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .product-thumb {
    font-size: 32px;
  }

  .product-body h3,
  .job-card h3,
  .resume-card h3 {
    font-size: 16px;
  }
}

html[data-theme="dark"] .mini-count {
  background: rgba(15,23,42,.90);
  border-color: var(--line);
}

html[data-theme="dark"] .category-summary.compact-count span {
  color: var(--muted);
}


/* V22: remove category results count box completely */
.category-summary,
.compact-count,
.mini-count {
  display: none !important;
}

.hero-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

.category-hero {
  padding-bottom: 12px;
}

.category-hero p {
  max-width: 820px;
}

@media (max-width: 760px) {
  .category-hero {
    padding-bottom: 8px;
  }
}
.product-thumb img{width:100%;height:100%;object-fit:cover;display:block;border-radius:inherit}
