@import './../../../../sources/styles/include.scss';

$component: 'shares';
$template: 'template-1';
$item: 'widget-item';
$loader: 'widget-loader';

@mixin webkit-box($lines, $lineheight) {
    max-height: #{$lines * $lineheight}px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: $lines;
    overflow: hidden;
}

@keyframes c-#{$component}-#{$template}-loader {
  from {
    @include transform-translate(-100%, -100%);
  } to {
      @include transform-translate(100%, 100%);
    }
}

.widget.c-#{$component}.c-#{$component}-#{$template} {
  .widget-all {
    display: block;
    width: 140px;
    padding-left: 10px;
    text-align: right;
    text-decoration: none;
  }
  .widget-all-desktop {
    display: block;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    color: #808080;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    word-break: break-word;
    
    @include transition(.35s, color);
  }
  .widget-all-mobile {
    display: none;
    padding: 6px 7px;
    
    svg {
      path {
        stroke: #B0B0B0;
        @include transition(.35s, stroke);
      }
    }
  }
  .widget-header {
    
    &[data-link-all="true"] {
      
      .widget-title {
        
        &.align-center {
          margin-left: 150px;
        }
      }
      
      .widget-description {
        
        &.align-center {
          margin-left: 150px;
        }
      }
    }
  }
  .widget-content {
    overflow: hidden;
  }
  
  .#{$item} {
    border: 1px solid #F2F2F2;
    background: #FFFFFF;
    height: 100%;
    @include border-radius(4px);
  }
  .#{$item}-picture {
    display: block;
    padding-top: 100% / 16 * 9;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    
    &[data-lazyload-use='true'] {
      background-color: #F2F2F2;
    }
  }
  .#{$item}-text {
    padding: 24px;
  }
  .#{$item}-timer {
    margin-bottom: 16px;
  }
  .#{$item}-period {
    font-size: 12px;
    line-height: 1.333333;
    color: #808080;
    margin-bottom: 8px;
    @include webkit-box(1, 16);
  }
  .#{$item}-name {
    @include webkit-box(3, 25);
    
    & > * {
      font-size: 15px;
      line-height: 1.47;
      color: #404040;
      text-decoration: none;
      @include transition(.35s, color);
    }
  }

  .#{$loader}-effect {
    position: relative;
    background-color: #F2F2F2;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      right: -50%;
      bottom: -50%;
      background: linear-gradient(135deg, rgba(0, 0, 0, 0) 35%, rgba(255, 255, 255, 0.85) 50%, rgba(0, 0, 0, 0) 65%);
      z-index: 1;
      animation-name: c-#{$component}-#{$template}-loader;
      animation-duration: 1.5s;
      animation-iteration-count: infinite;
    }
  }
  .#{$loader}-timer {
    overflow: hidden;
  }
  .#{$loader}-timer-item {
    width: 52px;
    height: 30px;
    @include border-radius(4px);
  }

  .widget-product-timer-item-block {
    border: none!important;
  }
  
  @include breakpoint-768() {
    .#{$item}-name {
      & > * {
        font-size: 16px;
        line-height: 1.38;
      }
    }
  }
  @include breakpoint-custom(500) {
    .widget-header {
      
      &[data-link-all="true"] {
        
        .widget-title {
          
          &.align-center {
            margin-left: 40px;
          }
        }
        
        .widget-description {
          
          &.align-center {
            margin-left: 40px;
          }
        }
      }
    }
    .widget-all-desktop {
      display: none;
    }
    .widget-all-mobile {
      display: block;
    }
    .widget-all {
      width: 30px;
      padding-left: 0;
      margin-left: 10px;
    }
    
    .#{$item} {
      @include border-radius(0);
    }
    .#{$item}-picture {
      margin-top: 16px;
      margin-left: 16px;
      margin-right: 16px;
      
      @include border-radius(2px);
    }
    .#{$item}-text {
      padding-left: 16px;
      padding-right: 16px;
      padding-bottom: 32px;
    }
  }
}