body,
html {
  &:has(.360-view) {
    scroll-padding-top: 40px;
  }
}

div[class*='360-view block'] {
  clip-path: polygon(74% 0, 100% 0, 100% 100%, 0 100%, 0 16px, 70% 16px);
  margin-top: -16px;
  padding-top: 16px;
  background: var(--tertiary-white);
}

.view360__container {
  padding-top: 32px;

  .view360__top-section {
    padding: 0 1.25rem;
    display: flex;
    flex-direction: column;

    .cta__primary .view360__primary-btn {
      background-color: var(--primary-main);
      color: var(--tertiary-white);
      font-family: var(--font-primary-nexa);
      font-size: 1rem;
      font-style: normal;
      font-weight: 400;
      line-height: 1.5rem;
      text-align: center;
      margin-top: 1.5rem;
      padding: 0.5rem 1.25rem;
      clip-path: polygon(0 var(--slant-l), var(--slant-s) 0, 100% 0, 100% calc(100% - var(--slant-l)), calc(100% - var(--slant-s)) 100%, 0 100%);
      height: auto;
      transition: all 0.2s linear;
    }

    .cta__primary .view360__primary-btn:hover {
      background-color: var(--secondary-main);
    }
  }

  .view360__title {
    color: var(--primary-main);
    font-family: var(--body-heading-font-family);
    font-size: var(--heading-font-3-mob);
    font-style: normal;
    font-weight: var(--keplar-fw-700);
    line-height: var(--heading-lh-1--mob-display) ;
    letter-spacing: 0.64px;
    margin: 0;
  }

  .view360__right-section {
    padding-top: 1.5rem;
    align-self: flex-start;

    .view360__description p {
      color: var(--primary-main);
      font-family: var(--font-primary-nexa);
      font-size: 0.875rem;
      font-style: normal;
      font-weight: 300;
      line-height: 1.25rem;
      margin: 0;
    }

    .cta__primary {
      width: fit-content;

      a::after {
        display: none;
        filter: invert(1);
        scale: 1.25;
        position: relative;
        top: -2px;
      }
    }
  }

  .view360__interior-exterior-color-wrapper {
    display: flex;
    justify-content: space-between;
    margin-top: 1.75rem;
    padding-inline: 1.25rem;
  }

  .view360__tabs-wrapper {
    display: none;
    text-align: center;

    .view360__tabs {
      display: inline-block;
      border-bottom: 1px solid var(--tertiary-medium-grey);

      .view360__tab-label {
        color: var(--secondary-main);
        font-family: var(--font-primary-nexa);
        font-size: 0.875rem;
        font-style: normal;
        font-weight: 400;
        line-height: 1.25rem;
        text-align: center;
        padding: 0.75rem 3rem;
        display: inline-block;
        cursor: pointer;
        position: relative;
        height: 44px;

        &::after {
          border-bottom: 1px solid #b2b2b2;
          display: inline-block;
        }

        &.view360__tab-label--active {
          color: var(--primary-main);
          font-weight: 500;
          border-bottom: 2px solid var(--primary-main);
        }
      }
    }
  }

  .view360__colors-wrapper {
    flex-grow: 0;
    display: flex;
    gap: 0.625rem;
    margin-top: 64px;
    align-items: flex-start;
    justify-content: flex-start;
    
    .view360__colors-list {
      display: flex;
      gap: 0.75rem;
      width: 15.8125rem;
      height: 70px;
      overflow: hidden hidden;
      scroll-behavior: smooth;
      scrollbar-width: none;
      position: relative;

      div {
        cursor: pointer;
        flex-shrink: 0;

        &.view360_white_palette.view360__colors-white {
          border: none;
        }

        &.view360_white_palette{
          border: 1px solid var(--tertiary-medium-grey);
        }

        &.view360__colors-white span {
          content: '';
          position: absolute;
          height: 32px;
          width: 32px;
          border: 1px solid #b2b2b2;
          top: 0;
          left: 0;
        }

        &::before {
          color: var(--secondary-main);
          font-family: var(--font-primary-nexa);
          font-size: 0.75rem;
          font-style: normal;
          font-weight: 400;
          line-height: 1rem;
          position: absolute;
          top: 31px;
          @media (width >=1024px){
            top: 36px;
          }
        }

        &.selected {
          &::after {
            content: '';
            width: 24px;
            height: 24px;
            margin: auto;
            position: relative;
            top: 5px;
            display: flex;
            background-image: url(/icons/check.svg);
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
          }

          &::before {
            content: attr(data-content);
            margin-top: 4px;
            z-index: 1;
            width: max-content;
            max-width: 150px;
          }

          @media (width >=768px) {
            &::before {
              margin-top: 8px;
              width: max-content;
            }
          }
          @media (width >=768px){
            &.text-wrap{
              &::before {
                white-space: normal;
                text-align: left;
                word-wrap: break-word;
                margin-top: 0;
              }
            }
          }

          &.selected.view360__colors-white::after , &.view360_white_palette::after {
            background-image: url(/icons/check_grey.svg);
          }

          &.align-label-left {
            &::before {
              right: 0;
            }
          }
        }
      }
    }

    .slide-icon {
      cursor: pointer;
      content: '';
      width: 24px;
      height: 24px;
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
    }

    .slide-right {
      margin-top: 0.25rem;
      visibility: visible;
      background-image: url(/icons/slide_right.svg);

      &.disabled {
        opacity: 0.4;
        cursor: default;
      }
    }

    .slide-left {
      margin-top: 0.25rem;
      visibility: visible;
      background-image: url(/icons/slide-left.svg);

      &.disabled {
        opacity: 0.4;
        cursor: default;
      }
    }
  }

  .view360__bottom-section {
    position: relative;
    /* height: 535px; */

    .view360-icon {
      display: flex;
      flex-direction: column;
      position: relative;
      margin-top: 36px;
      margin-left: 20px;
      align-items: center;

      &::before {
        content: '';
        width: 36px;
        height: 36px;
        display: inline-block;
        background-image: url(/icons/switch-360-circle.svg);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        position: absolute;
        left: 0;
      }

      &::after {
        position: absolute;
        content: '';
        display: inline-block;
        background-image: url(/icons/switch-360.svg);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        width: 24px;
        height: 24px;
        top: 6px;
        left: 6px;
      }

      span {
        font-family: var(--font-primary-nexa);
        font-size: 0.75rem;
        font-weight: 400;
        line-height: 1.25rem;
        color: var(--primary-main);
        margin-top: 38px;
        left: 8px;
        position: absolute;
      }
    }

    .view360__content {
      width: 100%;
      position: relative;

      #view360-canvas {
        left: 0;
        width: 100%;
        cursor: grab;
        display: block;
        position: relative;
        margin-block: 24px 48px;

        &:active {
          cursor: grabbing;
        }
      }

      &.view360__content-interior {
        padding-top: calc(36px + 1.25rem);

        #one3d {
          position: relative;
          height: 100%;
          width: 100%;

          video {
            display: none !important;
          }
        }

        .view360-icon {
          top: 0;
          left: 1.25rem;
        }

        .view360-loading-overlay {
          position: absolute;
          inset: calc(2.25rem + 1.25rem) 0 0 0;
          z-index: 2;
          background-color: var(--tertiary-black);

          picture {
            display: block;
            height: 100%;
            width: 100%;

            img {
              object-fit: cover;
              filter: blur(6px);
              opacity: 0.6;
              height: 100%;
              width: 100%;
            }
          }

          .view360-loading-overlay-content {
            position: absolute;
            color: var(--tertiary-white);
            inset: 0 0 0 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            font-family: var(--font-primary-nexa);
            font-size: 0.875rem;
            font-weight: 400;
            line-height: 1.25rem;

            .view360-loading-text {
              width: 75%;
              margin: 0;
            }

            .view360-progress-bar {
              display: block;
              height: 0.375rem;
              background-color: var(--tertiary-deep-Grey);
              width: calc(100% - 2.5rem);
              clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
              margin-top: 1.5rem;
              margin-bottom: 0.75rem;
            }
          }
        }
      }
    }

    .view360__not-available {
      color: var(--primary-blue);
      font-family: var(--font-primary-nexa);
      font-size: 0.75rem;
      font-style: normal;
      font-weight: 400;
      line-height: 1rem;
      display: flex;
      margin: 0;
      position: absolute;
      bottom: 0;

      &::before {
        content: '';
        width: 16px;
        height: 16px;
        display: inline-block;
        background-image: url(/icons/error-blue.svg);
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        margin-right: 0.25rem;
      }
    }
  }
}

