html,
body {
  &:has(.fullscreen) {
    overflow: hidden;
  }
}

.brand-film-carousel.block {
  background: var(--tertiary-light-grey);
}

.brand-film__container {
  position: relative;
  padding-top: 64px;
  padding-bottom: 64px;
  background-color: var(--tertiary-black);

  .brand-film__description:has(+ .brand-film__wrapper.fullscreen),
  .brand-film__description:has(+ .brand-film__wrapper.pip) {
    margin-bottom: 180px;
  }

  .loader {
    display: none;
    position: absolute;
    top: calc(50% - 24px);
    left: calc(50% - 24px);
    transform: translate(-50%, -50%);
    border: 6px solid rgba(43, 51, 63, 0.7);
    border-top-color: #fff;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    animation: hls-spin 1s linear infinite;
    z-index: 10;
  }
  .brand-film__video-container.loading .loader {
    display: block;
  }

  @keyframes hls-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
  }

  .brand-film__wrapper {
    &.fullscreen {
      padding: 24px;
      background-color: rgba(0, 0, 0, 0.8);
      position: fixed;
      width: 100%;
      height: 100vh;
      z-index: 1000;
      inset: 0 0 0 0;
      display: flex;
      margin-bottom: 0;
      -webkit-backdrop-filter: blur(2px);
      backdrop-filter: blur(2px);

      @media (width >=1024px) {
        justify-content: center;
        align-items: center;
      }

      .video-controls-overlay {
        .top-controls {
          .fullscreen-button {
            background: url(/icons/fullscreen_exit.svg) no-repeat center;
          }

          .close-button {
            display: inline-block;
          }
        }

        .bottom-controls {
          display: flex;
        }
      }

      .brand-film__asset {
        width: 100%;

        .brand-film__video-container {
          &::before,
          &::after {
            display: none;
          }
        }
      }
    }

    &.pip {
      position: fixed;
      width: 236px;
      height: 133px;
      top: 96px;
      right: 24px;
      z-index: 1000;
      margin-bottom: 0;

      .brand-film__asset {
        height: 100%;
        .video-controls-overlay {
          padding: 12px;
          height: max-content;

          .top-controls {
            .close-button {
              display: inline-block;
            }
          }

          .bottom-controls {
            display: none;
          }
        }

        .brand-film__video-container {
          &::before,
          &::after {
            display: none;
          }
        }
      }
    }
  }

  .brand-film__asset {
    position: relative;

    &.brand-film__asset--paused {
      .video-controls-overlay {
        .bottom-controls {
          .left-section {
            .play-pause-button {
              background: url(/icons/playing-icon.svg) no-repeat center;
              height: 24px;
              width: 24px;
            }
          }
        }
      }
    }

    &.brand-film__asset--muted {
      .video-controls-overlay {
        .top-controls {
          .sound-button {
            background: url(/icons/volume-off-icon.svg) no-repeat center;
            height: 24px;
            width: 24px;
          }
        }

        .bottom-controls {
          .left-section {
            .sound-button {
              background: url(/icons/volume-off-icon.svg) no-repeat center;
              height: 24px;
              width: 24px;
            }
          }
        }
      }
    }

    .video-controls-overlay {
      visibility: visible;
      position: absolute;
      width: 100%;
      height: 100%;
      z-index: 5;
      padding: 12px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      pointer-events: none;

      .control-button {
        border: none;
        outline: none;
        cursor: pointer;
      }

      .top-controls {
        display: flex;
        pointer-events: all;
        justify-content: space-between;

        .left-section,
        .right-section {
          display: flex;
          gap: 0.75rem;
          align-items: center;

          @media (width >=768px) {
            gap: 1.5rem;
          }
        }

        .pip-button {
          transform: rotate(180deg) scaleX(-1);
          background: url(/icons/pip_icon.svg) no-repeat center;
          height: 24px;
          width: 24px;

          @media (width >=768px) {
            height: 2rem;
            width: 2rem;
          }
        }

        .fullscreen-button {
          background: url(/icons/fullscreen.svg) no-repeat center;
          height: 24px;
          width: 24px;

          @media (width >=768px) {
            height: 2rem;
            width: 2rem;
          }
        }

        .close-button {
          background: url(/icons/close_white.svg) no-repeat center;
          height: 24px;
          width: 24px;
          display: none;
        }

        .sound-button {
          background: url(/icons/volume-on-icon.svg) no-repeat center;
          height: 24px;
          width: 24px;
        }
      }

      .bottom-controls {
        display: none;
        gap: 16px;
        align-items: center;
        pointer-events: all;

        .left-section {
          display: flex;
          gap: 8px;
          align-items: center;

          .play-pause-button {
            background: url(/icons/pause-icon.svg) no-repeat center;
            height: 24px;
            width: 24px;
          }

          .sound-button {
            background: url(/icons/volume-on-icon.svg) no-repeat center;
            height: 24px;
            width: 24px;
          }

          .video-timer {
            display: flex;
            gap: 2px;

            p {
              color: var(--tertiary-light-grey);
              font-size: 14px;
              line-height: 15px;
              font-family: var(--font-primary-nexa);
              font-weight: 400;
              word-wrap: break-word;
              margin: 0;
            }
          }
        }

        .right-section {
          width: 100%;

          .progress-bar-container {
            height: 4px;
            position: relative;
            background-color: var(--tertiary-light-grey);

            .progress-bar {
              background-color: var(--primary-main);
              width: 0%;
              height: 100%;
              position: relative;

              &::after {
                content: '';
                position: absolute;
                width: 14px;
                height: 14px;
                border-radius: 50%;
                background-color: var(--primary-main);
                right: 0;
                top: 50%;
                transform: translateY(-50%);
              }
            }
          }
        }
      }
    }
  }

  .carousel__navigation {
    display: none;
  }
}

