/* @import url('../fonts/import.css'); */

:root {
  --container-max: 1460px;
  --container-padding: 20px;

  --blocks-gap: 140px;
  --list-gap: 22px;
  --page-top: 44px;

  --color-text: #181818;
  --color-accent: #FFFFFF;
  --color-secondary: #191A1B;
  --color-disable: #BFCBD9;
  --color-therity: #96A1AE;
  --color-stroke: #BDC3C5;
  --color-light: #F5F5F5;
  --color-light-1: rgba(152, 152, 152, 0.08);
  --color-light-2: rgba(24, 24, 24, 0.08);
  --color-additional: #04A1CC;
  --color-additional-1: rgba(4, 161, 204, 0.08);
  --color-additional-2: rgba(4, 161, 204, 0.4);
  --color-additional-hover: #017A9B;
  --color-medium-additional: #C7E9F2;
  --color-medium-additional-1: rgba(199, 233, 242, 0.4);
  --color-light-additional: #EDFBFD;
  --color-danger: #E11919;
  --color-overlay: rgba(0, 0, 0, 0.25);
  --color-underlay: rgba(0, 0, 0, 0.75);
  --color-shadow: rgba(51, 51, 51, 0.1);

  font-weight: 300;
  font-size: 1rem;
  font-family: 'Bounded', Arial, Helvetica, sans-serif;
  color: var(--color-text);
  line-height: 1.5;

  @media screen and (max-width: 1200px) {
    --blocks-gap: 90px;
  }
  @media screen and (max-width: 1024px) {
    --list-gap: 16px;
    --blocks-gap: 60px;
    --page-top: 24px;
  }
}

body {
  --site-background: #FFFFFF;

  font-size: 1rem;
  background-color: var(--site-background);

  @media screen and (max-width: 1024px) {
    font-size: 0.875rem;
  }

  &::before {
    content: '';
    opacity: 0;
    transition: opacity .3s;
  }
  &.opened-menu {
    overflow: hidden;

    &::before {
      opacity: 1;
      z-index: 2;
      position: fixed;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: var(--color-light);
    }
  }
}

.container {
  width: 100%;
  max-width: var(--container-max);
  padding: 0 var(--container-padding);
  margin: 0 auto;
  box-sizing: border-box;

  & .container {
    max-width: none;
    padding: 0;
    margin: 0;
  }
}

.media :is(img, picture) {
  display: block;
  object-fit: cover;
  object-position: center;
}

a {
  width: auto;
}

p {
  margin: 16px 0;

  &:first-child {
    margin-top: 0;
  }
  &:last-child {
    margin-bottom: 0;
  }
}

strong {
  font-weight: 400;
}

