// Стилизация БЭМ-блока page.
// Общие стили тегов.
// Подключение шрифтов.
// Типографика.

// stylelint-disable plugin/selector-bem-pattern

// Сделаем viewport великим снова! (привет, IE10) http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/
@at-root {
  @-ms-viewport {
    // stylelint-disable-line
    width: device-width;
  }
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  src: local(""),
    url("../fonts/manrope-v13-latin_cyrillic-regular.woff2") format("woff2"),
    url("../fonts/manrope-v13-latin_cyrillic-regular.woff") format("woff");
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500;
  src: local(""),
    url("../fonts/manrope-v13-latin_cyrillic-500.woff2") format("woff2"),
    url("../fonts/manrope-v13-latin_cyrillic-500.woff") format("woff");
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700;
  src: local(""),
    url("../fonts/manrope-v13-latin_cyrillic-700.woff2") format("woff2"),
    url("../fonts/manrope-v13-latin_cyrillic-700.woff") format("woff");
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 800;
  src: local(""),
    url("../fonts/manrope-v13-latin_cyrillic-800.woff2") format("woff2"),
    url("../fonts/manrope-v13-latin_cyrillic-800.woff") format("woff");
}

.page {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-text-size-adjust: 100%; // stylelint-disable-line
  min-width: 320px;
  min-height: 100%;

  &__inner {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  &__content {
    flex-grow: 1;
  }

  &__footer-wrapper {
    flex-shrink: 0;
  }
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex; // Исправляем баг в IE для min-height and flexbox (flex-direction:column)
  flex-direction: column; // и прижимаем footer в IE 10-11
  min-height: 100%;
  margin: 0;
  word-break: break-word;
  font-family: $font-family;
  font-weight: 400;
  font-size: 13px;
  line-height: $line-height;
  text-align: left;
  color: $text-color;
  background-color: $body-bg;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  @media (min-width: $screen-xxl) {
    font-size: $font-size;
  }

  @media (min-width: $screen-lg) {
    font-size: 16px;
  }

  @media (min-width: $screen-sm) {
    font-size: 14px;
  }
}

[tabindex="-1"]:focus {
  outline: none !important; // stylelint-disable-line
}

// Коррекция для кликабельных элементов с указанной ролью в iOS
[role="button"] {
  cursor: pointer;
}

// Мы любим Сафари (на самом деле, нет).
[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none; // stylelint-disable-line
}

// area,
// summary,
a,
button,
[role="button"],
input,
label,
select,
textarea {
  touch-action: manipulation; // Стилевая коррекция 300ms задержки (для поддерживающих браузеров)
  margin: 0; // Убираем margin в Firefox и Safari
}

button,
input {
  overflow: visible; // Покажем торчащее в Edge
  text-transform: none; // Уберём наследование text transform в Firefox
}

// Коррекция проблем стилизации для Safari
button,
html [type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button; // stylelint-disable-line
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  padding: 0;
  border-style: none;
}

// Коррекция для Mobile Safari (https://github.com/twbs/bootstrap/issues/11266)
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
  -webkit-appearance: listbox; // stylelint-disable-line
}

textarea {
  overflow: auto; // Удаление верт. скролла в IE.
  resize: vertical; // Правильное изменение размеров
}

svg {
  a &,
  button & {
    pointer-events: none; // Мы любим Edge, это браузер! (почти)
  }

  &:not(:root) {
    overflow: hidden; // Скрыть выступающее за границы в IE
  }
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: $color-2;
  text-decoration: none;
  background-color: transparent;
  transition: color 0.3s;

  &:hover {
    color: $color-1;
  }

  &:focus {
    color: $color-1-1;
  }

  // &:visited {
  //   color: $link-color--hover;
  // }
}

hr {
  box-sizing: content-box; // Проблема Firefox
  height: 0; // Проблема Firefox
  margin-top: $typo-margin-vertical * 2;
  margin-bottom: $typo-margin-vertical * 2;
  border: 0;
  border-top: 1px solid $border-color;
  overflow: visible; // Проблема Edge и IE
}

h1,
h2,
h3,
h4,
h5,
h6 {
  // margin-top: 1em;
  // margin-bottom: 0.5em;
  margin-top: 0;
  margin-bottom: 0;
  font-family: $font-family;
  font-weight: 700;
  line-height: 1.2;
  color: $color-3;
}

