﻿.products-page {
  padding-top: 84px;
  padding-bottom: 60px;
}

.products-hero.page-hero,
.products-list-section {
  --products-page-width: 1360px;
}

.products-hero.page-hero {
  padding-bottom: 36px;
}

.products-hero.page-hero > .page-hero__inner.container,
.products-list-section > .container {
  width: min(var(--products-page-width), calc(100% - 40px));
}

body.admin-bar .products-page {
  padding-top: 116px;
}

.product-single-page {
  padding-top: 0;
  padding-bottom: 56px;
}

body.admin-bar .product-single-page {
  padding-top: 0;
}

.product-single-head {
  padding-top: 68px;
  padding-bottom: 36px;
}

.product-single-head .breadcrumb-trail {
  margin-bottom: 14px;
  font-size: 14px;
}

.product-single-head h1 {
  margin-bottom: 10px;
  line-height: 1.16;
  letter-spacing: 0;
  max-width: none;
  width: 100%;
}

.breadcrumb-trail,
.breadcrumb-trail * {
  position: relative;
  z-index: 3;
  min-width: 0;
}

.breadcrumb-trail {
  width: 100%;
  margin-bottom: 0;
}

.breadcrumb-trail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.breadcrumb-trail li {
  display: inline-flex;
  align-items: center;
  color: #5f758d;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
}

.breadcrumb-trail li + li::before {
  content: "/";
  margin-right: 8px;
  color: #8ea2b8;
}

.breadcrumb-trail a {
  color: #3f607f;
  overflow-wrap: anywhere;
}

.breadcrumb-trail a:hover {
  color: #0e7f9e;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.products-categories,
.products-list-section {
  padding: 8px 0 48px;
}

.products-list-section {
  padding-top: 0;
}

.product-single-content {
  padding: 20px 0 40px;
}

.products-category-grid,
.products-list-grid {
  display: grid;
  gap: 20px;
}

.products-category-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.products-list-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.products-list-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

@media (max-width: 1280px) {
  .products-list-grid,
  .products-list-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .products-list-grid,
  .products-list-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.products-category-card,
.product-item-card {
  border: 1px solid var(--dm-color-border);
  border-radius: var(--dm-radius-card);
  padding: 12px;
  background: var(--dm-color-bg);
}

.product-item-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px;
  border-color: #e1e6ec;
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.product-item-card:hover {
  border-color: #cfd9e4;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
  transform: translateY(-2px);
}

.products-category-card h2,
.product-item-content h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.products-category-slug,
.products-category-count {
  margin-bottom: 8px;
  color: #555;
}

.product-item-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  width: 100%;
  margin-inline: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 0;
  background: #fff;
}

.product-item-thumb img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  transform: scale(1.28);
}

.product-item-content {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.product-item-content h2 {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
  margin: 0;
  min-height: 60px;
}

.product-item-content h2 a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-item-content p {
  color: #555;
  margin-bottom: 8px;
  font-size: 14px;
}

.product-item-content .btn {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.product-item-content .btn.btn--ghost {
  background: #fff;
  color: #0b6f8a;
  border-color: #cbd7e3;
}

.product-item-content .btn.btn--ghost:hover {
  opacity: 1;
  background: #eef6f8;
  border-color: #0e7f9e;
  color: #075d73;
}

.product-thumb-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  color: var(--dm-color-text-muted);
}

.products-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.products-sidebar {
  border: 1px solid #e3e9ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f7f9fc 100%);
  padding: 16px 14px;
  position: sticky;
  top: 108px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  box-shadow:
    0 10px 24px rgba(17, 24, 39, 0.04),
    inset 0 -14px 16px -18px rgba(0, 0, 0, 0.16);
}

.products-sidebar::-webkit-scrollbar {
  width: 6px;
}

.products-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.products-sidebar::-webkit-scrollbar-thumb {
  border: 1px solid var(--dm-color-bg);
  border-radius: 999px;
  background: #d7dde5;
}

.products-sidebar::-webkit-scrollbar-thumb:hover {
  background: #bcc7d3;
}

.products-sidebar h2 {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e7edf3;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
}

.products-category-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.products-category-menu li + li {
  margin-top: 2px;
}

.products-category-menu li.is-collapsed {
  display: none;
}

.products-category-menu li.category-depth-0 {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #edf2f6;
}

.products-category-menu li.category-depth-0:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.products-category-row {
  position: relative;
  padding-right: 30px;
}

.products-category-row > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-width: 0;
}

