:root {
  --mat-max: 1500px;
}

.mat-page {
  background: #fff;
  color: var(--ks-text);
}

.mat-chapters {
  position: sticky;
  top: 86px;
  z-index: 20;
  border-bottom: 1px solid var(--ks-line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
}

.mat-chapters__inner {
  display: flex;
  max-width: var(--mat-max);
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 92px);
  overflow-x: auto;
  scrollbar-width: none;
}

.mat-chapters__inner::-webkit-scrollbar {
  display: none;
}

.mat-chapters a {
  position: relative;
  flex: 0 0 auto;
  padding: 19px clamp(14px, 1.8vw, 28px);
  border-right: 1px solid var(--ks-line);
  color: #5a6570;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mat-chapters a:first-child {
  border-left: 1px solid var(--ks-line);
}

.mat-chapters a:hover,
.mat-chapters a.active {
  color: var(--blue);
  background: #f7faff;
}

.mat-chapters a.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--blue);
}

.mat-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 34px;
  color: var(--ks-muted);
  font-size: 12px;
  font-weight: 700;
}

.mat-breadcrumb a:hover,
.mat-breadcrumb strong {
  color: var(--blue);
}

.mat-hero {
  display: grid;
  grid-template-columns: minmax(340px, .43fr) minmax(460px, .57fr);
  min-height: 610px;
  border-bottom: 1px solid var(--ks-line);
}

.mat-hero__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(66px, 7vw, 120px) clamp(24px, 6vw, 108px);
}

.mat-hero h1 {
  max-width: 720px;
  margin: 0 0 26px;
  color: var(--ks-black);
  font-size: 72px;
  line-height: 1.12;
  font-weight: 800;
}

.mat-hero__copy > p:not(.ks-kicker) {
  max-width: 650px;
  color: #3b4652;
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.62;
}

.mat-hero__media {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: #f5f7f9;
}

.mat-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mat-hero__media--contain img {
  object-fit: contain;
}

.mat-hero__label {
  position: absolute;
  right: 28px;
  bottom: 28px;
  max-width: 310px;
  padding: 17px 20px;
  border-left: 3px solid var(--blue);
  background: rgba(255, 255, 255, .94);
  color: var(--ks-black);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.mat-fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--ks-line);
}

.mat-fact-strip article {
  min-height: 128px;
  padding: 28px clamp(20px, 3vw, 48px);
  border-right: 1px solid var(--ks-line);
}

.mat-fact-strip article:last-child {
  border-right: 0;
}

.mat-fact-strip span {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.mat-fact-strip strong {
  display: block;
  color: var(--ks-black);
  font-size: 24px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.mat-band {
  padding: clamp(72px, 8vw, 128px) clamp(24px, 5vw, 92px);
  border-bottom: 1px solid var(--ks-line);
  background: #fff;
}

.mat-band--soft {
  background: #f6f8fa;
}

.mat-band--dark {
  background: var(--ks-black);
  color: #fff;
}

.mat-band__inner {
  width: 100%;
  max-width: var(--mat-max);
  margin: 0 auto;
}

.mat-heading {
  display: grid;
  grid-template-columns: minmax(220px, .34fr) minmax(0, .66fr);
  gap: clamp(34px, 7vw, 120px);
  margin-bottom: clamp(46px, 6vw, 86px);
}

.mat-heading h2 {
  margin: 0;
  color: var(--ks-black);
  font-size: clamp(38px, 4.8vw, 72px);
  line-height: 1.07;
}

.mat-heading p:not(.ks-kicker) {
  max-width: 760px;
  color: var(--ks-muted);
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.68;
}

.mat-band--dark .mat-heading h2,
.mat-band--dark .mat-heading p {
  color: #fff;
}

.mat-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(34px, 6vw, 96px);
  align-items: center;
}

.mat-split--top {
  align-items: start;
}

.mat-media {
  overflow: hidden;
  border: 1px solid var(--ks-line);
  background: #fff;
}

.mat-media img {
  display: block;
  width: 100%;
  min-height: 360px;
  object-fit: cover;
}

.mat-media--contain img {
  object-fit: contain;
}

.mat-caption {
  padding: 14px 18px;
  border-top: 1px solid var(--ks-line);
  color: var(--ks-muted);
  font-size: 12px;
  line-height: 1.5;
}

.mat-copy h3 {
  margin: 0 0 18px;
  color: var(--ks-black);
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1.06;
}

.mat-copy p {
  margin: 0 0 20px;
  color: var(--ks-muted);
  font-size: 16px;
  line-height: 1.7;
}

.mat-checklist {
  display: grid;
  margin-top: 28px;
  border-top: 1px solid var(--ks-line);
}

.mat-checklist li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--ks-line);
  color: #34404b;
  font-size: 14px;
  line-height: 1.5;
}

.mat-checklist li::before {
  content: "✓";
  color: var(--blue);
  font-weight: 900;
}

