/* accordion */

.js-accordion-toggle {
  cursor: pointer;

  + * {
    display: none;
  }

  &.is-active + * {
    display: block;
  }
}

.accordions {
  margin-bottom: 60px;
}

.accordions__toggle {
  position: relative;
  padding: 15px 45px 15px 25px;
  margin: 0 0 10px;

  background: var(--color-grey-extra-light);
  border-bottom: 1px solid var(--color-grey-light);
  color: var(--color-black);
  font-size: 19px;
  font-weight: 500;

  transition: color .1s ease;

  @media (width < 480px) {
    padding: 10px 25px 10px 15px;

    font-size: 16px;
  }

  &::first-letter {
    color: var(--color-accent);
    font-size: 20px;
    font-weight: 700;

    @media (width < 480px) {
      font-size: 18px;
    }
  }

  &::after {
    position: absolute;
    right: 20px;
    top: 50%;

    content: '';
    width: 10px;
    height: 10px;
    margin-top: -10px;

    background: transparent;
    border: 2px solid var(--color-black-extra-light);
    border-top: none;
    border-left: none;

    transform: rotate(45deg);

    transition: transform .15s ease;

    @media (width < 480px) {
      margin-top: -6px;
      right: 12px;
      width: 6px;
      height: 6px;
    }
  }
}

.accordions__toggle.is-active {
  color: var(--color-accent);

  &::after {
    transform: rotate(-135deg) translate(-5px, -5px);

    @media (width < 480px) {
      transform: rotate(-135deg) translate(-3px, -3px);
    }
  }
}

.accordions__body {
  padding: 20px 20px 10px 20px;
  margin: 0;
}

/* choices-custom */

:root .choices__inner {
  padding: 7px 11px;
  min-height: 50px;

  background: var(--color-grey-extra-light);
  border: 1px solid transparent;
  border-bottom-color: var(--color-grey-light);
  font-size: 16px;
  transition: border-color .1s ease;

  @media (width < 480px) {
    min-height: 40px;
    padding: 2px 11px;
  }
}

:root .choices[data-type*=select-one] .choices__inner {
  padding: 7px 11px;

  @media (width < 480px) {
    padding: 2px 11px;
  }
}

:root .choices__placeholder {
  opacity: 1;
}

:root .choices__item--disabled {
  display: none;
}

:root .choices__input {
  border-color: var(--color-grey-light);
}

:root .choices {
  .choices__list--dropdown {
    background: var(--color-grey-extra-light);
    border: 1px solid var(--color-grey-light);
    opacity: 0;

    &.is-active {
      opacity: 1;
      transition: opacity .12s ease, visibility .12s ease;
    }

    .choices__item--selectable {
      padding-right: 70px;
    }
  }

  ::-webkit-scrollbar-track-piece {
    background-color: var(--color-grey-light);
  }

  ::-webkit-scrollbar-thumb {
    height: 5px;
    background-color: var(--color-grey);
  }

  &.is-focused {
    .choices__inner {
      border: 1px solid transparent;
      border-bottom-color: var(--color-grey);
    }
  }

  &.is-open {
    .choices__list--dropdown {
      border-color: var(--color-grey-light);
    }

    .choices__inner {
      border-color: var(--color-grey-light);
    }

    &::after {
      margin: -4px 0 0;

      border-color: var(--color-black-light) transparent transparent;
      transform: rotate(-180deg) translateY(5px);
    }
  }

  &::after {
    margin: -4px 0 0;

    border-top-color: var(--color-black-light);

    transition: transform .2s ease-in-out;
  }
}

/* table */

.table-wrapper {
  position: relative;
  margin-bottom: 60px;

  @media (width < 768px) {
    padding: 0 10px;
    margin: 0 -10px 60px;
    overflow: auto;
  }

  .table {
    position: relative;
    margin: 0 10px 0 0;

    &::after {
      content: ' ';
      position: absolute;
      right: -10px;
      top: 0;
    }
  }
}

