/* адаптив */
@media (max-width: 1440px) {
  .header__phone {
    display: none;
  }
}

@media (max-width: 1180px) {

  /* Полная шапка с логотипом занимает 136px; ниже оставляем 40px. */
  .page-head {
    padding-top: 176px;
  }

  .header__nav,
  .header__phone {
    display: none;
  }

  .header__burger {
    display: block;
  }

  .header__actions {
    margin-left: auto;
  }
}

@media (max-width: 1024px) {
  .hero__spiral-wrap {
    left: 50%;
    transform: translateX(-50%);
    width: clamp(380px, 58vw, 700px);
    max-width: 90vw;
    bottom: clamp(-20px, -1vw, 0px);
  }

  /* «О нас»: текст под заголовком */
  .about__head {
    grid-template-columns: minmax(0, 1fr);
  }

  /* minmax(0, 1fr): иначе колонку распирает лента слайдов; фото — над списком */
  .showcase {
    grid-template-columns: minmax(0, 1fr);
  }

  .showcase__media {
    order: -1;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  /* конфигуратор: одна колонка, схема сверху, итог — плашкой внизу экрана */
  .configurator__intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .configurator__presets {
    justify-content: flex-start;
  }

  .configurator__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .configurator__visual {
    position: static;
  }

  .configurator__bar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    padding: 8px 8px 8px 24px;
    border-radius: 999px;
    background: var(--color-snow);
    color: var(--color-night);
    box-shadow: 0 14px 32px rgba(0, 3, 10, 0.45);
  }

  .configurator__bar-total {
    font-family: var(--font-display);
    font-size: 20px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  .charity__row {
    flex-direction: column;
    align-items: flex-start;
  }

  .reviews__head {
    grid-template-columns: minmax(0, 1fr);
  }

  .reviews__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-configurator__head,
  .service-configurator__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-summary {
    position: static;
  }

  /* паспорт товара: фото сверху, описание под ним */
  .product,
  .product--reverse {
    grid-template-columns: minmax(0, 1fr);
  }

  .product--reverse .product__gallery {
    order: 0;
  }

  .product__gallery {
    position: static;
  }

  /* планшет: все разделы по два в ряд */
  .catalog__item,
  .catalog__item--wide,
  .catalog__item--medium,
  .catalog__item--third,
  .catalog__item--half,
  .catalog__item--full {
    grid-column: span 6;
  }

  .catalog__item:last-child:nth-child(odd) {
    grid-column: span 12;
  }

  .footer__top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  :root {
    --header-h: 82px;
    --gutter: clamp(20px, 4vw, 56px);
  }

  .header__inner {
    padding: 16px var(--gutter);
  }

  .configurator-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .configurator__options--end-choice {
    grid-template-columns: minmax(0, 1fr);
  }

  .header--scrolled .header__logo {
    max-width: 100px;
  }

  /* на телефоне показываем вертикальную композицию целиком */
  .hero {
    --photo-position: 50% 0%;
  }

  .hero__shadow--spiral {
    top: 70%;
    bottom: auto;
    left: 7%;
    width: 86%;
    height: clamp(28px, 9vw, 46px);
    opacity: 0.78;
  }

  /* длинное название не помещается — на телефоне оно только в шапке;
     h1 прячем визуально, но оставляем для поисковиков и экранных дикторов */
  .hero__title {
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .hero__tagline {
    display: none;
  }

  /* на телефоне показываем петлю (слева под логотипом), скобу Softschäkel (справа) и центральную спираль у правого края */
  .hero__loops {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
  }

  .hero__loop--eye {
    top: clamp(140px, 18.5vh, 175px);
    left: clamp(14px, 4.5vw, 32px);
    width: clamp(120px, 32vw, 155px);
    height: auto;
    rotate: -40deg;
    opacity: 0.92;
  }

  .hero__brand {
    position: absolute;
    top: clamp(140px, 18.5vh, 175px);
    right: clamp(14px, 4.5vw, 32px);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    max-width: 44vw;
  }

  .hero__shackle-box {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0;
    transform: none;
  }

  .hero__shackle-box .hero__loop--shackle {
    position: static;
    display: block;
    width: clamp(105px, 28vw, 140px);
    height: auto;
    object-fit: contain;
    opacity: 0.92;
  }

  .hero__origin {
    display: block;
    align-self: flex-start;
    width: clamp(56px, 14vw, 68px);
    height: clamp(56px, 14vw, 68px);
    margin-bottom: 8px;
    opacity: 1;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
  }

  .hero__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .hero__right-block {
    align-items: flex-start;
    width: 100%;
  }

  .hero__facts {
    justify-self: start;
  }

  .hero__spiral-wrap {
    position: absolute;
    inset: auto;
    top: 52%;
    bottom: auto;
    right: -4px;
    left: auto;
    transform: translateY(-50%);
    width: min(96vw, 500px);
    height: auto;
    max-height: 44vh;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    pointer-events: none;
    z-index: 2;
  }

  .hero__cutout {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    max-height: 44vh;
    object-fit: contain;
    object-position: right center;
    filter: drop-shadow(0 16px 10px rgba(0, 2, 8, 0.68));
    -webkit-mask-image: none;
    mask-image: none;
    transform: none;
  }

  .header__button,
  .header__lang {
    display: none;
  }



  .footer {
    border-radius: 24px 24px 0 0;
  }

  .to-top {
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
  }

  .to-top--raised {
    bottom: 84px;
  }

  /* на телефоне одна колонка; меню — в две, чтобы подвал не вытягивался */
  .footer__top {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .footer__column:first-of-type .footer__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
  }

  .footer__meta {
    width: 100%;
    justify-content: space-between;
  }

  .footer__link--large {
    font-size: 16px;
  }

  .footer__link {
    overflow-wrap: anywhere;
  }

  .hero__text {
    margin-bottom: 22px;
    font-size: 14px;
  }

  .hero__actions .button {
    flex: 1 1 auto;
    height: 50px;
    padding: 0 20px;
  }

  .facts {
    gap: 16px;
  }

  .facts__item {
    padding-left: 12px;
  }

  .facts__label {
    font-size: 11px;
  }

  .about__paragraph {
    font-size: 15px;
  }

  .showcase__media {
    border-radius: 18px;
  }

  .showcase__tab {
    min-height: 0;
    padding: 20px;
  }

  .reviews__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-card {
    min-height: 220px;
    border-radius: 18px;
  }

  .service-summary {
    border-radius: 18px;
  }

  .configurator__text {
    font-size: 15px;
  }

  .configurator__presets-label {
    width: 100%;
  }

  .configurator__options--ends {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .configurator__options--splices {
    grid-template-columns: minmax(0, 1fr);
  }

  .configurator-request {
    grid-template-columns: minmax(0, 1fr);
  }

  .option--end .option__body {
    min-height: 118px;
  }

  .length {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "field"
      "range"
      "scale";
    gap: 12px;
  }

  .length__field {
    justify-self: start;
  }

  .rope-preview {
    border-radius: 20px;
  }

  .rope-preview__head {
    flex-direction: column;
    gap: 4px;
  }

  .rope-preview__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rope-preview__stat--total {
    align-items: flex-start;
    text-align: left;
  }

  .summary {
    border-radius: 20px;
  }

  .summary__fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .product__media {
    border-radius: 18px;
  }

  .product__thumb {
    width: 68px;
    height: 52px;
  }

  .product__spec {
    grid-template-columns: minmax(0, 130px) minmax(0, 1fr);
  }

  .product__cell {
    padding: 9px 10px;
  }

  .product__actions .button {
    width: 100%;
  }

  /* на телефоне шапка страницы в одну колонку, разделы — друг под другом */
  .page-head {
    padding-bottom: 64px;
  }

  .page-head__inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 32px;
  }

  .page-head__breadcrumbs {
    margin-bottom: 8px;
  }

  .catalog__list {
    border-radius: 20px;
  }

  .catalog__item,
  .catalog__item--wide,
  .catalog__item--medium,
  .catalog__item--third,
  .catalog__item--half,
  .catalog__item--full {
    grid-column: 1 / -1;
  }

  .category,
  .category--featured {
    min-height: 220px;
  }

  .category--featured .category__title {
    font-size: 24px;
  }

  .charity__inner {
    border-radius: 24px;
  }

  .charity__row {
    padding: 20px 20px 0 20px;
  }

  .container {
    padding: 0 5px;
  }

  :root {
    --margin-block: 60px
  }

  .charity__about {
    padding: 0 4px;
  }

  .charity__formula {
    padding: 0 4px;
  }

  .charity__text {
    font-size: 15px;
  }

  .gallery__viewport,
  .gallery__slide {
    border-radius: 18px;
  }

  /* квадратный слайд: подпись внизу не заходит под стрелки */
  .gallery__slide {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .gallery__caption {
    padding: 72px 20px 20px;
  }

  /* на телефоне стрелки целиком внутри фото, по центру слайда */
  .gallery__button {
    width: 48px;
    height: 48px;
  }

  .gallery__button .button__icon {
    width: 22px;
    height: 22px;
  }

  .gallery__button--prev {
    left: 12px;
    translate: 0 -50%;
  }

  .gallery__button--next {
    right: 12px;
    translate: 0 -50%;
  }
}

.work-gallery {
  margin: var(--margin-block) 0;
  padding: 0;
}

.work-gallery__inner {
  max-width: 1440px;
  margin: 0 auto;
}

.work-gallery__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 40px;
}

.work-gallery__title {
  margin: 0;
  font: 500 clamp(32px, 3.6vw, 56px)/1.1 var(--font-display);
  letter-spacing: -.025em;
}

.work-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-radius: 24px;
}

.work-gallery__photo {
  aspect-ratio: 4 / 3;
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  border-radius: 0;
  background: var(--color-surface);
  color: var(--color-snow);
  text-align: left;
  cursor: zoom-in;
}

.work-gallery__photo:nth-child(3n),
.work-gallery__photo:nth-last-child(1 of :not([hidden])) {
  border-right: 0;
}

.work-gallery__photo:nth-last-child(-n+3 of :not([hidden])) {
  border-bottom: 0;
}

.work-gallery__photo img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  transition: transform .7s var(--ease-out);
}
.work-gallery__caption { position: absolute; inset: auto 0 0; padding: 12px 16px; background: linear-gradient(transparent, rgba(0,0,0,.8)); color: #fff; font: inherit; white-space: pre-line; overflow-wrap: anywhere; }
.work-gallery__description { margin: 12px 20px; color: #fff; white-space: pre-line; overflow-wrap: anywhere; }
.content-load-status { padding: 24px; text-align: center; }
[data-no-translate] { overflow-wrap: anywhere; }

.work-gallery__photo:focus-visible img {
  transform: scale(1.04);
}

@media (hover: hover) {
  .work-gallery__photo:hover img {
    transform: scale(1.04);
  }
}

.work-gallery__photo[hidden],
[data-gallery-more][hidden] {
  display: none;
}

.work-gallery__more {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.work-gallery__more:has([hidden]) {
  display: none;
}

.work-gallery__dialog {
  width: fit-content;
  max-width: calc(100% - 16px);
  max-height: calc(100dvh - 32px);
  padding: 64px 72px 34px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-snow);
}

.work-gallery__dialog::backdrop {
  background: rgba(3, 10, 22, .55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.work-gallery__close {
  position: absolute;
  top: 0;
  right: 72px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  color: inherit;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
}

.work-gallery__full-image {
  display: block;
  border-radius: 20px;
  width: auto;
  height: auto;
  max-width: calc(100vw - 176px);
  max-height: calc(100dvh - 140px);
  object-fit: contain;
}

.work-gallery__controls {
  position: absolute;
  inset: 64px 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.work-gallery__current {
  position: absolute;
  bottom: -28px;
  left: 0;
  width: 100%;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  color: var(--color-text-muted);
}

.work-gallery__controls .button {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  font-size: 24px;
  flex-shrink: 0;
  min-width: 48px;
  padding: 0;
}

@media (max-width: 767px) {
  .work-gallery__head {
    flex-direction: column;
    align-items: start;
    gap: 20px;
    margin-bottom: 28px;
  }

  .work-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-gallery__photo:nth-child(n of :not([hidden])) {
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
  }

  .work-gallery__photo:nth-child(2n of :not([hidden])),
  .work-gallery__photo:nth-last-child(1 of :not([hidden])) {
    border-right: 0;
  }

  .work-gallery__photo:nth-last-child(-n+2 of :not([hidden])) {
    border-bottom: 0;
  }

  .work-gallery__dialog {
    padding: 60px 0 34px;
  }
  .work-gallery__full-image { max-width: calc(100vw - 32px); }
  .work-gallery__close { right: 0; }
  .work-gallery__controls { inset: 60px 8px 34px; }

  .work-gallery__current {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .work-gallery__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .work-gallery__photo:nth-child(n of :not([hidden])) {
    border-right: 0;
    border-bottom: 1px solid #fff;
  }

  .work-gallery__photo:nth-last-child(1 of :not([hidden])) {
    border-bottom: 0;
  }
}

