
@import './variables';
@import './libs/normalize';

@import './components/all.scss';

body {
  background-color: var(--background);
  color: var(--black);
  transition: background 0.3s, color 0.3s;
}

.wrapper {
  width: calc(100vw - 100px);
  height: 100%;
  background-color: var(--w-background); 
  margin: 50px auto;
  border-radius: 10px;
  max-width: 1400px;
  transition: background 0.3s ease-in-out; 
  box-shadow: 0px 0px 18px 8px  var(--shadow);

  @media (max-width: 645px) {
    width: calc(100vw - 30px);
    margin-top: 15px;
  }
}




.content {
  padding: 40px 0;
  
  &__title {
    font-weight: 800;
    font-size: 38px;
    margin-top: 60px;
    margin-bottom:  50px;
    color: var(--black);
  }

  &__items {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    grid-column-gap: 11px;
 
    @media (max-width: 1400px) {
       grid-template-columns: repeat(3, 1fr);
    }
    @media (max-width: 1060px) {
      grid-template-columns: repeat(2, 1fr);
      
   }

   @media (max-width: 730px) {
    grid-template-columns: repeat(1, 1fr);
 }
 }
 
    
  

  &__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    @media (max-width: 1260px) {
      flex-direction: column-reverse;


      .categories{
       
        width: 100%;
        overflow: auto;

        ul{
          width: 785px;
        }
      }
   
      .sort{
        padding-left: 20px;
        b {
          display: none;
        }
      }
    }
      @media (max-width:760px) {
  
        .categories{
          ul{
            li{
              padding: 8px 20px;
            }
          }
        }

    }

@media (max-width: 820px) {
  
  .categories{
    margin-top: 30px;
  }
  flex-direction:  column-reverse;
}
}

  }


  @media (max-width: 768px) {
   
    .pay-btn {
    margin-left: 5px;
    }


    .cart__item {
      flex-direction: column;
      align-items: center;
      text-align: center;
      
      &-img {
        width: 100%;
        display: flex;
        justify-content: center;
        white-space: nowrap;
        margin-left: 10px;
        

      }
  
      &-info {
        width: 100%;
        margin-bottom: 15px;
      }
  
      &-count {
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
      }
  
      &-price {
        width: 100%;
        justify-content: center;
        margin-bottom: 15px;
      }
  
      &-remove {
        width: 100%;
        justify-content: center;
      }
    }
  }
  




.container {
  width: $container-width;
  margin: 0 auto;
  
  &--cart {
    max-width: 820px;
    margin: 0px auto;
    .content__title {
      
      margin: 0;
    }
  }
}

.cart {
  &__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .content__title {
    display: flex;
    align-items: center;
    
    



    svg {
      position: relative;
      top: -2px;
      width: 30px;
      height: 30px;
      margin-right: 10px;
      path {
        stroke: $black;
        strokeWidth: 1.9;
      }
    }
  }

  &__clear {
    display: flex;
    align-items: center;
    cursor: pointer;
    @include noselect();

    span {
      display: inline-block;
      margin-left: 7px;
      color: var(--black);
      font-size: 18px;
    }

    span,
    svg,
    path {
      transition: all $duration ease-in-out;
    }

    &:hover {
      svg {
        path {
          stroke: darken($color: #b6b6b6, $amount: 50);
        }
      }
      span {
        color: darken($color: #b6b6b6, $amount: 50);
      }
    }
  }

  
.content__items{
  display: block
}


  &__item {
    display: flex;
    width: 100%;
    border-top: 1px solid $gray-line;
    padding-top: 30px;
    margin-top: 30px;

    &-img {
      display: flex;
      align-items: center;
      margin-right: 15px;
      width: 10%;

      img {
        width: 80px;
        height: 80px;
      }
    }

    &-info {
      display: flex;
      flex-direction: column;
      justify-content: center;
      width: 40%;

      h3 {
        font-weight: bold;
        font-size: 22px;
        line-height: 27px;
        letter-spacing: 0.01em;
      }

      p {
        font-size: 18px;
        color: #8d8d8d;
      }
    }

    &-count {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 13%;

      &-minus {
        svg {
          path:first-of-type {
            display: none;
          }
        }
      }

      b {
        font-size: 22px;
      }
    }

    &-price {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 33%;

      b {
        font-weight: bold;
        font-size: 22px;
        letter-spacing: 0.01em;
      }
    }

    &-remove {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      width: 4%;

      .button {
        border-color: darken($color: $gray-line, $amount: 10);
      }

      svg {
        transform: rotate(45deg);

        path {
          fill: darken($color: $gray-line, $amount: 15);
        }
      }

      .button {
        svg {
          width: 11.5px;
          height: 11.5px;
          position: relative;
        }
        &:hover,
        &:active {
          border-color: darken($color: $gray-line, $amount: 80);
          background-color: darken($color: $gray-line, $amount: 80);
        }
      }
    }
  }

  &__bottom {
    margin: 50px 0;

    &-details {
      display: flex;
      justify-content: space-between;

      span {
        font-size: 22px;

        &:last-of-type {
          b {
            color: $orange;
          }
        }
      }
    }

    &-buttons {
      display: flex;
      justify-content: space-between;
      margin-top: 40px;

      .go-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 210px;

        border-color: var(--cat-black);

        span {
          color: var(--cat-black);
          font-weight: 500;
          font-weight: 600;
        }

        &:hover {
          background-color: var(--cat-active);
          border-color: darken($color: $gray-line, $amount: 90);

          span {
            color: $gray-line;
          }
        }

        svg {
          margin-right: 12px;
          path {
            fill: transparent;
            strokeWidth: 2;
          }
        }
      }

      .pay-btn {
        font-size: 16px;
        font-weight: 600;
        width: 210px;
        padding: 16px;
      }
    }
  }

  &--empty {
    margin: 0 auto;
    width: 560px;
    text-align: center;

    h2 {
      font-size: 32px;
      margin-bottom: 10px;
    }

    p {
      font-size: 18px;
      line-height: 145.4%;
      letter-spacing: 0.01em;
      color: #777777;
    }

    icon {
      position: relative;
      top: 2px;
    }

    img {
      display: block;
      width: 300px;
      margin: 45px auto 60px;
    }

    .button--black {
      padding: 12px 0 14px;
      width: 230px;
      margin: 0 auto;
      font-weight: 600;
      font-size: 18px;
    }
  }
}
