section#info {
  margin: var(--header-height) auto 0;
  padding-block: 60px 80px;

  & .wrap {
    display: grid;
    grid-template-columns: 6fr 7fr;
    align-items: stretch;
    gap: 80px;

    & > div h1,
    & > div > .desc p,
    & > div .params,
    & #ground-plan-img {
      translate: 0 5px;
      opacity: 0;
      animation:
        fadeIn var(--duration-200) ease-out forwards,
        returnTranslate var(--duration-200) ease-out forwards;
    }

    & > div {
      nav.breadcrumbs {
        color: #757c8a;

        & b {
          color: inherit;
          font-weight: 400;
          text-transform: uppercase;
        }
      }

      & h1 {
        margin-block: 40px 50px;
        animation-delay: 100ms;
      }

      & > .desc {
        margin-block: 50px;

        p {
          margin-bottom: 20px;

          &:nth-of-type(1) {
            animation-delay: 125ms;
          }

          &:nth-of-type(2) {
            animation-delay: 150ms;
          }
        }
      }

      & .params {
        max-width: 450px;
        border: 1px solid #c1c7d3;
        border-radius: 10px;
        animation-delay: 175ms;

        & .header {
          padding: 10px 24px;
          border-bottom: 1px solid #c1c7d3;
        }

        & .params-grid {
          padding: 10px 24px;
          display: grid;
          grid-template-columns: auto auto auto;
          justify-content: start;

          & .separator {
            margin-inline: 30px;
            width: 2px;
            background-color: #c1c7d3;
          }
        }
      }
    }

    & #ground-plan-img {
      display: block;
      width: 100%;
      height: 100%;
      padding: 30px;
      padding-left: 100px;
      background-color: var(--color-secondary);
      border-radius: 10px;
      overflow: hidden;
      cursor: zoom-in;
      outline-offset: 2px;
      animation-delay: 125ms;

      & img {
        width: 100%;
        height: 100%;
        object-fit: contain;
      }
    }
  }

  @media (max-width: 1460px) {
    padding-block: 50px;

    & .wrap {
      gap: 40px;

      & > div {
        & h1 {
          margin-block: 40px 30px;
        }

        & > .desc {
          margin-block: 30px 40px;
        }
      }
      & #ground-plan-img {
        padding: 30px;
        padding-left: 30px;
      }
    }

    @media (max-width: 1200px) {
      padding-block: 30px;

      & .wrap {
        grid-template-columns: 1fr;

        & #ground-plan-img {
          padding: 30px;
          padding-left: 30px;
        }
      }
    }

    @media (max-width: 800px) {
      & .wrap {
        & #ground-plan-img {
          padding: 20px;
          padding-left: 20px;
        }
      }
    }
  }
}

section#gallery {
  padding-block: 0;

  & .wrap {
    padding: 0;
    max-width: var(--max-site-width);

    & .splide {
      translate: 0 5px;
      opacity: 0;
      animation:
        fadeIn var(--duration-200) ease-out forwards,
        returnTranslate var(--duration-200) ease-out forwards;
      animation-delay: 200ms;

      & .splide__slide {
        & img {
          width: 100%;
          height: 100%;
          max-height: 740px;
          object-fit: cover;
        }
      }

      & .splide__pagination {
        inset: 0;
        top: auto;
        height: 150px;
        padding-bottom: 30px;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
        transform: none;
        border-radius: 0;

        & .splide__pagination__page {
          width: 18px;
          height: 18px;
          margin-inline: 10px;
          border: 2px solid var(--color-secondary);
          background-color: transparent;

          &:focus-visible {
            outline: 2px solid var(--color-secondary);
            outline-offset: 2px;
          }

          &.is-active {
            background-color: var(--color-secondary);
          }
        }

        @media (max-width: 600px) {
          height: 80px;
          padding-bottom: 20px;
          & .splide__pagination__page {
            width: 14px;
            height: 14px;
            margin-inline: 6px;
          }
        }

        @media (max-width: 420px) {
          height: 50px;
          padding-bottom: 15px;

          & .splide__pagination__page {
            width: 10px;
            height: 10px;
            margin-inline: 4px;
          }
        }
      }
    }
  }
}