.brand-film__container .brand-film__description {
  margin: 0 auto 24px;
  padding-inline: 50px 49px;

  @media (width >=768px) {
    margin-bottom: 64px;
  }

  @media (width >=1024px) {
    margin-bottom: 60px;
    padding-inline: unset;
  }

  @media (width >=1366px) {
    margin-bottom: 48px;
    padding-inline: unset;
  }

  .brand-film__description-text {
    margin: 0;
    color: white;
    font-size: var(--heading-font-4-mob);
    font-family: var(--body-heading-font-family);
    font-weight: var(--fw-400);
    font-style: normal;
    line-height: 32px;
    word-wrap: break-word;
    text-align: center;
  
    *{
      font-weight: var(--fw-400);
    }
  }
}

/* .brand-film__container .brand-film__description {
  margin-bottom: 60px;
} */

.brand-film__description p.brand-film__description-text {
  margin: 0;
  color: white;
  font-size: var(--heading-font-4-mob);
  font-family: var(--body-heading-font-family);
  font-weight: var(--fw-400);
  font-style: normal;
  line-height: 32px;
  word-wrap: break-word;
  text-align: center;
}

.brand-film__container .brand-film__content {
  display: none;
  flex-direction: column;
  gap: 32px;

  .brand-film__title {
    color: white;
    font-size: 14px;
    font-family: var(--font-primary-nexa);
    font-weight: 500;
    line-height: 20px;
    word-wrap: break-word;
    margin: 0;
    margin-bottom: 8px;
  }

  .brand-film__subtitle {
    /* color: var(--tertiary-medium-grey); */
    color: var(--tertiary-white);
    font-size: 12px;
    font-family: var(--font-primary-nexa);
    font-weight: 400;
    line-height: 16px;
    word-wrap: break-word;
  }
}

.brand-film__container .carousel__slide {
  transition:
    visibility 0s,
    opacity 0s linear;
}

.brand-film__container {
  .fullscreen {
    .brand-film__video-container:has(video[src]) {
      height: 100%;
    }

    .brand-film__video-container .video-js.vjs-fill:not(.vjs-audio-only-mode) {
      height: 100%;
    }
  }
}

.brand-film__container .brand-film__video-container {
  width: 100%;
  aspect-ratio: 16/9;

  &:has(video[src]) {
    height: 450px;
  }

  video.video-js {
    width: 100%;
    height: 450px;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    @media (width >=1024px) {
      height: 593px;
    }
  }

  .video-js.vjs-fill:not(.vjs-audio-only-mode) {
    height: 450px;
  }

  .brand-film__video {
    video {
      aspect-ratio: 9 / 16;
      object-fit: cover;
      @media (width >=1024px) {
        aspect-ratio: 16 / 9;
      }
    }
  }
}

@media (width >=1024px) {
  .brand-film__container .brand-film__video-container {
    &:has(video[src]) {
      height: 100%;
    }

    .video-js.vjs-fill:not(.vjs-audio-only-mode) {
      height: 100%;
    }
  }
}

.brand-film__container .brand-film__video--paused .brand-film__play-btn {
  content: '';
  display: inline-block;
  position: absolute;
  top: calc(50% - 24px);
  left: calc(50% - 24px);
  height: 48px;
  width: 48px;
  transform: scale(0.67);
  background: url('/icons/play-icon.svg') no-repeat;
  cursor: pointer;
}

.brand-film__container .brand-film__slides.carousel__slides {
  width: 100%;
  margin: 0 auto;

  @media (width >=1024px) {
    width: 100%;
  }
}

.brand-film__container .brand-film__wrapper.fullscreen .brand-film__asset,
.brand-film__container .brand-film__wrapper.fullscreen .brand-film__slides {
  width: 100%;
  height: 100%;

  @media (orientation: landscape) {
    height: 100%;
    width: -webkit-fill-available;
  }

  @media (orientation: portrait) {
    width: 100%;
    /* height: auto; */
  }
}