h1 {
  font-size: $font-size-h1;
} // stylelint-disable-line
h2 {
  font-size: $font-size-h2;
} // stylelint-disable-line
h3 {
  font-size: $font-size-h3;
} // stylelint-disable-line
h4 {
  font-size: $font-size-h4;
} // stylelint-disable-line
h5 {
  font-size: $font-size-h5;
} // stylelint-disable-line
h6 {
  font-size: $font-size-h6;
} // stylelint-disable-line

p,
ul,
ol,
dl,
table,
blockquote,
pre,
address,
figure {
  margin-top: 0;
  margin-bottom: $typo-margin-vertical;
}

p {
  // http://clagnut.com/blog/2395
  hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  hyphenate-limit-lines: 2;
  hyphenate-limit-last: always;
  hyphenate-limit-zone: 8%;
}

address {
  font-style: normal;
}

ul,
ol {
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;

  ul,
  ol {
    margin-top: 0;
    margin-bottom: 0;
  }
}

li {
  line-height: inherit;
}

// dt {
//   font-weight: 700;
// }

// dd {
//   margin-left: 0;

//   @media (min-width: $screen-sm) {
//     margin-left: 1.5rem;
//   }

//   & + dt {
//     margin-top: ($line-height / 2);
//   }
// }

// .small,
small {
  font-size: $font-size-sm;
}

sub,
sup {
  font-size: $font-size-sm;
}

// .mark,
// mark {
//   background: rgba($color-warning, 0.3);
//   padding: 0.1em 0.3em;
// }

b,
strong {
  font-weight: bolder;
}

// abbr[title] {
//   text-decoration: underline dotted;
// }