.products-category-menu a {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.5;
  background: transparent;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.products-category-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.products-category-count {
  justify-self: end;
  width: 30px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf2f7;
  color: #8a97a5;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.products-category-count--placeholder {
  visibility: hidden;
}

.products-category-menu a:hover {
  background: #f4f8fb;
  color: #111827;
}

.products-category-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  flex: 0 0 22px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 0;
  background: #f1f5f9;
  color: #8a97a5;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.16s ease, color 0.16s ease;
}

.products-category-toggle::before,
.products-category-toggle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.products-category-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.products-category-menu li.category-depth-0.is-expanded .products-category-toggle::after {
  opacity: 0;
}

.products-category-toggle:hover {
  background: #e6edf5;
  color: #111827;
}

.products-category-menu a.is-ancestor {
  background: #f3f8fb;
  color: #1f3d5a;
}

.products-category-menu li.category-depth-1 a,
.products-category-menu li.category-depth-2 a,
.products-category-menu li.category-depth-3 a {
  position: relative;
  color: #526172;
  font-weight: 500;
}

.products-category-menu li.category-depth-0 a {
  font-size: 14px;
  font-weight: 700;
  min-height: 38px;
  padding: 8px 10px;
  color: #111827;
}

.products-category-menu li.category-depth-1 a {
  margin-left: 0;
  padding-left: 22px;
}

.products-category-menu li.category-depth-2 a {
  margin-left: 0;
  padding-left: 34px;
}

.products-category-menu li.category-depth-3 a {
  margin-left: 0;
  padding-left: 46px;
}

.products-category-menu li.category-depth-1 a::before,
.products-category-menu li.category-depth-2 a::before,
.products-category-menu li.category-depth-3 a::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  border-radius: 999px;
  background: #e4ebf2;
}

.products-category-menu li.category-depth-0 > .products-category-row > a.is-active,
.products-category-menu li.category-depth-1 > .products-category-row > a.is-active,
.products-category-menu li.category-depth-2 > .products-category-row > a.is-active,
.products-category-menu li.category-depth-3 > .products-category-row > a.is-active {
  background: #eaf5fa;
  color: #0b6f8a;
  box-shadow: inset 3px 0 0 #0b6f8a;
}

.products-category-menu li.category-depth-0 > .products-category-row > a.is-active span,
.products-category-menu li.category-depth-1 > .products-category-row > a.is-active span,
.products-category-menu li.category-depth-2 > .products-category-row > a.is-active span,
.products-category-menu li.category-depth-3 > .products-category-row > a.is-active span {
  background: #d8edf5;
  color: #0b6f8a;
}

.products-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 16px;
}

.products-search input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #d6d6d6;
  padding: 0 12px;
  font-size: 14px;
}

.products-search button {
  height: 42px;
  border-radius: var(--dm-radius-control);
  border: 1px solid #0e7f9e;
  background: #0e7f9e;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 0 18px;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.products-search button:hover {
  background: #0b6f8a;
  border-color: #0b6f8a;
}

.products-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid #e3e9ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f8fafc 100%);
}

.products-results-bar__meta {
  min-width: 0;
  display: flex;
  align-items: center;
}

.products-results-bar__summary {
  margin: 0;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.products-results-bar__filters {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.products-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e9f5fb;
  color: #0b6f8a;
  font-size: 13px;
  line-height: 1.4;
}

.products-filter-chip strong {
  font-weight: 700;
}

.products-results-bar__clear {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #d5dee7;
  border-radius: 999px;
  color: #425466;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.products-results-bar__clear:hover {
  border-color: #0e7f9e;
  color: #0b6f8a;
}

.products-pagination {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--dm-color-border);
  text-align: center;
}

.products-pagination__summary {
  margin: 0;
  color: var(--dm-color-text-muted);
  font-size: 14px;
}

.products-pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.products-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--dm-color-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s ease;
}

.products-pagination .prev,
.products-pagination .next {
  min-width: 56px;
}

