@import './../../../../sources/styles/include.scss';

$block: 'widget-block';
$component: 'slider';
$dots: 'widget-slider-dots';
$item: 'widget-item';
$nav: 'widget-slider-nav';
$template: 'template-3';

@mixin webkit-box ($lines, $line-height) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: $lines;
  overflow: hidden;
  max-height: #{$lines * $line-height}px;
}

.c-#{$component}.c-#{$component}-#{$template} {

  .widget-content {
    position: relative;
  }

  .widget-slider {
    position: relative;
    overflow: hidden;
    z-index: 1;
  }

  .widget-items {
    position: relative;
    display: block;
    width: auto;
    z-index: 1;

    &.owl-carousel {
      .#{$item} {
        display: none;

        &:first-child {
          display: block;
        }
      }

      &.owl-loaded .#{$item} {
        display: block;
      }
    }
  }

  .#{$item} {
    position: relative;
  }
  .#{$item}-block-mobile {
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-color: #fff;
  }
  .#{$item}-block-mobile-small-picture {
    position: absolute;
    bottom: 0;
    width: 95%;
    height: calc(100% - 10px);
    left: 3%;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-size: contain;
  }
  .#{$item}-block-desktop {
    display: block;
    text-decoration: none;
    position: relative;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #f8f9fb;
  }
  .#{$item}-video {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
  }
  .#{$item}-fade {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0 ,0, 0, 0.5);
    z-index: 2;
  }
  .#{$item}-content {
    position: relative;
    z-index: 3;

    @include box-sizing(content-box);
  }
  .#{$item}-over {
    color: #000;

    &[data-view='1'] {
      font-size: 12px;
      line-height: 18px;
      letter-spacing: 1.6px;
      text-transform: uppercase;
      margin-bottom: 8px;
      height: 18px;
      overflow: hidden;
    }
  }
  .#{$item}-header {
    color: #000;

    &[data-view='1'] {
      font-size: 34px;
      line-height: 40px;
      font-weight: 400;
    }
    &[data-view='2'] {
      font-size: 40px;
      font-weight: 400;
      line-height: 42px;
    }
    &[data-view='3'] {
      font-size: 48px;
      font-weight: 400;
      line-height: 52px;
    }
    &[data-view='4'] {
      font-size: 48px;
      font-weight: 500;
      line-height: 52px;
    }
    &[data-view='5'] {
      font-size: 40px;
      font-weight: 400;
      line-height: 46px;
    }
  }
  .#{$item}-description {
    color: #000;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;

    &[data-view='1'] {
      font-size: 14px;
      line-height: 20px;
      margin-top: 16px;
      max-height: 80px;
    }
    &[data-view='2'] {
      font-size: 16px;
      line-height: 24px;
      margin-top: 24px;
      max-height: 96px;
    }
    &[data-view='3'] {
      font-size: 14px;
      line-height: 22px;
      margin-top: 16px;
      max-height: 88px;
    }
    &[data-view='4'] {
      font-size: 18px;
      line-height: 28px;
      margin-top: 24px;
      max-height: 112px;
    }
    &[data-view='5'] {
      font-size: 16px;
      line-height: 24px;
      margin-top: 16px;
      max-height: 96px;
    }
  }
  .#{$item}-buttons {
    font-size: 0;

    .#{$item}-button {
      display: inline-block;
      text-align: center;
      text-decoration: none;
      @include transition(.35s, background-color);
    }
    &[data-view='1'] {
      margin-top: 32px;

      .#{$item}-button {
        font-size: 14px;
        line-height: 14px;
        color: #fff;
        padding: 16px 24px;
        @include border-radius(2px);
      }
    }
    &[data-view='2'] {
      margin-top: 32px;

      .#{$item}-button {
        font-size: 16px;
        line-height: 16px;
        padding: 20px 32px;
        color: #fff;
        @include border-radius(28px);
      }
    }
    &[data-view='3'] {
      margin-top: 32px;

      .#{$item}-button {
        font-size: 14px;
        line-height: 14px;
        color: #fff;
        padding: 20px 32px;
        @include border-radius(4px);
      }
    }
    &[data-view='4'] {
      margin-top: 32px;

      .#{$item}-button {
        font-size: 16px;
        line-height: 16px;
        color: #fff;
        padding: 24px 40px;
        @include border-radius(32px);
      }
    }
  }
  .#{$item}-picture {
    position: relative;
    height: 100%;
    font-size: 0;

    img {
      position: absolute;
      display: inline-block;
      width: auto;
      height: auto;
      max-width: inherit;
      max-height: 100%;

      &[data-align-vertical="top"] {
        top: 0;
      }
      &[data-align-vertical="center"] {
        top: 50%;
        @include transform-translate(null, -50%);
      }
      &[data-align-vertical="bottom"] {
        bottom: 0;
      }
    }
  }

  .widget-blocks-items {
    height: 100%;
  }
  .#{$block} {
    position: relative;
    overflow: hidden;
  }
  .#{$block}-wrapper,
  .#{$block}-picture,
  .#{$block}-fade {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  .#{$block}-wrapper {
    display: block;
    text-decoration: none;
  }
  .#{$block}-picture {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    @include transition(.35s, transform);
  }
  .#{$block}-fade {
    opacity: 0;
    background-color: rgba(0, 0, 0, 0.5);
    @include transition(.35s, opacity);
    z-index: 2;
  }
  .#{$block}-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 20%, transparent);
    z-index: 3;
  }
  .#{$block}-header {
    display: -webkit-box;
    font-size: 18px;
    font-weight: 500;
    line-height: 24px;
    color: #fff;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-height: 48px;
  }
  .#{$block}-description {
    font-size: 12px;
    line-height: 20px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 8px;

    @include webkit-box(2, 20);
  }
  .#{$block}:hover {
    .#{$block}-fade {
      opacity: 1;
    }
  }

  [data-blocks-position='right'] {
    .widget-slider {
      width: 75%;
    }
    .widget-blocks {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      width: 25%;
      z-index: 2;
    }
    [data-count='1'] {
      .#{$block} {
        height: 100%;
      }
    }
    [data-count='2'] {
      .#{$block} {
        height: 50%;
      }
    }
    [data-count='3'] {
      .#{$block} {
        height: (100%/3);
      }
    }
  }
  [data-blocks-position='bottom'] {
    .#{$block} {
      height: 100%;
    }
  }
  [data-effect-scale='true'] {
    .#{$block} {
      &:hover {
        .#{$block}-picture {
          -webkit-transform: scale(1.1);
          -moz-transform: scale(1.1);
          -ms-transform: scale(1.1);
          -o-transform: scale(1.1);
          transform: scale(1.1);
        }
      }
    }
  }

  .#{$nav},
  .#{$dots} {
    font-size: 0;
    pointer-events: none;
    z-index: 2;

    button {
      padding: 0;
      border: none;
      outline: none;
      pointer-events: all;
    }
  }

  [data-nav-view='1'] {
    .#{$nav} {
      position: absolute;
      top: 50%;
      left: 0;
      right: 0;
    }
    .#{$nav}-item {
      position: absolute;
      display: inline-block;
      width: 40px;
      height: 40px;
      background-color: #FFF;
      opacity: 0;
      cursor: pointer;
      outline: none;
      @include border-radius(2px);
      @include box-shadow(0, 4px, 16px, 0, rgba(27, 30, 37, 0.16));
      @include transform-translate(null, -50%);
      @include transition(.35s, (background-color, opacity));

      svg {
        path {
          stroke: #808080;
          @include transition(.35s, stroke);
        }
      }
      &.disabled {
        opacity: 0 !important;
        pointer-events: none;
      }
      &:hover {
        svg {
          path {
            stroke: #F2F2F2;
          }
        }
      }
    }
    &[data-wide='false'] {
      .#{$item}-content {
        padding-left: 68px;
        padding-right: 68px;
      }
      .#{$nav}-item-left {
        left: 16px;
      }
      .#{$nav}-item-right {
        right: 16px;
      }
    }
    &[data-wide='true'] {
      .#{$item}-content {
        padding-left: 68px;
        padding-right: 68px;
      }
      .#{$nav}-item-left {
        left: 80px;
      }
      .#{$nav}-item-right {
        right: 80px;
      }
      &[data-blocks-use='true'] {
        &[data-blocks-position='right'] {
          .#{$item}-content {
            padding-left: 88px;
            padding-right: 88px;
          }
          .#{$nav}-item-left {
            left: 16px;
          }
          .#{$nav}-item-right {
            right: 16px;
          }
        }
      }
    }
    &:hover {
      .#{$nav}-item {
          opacity: 1;
      }
    }
  }
  [data-nav-view='2'] {
    .#{$nav} {
      position: absolute;
      top: 50%;
      left: 0;
      right: 0;
    }
    .#{$nav}-item {
      position: absolute;
      display: inline-block;
      width: 40px;
      height: 40px;
      opacity: 0;
      cursor: pointer;
      outline: none;
      @include border-radius(50%);
      @include transform-translate(null, -50%);
      @include transition(.35s, (background-color, opacity));

      svg {
        path {
          stroke: #FFF;
        }
      }
      &.disabled {
        opacity: 0 !important;
        pointer-events: none;
      }
    }
    &[data-wide='false'] {
      .#{$item}-content {
        padding-left: 68px;
        padding-right: 68px;
      }
      .#{$nav}-item-left {
        left: 16px;
      }
      .#{$nav}-item-right {
        right: 16px;
      }
    }
    &[data-wide='true'] {
      .#{$item}-content {
        padding-left: 68px;
        padding-right: 68px;
      }
      .#{$nav}-item-left {
        left: 80px;
      }
      .#{$nav}-item-right {
        right: 80px;
      }
      &[data-blocks-use='true'] {
        &[data-blocks-position='right'] {
          .#{$item}-content {
            padding-left: 88px;
            padding-right: 88px;
          }
          .#{$nav}-item-left {
            left: 16px;
          }
          .#{$nav}-item-right {
            right: 16px;
          }
        }
      }
    }
    &:hover {
      .#{$nav}-item {
        opacity: 1;
      }
    }
  }
  [data-dots-view='1'] {
    .#{$dots} {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 24px;
      text-align: center;
      margin-top: -8px;
      margin-bottom: -8px;

      button {
        display: inline-block;
        width: 9px;
        height: 9px;
        margin: 8px;
        background-color: #E8E8E8;
        border: 1px solid rgba(0, 0, 0, 0.35);
        cursor: pointer;
        @include border-radius(50%);
        @include transition(.35s, (background-color, border-color));
      }
    }
  }
  [data-dots-view='2'] {
    .#{$dots} {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 24px;
      text-align: center;
      margin-top: -8px;
      margin-bottom: -8px;

      button {
        display: inline-block;
        width: 9px;
        height: 9px;
        margin: 8px;
        background-color: #E8E8E8;
        border: 1px solid rgba(0, 0, 0, 0.35);
        cursor: pointer;
        @include border-radius(1px);
        @include transition(.35s, (background-color, border-color));
      }
    }
  }

  [data-scheme='white'] {
    &[data-nav-view='2'] {
      .#{$nav}-item {
        background-color: rgba(255, 255, 255, 0.3);
      }
    }
  }
  [data-scheme='black'] {
    &[data-nav-view='2'] {
      .#{$nav}-item {
        background-color: rgba(0, 0, 0, 0.3);
      }
    }
  }
  [data-item-scheme='black'] {
    .#{$item}-over,
    .#{$item}-header,
    .#{$item}-description {
      color: #000;
    }
  }

  [data-wide='false'] {
    [data-code="marks"],
    [data-code="timer"] {
      display: none;
    }

    .#{$item}-content {
      padding-left: 28px;
      padding-right: 28px;
    }
  }
  [data-wide='true'] {
    &[data-blocks-use='true'] {
      &[data-blocks-position='right'] {
        .#{$item}-content {
          padding-left: 80px;
          padding-right: 80px;
        }
      }
    }
  }

  @media all and (max-width: 1440px) {
    [data-nav-view='1'],
    [data-nav-view='2'] {
      &[data-wide='true'] {
        .#{$nav}-item-left {
          left: 16px;
        }
        .#{$nav}-item-right {
          right: 16px;
        }
      }
    }
  }
  @media all and (max-width: 1024px) {
    .#{$item}-over {
      &[data-view] {
        font-size: 12px;
        line-height: 16px;
        margin-bottom: 8px;
        height: 16px;
        overflow: hidden;
      }
    }
    .#{$item}-header {
      &[data-view] {
        font-size: 22px;
        font-weight: 500;
        line-height: 28px;
      }
    }
    .#{$item}-description {

      &[data-view] {
        font-size: 14px;
        line-height: 20px;
        margin-top: 8px;
        max-height: 80px;
      }
    }
    .#{$item}-buttons {
      &[data-view] {
        margin-top: 24px;

        .#{$item}-button {
          font-size: 14px;
          line-height: 14px;
          padding: 16px 24px;
          @include border-radius(2px);
        }
      }
    }

    .#{$block}-wrapper {
      position: static;
    }

    [data-wide='true'] {
      .#{$item}-content {
        padding-left: 28px;
        padding-right: 28px;
      }
      &[data-blocks-use='true'] {
        &[data-blocks-position='right'] {
          .#{$item}-content {
            padding-left: 48px;
            padding-right: 48px;
          }
        }
      }
    }
    [data-count='1'] {
      .#{$block}-wrapper {
        padding-top: 25%;
      }
    }
    [data-count='2'] {
      .#{$block}-wrapper {
        padding-top: 50%;
      }
    }
    [data-count='3'] {
      .#{$block}-wrapper {
        padding-top: 75%;
      }
    }
    [data-count='4'] {
      .#{$block}-wrapper {
        padding-top: 100%;
      }
    }
    [data-blocks-position='right'] {
      .widget-slider {
        width: auto;
      }
      .widget-blocks {
        position: static;
        width: auto;
      }
      [data-count] {
        .#{$block} {
          height: auto;
        }
      }
    }
    [data-blocks-position='bottom'] {
      .widget-blocks {
        height: auto!important;
      }
    }
    [data-nav-view='1'],
    [data-nav-view='2'] {
      .#{$nav}-item {
        width: 30px;
        height: 30px;
        opacity: 1;
      }
      &[data-wide='false'] {
        .#{$item}-content {
          padding-left: 58px;
          padding-right: 58px;
        }
      }
      &[data-wide='true'] {
        .#{$item}-content {
          padding-left: 58px;
          padding-right: 58px;
        }
        &[data-blocks-use='true'] {
          &[data-blocks-position='right'] {
            .#{$item}-content {
              padding-left: 78px;
              padding-right: 78px;
            }
          }
        }
      }
    }
  }
  @media all and (min-width: 769px) {
    [data-item-scheme='white'] {
      .#{$item}-over,
      .#{$item}-header,
      .#{$item}-description {
        color: #fff;
      }

      .#{$item}-product {

        .catalog-element-name,
        .widget-time-header,
        .widget-quantity-header,
        .catalog-element-price-discount,
        .catalog-element-price-base {
          color: #fff;
        }
      }
    }
  }
  @media all and (max-width: 768px) {
    .#{$item}-content-body {
      height: 300px !important;
    }

    [data-mobile-picture="true"] {
      .#{$item}-block-desktop {
        background: none!important;
      }
    }

    [data-mobile-separated="true"] {
      .#{$item}-block-mobile {
        position: relative;
        height: 300px;
      }
      .#{$item}-block-desktop {
        background: none!important;
      }
      .#{$item}-fade {
        display: none;
      }
    }

    [data-mobile-separated="false"] {

      [data-item-scheme='white'] {
        .#{$item}-over,
        .#{$item}-header,
        .#{$item}-description {
          color: #fff;
        }

        .#{$item}-product {

          .catalog-element-name,
          .widget-time-header,
          .widget-quantity-header,
          .catalog-element-price-discount,
          .catalog-element-price-base {
            color: #fff;
          }
        }
      }
    }
    .#{$item}-video {
      display: none;
    }
    .#{$item}-text {
      width: auto;
      text-align: center;
    }
    .#{$item}-header {
      &[data-view] {
        font-size: 24px;
        font-weight: normal;
        line-height: 30px;
        max-height: 60px;
        overflow: hidden;
      }
    }
    .#{$item}-description {

      &[data-view] {
        font-size: 14px;
        line-height: 18px;
        margin-top: 8px;
        max-height: 72px;
      }
    }
    .#{$item}-picture {
      display: none;
    }

    [data-count] {
      .#{$block}-wrapper {
        padding-top: 35%;

        &[data-half="true"] {
          padding-top: 50%;
        }
      }
    }
    [data-nav-view='1'],
    [data-nav-view='2'] {
      &[data-wide='false'] {
        .#{$item}-content {
          padding-left: 42px;
          padding-right: 42px;
        }
      }
      &[data-wide='true'] {
        .#{$item}-content {
          padding-left: 42px;
          padding-right: 42px;
        }
        &[data-blocks-use='true'] {
          &[data-blocks-position='right'] {
            .#{$item}-content {
              padding-left: 62px;
              padding-right: 62px;
            }
          }
        }
      }
    }
    [data-dots-view='1'],
    [data-dots-view='2'] {

      &[data-mobile-separated="true"] {
        .#{$dots} {
          bottom: calc(50% + 16px);
        }
      }

      .#{$dots} {
        bottom: 16px;
      }
    }
    [data-wide='false'] {
      .#{$item}-content {
        padding-left: 0;
        padding-right: 0;
      }
    }
    [data-wide='true'] {
      .#{$item}-content {
        padding-left: 0;
        padding-right: 0;
      }
      &[data-blocks-use='true'] {
        &[data-blocks-position='right'] {
          .#{$item}-content {
            padding-left: 20px;
            padding-right: 20px;
          }
        }
      }
    }
  }
  @media all and (max-width: 500px) {
    .#{$item}-over {
      &[data-view] {
        font-size: 10px;
        line-height: 14px;
        height: 14px;
        overflow: hidden;
      }
    }

    .#{$block}-text {
      padding: 16px;
    }
    .#{$block}-header {
      font-size: 16px;
      line-height: 21px;
    }
    .#{$block}-description {
      font-size: 12px;
      line-height: 18px;
    }

    [data-count] {
      .#{$block}-wrapper {
        padding-top: 50%;

        &[data-half="true"] {
          padding-top: 80%;
        }
      }
    }
    [data-nav-view='1'],
    [data-nav-view='2'] {
      .#{$nav} {
        display: none;
      }
      &[data-wide='false'] {
        .#{$item}-content {
          padding-left: 0;
          padding-right: 0;
        }
      }
      &[data-wide='true'] {
        .#{$item}-content {
          padding-left: 0;
          padding-right: 0;
        }
        &[data-blocks-use='true'] {
          &[data-blocks-position='right'] {
            .#{$item}-content {
              padding-left: 20px;
              padding-right: 20px;

              &[data-product='true'] {
                padding-left: 0;
                padding-right: 0;
              }
            }
          }
        }
      }
    }
  }
}

.intec-template[data-background-show="true"] {
  .c-#{$component}.c-#{$component}-#{$template} {

    .#{$nav}-item-left {
      left: 32px;
    }
    .#{$nav}-item-right {
      right: 32px;
    }

    @media all and (max-width: 720px) {
      .#{$nav}-item-left {
        left: 16px;
      }
      .#{$nav}-item-right {
        right: 16px;
      }
    }
  }
}