.brand-film__container .brand-film__wrapper--fullscreen .brand-film__video-container {
  width: 100%;
  height: 100%;

  &::before,
  &::after {
    visibility: hidden;
  }
}

.brand-film__container .brand-film__navigation-wrapper {
  width: max-content;
  margin-bottom: 24px;
  display: none;

  .carousel__navigation {
    display: flex;
    gap: 8px;
  }
}

.brand-film__container .brand-film__video-container:has(video:picture-in-picture) video:not([controls]):picture-in-picture {
  opacity: 0;
}

.brand-film__container .brand-film__video-container:has(video:picture-in-picture) {
  background-color: black;
}

.brand-film__wrapper.pip .pip-button {
  display: none;
}

@media (width >=768px) {
  .brand-film__container {
    .brand-film__description:has(+ .brand-film__wrapper.fullscreen),
    .brand-film__description:has(+ .brand-film__wrapper.pip) {
      margin-bottom: 663px;
    }

    .brand-film__wrapper.fullscreen .brand-film__asset .video-controls-overlay {
      padding-top: 24px;
    }

    .brand-film__wrapper {
      margin: 0 auto 24px auto;

      &.fullscreen {
        padding: 56px;
      }

      &.pip {
        width: 400px;
        height: 230px;
        top: 64px;
        right: 56px;
        margin-bottom: 0;

        .brand-film__video-container:has(video[src]), video, .video-js {
          height: 100% !important;
        }
      }
    }

    .brand-film__asset {
      .video-controls-overlay {
        padding: 12px;
        visibility: hidden;

        .bottom-controls {
          display: flex;
          flex-direction: row;
          gap: 24px;
        }
      }

      &:hover {
        .video-controls-overlay {
          visibility: visible;
        }
      }
    }
  }

  .brand-film__container .brand-film__description {
    .brand-film__description-text {
      font-size: var(--heading-font-15-mob-sub-heading);
      line-height: var(--heading-lh-18-mob-text-small);
      padding-left: 184px;
      padding-right: 184px;
    }
  }

  .brand-film__container .brand-film__content {
    flex-direction: column;
    gap: 32px;

    .brand-film__title {
      font-size: 1.25rem;
      font-weight: 500;
      line-height: 1.5rem;
      margin-bottom: 0;
    }

    .brand-film__subtitle {
      font-size: 1rem;
      font-weight: 300;
      line-height: 1.25rem;
      margin-top: 8px;
    }
  }

  .brand-film__container .brand-film__navigation-wrapper {
    margin-bottom: 0;
  }

  .brand-film__container .brand-film__video--paused .brand-film__play-btn {
    transform: scale(1);
  }

  .brand-film__container .brand-film__wrapper.fullscreen .brand-film__asset,
  .brand-film__container .brand-film__wrapper.fullscreen .brand-film__slides {
    width: 100%;
    height: 100%;

    @media (orientation: landscape) {
      height: 100%;
      width: 100%;

      .brand-film__video-container {
        height: 100%;
        width: -webkit-fill-available;
      }
    }

    @media (orientation: portrait) {
      width: 100%;
      height: auto;
    }
  }

  .brand-film__container .brand-film__wrapper .brand-film__actions {
    visibility: hidden;
  }

  .brand-film__container .brand-film__video-container {
    &::before {
      height: 101%;
    }
  }
}

@media (width >=1024px) {
  .brand-film__container {
    padding-top: 96px;
    padding-bottom: 96px;

    .brand-film__asset {
      .video-controls-overlay {
        padding: 24px;
        padding-top: 0px;
      }
    }

    .brand-film__wrapper {
      margin: 0 auto;
    }
  }

  .brand-film__container .brand-film__description .brand-film__description-text {
    font-size: var(--heading-font-2-des);
    line-height: var(--heading-lh-2-des-display);
    padding-left: 0;
    padding-right: 0;
  }

  .brand-film__container .brand-film__content {
    flex-direction: row;
    justify-content: space-between;

    .brand-film__title {
      font-size: 24px;
      font-style: normal;
      font-weight: 500;
      line-height: 32px;
    }

    .brand-film__subtitle {
      font-size: 18px;
      font-style: normal;
      font-weight: 300;
      line-height: 24px;
      margin-top: 4px;
    }
  }
}

@media (width >=1366px) {
  .brand-film__container {
    padding-bottom: 97px;
    
    .brand-film__asset {
      .video-controls-overlay {
        padding: 32px 24px 24px 32px;
      }
    }
  }
}

.yy8-teaser-film {
  .brand-film__container .brand-film__description .brand-film__description-text {
    max-width: 1074px;
    margin: 0 auto;
  }
}

@media(width>=1920px) {
  brand-film__container {
    padding-top: 97px;
    padding-bottom: 105px;
  }
}