.table {
  width: 100%;
  margin-bottom: 60px;

  border: 1px solid #eee;
  border-top: 3px solid var(--color-accent);
  border-radius: 2px;

  & td,
  & th {
    padding: 10px 15px;

    border-right: 1px solid var(--color-grey-extra-light);
    text-align: left;
    font-size: 18px;
    vertical-align: middle;

    &:last-child {
      border: none;
    }

    @media (width < 1024px) {
      font-size: 16px;
      line-height: 1.2;
    }

    @media (width < 768px) {
      padding: 6px 10px;
      min-width: 160px;

      &:first-child {
        min-width: auto;
      }
    }
  }

  & th {
    background: var(--color-grey-extra-light);
    border-right: 1px solid #ececec;
  }

  & tr {
    border-bottom: 1px solid #eee;
  }

  + .oferta {
    margin-top: -45px;
  }
}

.table--price {
  min-width: 500px;

  & td:last-child {
    white-space: nowrap;
  }
}

/* service */

.service {
  margin: 0 0 60px;

  font-size: 16px;
  line-height: 1.2;

  .h2 {
    text-align: center;
  }

  & ul {
    padding: 0;
    margin: 0;

    list-style: none;
  }

  & li {
    margin: 0 0 12px;

    font-size: 18px;
    line-height: 1.2;
    text-shadow: 1px 1px 0 var(--color-grey-extra-light);

    @media (width < 1200px) {
      font-size: 17px;
    }

    @media (width < 768px) {
      font-size: 16px;
    }

    & li li {
      position: relative;
      padding-left: 15px;
      margin: 8px 0;

      font-size: 15px;

      &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 9px;
        width: 6px;
        height: 1px;
        background: var(--color-grey-dark);
      }
    }
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;

    @media (width < 768px) {
      justify-content: center;
    }

    > li {
      position: relative;
      overflow: hidden;

      width: 370px;
      flex: 1 1 calc(100% / 3 - 20px);
      padding: 30px 40px;
      margin: 0 10px 20px;

      background: var(--color-grey-extra-light);
      border-bottom: 2px solid var(--color-grey-light);

      transition: border-color .15s ease;

      @media (width < 1200px) {
        padding: 20px 25px;
      }

      @media (width < 1024px) {
        flex: 1 1 calc(100% / 2 - 20px);
      }

      @media (width < 768px) {
        max-width: 420px;
        min-width: 310px;
      }

      @media (width < 480px) {
        margin: 0 20px 20px;
      }

      > img {
        position: absolute;
        bottom: 10px;
        left: calc(100% - 120px);
        max-width: 180px;
        max-height: 180px;
        filter: grayscale(1);
        opacity: .2;

        transform: translateZ(1px);

        transition: filter .15s ease-in-out, opacity .15s ease-in-out;
      }

      &:hover {
        border-color: var(--color-grey);

        > img {
          filter: grayscale(0);
          opacity: .3;
        }
      }

      > a {
        position: relative;
        display: inline-block;
        margin-bottom: 20px;

        color: var(--color-black-extra-light);
        font-size: 22px;
        font-weight: 700;

        &[href="/"] {
          pointer-events: none;
        }

        @media (width < 480px) {
          font-size: 18px;
        }
      }
    }
  }

  .nav-child {
    position: relative;
    margin: 0 0 0 5px;
  }
}

/* two-column */

.two-column {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  @media (width < 1024px) {
    flex-direction: column;
  }
}

.two-column__left {
  flex: 1 1 calc(100% - 360px);

  & h2 {
    margin-top: 10px;
  }

  @media (width < 1024px) {
    width: 100%;
    margin: 0 0 15px;
  }
}

.two-column__right {
  position: relative;
  flex: 1 1 360px;
  padding: 30px 40px;
  margin: 0 0 30px 20px;

  background: var(--color-grey-extra-light);
  overflow: hidden;

  @media (width < 1024px) {
    width: 100%;
    flex: 1 1 100%;
    padding: 25px 30px;
    margin: 0 0 30px;
  }

  @media (width < 768px) {
    width: calc(100% + 28px);
    flex: 1 1 calc(100% + 28px);
    padding: 25px;
    margin: 0 -14px;
  }

  @media (width < 480px) {
    width: calc(100% + 20px);
    flex: 1 1 calc(100% + 20px);
    margin: 0 -10px;
  }
}