.mat-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--ks-line);
  border-left: 1px solid var(--ks-line);
}

.mat-type-grid article {
  min-height: 250px;
  padding: clamp(24px, 3vw, 42px);
  border-right: 1px solid var(--ks-line);
  border-bottom: 1px solid var(--ks-line);
  background: #fff;
}

.mat-type-grid span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.mat-type-grid h3 {
  margin: 28px 0 12px;
  color: var(--ks-black);
  font-size: 24px;
  line-height: 1.16;
}

.mat-type-grid p {
  color: var(--ks-muted);
  font-size: 14px;
  line-height: 1.65;
}

.mat-table-wrap {
  overflow-x: auto;
  border-top: 2px solid var(--blue);
}

.mat-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  text-align: left;
}

.mat-table th,
.mat-table td {
  padding: 20px 18px;
  border-bottom: 1px solid var(--ks-line);
  vertical-align: top;
}

.mat-table th {
  color: var(--ks-black);
  background: #f7f9fb;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.mat-table td {
  color: #4f5a65;
  font-size: 14px;
  line-height: 1.55;
}

.mat-table td:first-child {
  color: var(--ks-black);
  font-weight: 800;
}

.mat-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  margin-top: 34px;
  padding: 24px;
  border: 1px solid #bcd8ff;
  border-left: 3px solid var(--blue);
  background: #f4f8ff;
}

.mat-note strong {
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
}

.mat-note p {
  max-width: 78ch;
  color: #4b5763;
  font-size: 14px;
  line-height: 1.6;
}

.mat-visual-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}

.mat-visual-grid img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: cover;
  border: 1px solid var(--ks-line);
}

.mat-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, .2);
}

.mat-steps article {
  min-height: 210px;
  padding: 30px 24px;
  border-right: 1px solid rgba(255, 255, 255, .2);
}

.mat-steps article:last-child {
  border-right: 0;
}

.mat-steps span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.mat-steps h3 {
  margin: 34px 0 12px;
  color: #fff;
  font-size: 20px;
}

.mat-steps p {
  color: rgba(255, 255, 255, .68);
  font-size: 13px;
  line-height: 1.6;
}

.mat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.mat-pills span {
  padding: 9px 12px;
  border: 1px solid var(--ks-line);
  color: #4d5964;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}

.mat-related {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--ks-line);
}

.mat-related a {
  position: relative;
  min-height: 160px;
  padding: 28px;
  border-right: 1px solid var(--ks-line);
  background: #fff;
  transition: background .2s ease;
}

.mat-related a:last-child {
  border-right: 0;
}

.mat-related a:hover {
  background: #f4f8ff;
}

.mat-related small,
.mat-related strong,
.mat-related span {
  display: block;
}

.mat-related small {
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.mat-related strong {
  margin-top: 28px;
  color: var(--ks-black);
  font-size: 22px;
}

.mat-related span {
  position: absolute;
  right: 24px;
  bottom: 22px;
  color: var(--blue);
  font-size: 24px;
}

.mat-ral-layout {
  display: grid;
  grid-template-columns: minmax(320px, .46fr) minmax(400px, .54fr);
  gap: clamp(36px, 6vw, 100px);
  align-items: start;
}

.mat-ral-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mat-ral-choice {
  min-height: 96px;
  padding: 0;
  border: 1px solid var(--ks-line);
  background: #fff;
  cursor: pointer;
}

.mat-ral-choice::before {
  content: "";
  display: block;
  height: 58px;
  background: var(--ral);
}

.mat-ral-choice span {
  display: block;
  padding: 10px 6px;
  color: var(--ks-black);
  font-size: 10px;
  font-weight: 850;
}

.mat-ral-choice:hover,
.mat-ral-choice[aria-pressed="true"] {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.mat-ral-preview {
  position: sticky;
  top: 164px;
  overflow: hidden;
  border: 1px solid var(--ks-line);
  background: #fff;
  box-shadow: 0 24px 70px rgba(22, 30, 38, .08);
}

.mat-ral-preview__surface {
  position: relative;
  display: grid;
  min-height: 500px;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #eef2f5;
}

.mat-ral-preview__surface::before {
  content: "";
  position: absolute;
  right: 7%;
  bottom: 16%;
  left: 7%;
  height: 1px;
  background: #cdd4da;
}

.mat-ral-preview__surface::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: 9%;
  left: 8%;
  height: 12%;
  border-right: 1px solid #d6dde2;
  border-bottom: 1px solid #d6dde2;
  border-left: 1px solid #d6dde2;
  opacity: .85;
}

.mat-ral-preview__spec {
  position: absolute;
  top: 24px;
  left: 26px;
  z-index: 4;
}

.mat-ral-preview__spec span,
.mat-ral-preview__spec small {
  display: block;
}

.mat-ral-preview__spec span {
  color: var(--ks-black);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.mat-ral-preview__spec small {
  margin-top: 5px;
  color: #6c7781;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mat-ral-preview__product {
  --product-image: url("assets/materials/ral-trapezovy-plech.png");
  position: relative;
  z-index: 2;
  width: 94%;
  aspect-ratio: 4 / 3;
  margin-top: 14px;
}

.mat-ral-preview__product img,
.mat-ral-preview__product::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mat-ral-preview__product img {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 26px 24px rgba(20, 28, 34, .22));
}

.mat-ral-preview__product::after {
  content: "";
  z-index: 2;
  background-color: var(--selected-ral, #29343a);
  -webkit-mask-image: var(--product-image);
  mask-image: var(--product-image);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  mix-blend-mode: multiply;
  opacity: .82;
  pointer-events: none;
  transition: background-color .32s ease;
}

.mat-ral-preview__finish {
  position: absolute;
  right: 26px;
  bottom: 22px;
  z-index: 4;
  color: #65717c;
  font-size: 10px;
  text-transform: uppercase;
}

.mat-ral-preview__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-top: 1px solid var(--ks-line);
}

.mat-ral-preview__meta small,
.mat-ral-preview__meta strong {
  display: block;
}

.mat-ral-preview__meta small {
  color: var(--ks-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.mat-ral-preview__meta strong {
  margin-top: 4px;
  color: var(--ks-black);
  font-size: 20px;
}

.mat-ral-preview__code {
  color: var(--blue);
  font-size: 15px;
  font-weight: 850;
}

.mat-hub-card {
  position: relative;
  display: flex;
  min-height: 460px;
  padding: 0 0 64px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ks-line);
  border-top: 3px solid var(--blue);
  background: #fff;
  transition: transform .25s var(--ease), box-shadow .25s ease, border-color .25s ease;
}

.mat-hub-card:hover {
  transform: translateY(-4px);
  border-color: rgba(8, 124, 255, .48);
  box-shadow: 0 24px 70px rgba(16, 20, 26, .09);
}

.mat-hub-card__visual {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--ks-line);
  background: #f2f4f6;
}

.mat-hub-card__visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--blue);
  transform: scaleX(.18);
  transform-origin: left;
  transition: transform .35s var(--ease);
}

