/*
 * Shared geometry for product-category gateway pages.
 * Family styles own product-specific media and catalog controls; this file owns
 * the shell, section order, spacing, responsive behavior and interaction rhythm.
 */

.product-category-page {
  --product-category-gap: 30px;
  --product-category-section-space: 68px;
  --product-category-panel-min-height: 520px;
}

.product-category-page .product-category-hero {
  padding: 12px 0 32px;
}

.product-category-page .product-category-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: var(--product-category-gap);
  align-items: stretch;
}

.product-category-page .product-category-copy,
.product-category-page .product-category-media {
  min-width: 0;
  min-height: var(--product-category-panel-min-height);
  border: 1px solid var(--stp-line);
  border-radius: var(--site-radius-card);
  background: var(--stp-surface);
  box-shadow: none;
}

.product-category-page .product-category-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 3vw, 44px);
  text-align: left;
}

.product-category-page .product-category-copy h1 {
  max-width: 820px;
  margin: 18px 0 16px;
  color: var(--stp-text);
  font-size: clamp(42px, 4.2vw, 62px);
  font-weight: 900;
  line-height: .98;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

/* Long compound category names retain the hierarchy without clipping. */
.product-category-page[data-product-category="komplektuyushchie"] .product-category-copy h1,
.product-category-page[data-product-category="cepi-protivoskolzheniya"] .product-category-copy h1,
.product-category-page[data-product-category="gruzopodemnoe-oborudovanie"] .product-category-copy h1,
.product-category-page[data-product-category="traversy-gruzopodemnye"] .product-category-copy h1 {
  max-width: 100%;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -.035em;
}

.product-category-page[data-product-category="gruzopodemnoe-oborudovanie"] .product-category-copy h1 {
  font-size: clamp(34px, 3.4vw, 48px);
}

.product-category-page[data-product-category="cepi-protivoskolzheniya"] .product-category-copy h1 {
  font-size: clamp(34px, 4vw, 42px);
}

.product-category-page .product-category-copy > p {
  max-width: 760px;
  margin: 0;
  color: var(--stp-muted);
  font-size: 19px;
  line-height: 1.5;
}

.product-category-page .product-category-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.product-category-page .product-category-actions .category-btn {
  min-height: var(--site-control-height);
}

.product-category-hero-routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.product-category-hero-routes > a,
.product-category-hero-routes > button {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 88px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--stp-line);
  border-radius: var(--site-radius-card);
  background:
    linear-gradient(rgba(111, 127, 143, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 127, 143, .08) 1px, transparent 1px),
    var(--stp-surface);
  background-size: 42px 42px;
  color: var(--stp-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.product-category-hero-routes > :is(a, button):hover,
.product-category-hero-routes > :is(a, button):focus-visible {
  border-color: var(--site-color-accent);
  transform: translateY(-2px);
}

.product-category-hero-routes > :is(a, button):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--site-color-accent) 30%, transparent);
  outline-offset: 2px;
}

.product-category-hero-routes > :is(a, button) > i {
  color: var(--site-color-accent);
  font-size: 24px;
  line-height: 1;
}

.product-category-hero-routes > :is(a, button) > span {
  display: grid;
  gap: 5px;
}

.product-category-hero-routes b {
  color: var(--stp-text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.18;
}

.product-category-hero-routes em {
  color: var(--stp-muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.product-category-hero-routes strong {
  align-self: center;
  color: var(--site-color-accent);
  font-size: 18px;
  transition: transform 220ms ease;
}

.product-category-hero-routes > :is(a, button):hover strong,
.product-category-hero-routes > :is(a, button):focus-visible strong {
  transform: translateX(3px);
}

.product-category-page .product-category-media {
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  padding: clamp(18px, 2.6vw, 34px);
}

.product-category-page .product-category-media > img {
  width: 100%;
  max-width: 780px;
  height: 100%;
  max-height: 452px;
  object-fit: contain;
}

.product-category-page .product-category-media.product-category-media-hub {
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  place-items: stretch;
}

.product-category-showcase {
  position: relative;
  width: 100%;
  min-height: 300px;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--stp-line);
  border-radius: var(--site-radius-card);
  background:
    linear-gradient(rgba(111, 127, 143, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 127, 143, .09) 1px, transparent 1px),
    var(--stp-soft);
  background-size: 48px 48px;
}

.product-category-showcase img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  max-height: 390px;
  padding: clamp(12px, 2vw, 26px);
  object-fit: contain;
}

.product-category-showcase figcaption {
  position: absolute;
  right: 16px;
  bottom: 14px;
  left: 16px;
  padding: 10px 12px;
  border: 1px solid var(--stp-line);
  border-radius: var(--site-radius-control);
  background: color-mix(in srgb, var(--stp-surface) 92%, transparent);
  color: var(--stp-muted);
  font-size: 13px;
  line-height: 1.4;
  backdrop-filter: blur(8px);
}

.product-category-media-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--stp-line);
  border-radius: var(--site-radius-card);
  background: var(--stp-line);
}

