.elementor-widget-container {
  .header-cart-basket {
    .cart-basket-box {
      .icon, .title, .subtitle, .count {
        display: none;
      }
    }
  }
}

.header-cart-basket {
  position: relative;
  display: block;

  .cart-basket-box {
    display: flex;
    align-items: center;
    position: relative;
    gap: 10px;
    border-radius: var(--ns-radius) ;
    background-color: var(--ns-primary);
    color: #Fff;
    padding: 10px 20px;
    flex-direction: row-reverse;
    transition: 0.2s;
    line-height: normal;

    .icon {
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      opacity: 1;
      transition: 0.2s;
    }

    .title-outer {
      flex: 1;
      display: block;
      text-align: left;
    }

    .title {
      display: block;
      font-weight: 500;
      font-size: 14px;
      transition: 0.2s;
    }

    .subtitle {
      display: block;
      font-size: 13px;
      transition: 0.2s;
    }

    .count {
      color: var(--ns-primary);
      background: #fff;
      border-radius: 100px;
      padding: 2px 10px;
      font-weight: 500;
      text-align: center;
      transition: 0.2s;
    }
  }

  &.cart-mode-hover .cart-basket-box:not(.cart-mode-popup):not(:hover) {
    + {
      .widget.widget_shopping_cart {
        &:not(:hover) {
          margin-top: 15px;
          opacity: 0;
          visibility: hidden;
        }
      }
    }
  }


  &.cart-mode-popup {
    > .widget.widget_shopping_cart {
      position: fixed;
      right: 0;
      top: 0;
      bottom: 0;
      width: 350px;
      transition: 0.2s;
      border-radius: 0 !important;

      &.cart-items-align-left {
        left: 0;
        right: auto;
      }

      .cart-items-header {
        display: flex;
        align-items: center;
        padding: 0 30px 0 0;

        .header-title {
          flex: 1;
          margin-bottom: 0;
        }

        .header-close {
          height: 80px;
          width: 80px;
          text-align: center;
          line-height: 80px;
          font-size: 18px;
          padding: 0;
        }
      }

      ul li p.product-name {
        white-space: normal;
        overflow: inherit;
        text-overflow: inherit;
        margin-bottom: 5px;
      }

      .buttons {
        padding: 20px;
      }

      p.total {
        padding: 20px;
      }

      .widget_shopping_cart_content {
        display: flex;
        flex-direction: column;
        height: calc(100% - 80px);
      }

      .woocommerce-mini-cart {
        flex: 1 1 auto;
        max-height: inherit;
      }
    }

    &:not(.show-cart) {
      > .widget.widget_shopping_cart {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translateX(100%);

        &.cart-items-align-left {
          transform: translateX(-100%);
        }
      }
    }

    .ns-closer {
      display: none;
      transition: none;
      z-index: 9998;
    }
  }

  > .widget.widget_shopping_cart {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    z-index: 9999;
    background: #fff;
    width: 300px;
    border-radius: var(--ns-radius) ;
    box-shadow: rgba(0, 0, 0, .1) 0 2px 5px;
    transition: .2s;
    text-align: right;

    .cart-items-header {
      display: none;
    }

    &.cart-items-align-left {
      left: auto;
      right: 0;
    }

    &::before {
      content: "";
      display: block;
      position: absolute;
      bottom: 100%;
      left: 0;
      right: 0;
      height: 10px;
    }

    ul {
      list-style: none;
      padding: 0;
      margin: 0;
      max-height: 230px;
      overflow: auto;

      li {
        padding: 10px 70px 10px 10px;
        min-height: 70px;
        position: relative;
        transition: .2s;
        white-space: nowrap;

        &:hover {
          background: #f9f9f9;
        }

        &::after {
          content: "";
          display: block;
          clear: both;
        }

        img.wp-post-image {
          float: right;
          width: 50px;
          height: 50px;
          margin-right: -60px;
          border-radius: var(--ns-radius) ;
        }

        img.attachment-woocommerce_thumbnail {
          float: right;
          width: 50px;
          height: 50px;
          margin-right: -60px;
          border-radius: var(--ns-radius) ;
        }

        a.remove {
          display: block;
          position: absolute;
          right: 10px;
          top: 10px;
          width: 50px;
          height: 50px;
          text-align: center;
          line-height: 50px;
          background: #eee;
          border-radius: var(--ns-radius) ;
          font-size: 28px;
          transition: .2s;
          z-index: 9;

          &:hover {
            background: var(--ns-primary);
            color: #fff;
          }
        }

        &:not(:hover) {
          a.remove {
            transform: scale(.8);
            -webkit-transform: scale(.8);
            opacity: 0;
          }
        }

        p.product-name {
          float: right;
          width: 100%;
          text-overflow: ellipsis;
          overflow: hidden;
          margin-bottom: 0;
          color: #777;
          font-weight: 500;
        }

        dl.variation {
          float: right;
          width: 100%;
          text-overflow: ellipsis;
          overflow: hidden;
          color: #999;
          font-weight: normal;
          font-size: 13px;

          * {
            color: #999;
            font-weight: normal;
            font-size: 13px;
          }
        }

        span.quantity {
          float: right;
          width: 100%;
          text-overflow: ellipsis;
          overflow: hidden;
          color: #999;
          font-weight: normal;
          font-size: 13px;

          * {
            color: #999;
            font-weight: normal;
            font-size: 13px;
          }
        }
      }
    }

    > .widget_shopping_cart_content {
      border-radius: var(--ns-radius) ;
      overflow: hidden;
    }

    p.total {
      text-align: center;
      padding: 10px;
      color: var(--ns-primary);
      background: rgba(255, 2, 102, .1);
      margin: 0;

      strong {
        margin-left: 10px;
      }
    }

    .buttons {
      margin: 0;
      text-align: center;
      display: flex;
      justify-content: center;
      padding: 10px;

      .button {
        width: 50%;
        font-size: 13px;
        transition: .2s;
      }

      a.checkout {
        background: #eee;
        color: #777;
        border-radius: var(--ns-radius) ;

        &:hover {
          background: var(--ns-primary);
          color: #fff;
        }

        &::after {
          font-family: "Font Awesome 5 Pro", sans-serif;
          content: "\f104";
          font-weight: 300;
          margin-right: 10px;
          transform: translateY(2px) scale(1.5);
          display: inline-block;
        }
      }
    }
  }

}

.admin-bar .header-cart-basket.cart-mode-popup > .widget.widget_shopping_cart {
  top: 32px
}

#responsive-contents {
  .header-cart-basket {
    display: block;
    position: static;

    .cart-basket-box {
      display: none;
    }

    .widget.widget_shopping_cart {
      position: static !important;
      display: block !important;
      visibility: visible !important;
      opacity: 1 !important;
      width: auto !important;
      max-height: inherit !important;
      box-shadow: none !important;

      ul {
        max-height: inherit !important;

        li a.remove {
          opacity: 1 !important;
          visibility: visible;
          transform: none !important;
          width: auto !important;
          height: auto;
          line-height: normal;
          padding: 5px;
          display: inline-block;
          font-size: 14px;
          left: 0;
          right: auto;
          top: auto;
          bottom: 0;
          background: transparent !important;
          color: var(--ns-primary);

          &::after {
            content: "حذف";
            margin: 0 5px 0 0;
            font-size: 12px
          }
        }
      }

      .buttons {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px;
        background: #fff;
        z-index: 9;
        border-top: #eee 1px solid;
      }

      p.total {
        border-radius: var(--ns-radius) ;
      }
    }
  }
}