.view360-editor-mode {
  .view360__container {
    .view360__content {
      height: 400px;
    }
  }
}

@media (width >= 768px) {
  div[class*='360-view block'] {
    clip-path: polygon(84% 0, 100% 0, 100% 100%, 0 100%, 0 16px, 82% 16px);
  }
  .view360__container {
    .view360__top-section,
    .view360__interior-exterior-color-wrapper {
      padding-inline: 3.5rem;
    }
    .view360__bottom-section {
      .view360__content {
        padding-inline: 2rem;
      }
      .view360-icon {
        margin-left: 3.5rem;
      }
    }

    .view360__top-section {
      .view360__left-section,
      .view360__right-section {
        width: 100%;
      }
    }
  }
}

@media (width >= 1024px) {
  div[class*='360-view block'] {
    clip-path: polygon(76% 0, 100% 0, 100% 100%, 0 100%, 0 16px, 75% 16px);
  }
  .view360__container {
    padding: 96px 0 0;

    .view360__tabs-wrapper {
      display: block;
    }

    .view360__colors-wrapper {
      padding-left: 8px;
      margin-top: 61px;
      gap: 8px;
      .view360__colors-list {
        gap: 1rem;
        width: 18.5rem;
        height: 65px;
      }
    }

    .view360__top-section {
      padding: 0 3.5rem;
      justify-content: space-between;
      align-items: stretch;
      flex-direction: row;

      .view360__left-section {
        width: calc((var(--grid-formula) * 6) + (var(--grid-gutter-width) * (6 - 1)));
      }
      .view360__right-section {
        padding-left: 8px;
        width: calc((var(--grid-formula) * 5) + (var(--grid-gutter-width) * (5 - 1)));
      }
    }

    .view360__title {
      font-family: var(--body-heading-font-family);
      font-size: var(--heading-font-5-des);
      font-style: normal;
      font-weight: var(--keplar-fw-700);
      line-height: normal;
      letter-spacing: 0.07rem;
      width: 25.125rem;
      padding: 0;
    }

    .view360__right-section {
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-self: stretch;
      width: 350px;

      .view360__description p {
        font-size: 1.125rem;
        font-style: normal;
        line-height: 1.5rem;
      }

      .cta__primary {
        align-self: flex-start;
      }
    }

    .view360__bottom-section {
      display: flex;
      flex-wrap: wrap;
      margin-top: 19px;
      /* height: 535px; */

      .view360__content {
        #view360-canvas {
          width: 80%;
          margin-block: 0;
          margin-inline: auto;
          margin-top: -6rem;
          margin-bottom: -1rem;
        }
      }

      .view360__tabs-wrapper {
        padding: 0 3.5rem;
        order: 1;
        width: unset;
        flex-grow: 1;
        text-align: left;
        margin: 0;

        .view360__tabs {
          height: 40px;

          .view360__tab-label {
            font-size: 0.75rem;
            font-style: normal;
            font-weight: 400;
            line-height: 1rem;
            text-align: center;
            padding: 0.75rem 1.5rem 0.625rem;
            height: 40px;
          }
        }
      }

      .view360__colors-wrapper {
        padding-right: 3.5rem;
        order: 2;
        min-width: 316px;
        gap: 0.5rem;
        width: auto;
        justify-content: end;
        margin-top: 0;
        height: 64px;
        padding-left: 32px;

        .view360__colors-list {
          gap: 1rem;
          width: 18.5rem;
          height: 56px;
        }
      }

      .view360__not-available {
        font-size: 0.875rem;
        line-height: 1.25rem;
        width: 15.625rem;
        bottom: 2.25rem;

        &::before {
          width: 35px;
          height: 20px;
          margin-right: 0.75rem;
        }
      }
    }

    .view360__bottom-section .view360__content .view360-canvas-exterior {
      min-height: 400px;
    }
    
    .view360__top-section .cta__primary .view360__primary-btn {
      font-size: 1.125rem;
      line-height: 1.5rem;
      text-align: center;
      margin-top: 1.5rem;
      padding: 14px 28px;
      clip-path: polygon(0 var(--slant-l), var(--slant-s) 0, 100% 0, 100% calc(100% - var(--slant-l)), calc(100% - var(--slant-s)) 100%, 0 100%);
      height: 52px;
    }
  }

  .view360__top-section .cta__primary .view360__primary-btn {
    font-size: 1.125rem;
    line-height: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
    padding: 0.75rem 1.25rem;
    clip-path: polygon(0 var(--slant-l), var(--slant-s) 0, 100% 0, 100% calc(100% - var(--slant-l)), calc(100% - var(--slant-s)) 100%, 0 100%);
    height: 52px;
  }
}