section#flexibility {
  padding-block: 100px;
  grid-template-columns: 1fr 1fr;

  & > .wrap {
    max-width: var(--max-content-width);

    & h1,
    & .grid .version,
    & .button {
      translate: 0 5px;
      opacity: 0;
      animation:
        fadeIn var(--duration-200) ease-out forwards,
        returnTranslate var(--duration-200) ease-out forwards;
      --delay-step: 40ms;

      &:nth-of-type(1) {
        animation-delay: calc(50ms + var(--delay-step));
      }

      &:nth-of-type(2) {
        animation-delay: calc(50ms + 2 * var(--delay-step));
      }

      &:nth-of-type(3) {
        animation-delay: calc(50ms + 3 * var(--delay-step));
      }

      &:nth-of-type(4) {
        animation-delay: calc(50ms + 4 * var(--delay-step));
      }

      &:nth-of-type(5) {
        animation-delay: calc(50ms + 5 * var(--delay-step));
      }
    }

    & h1 {
      margin-bottom: 100px;
    }

    .apt-info {
      & .layout {
        height: 70px;
        font-size: 30px;
        font-weight: 600;
        padding-inline: 10px;
        background-color: #c1c7d2;
        border-radius: 10px;
        display: grid;
        place-items: center;
        text-align: center;
      }

      & .module-type {
        margin-top: 20px;
        height: 110px;
        display: grid;
        place-items: center;
        text-align: center;
        border-radius: 10px 10px 0 0;
        font-weight: 600;
        line-height: 1.2;
        background-color: #eef1f4;
      }

      & .features {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        text-align: center;
        padding: 30px 20px 40px;
        font-size: 16px;
        border: 2px solid #eef1f4;
        border-top: none;
        border-radius: 0 0 10px 10px;

        & p {
          text-wrap: balance;
        }

        & .badge {
          position: absolute;
          bottom: 0;
          left: 50%;
          translate: -50% 50%;
          background-color: var(--color-primary);
          color: var(--color-secondary);
          width: 38px;
          height: 38px;
          border-radius: 100px;
          font-size: 18px;
          font-weight: 600;
          display: grid;
          place-items: center;
        }
      }
    }

    .apartment-section {
      display: none;

      &.active {
        display: block;
      }

      &#byt-1kk {
        & .flex {
          display: flex;
          gap: 80px;

          & img {
            max-width: 350px;
          }

          & .apt-info {
            margin-top: 30px;
            width: 230px;
          }
        }

        @media (max-width: 800px) {
          & .flex {
            gap: 20px;
            justify-content: space-between;
          }
        }

        @media (max-width: 700px) {
          & .flex {
            flex-direction: column;
            align-items: center;
            gap: 40px;
          }
        }
      }

      &#byt-2kk,
      &#byt-3kk {
        & h1 {
          margin-bottom: 100px;
        }

        & .grid {
          display: grid;
          grid-template-columns: repeat(3, 1fr);
          gap: 40px;

          & .version {
            display: flex;
            flex-direction: column;
            align-items: stretch;

            & img {
              margin-bottom: 40px;
            }

            & .apt-info {
              padding-right: 8%;
              display: flex;
              flex-direction: column;
              height: 100%;

              & .features {
                flex-grow: 1;
              }
            }
          }
        }
      }

      &#byt-2kk {
        @media (max-width: 1400px) {
          & .grid {
            gap: 120px;
            grid-template-columns: repeat(2, 1fr);

            & .version {
              display: grid;
              grid-template-columns: 3fr 2fr;
              gap: 20px;

              & .apt-info {
                padding-right: 0;
                padding-bottom: 0;
                height: max-content;

                & .layout {
                  font-size: 24px;
                }

                & .module-type {
                  height: 80px;
                }
              }
            }
          }
        }

        @media (max-width: 1200px) {
          & h1 {
            margin-bottom: 60px;
          }

          & .grid {
            grid-template-columns: 1fr;

            & .version {
              & .apt-info {
                & .layout {
                  font-size: 30px;
                }
              }
            }
          }
        }

        @media (max-width: 700px) {
          & .grid {
            grid-template-columns: 1fr;
            place-items: center;
            gap: 150px;

            & .version {
              grid-template-columns: 1fr;
              gap: 70px;

              & img {
                order: 2;
                max-width: 350px;
              }

              & .apt-info {
                width: 100%;
                max-width: 350px;
                padding-right: 0;

                & .layout,
                & .module-type {
                  height: 60px;
                }

                & .features {
                  padding-top: 20px;
                }
              }
            }
          }
        }
      }

      &#byt-3kk {
        & .grid {
          grid-template-columns: repeat(3, 1fr);

          & .version {
            & .apt-info {
              padding-right: 0;
            }
          }
        }

        @media (max-width: 1350px) {
          & .grid {
            grid-template-columns: 1fr;
            gap: 100px;

            & .version {
              display: grid;
              grid-template-columns: 4fr 2fr;
              gap: 50px;

              & .apt-info {
                padding-right: 0;
                padding-bottom: 0;
                height: max-content;

                & .layout {
                  font-size: 24px;
                }

                & .module-type {
                  height: 80px;
                }
              }
            }
          }
        }

        @media (max-width: 1200px) {
          & .grid {
            & .version {
              grid-template-columns: 3fr 2fr;
            }
          }
        }

        @media (max-width: 700px) {
          & h1 {
            margin-bottom: 60px;
          }

          & .grid {
            grid-template-columns: 1fr;
            place-items: center;
            gap: 120px;

            & .version {
              width: 100%;
              grid-template-columns: 1fr;
              justify-items: center;
              gap: 70px;

              & img {
                max-width: 100%;
                order: 2;
              }

              & .apt-info {
                width: 100%;
                max-width: 350px;
                padding-right: 0;

                & .layout,
                & .module-type {
                  height: 60px;
                }

                & .features {
                  padding-top: 20px;
                }
              }
            }
          }
        }
      }

      &#byt-4kk {
        & .grid {
          display: grid;
          grid-template-columns: auto 230px;
          gap: 50px;

          & .apt-info {
            width: 100%;

            & .features {
              padding-bottom: 30px;
            }
          }
        }

        @media (max-width: 1200px) {
          & .grid {
            grid-template-columns: 1fr;
            justify-items: center;
            gap: 80px;

            & .apt-info {
              max-width: 400px;

              & .module-type {
                height: 80px;
              }
            }
          }
        }

        @media (max-width: 700px) {
          & .grid {
            gap: 60px;

            & img {
              order: 2;
            }

            & .apt-info {
              width: 100%;
              max-width: 350px;

              & .layout,
              & .module-type {
                height: 60px;
              }

              & .features {
                padding-block: 20px;
              }
            }
          }
        }
      }
    }

    & .button {
      margin: 100px auto 0;
      display: block;
      max-width: max-content;
      height: 40px;
      font-size: 18px;
      padding-inline: 30px;
      animation-delay: 300ms !important;
    }
  }

  @media (max-width: 1200px) {
    padding-block: 70px;
    & > .wrap {
      & h1 {
        margin-bottom: 50px;
      }
    }
  }

  @media (max-width: 1000px) {
    padding-block: 70px;
    & > .wrap {
      & .button {
        height: unset;
        padding: 6px 14px;
        font-size: 16px;
      }
    }
  }
}