.product-category-media-links:has(> a:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-category-media-links a {
  min-width: 0;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 13px 14px;
  background: var(--stp-surface);
  color: var(--stp-text);
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease;
}

.product-category-media-links b {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
}

.product-category-media-links span {
  color: var(--stp-muted);
  font-size: 11px;
  line-height: 1.35;
}

.product-category-media-links a:hover,
.product-category-media-links a:focus-visible {
  color: var(--site-color-accent);
  background: var(--stp-brick-soft);
}

.product-category-media-links a:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--site-color-accent);
  outline-offset: -2px;
}

.product-category-nav {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--stp-line);
  border-bottom: 1px solid var(--stp-line);
  background: color-mix(in srgb, var(--stp-surface) 94%, transparent);
}

.product-category-nav .category-shell {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 0;
  padding-bottom: 0;
}

.product-category-nav a {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0 22px;
  border-right: 1px solid var(--stp-line);
  color: var(--stp-text);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease;
}

.product-category-nav a:first-child {
  border-left: 1px solid var(--stp-line);
}

.product-category-nav a span {
  margin-right: 10px;
  color: var(--stp-brick);
  font-size: 11px;
  font-weight: 900;
}

.product-category-nav a:hover,
.product-category-nav a:focus-visible {
  color: var(--stp-brick);
  background: var(--stp-brick-soft);
}

.product-category-page .product-category-catalog,
.product-category-page .product-category-selection,
.product-category-page .product-category-process,
.product-category-page .product-category-lead,
.product-category-page .product-category-info {
  padding-top: var(--product-category-section-space);
  padding-bottom: var(--product-category-section-space);
  scroll-margin-top: calc(var(--site-header-height-compact) + 18px);
}

.product-category-page .product-category-catalog .category-section-head,
.product-category-page .product-category-catalog .site-section-head,
.product-category-page .product-category-process .category-section-head,
.product-category-page .product-category-process .site-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  gap: 30px;
  align-items: end;
  margin-bottom: 30px;
  text-align: left;
}

.product-category-page .product-category-catalog .category-section-head h2,
.product-category-page .product-category-catalog .site-section-head h2,
.product-category-page .product-category-process .category-section-head h2,
.product-category-page .product-category-process .site-section-head h2 {
  margin: 12px 0 0;
  font-size: clamp(34px, 3.4vw, 52px);
  line-height: 1;
  text-wrap: balance;
}

.product-category-page .product-category-catalog .category-section-head > p,
.product-category-page .product-category-catalog .site-section-head > p,
.product-category-page .product-category-process .category-section-head > p,
.product-category-page .product-category-process .site-section-head > p {
  max-width: 620px;
  margin: 0;
  justify-self: end;
  color: var(--stp-muted);
  font-size: 17px;
  line-height: 1.55;
  text-align: left;
}

.product-category-page .product-category-grid {
  align-items: stretch;
  gap: 16px;
}

.product-category-page .product-category-grid > * {
  min-width: 0;
  border-radius: var(--site-radius-card);
}

.product-category-filter {
  display: none;
}

.product-category-filter.is-enhanced {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: -4px 0 22px;
  padding: 12px;
  border: 1px solid var(--stp-line);
  border-radius: var(--site-radius-card);
  background: var(--stp-surface);
}