.mat-hub-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s var(--ease);
}

.mat-hub-card:hover .mat-hub-card__visual::after {
  transform: scaleX(1);
}

.mat-hub-card:hover .mat-hub-card__visual img {
  transform: scale(1.025);
}

.mat-hub-card__body {
  padding: 25px 24px 0;
}

.mat-hub-card__body h3 {
  margin-top: 24px;
}

.mat-hub-card em {
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: var(--blue);
  font-size: 28px;
  font-style: normal;
}

.mat-hub-card small {
  display: block;
  margin-top: 22px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.ks-catalog-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .ks-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .mat-hero__media {
    min-height: 450px;
  }

  .mat-fact-strip,
  .mat-type-grid,
  .mat-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mat-fact-strip article:nth-child(2n),
  .mat-type-grid article:nth-child(2n),
  .mat-steps article:nth-child(2n) {
    border-right: 0;
  }

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

  .mat-ral-preview {
    position: relative;
    top: auto;
  }
}

@media (max-width: 820px) {
  .mat-chapters {
    top: 74px;
  }

  .mat-chapters__inner {
    padding: 0 18px;
  }

  .mat-heading,
  .mat-split,
  .mat-visual-grid {
    grid-template-columns: 1fr;
  }

  .mat-heading {
    gap: 18px;
  }

  .mat-related {
    grid-template-columns: 1fr;
  }

  .mat-related a {
    border-right: 0;
    border-bottom: 1px solid var(--ks-line);
  }

  .mat-related a:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .ks-catalog-grid {
    grid-template-columns: 1fr;
  }

  .mat-hero__copy {
    padding: 48px 20px;
  }

  .mat-hero h1 {
    font-size: 46px;
  }

  .mat-hero__media,
  .mat-media img,
  .mat-visual-grid img {
    min-height: 300px;
  }

  .mat-band {
    padding: 60px 20px;
  }

  .mat-fact-strip,
  .mat-type-grid,
  .mat-steps,
  .mat-ral-choices {
    grid-template-columns: 1fr;
  }

  .mat-fact-strip article,
  .mat-type-grid article,
  .mat-steps article {
    min-height: auto;
    border-right: 0;
  }

  .mat-note {
    grid-template-columns: 1fr;
  }

  .mat-ral-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mat-ral-preview__surface {
    min-height: 370px;
  }

  .mat-ral-preview__product {
    width: 96%;
    margin-top: 24px;
  }

  .mat-ral-preview__spec {
    top: 18px;
    left: 20px;
  }

  .mat-ral-preview__finish {
    right: 20px;
    bottom: 16px;
    max-width: 220px;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mat-hub-card,
  .mat-hub-card__visual::after,
  .mat-hub-card__visual img,
  .mat-ral-preview__product::after,
  .mat-related a {
    transition: none;
  }
}