.two-column__bg-icon {
  position: absolute;
  right: -90px;
  top: calc(50% - 90px);
  width: 180px;
  height: 180px;
  fill: var(--color-grey-light);
}

.two-column__list {
  position: relative;
  margin: 0;

  @media (width < 1024px) {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.two-column__item {
  position: relative;
  padding-left: 40px;
  margin: 0 0 15px;

  color: var(--color-black-light);
  list-style: none;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;

  @media (width < 1024px) {
    flex: 1 1 50%;
    min-width: 220px;
    padding-right: 30px;
  }
}

.two-column__item--btn {
  padding: 0;
  margin: 20px 0 0;

  @media (width < 1024px) {
    margin-top: 5px;
  }
}

.two-column__item-icon {
  position: absolute;
  left: 0;
  top: calc(50% - 11px);
  width: 24px;
  height: 24px;

  fill: var(--color-black-extra-light);
}

.two-column__item-title {
  display: block;

  color: var(--color-grey-dark);
  font-size: 16px;
  font-weight: 200;
}

.two-column__btn {
  position: relative;
  width: 100%;

  @media (width < 1024px) {
    width: auto;
    min-width: 220px;
  }
}

/* tags */

.tags__list {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  list-style: none;
  margin: 0 -3px;
  padding: 0;
}

.tags__title {
  margin: 3px 5px 0 0;

  color: var(--color-grey-dark);
  font-size: 16px;
  font-weight: 400;
}

.tags__tag {
  margin: 0 3px 5px;
}

.tags__link {
  padding: 5px 15px;

  border: 1px dashed var(--color-grey-light);
  border-radius: 2px;
  color: var(--color-grey);
  font-size: 14px;
  cursor: default;

  transition: background-color .07s ease;

  &:hover {
    background-color: var(--color-grey-extra-light);
    color: var(--color-grey-dark);
  }
}

/* search-by-tag */

.search-by-tag__head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  max-width: 400px;
  width: 100%;
}

.search-by-tag__input-wrapper {
  width: 100%;
}

.search-by-tag__btns {
  display: flex;
  align-items: flex-start;
}

.search-by-tag__submit {
  min-width: auto;
}

.search-by-tag__reset {
  min-width: auto;

  background: transparent;
  border: none;
  color: var(--color-grey-dark);
}

.search-by-tag__result {
  margin: 0 0 30px;

  border: 1px solid var(--color-grey-extra-light);
  list-style: none;
}

.search-by-tag__item {
  margin: 0;

  &:nth-child(odd) {
    background: var(--color-grey-extra-light);
  }
}

.search-by-tag__item-title {
  margin: 0;
}

.search-by-tag__item-link {
  display: block;
  padding: 10px 15px;

  font-size: 18px;
  font-weight: 200;
}

/* contacts-pages-common */

.contacts-page__info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
}

.contacts-page__item-inner {
  display: flex;
  flex-direction: column;
  color: var(--color-black);

  &:hover {
    text-decoration: none;
  }
}

.contacts-page__item-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 3px 15px 0 0;

  fill: var(--color-grey);
}

.contacts-page__item-value {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.2;
}

.contacts-page__item-inner:hover .contacts-page__item-value {
  text-decoration: underline;
}

.contacts-page__item-footnote {
  color: var(--color-black);
  font-size: 13px;
  font-weight: 100;
}

/* map-spinner */

@keyframes spin {
  from { transform: rotate(0deg); }

  to { transform: rotate(360deg); }
}

.maps-footer__maps,
.maps-wide__maps {
  &::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 40px;
    margin: -23px 0 0 -23px;

    border: 3px solid transparent;
    border-top-color: var(--color-accent);
    border-radius: 50%;

    animation: spin .8s ease-in-out 0s infinite;
  }

  /* Загруженная карта закрывает спиннер, пока она грузится, он виден сквозь пустой iframe. */
  & iframe {
    position: relative;
    display: block;
  }
}