.product-category-filter > span {
  flex: 0 0 auto;
  padding-left: 4px;
  color: var(--stp-muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.product-category-filter > div {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
}

.product-category-filter button {
  display: inline-flex;
  min-height: 40px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--stp-line);
  border-radius: var(--site-radius-control);
  background: var(--stp-surface);
  color: var(--stp-text);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.product-category-filter button em {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--stp-soft);
  color: var(--stp-muted);
  font-size: 11px;
  font-style: normal;
}

.product-category-filter button:hover,
.product-category-filter button:focus-visible,
.product-category-filter button.is-active {
  border-color: var(--site-color-accent);
  color: var(--site-color-accent);
}

.product-category-filter button.is-active {
  background: var(--stp-brick-soft);
}

.product-category-filter button:focus-visible {
  outline: 2px solid var(--site-color-accent);
  outline-offset: 2px;
}

.product-category-filter button.is-active em {
  background: var(--site-color-accent);
  color: #fff;
}

.product-category-filter-status {
  margin: 0 0 0 auto;
  color: var(--stp-muted);
  font-size: 12px;
  white-space: nowrap;
}

.product-category-page [data-product-category-card][hidden] {
  display: none !important;
}

.product-category-page .product-category-lead .category-shell,
.product-category-page .product-category-lead .site-lead-layout,
.product-category-page .product-category-lead .category-lead-layout {
  align-items: stretch;
}

.product-category-page .product-category-lead .site-lead-copy,
.product-category-page .product-category-lead .category-panel,
.product-category-page .product-category-lead .category-lead-form {
  border-radius: var(--site-radius-card);
}

.stp-theme-dark.product-category-page .product-category-copy,
.stp-theme-dark.product-category-page .product-category-media {
  border-color: var(--site-dark-line);
  background: var(--site-dark-surface);
}

.stp-theme-dark.product-category-page .product-category-showcase,
.stp-theme-dark.product-category-page .product-category-showcase figcaption,
.stp-theme-dark.product-category-page .product-category-media-links {
  border-color: var(--site-dark-line);
}

.stp-theme-dark.product-category-page .product-category-showcase {
  background:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px),
    var(--site-dark-surface-strong);
  background-size: 48px 48px;
}

.stp-theme-dark.product-category-page .product-category-showcase figcaption,
.stp-theme-dark.product-category-page .product-category-media-links a {
  border-color: var(--site-dark-line);
  background: color-mix(in srgb, var(--site-dark-surface-strong) 93%, transparent);
  color: var(--site-dark-text);
}

.stp-theme-dark.product-category-page .product-category-media-links {
  background: var(--site-dark-line);
}

.stp-theme-dark.product-category-page .product-category-media-links span,
.stp-theme-dark.product-category-page .product-category-showcase figcaption {
  color: var(--site-dark-muted);
}

.stp-theme-dark.product-category-page .product-category-media-links a:hover,
.stp-theme-dark.product-category-page .product-category-media-links a:focus-visible {
  color: var(--site-color-accent);
  background: rgba(239, 44, 3, .09);
}

.stp-theme-dark.product-category-page .product-category-nav {
  border-color: var(--site-dark-line);
  background: color-mix(in srgb, var(--site-dark-bg) 94%, transparent);
}

.stp-theme-dark.product-category-page .product-category-nav a {
  border-color: var(--site-dark-line);
  color: var(--site-dark-text);
}

.stp-theme-dark.product-category-page .product-category-nav a:hover,
.stp-theme-dark.product-category-page .product-category-nav a:focus-visible {
  color: var(--site-color-accent);
  background: rgba(239, 44, 3, .09);
}

.stp-theme-dark.product-category-page .product-category-hero-routes > :is(a, button),
.stp-theme-dark.product-category-page .product-category-filter,
.stp-theme-dark.product-category-page .product-category-filter button {
  border-color: var(--site-dark-line);
  background-color: var(--site-dark-surface-strong);
  color: var(--site-dark-text);
}

.stp-theme-dark.product-category-page .product-category-hero-routes > :is(a, button) {
  background:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px),
    var(--site-dark-surface-strong);
  background-size: 42px 42px;
}

.stp-theme-dark.product-category-page .product-category-hero-routes b,
.stp-theme-dark.product-category-page .product-category-filter button {
  color: var(--site-dark-text);
}

