/**=====================
    cart css
==========================**/
.add_to_cart {
  position: fixed;
  background-color: $white;
  z-index: 9;
  transition: all 0.5s ease;

  .sidebar-title {
    padding: 0 calc(13px + (20 - 13) * ((100vw - 320px) / (1920 - 320)));
    padding-bottom: calc(13px + (15 - 13) * ((100vw - 320px) / (1920 - 320)));
    width: 100%;
    text-align: right;

    a {
      color: var(--theme-color);
      font-size: calc(15px + (17 - 15) * ((100vw - 320px) / (1920 - 320)));
      font-weight: 600;
    }
  }

  .delete-button {
    border: none;
    background-color: transparent;
    padding: 0;
  }

  ::-webkit-scrollbar {
    width: 3px;
    height: 7px;
  }

  ::-webkit-scrollbar-track {
    background: $round-border;
  }

  ::-webkit-scrollbar-thumb {
    background: $grey5;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: $grey2;
  }

  .cart-inner {
    background-color: $white;
    z-index: 9;
    position: relative;
    top: 0;

    .cart_media {
      padding: 0 calc(13px + (20 - 13) * ((100vw - 320px) / (1920 - 320)));
      overflow: auto;
      height: calc(100vh - (309px + 25 * (100vw - 320px) / 1600));
      padding-bottom: calc(13px + (20 - 13) * ((100vw - 320px) / (1920 - 320)));

      li {
        position: relative;
        width: 100%;
        padding-left: 0 !important;
        display: block !important;

        +li {
          border-top: 1px solid $white-dark;
          padding-top: 14px;
          margin-top: 14px;
        }

        .media {
          align-items: center;
          height: 100%;
          position: relative;

          img {
            height: calc(75px + (90 - 75) * ((100vw - 320px) / (1920 - 320)));
            background-color: $top-header;
            border: 1px solid $white-dark;
            width: calc(75px + (90 - 75) * ((100vw - 320px) / (1920 - 320)));
            object-fit: contain;
          }

          .media-body {
            align-self: center;
            position: relative;

            .quantity {
              color: #777;
              letter-spacing: unset;
              font-weight: 400;
              line-height: 1.3;
              font-size: 16px;
            }

            .gram {
              margin-bottom: 0;
              color: var(--theme-color);
              margin-top: 6px;
            }

            a {
              h4 {
                color: #333333;
                letter-spacing: unset;
                font-weight: 500;
                line-height: 1.3;
                margin-bottom: 4px;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
                width: 72%;

                @media (max-width: 576px) {
                  width: 65%;
                }

                span {
                  color: $grey;
                  font-size: 16px;
                }
              }
            }
          }
        }

        .total {
          padding-top: 10px;
          padding-bottom: 10px;

          h5 {
            text-transform: capitalize;
            margin-bottom: 0;
            color: #333;
            font-weight: 500;
            font-size: 20px;
            @include flex_common($dis: flex, $align: center, $justify: space-between);

            span {
              font-weight: 600;
              color: var(--theme-color);
            }
          }
        }

        .buttons {
          display: flex;
          align-items: center;
          gap: 14px;

          a {
            font-size: calc(14px + (18 - 14) * ((100vw - 320px) / (1920 - 320)));
            border-radius: 0;
            color: $white;
            text-transform: capitalize;
            font-weight: 600;
            transition: all 0.25s ease-in-out;
            width: 100%;
            padding: calc(9px + (12 - 9) * ((100vw - 320px) / (1920 - 320))) calc(15px + (29 - 15) * ((100vw - 320px) / (1920 - 320)));
            background-color: var(--theme-color);
            border: 1px solid var(--theme-color);

            &:hover {
              color: var(--theme-color);
              background-color: $white;
            }
          }

          .checkout {
            float: right;
          }
        }
      }

      .close-circle {
        position: absolute;
        top: 0;
        right: 0;
        display: flex;
        align-items: center;
        gap: 5px;

        button,
        a {
          width: 30px;
          height: 30px;
          background-color: $top-header;
          border: 1px solid $white-dark;
          @include flex_common;

          &:hover {
            color: $black;
            transition: all 0.5s ease;
          }
        }

        svg {
          width: unset;
          height: unset;
          font-size: 16px;
          transition: all 0.5s ease;
        }
      }

      .cart_total {
        border-top: 1px solid $white-dark;

        li {
          +li {
            margin: 0;
          }
        }
      }
    }

    .cart_top {
      display: flex;
      padding: calc(13px + (20 - 13) * ((100vw - 320px) / (1920 - 320))) calc(13px + (20 - 13) * ((100vw - 320px) / (1920 - 320))) calc(13px + (14 - 13) * ((100vw - 320px) / (1920 - 320)));
      border-bottom: 1px solid $white-dark;
      margin-bottom: 15px;
      align-items: center;

      h3 {
        font-size: calc(18px + (20 - 18) * ((100vw - 320px) / (1920 - 320)));
        color: #222222;
        font-weight: 700;
        text-transform: unset;
        margin-bottom: 0;
        letter-spacing: unset;
      }

      .close-cart {
        margin-left: auto;
        line-height: 1;
        width: calc(27px + (30 - 27) * ((100vw - 320px) / (1920 - 320)));
        height: calc(27px + (30 - 27) * ((100vw - 320px) / (1920 - 320)));
        background-color: $top-header;
        border: 1px solid $white-dark;
        @include flex_common;

        svg {
          font-size: calc(17px + (19 - 17) * ((100vw - 320px) / (1920 - 320)));
          color: #333333;
        }
      }
    }

    :not(.pere-text-box) {
      ~.cart_media {
        .empty-cart-box {
          height: 100%;
          @include flex_common;
        }
      }
    }

    .empty-cart-box {
      text-align: center;

      .icon {
        width: 50px;
        height: 50px;
        background-color: $top-header;
        border-radius: 100%;
        color: #6a6a6a;
        border: 1px solid $white-dark;
        @include flex_common;
        margin: 0 auto 4px;
      }

      h5 {
        margin: 0;
        font-weight: 500;
        font-size: 17px;
      }

      *:empty {
        display: unset;
      }
    }

    .pere-text-box {
      padding-inline: calc(13px + (20 - 13) * ((100vw - 320px) / (1920 - 320)));
      padding-bottom: 6px;
      border-bottom: 1px solid $white-dark;
      margin-bottom: 8px;

      p {
        font-size: 16px;
        text-transform: capitalize;
        line-height: 1.2;
      }

      .progress {
        display: block;
        margin-block: calc(8px + 0.00625 * (100vw - 320px));
        height: calc(5px + (8 - 5) * ((100vw - 320px) / (1920 - 320)));
        background-color: #e6e7e9;
        border-radius: 0;
        position: relative;
        overflow: unset;

        .progress-bar {
          height: calc(5px + (8 - 5) * ((100vw - 320px) / (1920 - 320)));
          background-color: var(--theme-color);
          border-radius: 0;
          position: relative;
          overflow: unset;
          max-width: 96%;
          min-width: 3%;

          &.bg-warning {
            .progress-icon {
              background-color: #ffc107;
            }
          }

          &.bg-danger {
            .progress-icon {
              background-color: #dc3545;
            }
          }

          .progress-icon {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            right: -16px;
            width: calc(22px + 0.00375 * (100vw - 320px));
            height: calc(22px + 0.00375 * (100vw - 320px));
            border-radius: 100%;
            @include flex_common;
            background-color: var(--theme-color);
            padding: calc(2px + (5 - 2) * ((100vw - 320px) / (1920 - 320)));
            color: $white;
            font-size: calc(15px + 0.00125 * (100vw - 320px));

            svg {
              color: $white;
            }
          }
        }
      }
    }

    .qty-box {
      position: absolute;
      bottom: 0;
      right: 0;
      background-color: $top-header;
      padding: 5px 11px;
      border: 1px solid $white-dark;

      .input-group {
        justify-content: flex-end;
        gap: 3px;

        .form-control {
          width: 40px;
          height: unset;
          padding-block: 0;
          flex: unset;
          border: unset;
          display: block;
          padding: 0;
          text-align: center;
          background-color: transparent;

          &::-webkit-inner-spin-button {
            display: none;
          }
        }

        span {
          button {
            z-index: 0;
            border: unset;
            padding: 0;
            background-color: transparent !important;
          }
        }
      }
    }
  }

  .cart_total {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: calc(305px + (470 - 305) * ((100vw - 320px) / (1920 - 320)));
    padding: 0 15px 20px;
    background-color: $white;
  }

  .overlay {
    visibility: hidden;
    opacity: 0;
    background-color: #212331;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: all 0.5s ease;
  }

  &.open-side {
    transition: all 0.5s ease;

    .overlay {
      opacity: 0.8;
      visibility: visible;
      transition: all 0.5s ease;
    }
  }

  &.left {
    left: -390px;
    top: 0;
    height: 100vh;
    width: 390px;

    .cart-inner {
      height: 100vh;
      overflow: auto;
    }

    &.open-side {
      left: 0;
    }
  }

  &.right {
    right: -500px;
    height: 100vh;
    max-width: calc(305px + (470 - 305) * ((100vw - 320px) / (1920 - 320)));
    width: 100%;
    top: 0;

    .cart-inner {
      height: 100vh;
      overflow: auto;
    }

    .empty-cart {
      height: calc(100vh - 80px);
    }

    &.open-side {
      right: 0;
    }

    .cart-inner {
      .cart_media {
        li {
          .media {
            align-items: unset;
            gap: 16px;

            .media-body {
              width: calc(100% - 75px - 16px);
              align-self: unset;
            }
          }
        }
      }
    }
  }

  &.top,
  &.bottom {
    height: 218px;
    width: 100%;

    .cart_media {
      display: flex;
      width: 100%;

      .cart_product {
        display: flex;
        width: 75%;
        overflow-y: auto;

        li {
          min-width: 245px;
          max-width: 225px;
          margin-right: 18px;
          padding-bottom: 0;
        }
      }

      .cart_total {
        width: 25%;
      }
    }

    .cart-inner {
      height: 218px;

      .cart_top {
        margin-bottom: 0;
        background-color: #fbfbfb;
        padding: 15px 44px;
        border-bottom: none;
      }

      .cart_media {
        padding: 0;

        .cart_product,
        .cart_total {
          padding: 30px 44px;
        }
      }
    }
  }

  &.top {
    top: -300px;

    &.open-side {
      top: 0;
    }
  }

  &.bottom {
    bottom: -300px;

    &.open-side {
      bottom: 0;
    }
  }
}

.cart_qty_cls {
  position: absolute;
  background: var(--theme-color);
  width: calc(16px + (20 - 16) * ((100vw - 320px) / (1920 - 320)));
  height: calc(16px + (20 - 16) * ((100vw - 320px) / (1920 - 320)));
  color: $white;
  border-radius: 20px;
  text-align: center;
  font-size: calc(10px + (12 - 10) * ((100vw - 320px) / (1920 - 320)));
  line-height: 14px;
  font-weight: 600;
  top: 20%;
  right: calc(-5px + (-8 - -5) * ((100vw - 320px) / (1920 - 320)));
  padding: 3px;
  @include flex_common;
}