blockquote {
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

// samp,
code,
kbd,
pre {
  font-family: $font-family--monospace;
}

code {
  padding: 0.06em 0.3em;
  color: $text-color;
  background-color: rgba(#000, 0.08);
  border-radius: $border-radius;
}

kbd {
  padding: 0.06em 0.3em;
  color: $text-color;
  background-color: $gray-lightest;
  border-radius: $border-radius;

  kbd {
    padding: 0;
  }
}

pre {
  display: block;
  width: 100%;
  margin-bottom: $typo-margin-vertical;
  overflow-x: auto;
  tab-size: 2;
  background-color: rgba(#000, 0.08);

  code {
    background: transparent;
  }
}

:root {
  --container-width: 100%;
  --container-margin: auto;
  --container-horizontal-padding: 15px;

  @media (min-width: $screen-xxl) {
    --container-width: 1640px;
  }

  @media (min-width: $screen-xl) {
    --container-width: 1200px;
  }

  @media (min-width: $screen-lg) {
    --container-width: 992px;
  }

  @media (min-width: $screen-md) {
    --container-width: 768px;
  }
}

.container {
  margin: var(--container-margin);
  padding: 0 var(--container-horizontal-padding);
  width: var(--container-width);
}

/* ----- .simple-menu ----- */

.simple-menu {
  $block-name: &;

  display: flex;
  gap: 10px 30px;

  @media (min-width: $screen-xxl) {
    column-gap: 60px;
  }

  @media (min-width: $screen-xl) {
    column-gap: 40px;
  }

  &__item {
  }

  &__i-link {
  }
}

/* ----- .feedback ----- */

.feedback {
  $block-name: &;

  &__item {
  }

  &__i-link {
    font-weight: 500;
    color: $color-1;
  }

  &--type-1 {
    display: flex;
    flex-wrap: wrap;

    @media (min-width: $screen-xxl) {
      gap: 15px 90px;
    }

    @media (max-width: ($screen-xxl - 1)) {
      flex-direction: column;
      gap: 10px 90px;
    }

    @media (max-width: ($screen-md - 1)) {
      align-items: center;
      margin-left: auto;
      margin-right: auto;
      max-width: 270px;
    }

    #{$block-name}__i-link {
      display: inline-flex;
      align-items: center;
      color: #fff;

      svg {
        margin-right: 10px;
        min-width: 20px;
        height: auto;

        @media (min-width: $screen-md) {
          margin-right: 18px;
          min-width: 25px;
        }
      }
    }
  }
}

/* ----- .mob-menu ----- */

.mob-menu {
  $block-name: &;

  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  opacity: 0;
  visibility: hidden;

  @media (min-width: $screen-lg) {
    display: none;
  }

  @media (min-width: $screen-md) {
    top: var(--header-bottom);
    height: auto;
    background: #fff;
  }

  @media (max-width: ($screen-md - 1)) {
    transition: opacity 0.55s, visibility 0.55s;
  }

  @at-root .mob-menu-active & {
    opacity: 1;
    visibility: visible;
  }

  .simple-menu {
    justify-content: center;
    gap: 15px 70px;

    @media (max-width: ($screen-md - 1)) {
      flex-direction: column;
      align-items: center;
      gap: 30px;
      font-size: 15px;
    }
  }

  .feedback {
    @media (max-width: ($screen-md - 1)) {
      font-size: 18px;
    }

    .feedback__item + .feedback__item {
      @media (max-width: ($screen-md - 1)) {
        margin-top: 10px;
      }
    }
  }

  &__inner {
    padding: 0 0 25px;

    @media (max-width: ($screen-md - 1)) {
      padding: 20px 0;
      height: 100vh;
      overflow-y: auto;
    }
  }

  &__first,
  &__third {
    @media (min-width: $screen-md) {
      display: none;
    }
  }

  &__first-inner {
    @media (max-width: ($screen-md - 1)) {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
  }

  &__f-left {
    @media (min-width: $screen-sm) {
      line-height: 0;
    }
  }

  &__f-right,
  &__close {
    line-height: 0;
  }

  &__f-right {
    @media (max-width: ($screen-md - 1)) {
      display: flex;
      align-items: center;
    }
  }

  &__close {
    @media (max-width: ($screen-md - 1)) {
      margin-left: 25px;
      padding: 0;
      border: unset;
      background-color: transparent;
    }

    svg {
      pointer-events: none;
    }
  }

  &__second,
  &__third {
    @media (max-width: ($screen-md - 1)) {
      margin-top: 60px;
    }
  }

  &__second-inner {
  }

  &__third {
    @media (max-width: ($screen-md - 1)) {
      text-align: center;
    }
  }

  &__third-inner {
  }
}

/* ----- .big-text ----- */

.big-text {
  $block-name: &;

  margin: 40px 0;
  font-weight: 700;
  font-size: 20px;
  line-height: 140%;

  @media (min-width: $screen-xl) {
    margin-top: 100px;
    margin-bottom: 100px;
    font-size: 40px;
  }

  @media (min-width: $screen-md) {
    margin-top: 60px;
    margin-bottom: 60px;
    font-size: 28px;
  }

  p {
    margin-bottom: 0;
  }

  p + p {
    margin-top: 0.75em;
  }

  &__inner {
  }
}

/* ----- .banner ----- */

.banner {
  $block-name: &;

  margin: 40px 0;

  @media (min-width: $screen-xl) {
    margin-top: 80px;
    margin-bottom: 80px;
  }

  @media (min-width: $screen-md) {
    margin-top: 60px;
    margin-bottom: 60px;
  }

  &__inner {
  }

  &__img {
    overflow: hidden;
    aspect-ratio: 16/10;
    border-radius: 20px;
    line-height: 0;

    @media (min-width: $screen-lg) {
      aspect-ratio: 16/4.35;
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
    }
  }
}

/* ----- .about-us ----- */

.about-us {
  $block-name: &;

  margin: 40px 0;

  @media (min-width: $screen-xl) {
    margin-top: 80px;
    margin-bottom: 80px;
  }

  @media (min-width: $screen-md) {
    margin-top: 60px;
    margin-bottom: 60px;
  }

  &__inner {
    @media (min-width: $screen-md) {
      display: flex;
    }
  }

  &__first {
    @media (min-width: $screen-md) {
      padding-right: 30px;
      width: 30%;
    }

    @media (max-width: ($screen-md - 1)) {
      margin-bottom: 23px;
    }
  }

  &__second {
    @media (min-width: $screen-md) {
      width: 70%;
    }
  }
}

/* ----- .big-list ----- */

.big-list {
  $block-name: &;

  margin: 40px 0;

  @media (min-width: $screen-xl) {
    margin-top: 80px;
    margin-bottom: 80px;
  }

  @media (min-width: $screen-md) {
    margin-top: 60px;
    margin-bottom: 60px;
  }

  &__inner {
  }

  &__block {
    counter-reset: li;
  }

  &__b-item {
    padding-top: 40px;
    border-top: 1px solid #efefef;
    counter-increment: li;

    @media (min-width: $screen-xl) {
      padding-top: 70px;
    }

    @media (min-width: $screen-md) {
      display: flex;
      padding-top: 50px;
    }

    & + & {
      margin-top: 40px;

      @media (min-width: $screen-xl) {
        margin-top: 70px;
      }

      @media (min-width: $screen-md) {
        margin-top: 50px;
      }
    }
  }

  &__b-item-first {
    @media (min-width: $screen-md) {
      width: 42%;
    }
  }

  &__b-item-img {
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: 20px;
    line-height: 0;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
    }
  }

  &__b-item-second {
    @media (min-width: $screen-md) {
      padding-left: 7.5%;
      width: 58%;
    }

    @media (max-width: ($screen-md - 1)) {
      margin-top: 30px;
    }

    .text-flow {
      margin-top: 20px;

      @media (min-width: $screen-xl) {
        margin-top: 40px;
      }

      @media (min-width: $screen-md) {
        margin-top: 30px;
      }
    }
  }

  &__b-item-number {
    display: inline-block;
    padding: 10px 25px;
    border: 1px solid $color-1;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;

    @media (min-width: $screen-xl) {
      font-size: 20px;
    }

    @media (min-width: $screen-md) {
      font-size: 14px;
    }

    &::before {
      content: counter(li, decimal-leading-zero);
    }
  }

  &__b-item-title {
    margin-top: 15px;
    font-weight: 700;
    font-size: 23px;

    @media (min-width: $screen-xl) {
      margin-top: 30px;
      font-size: 40px;
    }

    @media (min-width: $screen-md) {
      margin-top: 25px;
      font-size: 30px;
    }
  }
}

/* ----- .form-block ----- */

.form-block {
  $block-name: &;

  margin: 40px auto;
  color: #fff;

  @media (min-width: $screen-xl) {
    margin-top: 90px;
    margin-bottom: 90px;
  }

  @media (min-width: $screen-md) {
    margin-top: 60px;
    margin-bottom: 60px;
  }

  @media (max-width: ($screen-xl - 1)) {
    max-width: 525px;
  }

  .def-title {
    color: #fff;
  }

  &__inner {
    padding: 30px 25px;
    border-radius: 20px;
    background: #f36601;

    @media (min-width: $screen-xxl) {
      padding: 50px 70px;
    }

    @media (min-width: $screen-xl) {
      display: flex;
      align-items: center;
      padding: 50px;
    }

    @media (min-width: $screen-md) {
      padding: 40px 60px;
    }

    @media (max-width: ($screen-xl - 1)) {
      text-align: center;
    }
  }

  &__first {
    margin-bottom: 25px;

    @media (min-width: $screen-xxl) {
      width: 30%;
    }

    @media (min-width: $screen-xl) {
      margin-bottom: 0;
      padding-right: 35px;
      width: 25%;
    }

    @media (min-width: $screen-sm) {
      margin-bottom: 30px;
    }

    .def-title {
      @media (min-width: $screen-xxl) {
        font-size: 50px;
      }

      @media (min-width: $screen-xl) {
        font-size: 30px;
      }
    }
  }

  &__second {
    @media (min-width: $screen-xxl) {
      width: 70%;
    }

    @media (min-width: $screen-xl) {
      width: 75%;
    }

    form {
      @media (min-width: $screen-xxl) {
        gap: 15px 25px;
      }

      @media (min-width: $screen-xl) {
        display: flex;
        gap: 15px;
      }

      @media (max-width: ($screen-xl - 1)) {
        margin-left: auto;
        margin-right: auto;
        max-width: 335px;
      }

      .field-text {
        @media (min-width: $screen-xl) {
          margin-bottom: 0;
        }
      }

      .btn {
        @media (max-width: ($screen-xl - 1)) {
          width: 100%;
          justify-content: center;
        }
      }
    }
  }
}

.text-flow {
  > * {
    margin-top: 1.7em;
    margin-bottom: 1.7em;
  }

  > :first-child {
    margin-top: 0;
  }

  > :last-child {
    margin-bottom: 0;
  }
}

.def-title {
  margin: 0;
  font-weight: 700;
  font-size: 23px;
  color: $color-3;

  @media (min-width: $screen-xl) {
    font-size: 50px;
  }

  @media (min-width: $screen-md) {
    font-size: 30px;
  }
}

.black-background {
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s, visibility 0.55s;

  &.active {
    visibility: visible;
    opacity: 1;
  }

  @at-root .mob-menu-active & {
    visibility: visible;
    opacity: 1;
  }
}

.of-h {
  overflow: hidden;
}

.response-wrapper,
.response-block {
  position: fixed;
  opacity: 0;
  visibility: hidden;
  transition: opacity $transition-time, visibility $transition-time;

  &.active {
    opacity: 1;
    visibility: visible;
  }
}

.response-wrapper {
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.response-block {
  z-index: 11;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 15px;
  border-right: 5px solid transparent;
  width: 450px;
  max-width: calc(100% - 30px);
  background-color: #fff;
  font: 16px/160% var(--ff);
  color: #333;

  &.error {
    border-color: red;
  }

  &.ok {
    border-color: limegreen;
  }
}