@media (width >=1200px) {
  .view360__container .view360__title {
    font-size: var(--heading-font-5-des);
    line-height: var(--heading-lh-4-des);
    letter-spacing: 1.28px;
  }

  .view360__container .view360__description p {
    font-size: 1.125rem;
    line-height: 1.5rem;
  }
}

@media (width >= 1366px) {
  div[class*='360-view block'] {
    clip-path: polygon(71% 0, 100% 0, 100% 100%, 0 100%, 0 16px, 70% 16px);
  }
  .view360__container {
    .view360__top-section {
      .view360__left-section {
        width: calc((var(--grid-formula) * 4) + (var(--grid-gutter-width) * (4 - 1)));
      }
      .view360__right-section {
        padding-left: 32px;
        width: calc((var(--grid-formula) * 4) + (var(--grid-gutter-width) * (4 - 1)));
      }
    }

    .view360__bottom-section {
      .view360__content {
        #view360-canvas {
          margin-top: -9rem;
        }
      }
    }

    .view360__colors-wrapper {
      z-index: 1;
      padding-left: 0;
      position: relative;
    }
  }
}

@media (width >= 1920px) {
  div[class*='360-view block'] {
    clip-path: polygon(69% 0, 100% 0, 100% 100%, 0 100%, 0 16px, 68% 16px);
  }
}

@media (width < 768px) {
  .view360__container .view360__bottom-section .view360__colors-wrapper {
    max-height: 52px;
    height: auto;
  }

  .view360__container .view360__bottom-section .view360__tabs-wrapper .view360__tabs .view360__tab-label {
    padding-bottom: 7px;
  }

  .view360__container .view360__bottom-section {
    .view360__tabs-wrapper {
      margin-top: 0;
    }
  }
}