.stp-theme-dark.product-category-page .product-category-hero-routes em,
.stp-theme-dark.product-category-page .product-category-filter > span,
.stp-theme-dark.product-category-page .product-category-filter-status {
  color: var(--site-dark-muted);
}

.stp-theme-dark.product-category-page .product-category-filter button:hover,
.stp-theme-dark.product-category-page .product-category-filter button:focus-visible,
.stp-theme-dark.product-category-page .product-category-filter button.is-active {
  border-color: var(--site-color-accent);
  color: var(--site-color-accent);
}

.stp-theme-dark.product-category-page .product-category-filter button.is-active {
  background: rgba(239, 44, 3, .1);
}

@media (max-width: 980px) {
  .product-category-page {
    --product-category-panel-min-height: 0px;
    --product-category-section-space: 56px;
  }

  .product-category-page .product-category-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-category-page .product-category-copy {
    min-height: 0;
  }

  .product-category-page .product-category-media {
    min-height: 420px;
  }
}

@media (max-width: 700px) {
  .product-category-page {
    --product-category-gap: 14px;
    --product-category-section-space: 44px;
  }

  .product-category-page .product-category-hero {
    padding-bottom: 20px;
  }

  .product-category-page .product-category-copy {
    padding: 26px 20px;
  }

  .product-category-page .product-category-copy h1 {
    margin-top: 14px;
    font-size: 30px;
    line-height: 1.04;
    text-wrap: pretty;
  }

  .product-category-page[data-product-category="komplektuyushchie"] .product-category-copy h1,
  .product-category-page[data-product-category="cepi-protivoskolzheniya"] .product-category-copy h1,
  .product-category-page[data-product-category="gruzopodemnoe-oborudovanie"] .product-category-copy h1,
  .product-category-page[data-product-category="traversy-gruzopodemnye"] .product-category-copy h1 {
    font-size: 30px;
  }

  .product-category-page .product-category-copy > p {
    font-size: 17px;
  }

  .product-category-page .product-category-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 22px;
  }

  .product-category-hero-routes {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .product-category-hero-routes > a,
  .product-category-hero-routes > button {
    min-height: 74px;
    padding: 12px;
  }

  .product-category-page .product-category-media {
    min-height: 330px;
    padding: 16px;
  }

  .product-category-page .product-category-media > img {
    max-height: 300px;
  }

  .product-category-showcase,
  .product-category-showcase img {
    min-height: 280px;
  }

  .product-category-media-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-category-media-links a {
    min-height: 62px;
  }

  .product-category-nav {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .product-category-nav::-webkit-scrollbar {
    display: none;
  }

  .product-category-nav .category-shell {
    width: max-content;
    min-width: 100%;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .product-category-nav a {
    min-height: 54px;
    padding: 0 16px;
    white-space: nowrap;
  }

  .product-category-page .product-category-catalog .category-section-head,
  .product-category-page .product-category-catalog .site-section-head,
  .product-category-page .product-category-process .category-section-head,
  .product-category-page .product-category-process .site-section-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 22px;
  }

  .product-category-page .product-category-catalog .category-section-head h2,
  .product-category-page .product-category-catalog .site-section-head h2,
  .product-category-page .product-category-process .category-section-head h2,
  .product-category-page .product-category-process .site-section-head h2 {
    font-size: 30px;
  }

  .product-category-page .product-category-catalog .category-section-head > p,
  .product-category-page .product-category-catalog .site-section-head > p,
  .product-category-page .product-category-process .category-section-head > p,
  .product-category-page .product-category-process .site-section-head > p {
    justify-self: start;
    font-size: 16px;
  }

  .product-category-filter.is-enhanced {
    display: grid;
    gap: 9px;
    margin-bottom: 18px;
  }

  .product-category-filter > div {
    margin-right: -12px;
    padding: 2px 12px 5px 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .product-category-filter > div::-webkit-scrollbar {
    display: none;
  }

  .product-category-filter button {
    flex: 0 0 auto;
  }

  .product-category-filter-status {
    margin-left: 4px;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-category-nav a,
  .product-category-hero-routes > :is(a, button),
  .product-category-hero-routes strong,
  .product-category-filter button {
    transition: none;
  }

  .product-category-media-links a {
    transition: none;
  }
}
