.main-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.products-toggle.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.catalog-hero {
  padding: 2.2rem 0 1.3rem;
}

.catalog-banner {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  min-height: 250px;
  box-shadow: var(--shadow);
}

.catalog-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 18, 34, 0.72), rgba(10, 18, 34, 0.18));
}

.catalog-title {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  padding: 1.7rem;
  color: #edf2ff;
}

.catalog-title h1 {
  margin: 0.5rem 0 0.3rem;
  font-size: clamp(1.6rem, 2.7vw, 2.3rem);
  line-height: 1.2;
}

.catalog-title p {
  margin: 0;
  max-width: 620px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: #d5e2ff;
}

.catalog-shell {
  padding-top: 0.5rem;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1rem;
}

.filters {
  position: sticky;
  top: 102px;
  align-self: flex-start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
}

.panel h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-head,
.panel-body {
  padding: 0.9rem;
}

.panel-head {
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-search {
  margin-bottom: 0.7rem;
}

.filter-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0.66rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
}

.filter-search input:focus {
  border-color: rgba(46, 111, 255, 0.55);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 0.28rem 0.56rem;
  cursor: pointer;
}

.chip.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #ffffff;
  border-color: transparent;
}

.toolbar {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--surface);
  padding: 0.8rem 0.9rem;
  margin-bottom: 0.8rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.toolbar .meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.toolbar .actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.toolbar select,
.toolbar button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.82rem;
  padding: 0.45rem 0.62rem;
}

.toolbar button {
  cursor: pointer;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: opacity, transform;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow);
  border-color: rgba(72, 130, 255, 0.45);
}

.product-card.is-filtering-out {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  pointer-events: none;
}

.product-card.is-filtering-in {
  animation: catalogCardIn 0.34s ease both;
}

@keyframes catalogCardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card.is-filtering-in {
    animation: none;
    transition: none;
  }
}

.product-media {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  padding: 0.5rem;
}

.product-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.42rem;
}

.product-tag {
  font-size: 0.68rem;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  color: #1e3a8a;
  background: #e8f0ff;
  border: 1px solid #c9ddff;
}

[data-theme="dark"] .product-tag {
  color: #d8e8ff;
  background: #23365a;
  border-color: #355182;
}

.product-content {
  padding: 0.82rem;
}

.product-content h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  line-height: 1.3;
}

.product-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.product-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.45rem;
}

.cta-btn {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.38rem 0.58rem;
}

.cta-btn.primary {
  background: #0f3fa8;
  color: #fff;
  border-color: #0f3fa8;
}

.cta-btn.primary:hover {
  background: #0c3385;
  border-color: #0c3385;
}

.pagination {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
  cursor: pointer;
}

.page-btn.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
}

@media (max-width: 1160px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }
}

@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}
