:root {
  --aster-accent: #f4d40b;
  --aster-dark: #101010;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* Исходный шаблон задавал прайсу фиксированную высоту, из-за чего
   следующая секция наезжала на последние строки таблицы. */
.prices {
  height: auto !important;
  min-height: 0;
}

.pre-prices {
  margin-top: 90px !important;
}

.pre-prices-title {
  display: inline-flex;
  width: auto !important;
  min-width: 258px;
  height: auto !important;
  min-height: 62px;
  margin: 0;
  padding: 12px 34px !important;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  white-space: nowrap;
}

.official {
  width: 100%;
  height: auto !important;
  padding-top: 0 !important;
  margin-top: 34px;
  margin-bottom: 110px;
}

.license-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  overflow: hidden;
  border: 1px solid #d8d8d8;
  background: #fff;
  box-shadow: 0 22px 50px rgba(0, 0, 0, .08);
}

.license-preview {
  position: relative;
  display: block;
  min-height: 480px;
  overflow: hidden;
  background: #edf1f4;
}

.license-preview img {
  width: 100%;
  height: 100%;
  min-height: 480px;
  object-fit: contain;
  transition: transform .35s ease;
}

.license-preview:hover img,
.license-preview:focus-visible img {
  transform: scale(1.015);
}

.license-preview span {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 11px 14px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.license-card__body {
  display: flex;
  padding: clamp(30px, 5vw, 64px);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: #171717;
  color: #fff;
}

.license-card__eyebrow {
  margin: 0 0 12px;
  color: var(--aster-accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.license-card__body h3 {
  margin: 0 0 20px;
  color: #fff;
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 800;
  line-height: 1;
}

.license-card__body > p:not(.license-card__eyebrow) {
  margin: 0 0 30px;
  color: #d7d7d7;
  font-size: 17px;
  line-height: 1.6;
}

.license-card .knd-p {
  display: inline-flex;
  width: auto;
  height: auto;
  margin: 0;
  padding: 13px 18px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--aster-accent);
  color: var(--aster-accent);
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease;
}

.license-card .knd-p:hover,
.license-card .knd-p:focus-visible {
  background: var(--aster-accent);
  color: #111;
}

.header1 img,
.footer-text img,
.offcanvas-body img {
  height: auto;
}

.legal-gallery-wrap {
  padding: 70px 0 90px;
  background: #f4f4f4;
}

.legal-gallery-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 560px);
  gap: 32px;
  align-items: end;
  margin-bottom: 30px;
}

.legal-gallery-kicker {
  margin: 0 0 8px;
  color: #777;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.legal-gallery-title {
  margin: 0;
  color: #111;
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 800;
  line-height: .98;
}

.legal-gallery-address {
  margin: 0;
  padding-left: 20px;
  border-left: 4px solid var(--aster-accent);
  color: #303030;
  font-size: 18px;
  line-height: 1.55;
}

.legal-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 180px;
  gap: 14px;
}

.legal-gallery-slider {
  position: relative;
}

.legal-gallery-nav,
.legal-gallery-hint {
  display: none;
}

.legal-gallery__item {
  position: relative;
  grid-column: span 4;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #222;
  cursor: zoom-in;
}

.legal-gallery__item:first-child,
.legal-gallery__item:nth-child(4) {
  grid-column: span 8;
}

.legal-gallery__item:first-child {
  grid-row: span 2;
}

.legal-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease, opacity .3s ease;
}

.legal-gallery__item::after {
  content: "+";
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--aster-accent);
  color: #111;
  font: 700 25px/1 Arial, sans-serif;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}

.legal-gallery__item:hover img,
.legal-gallery__item:focus-visible img {
  transform: scale(1.035);
  opacity: .84;
}

.legal-gallery__item:hover::after,
.legal-gallery__item:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.gallery-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  border: 0;
  padding: 0;
  background: transparent;
}

.gallery-dialog::backdrop {
  background: rgba(0, 0, 0, .9);
}

.gallery-dialog__frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.gallery-dialog img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
}

.gallery-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--aster-accent);
  color: #111;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 767px) {
  .pre-prices {
    margin-top: 60px !important;
  }

  .pre-prices-title {
    min-width: 220px;
    min-height: 54px;
    padding: 10px 26px !important;
    font-size: 23px !important;
  }

  .official {
    margin-top: 25px;
    margin-bottom: 70px;
  }

  .license-card {
    grid-template-columns: 1fr;
  }

  .license-preview,
  .license-preview img {
    min-height: 0;
  }

  .license-preview img {
    display: block;
    aspect-ratio: 700 / 687;
  }

  .license-card__body {
    padding: 30px 24px 34px;
  }

  .legal-gallery-wrap {
    padding: 50px 0 60px;
  }

  .legal-gallery-head {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .legal-gallery-address {
    font-size: 16px;
  }

  .legal-gallery-slider {
    margin-inline: -10px;
    padding-inline: 10px;
  }

  .legal-gallery {
    display: flex;
    grid-template-columns: none;
    grid-auto-rows: unset;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x;
  }

  .legal-gallery::-webkit-scrollbar {
    display: none;
  }

  .legal-gallery__item,
  .legal-gallery__item:first-child,
  .legal-gallery__item:nth-child(4) {
    width: auto;
    min-width: calc(100% - 34px);
    height: 260px;
    flex: 0 0 calc(100% - 34px);
    grid-column: auto;
    grid-row: auto;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .legal-gallery-nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--aster-accent);
    color: #111;
    font: 700 25px/1 Arial, sans-serif;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
    transform: translateY(-50%);
  }

  .legal-gallery-nav--prev {
    left: 0;
  }

  .legal-gallery-nav--next {
    right: 0;
  }

  .legal-gallery-hint {
    display: block;
    margin: 12px 0 0;
    color: #707070;
    font-size: 13px;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .legal-gallery {
    grid-auto-rows: unset;
  }

  .legal-gallery__item,
  .legal-gallery__item:first-child,
  .legal-gallery__item:nth-child(4) {
    height: 225px;
  }
}

/* Восстановленный оригинальный блок документов. */
.price-bottom {
  height: auto !important;
}

.official {
  display: flex;
  width: 100%;
  height: auto !important;
  margin: 34px auto 110px;
  padding-top: 0 !important;
  flex-direction: column;
  align-items: center;
}

.license-original-preview {
  display: flex;
  width: min(700px, 100%);
  height: auto;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
}

.license-original-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.official > .knd-p {
  display: block;
  width: auto;
  height: auto;
  margin: 28px 0 0;
  padding: 0 4px 10px;
  border: 0;
  border-bottom: 3px solid #000;
  color: #000;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 767px) {
  /* Убираем двойной вертикальный отступ между заголовком и текстом «О нас». */
  .about {
    gap: 32px !important;
    justify-content: flex-start;
  }

  .about .header {
    margin-top: 0 !important;
  }

  .about .header-title {
    margin-top: 0;
  }

  .official {
    margin-top: 26px;
    margin-bottom: 70px;
  }

  .license-original-preview {
    width: min(92vw, 700px);
    height: auto;
  }

  .official > .knd-p {
    max-width: 88vw;
    margin-top: 20px;
    font-size: 18px;
  }
}