.products-pagination a.page-numbers:hover {
  border-color: var(--dm-color-text);
  background: #f5f5f5;
}

.products-pagination .current {
  background: var(--dm-color-text);
  border-color: var(--dm-color-text);
  color: var(--dm-color-bg);
}

.products-pagination .dots {
  border-color: transparent;
  color: var(--dm-color-text-muted);
}

.product-single-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.product-single-flow {
  max-width: none;
}

.product-single-media {
  margin-bottom: 18px;
  min-height: clamp(300px, 46vh, 460px);
  padding: 18px;
  border: 1px solid var(--dm-color-border);
  border-radius: var(--dm-radius-card);
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fa 100%);
  box-shadow: var(--dm-shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-single-body .product-single-media img,
.product-single-media__img {
  width: auto;
  height: auto;
  max-width: min(100%, 760px);
  max-height: clamp(240px, 38vh, 380px);
  object-fit: contain;
  object-position: center;
  border-radius: var(--dm-radius-soft);
  border: 0;
}

.product-single-body {
  border: 1px solid var(--dm-color-border);
  border-radius: var(--dm-radius-card);
  padding: 24px;
  background: var(--dm-color-bg);
  box-shadow: var(--dm-shadow-soft);
  line-height: 1.8;
}

.product-single-body p {
  color: #333;
}

.product-single-body h2,
.product-single-body h3,
.product-single-body h4 {
  margin-top: 1.6em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.product-single-body h2,
.product-single-body h3,
.product-single-body h4,
.product-single-body p,
.product-single-body ul,
.product-single-body ol,
.product-single-body blockquote,
.product-single-body pre {
  max-width: none;
}

.product-single-body ul,
.product-single-body ol {
  padding-left: 1.25em;
}

.product-single-body blockquote {
  margin: 1.25em 0;
  padding: 14px 16px;
  border-left: 4px solid var(--dm-color-text);
  background: #fafafa;
  color: #333;
}

.product-single-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25em 0;
}

.product-single-body th,
.product-single-body td {
  border: 1px solid var(--dm-color-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.product-single-body iframe,
.product-single-body video {
  max-width: 100%;
}

.product-single-body img,
.product-single-body figure {
  width: 100%;
  max-width: 100%;
}

.product-single-body figure {
  margin: 1rem 0;
}

.product-single-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.product-single-actions .btn {
  min-height: 44px;
  padding: 10px 16px;
}

@media (max-width: 900px) {
  .products-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .products-sidebar {
    position: static;
    top: auto;
    max-height: none;
  }

  .product-single-page {
    padding-top: 0;
  }

  body.admin-bar .product-single-page {
    padding-top: 0;
  }

  .product-single-head {
    padding-top: 72px;
    padding-bottom: 14px;
  }

  .product-single-head .breadcrumb-trail {
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.4;
  }

  .product-single-content {
    padding-top: 20px;
    padding-bottom: 28px;
  }

  .product-single-head h1 {
    font-size: clamp(28px, 6.5vw, 40px);
    line-height: 1.1;
  }

  .product-single-media {
    min-height: clamp(240px, 42vh, 340px);
    padding: 12px;
    margin-bottom: 14px;
  }

  .product-single-body .product-single-media img,
  .product-single-media__img {
    max-height: min(54vh, 300px);
    max-width: 100%;
  }

  .product-single-actions .btn {
    width: 100%;
  }

  .products-search {
    grid-template-columns: 1fr;
  }

  .products-search button {
    width: 100%;
  }

  .products-results-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .products-results-bar__filters {
    justify-content: flex-start;
  }

  .product-item-content h2 {
    min-height: 0;
    -webkit-line-clamp: 4;
  }
}

@media (max-width: 600px) {
  .products-list-grid,
  .products-list-grid--compact {
    grid-template-columns: 1fr;
  }

  .product-item-thumb {
    width: 100%;
  }

  .product-single-body {
    padding: 14px;
    line-height: 1.75;
  }

  .product-single-body h2,
  .product-single-body h3,
  .product-single-body h4 {
    margin-top: 1.4em;
  }

  .product-single-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .product-single-actions {
    margin-top: 20px;
  }

  .products-pagination .nav-links {
    flex-wrap: wrap;
  }
}