/* BLOCK */
.block {
  margin: var(--blocks-gap) 0;

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

/* HEADER */
header {
  --header-radius: 40px;

  top: 0;
  z-index: 5;
  position: sticky;

  /* overflow: hidden; */
  margin-bottom: var(--page-top);
  border-radius: 0 0 var(--header-radius) var(--header-radius);
  background-color: var(--color-accent);
  box-shadow: 0px 4px 24px 0px var(--color-shadow);
  transition: background .3s, box-shadow .3s, transform .3s;

  @media screen and (max-width: 1024px) {
    --header-radius: 24px;
  }

  body.page-loaded:has(.block--cover:first-child).scroll & {
    @media screen and (min-width: 1024px) {
      transform: translateY(-18px);
    }
  }

  body.page-loaded:has(.block--cover:first-child):not(.scroll) & {
    body:not(.opened-menu) & {
      background: transparent;
      box-shadow: none;
      color: var(--color-accent);
    }
  }

  & .header {
    --header-columns-gap: 32px;

    margin: 0 auto;
    width: calc(100% - 48px);
    max-width: 1720px;
    padding: 24px 0;
    position: relative;

    display: flex;
    column-gap: var(--header-columns-gap);
    align-items: center;
    justify-content: space-between;

    @media screen and (max-width: 1024px) {
      --header-columns-gap: 20px;

      width: calc(100% - 40px);
      padding: 24px 0px !important;
    }

    body.page-loaded:has(.block--cover:first-child) & {
      padding-top: 42px;
    }

    & :is(.left, .right) {
      width: 100%;
      display: flex;
      column-gap: var(--header-columns-gap);
      align-items: center;
      
      @media screen and (max-width: 1400px) {
        width: auto;
      }

      &.right {
        justify-content: end;
        align-items: stretch;

        & .column {
          display: flex;
          row-gap: 4px;
          flex-direction: column;
          align-items: end;
          justify-content: center;
        }
      }
    }

    & .middle {
      @media screen and (max-width: 1400px) and (min-width: 1025px) {
        margin-right: auto;
      }
    }
  }

  & .left > .menu {
    @media screen and (max-width: 1400px) {
      display: none;
    }

    & nav ul {
      display: flex;
      column-gap: 24px;
      align-items: center;

      & .link {
        font-size: 1rem;
        white-space: nowrap;

        &:hover {
          color: var(--color-additional-hover);
        }
      }
    }
  }

  & .logo {
    width: max-content;
    height: 35px;

    @media screen and (max-width: 768px) {
      height: 20px;
    }

    & :is(picture, img) {
      height: 100%;
      display: block;
    }

    body.page-loaded:not(.scroll):has(.block--cover:first-child) & .logo_default {
      body:not(.opened-menu) & {
        display: none;
      }
    }
    :is(body:not(.page-loaded), body.opened-menu, body.scroll, body:not(:has(.block--cover:first-child))) & .logo_light {
      display: none;
    }
  }

  & :is(.schedule, .address, .telephone, .feedback) {
    font-size: 0.875rem;
    white-space: nowrap;

    &.address {
      color: var(--color-therity);
    }
    &.telephone {
      font-size: 1rem;

      &:hover {
        color: var(--color-additional-hover);
      }
    }
    &.feedback {
      font-weight: 400;
      color: var(--color-additional);

      &:hover {
        color: var(--color-additional-hover);
      }
    }
  }

  & .column:has(.schedule, .address, .telephone, .feedback) {
    @media screen and (max-width: 1024px) {
      display: none !important;
    }
  }

  & .disability .button {
    --icon-size: 41px;
    --button-color: currentColor;

    @media screen and (max-width: 768px) {
      --icon-size: 24px;
    }
  }
}

/* BIGMENU */
.bigmenu {
  display: flex;
  column-gap: 32px;
  align-items: center;

  & .button {
    --button-width: 60px;
    --button-height: 40px;
    --button-radius: 12px;
    --button-padding: 0px;

    align-items: center;
    justify-content: center;

    @media screen and (max-width: 768px) {
      --button-width: 36px;
      --button-height: 32px;
      --button-radius: 8px;
    }

    & .icon {
      --icon-fill: var(--color-accent);

      &.icon--burger {
        --icon-size: 24px;

        @media screen and (max-width: 768px) {
          --icon-size: 14px;
        }
      }
      &.icon--close {
        --icon-size: 18px;

        @media screen and (max-width: 768px) {
          --icon-size: 15px;
        }
      }
    }
  }
    
  &.open .icon--burger {
    display: none;
  }
  &:not(.open) .icon--close {
    display: none;
  }

  & .wrapper {
    --bigmenu-padding: 40px;

    display: flex;
    column-gap: 24px;
    align-items: stretch;


    margin-top: 25px;
    padding-bottom: 30px;
    transition: opacity .3s, transform .3s;

    z-index: 0;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    /* height: calc(100vh - var(--page-header-height)); */
    height: var(--page-body-inside-height);

    @media screen and (max-width: 1200px) {
      --bigmenu-padding: 20px;
    }
    @media screen and (max-width: 768px) {
      padding: var(--bigmenu-padding) 0;
      border-radius: var(--header-radius);
      background-color: var(--color-accent);
      height: calc(var(--page-body-inside-height) - var(--bigmenu-padding));
    }

    & :not(.socials) > .title {
      font-weight: 400;
      font-size: 2rem;
      margin-bottom: 24px;

      @media screen and (max-width: 768px) {
        display: none;
      }
    }

    & .sidebar {
      width: 100%;
      display: flex;
      row-gap: 24px;
      flex-direction: column;
      padding: var(--bigmenu-padding);
      border-radius: var(--header-radius);
      background-color: var(--color-accent);

      @media screen and (min-width: 992px) {
        width: 23%;
        min-width: 390px;
        overflow: hidden;
      }
      @media screen and (max-width: 768px) {
        overflow-y: auto;
        padding: 0 var(--bigmenu-padding);
      }

      & .bottom {
        margin-top: auto;

        & :is(.address, .schedule) {
          margin-bottom: 4px;

          @media screen and (min-width: 768px) {
            display: none;
          }
        }

        & .socials {
          margin-top: 12px;
        }
      }
    }

    & .services-wrapper {
      width: 100%;
      overflow: hidden;
      padding: var(--bigmenu-padding);
      border-radius: var(--header-radius);
      background-color: var(--color-accent);

      @media screen and (max-width: 768px) {
        opacity: 0;
        z-index: -99;
        position: absolute;
        left: 0;
        top: 0;
        overflow-y: auto;
        pointer-events: none;
        background-color: var(--color-accent);
        transition: left .3s, opacity .3s;

        &.shown {
          opacity: 1;
          z-index: 1;
          height: 100%;
          pointer-events: all;
        }
      }
    }
  }
  &:not(.open) .wrapper {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
  }

  & .pages {
    @media screen and (min-width: 769px) {
      overflow: hidden;
    }

    & .menu {
      height: 100%;
      position: relative;
      max-height: calc(100% - 70px);

      &::before, &::after {
        content: '';
        z-index: 1;
        position: absolute;
        left: 0;
        width: 100%;
        height: 20px;

        @media screen and (max-width: 768px) {
          content: none;
        }
      }
      &::before {
        top: -5px;
        background: linear-gradient(0deg, transparent 0%, var(--color-accent) 100%);
      }
      &::after {
        bottom: 0;
        height: 40px;
        background: linear-gradient(180deg, transparent 0%, var(--color-accent) 80%);
      }

      & nav {
        height: 100%;

        @media screen and (min-width: 769px) {
          overflow-y: auto;
          padding-bottom: 20px;
          overscroll-behavior: none;
          scrollbar-width: none;
          -ms-overflow-style: none;
        }
      }

      & ul {
        display: flex;
        row-gap: 0;
        flex-direction: column;

        @media screen and (max-width: 768px) {
          row-gap: 8px;
        }

        & li {
          padding-bottom: 16px;

          @media screen and (max-width: 768px) {
            padding-bottom: 8px;
            border-bottom: 1px solid var(--color-stroke);
          }

          &:has(.parent) {
            display: block;

            @media screen and (min-width: 769px) {
              display: none;
            }
          }
        }

        & .link {
          font-size: 1.125rem;
          color: var(--color-secondary);

          @media screen and (max-width: 768px) {
            min-height: 40px;

            display: flex;
            column-gap: 24px;
            align-items: center;
            justify-content: space-between;
          }

          & .icon {
            --icon-size: 40px;
            --icon-fill: var(--color-additional);

            padding: 12px;
          }
          &:hover:not(:focus-within) {
            color: var(--color-additional-hover);

            & .icon {
              --icon-fill: var(--color-additional-hover);
            }
          }
          &:focus-within {
            color: var(--color-additional);
          }
        }
      }
    }
  }

  & .services {
    height: 100%;
    overflow-y: auto;

    @media screen and (min-width: 769px) {
      max-height: calc(100% - 70px);
      overscroll-behavior: none;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }

    &::-webkit-scrollbar {
      display: none;
    }

    & .container {
      padding: 0;
      max-width: none;
    }

    & .list {
      column-count: 3;

      @media screen and (max-width: 1600px) {
        column-count: 2;
      }
      @media screen and (max-width: 1200px) {
        column-count: 1;
      }
    }
  }
}

/* FOOTER */
footer {
  margin-top: auto;
  padding: 80px 0;
  border-radius: 80px 80px 0 0;
  background-color: var(--color-light);

  @media screen and (max-width: 1024px) {
    padding: 40px 0;
    border-radius: 40px 40px 0 0;
  }

  & a:not(.button) {
    &:hover {
      color: var(--color-additional-hover) !important;
      text-decoration: underline !important;
    }
  }

  & .footer {
    display: flex;
    row-gap: 40px;
    flex-direction: column;

    & :is(.top, .middle, .bottom) {
      display: flex;
      row-gap: 24px;
      column-gap: 80px;

      @media screen and (max-width: 1024px) {
        row-gap: 40px;
      }

      &:is(.middle, .bottom) {
        column-gap: 120px;

        @media screen and (max-width: 1200px) {
          column-gap: 80px;
        }
        @media screen and (max-width: 1024px) {
          column-gap: 40px;
        }
      }
    }
  }

  & .top {
    align-items: center;

    @media screen and (max-width: 1200px) {
      flex-wrap: wrap;
    }

    & .logo {
      min-width: max-content;
      height: 36px;

      @media screen and (min-width: 400px) {
        height: calc(36px + 28 * (100vw - 320px) / 1460);
      }
      @media screen and (min-width: 1400px) {
        height: 64px;
      }

      & :is(picture, img) {
        display: block;
      }
    }

    & .call {
      --icon-size: 20px;

      @media screen and (max-width: 768px) {
        order: 5;
      }
      @media screen and (max-width: 480px) {
        width: 100%;
        justify-content: center;
      }
    }

    & > .text {
      font-size: 0.875rem;
      color: var(--color-secondary);
    }
  }

  & .middle {
    @media screen and (max-width: 768px) {
      row-gap: 12px;
      flex-direction: column;  
    }

    & .socials {
      --socials-background: var(--color-accent);
      --socials-icon-size: 28px;
      
      @media screen and (max-width: 1024px) {
        --socials-icon-size: 24px;
      }
    }

    & .columns {
      width: 100%;
      max-width: 680px;
      display: flex;
      column-gap: 120px;
      justify-content: center;
      margin-left: auto;

      @media screen and (max-width: 1300px) {
        column-gap: 80px;
      }
      @media screen and (max-width: 1100px) {
        row-gap: 12px;
        flex-direction: column;
        justify-content: start;
        margin-left: 0;
      }
      @media screen and (max-width: 768px) {
        order: -1;
      }
    }

    & .menu {
      width: auto;
      display: flex;
      row-gap: 24px;
      flex-direction: column;

      @media screen and (max-width: 1400px) {
        width: auto;
      }
      @media screen and (max-width: 1100px) {
        padding-bottom: 12px;
        border-bottom: 1px solid var(--color-stroke);
      }

      & .title {
        font-size: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;

        @media screen and (max-width: 1100px) {
          cursor: pointer;
          font-size: 1.25rem;
        }

        & .icon {
          --icon-size: 16px;
          --icon-fill: var(--color-additional);

          transform: rotate(90deg);

          @media screen and (min-width: 1101px) {
            display: none;
          }
        }
      }

      & nav {
        @media screen and (max-width: 1100px) {
          display: none;
        }

        & ul {
          display: flex;
          row-gap: 8px;
          flex-direction: column;

          & .link {
            display: block;
            width: max-content;
            font-size: 0.875rem;
            color: var(--color-secondary);
          }
        }
      }
    }
  }

  & .bottom {
    align-items: end;

    @media screen and (max-width: 1024px) {
      align-items: start;
      flex-direction: column-reverse;
    }

    & .column {
      width: 100%;
    }

    & .copyright {
      font-size: 0.75rem;
      color: var(--color-secondary);
    }

    & .menu {
      margin-top: 8px;

      & nav ul {
        display: flex;
        row-gap: 4px;
        flex-direction: column;

        & a.link {
          display: block;
          width: max-content;
          font-size: 0.75rem;
          color: var(--color-additional);

          & span {
            line-height: 1.2;
            display: inline-block;
          }
        }
      }
    }

    & .payments {
      font-size: 0.75rem;
      color: var(--color-secondary);

      & :is(picture, img) {
        width: auto;
        height: auto;
        max-height: 31px;
        display: block;
      }
    }
  }

  & .developer {
    display: flex;
    column-gap: 8px;
    align-items: center;
    width: max-content;
    margin-top: 24px;
    font-weight: 400;
    font-size: 0.75rem;

    & .icon {
      --icon-width: 92px;
      --icon-height: 18px;
    }
  }
}

/* 404 */
main:has(.page-404) {
  & .block--404 {
    margin: 0;
    margin-top: calc(-1 * var(--page-top, 0));
  }

  & .page-404 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--page-header-height, 0) - var(--page-top, 0));

    @media screen and (max-width: 768px) {
      min-height: 60vh;
    }

    & .image {
      width: 48%;
      min-width: 335px;
      margin: 0 auto 68px;

      @media screen and (max-width: 1200px) {
        margin-bottom: 50px;
      }
      @media screen and (max-width: 1024px) {
        margin-bottom: 42px;
      }
      @media screen and (max-width: 768px) {
        width: 90%;
        margin-bottom: 38px;
      }

      & :is(picture, img) {
        display: block;
        height: auto;
      }
    }

    & .block-title {
      --title-size: 2rem;
      text-align: center;

      @media screen and (max-width: 1024px) {
        --title-size: 1.25rem;
      }
    }

    & .button {
      margin: 0 auto;
    }
  }
}