/* ============================================================
   SALLA — LIGHTWEIGHT UPSELL CSS
   Used for:
   1. Cart Drawer
   2. Cart Page Upsell
   3. Product Page Upsell
   ============================================================ */


/* ============================================================
   CART DRAWER OVERLAY
   ============================================================ */

.sl-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;

  background: rgba(0, 0, 0, 0.35);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.sl-cart-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


/* ============================================================
   CART DRAWER
   ============================================================ */

.sl-cart {
  position: fixed;

  top: 0;
  right: 0;

  width: min(420px, 92vw);
  height: 100dvh;

  background: #fff;

  z-index: 9999;

  direction: rtl;

  display: flex;
  flex-direction: column;

  transform: translateX(105%);

  transition: transform 0.22s ease;

  box-shadow:
    -8px 0 28px rgba(0, 0, 0, 0.12);
}

.sl-cart.open {
  transform: translateX(0);
}


/* ============================================================
   CART HEADER
   ============================================================ */

.sl-cart-head {
  min-height: 62px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 12px 18px;

  border-bottom: 1px solid #eee;

  flex-shrink: 0;
}

.sl-cart-head h3 {
  margin: 0;

  font-size: 17px;
  font-weight: 700;

  line-height: 1.4;
}

.sl-cart-close {
  border: 0;
  background: transparent;

  padding: 4px 8px;

  font-size: 26px;
  line-height: 1;

  color: #222;

  cursor: pointer;
}


/* ============================================================
   CART BODY
   ============================================================ */

.sl-cart-body {
  flex: 1;

  overflow-y: auto;

  padding: 15px 18px 8px;

  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;
}


/* ============================================================
   CART ITEM
   ============================================================ */

.sl-cart-item {
  display: flex;

  align-items: center;

  gap: 10px;

  margin-bottom: 11px;

  padding-bottom: 11px;

  border-bottom: 1px solid #f0f0f0;
}

.sl-cart-item img {
  width: 62px;
  height: 62px;

  flex: 0 0 62px;

  object-fit: cover;

  border-radius: 8px;

  background: #f7f7f7;

  display: block;
}

.sl-cart-item-info {
  flex: 1;

  min-width: 0;
}

.sl-cart-item-name {
  margin-bottom: 4px;

  font-size: 13px;
  font-weight: 600;

  line-height: 1.5;
}

.sl-cart-item-meta {
  color: #777;

  font-size: 12px;

  line-height: 1.5;
}

.sl-cart-item-price {
  margin-top: 4px;

  color: #d67027;

  font-size: 13px;
  font-weight: 700;

  line-height: 1.5;
}


/* ============================================================
   CART UPSELL
   ============================================================ */

.sl-cart-upsell {
  margin-top: 8px;

  padding-top: 13px;

  border-top: 1px solid #eee;
}

.sl-cart-upsell-title {
  margin: 0 0 10px;

  font-size: 14px;
  font-weight: 700;

  line-height: 1.5;
}


/*
   Make Salla's native slider fit inside drawer
*/

.sl-cart-upsell salla-products-slider {
  display: block;

  width: 100%;

  max-width: 100%;
}


/* ============================================================
   CART FOOTER
   ============================================================ */

.sl-cart-footer {
  flex-shrink: 0;

  padding: 12px 18px 16px;

  border-top: 1px solid #eee;

  background: #fff;
}

.sl-cart-total {
  margin-bottom: 10px;

  font-size: 15px;
  font-weight: 700;

  line-height: 1.5;
}


/* ============================================================
   CHECKOUT BUTTON
   ============================================================ */

.sl-cart-checkout {
  display: flex;

  align-items: center;
  justify-content: center;

  width: 100%;

  min-height: 46px;

  padding: 10px 15px;

  border-radius: 9px;

  background: #d67027;
  color: #fff;

  text-decoration: none;

  font-size: 14px;
  font-weight: 700;

  line-height: 1.4;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.sl-cart-checkout:hover {
  opacity: 0.92;

  color: #fff;

  text-decoration: none;
}

.sl-cart-checkout:active {
  transform: scale(0.99);
}


/* ============================================================
   PRODUCT PAGE UPSELL
   ============================================================ */

.sl-product-upsell {
  width: 100%;

  margin: 28px 0;

  direction: rtl;
}

.sl-product-upsell h3 {
  margin: 0 0 12px;

  font-size: 18px;
  font-weight: 700;

  line-height: 1.5;
}

.sl-product-upsell salla-products-slider {
  display: block;

  width: 100%;

  max-width: 100%;
}


/* ============================================================
   CART PAGE UPSELL
   ============================================================ */

#salla-cart-upsell {
  width: 100%;

  direction: rtl;
}

#salla-cart-upsell .sl-product-upsell {
  margin-top: 25px;
  margin-bottom: 25px;
}


/* ============================================================
   SAR ICON / MONEY
   ============================================================ */

/*
   Salla may render:
   <i class="sicon-sar"></i>

   Keep the icon inline with the amount.
*/

.sl-cart-total .sicon-sar,
.sl-cart-item-price .sicon-sar {
  display: inline-block;

  margin-inline-start: 3px;

  vertical-align: middle;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 640px) {

  .sl-cart {
    width: 94vw;
  }

  .sl-cart-head {
    padding: 11px 15px;
  }

  .sl-cart-body {
    padding: 14px 15px 8px;
  }

  .sl-cart-footer {
    padding: 11px 15px 15px;
  }

  .sl-cart-item img {
    width: 58px;
    height: 58px;

    flex-basis: 58px;
  }

  .sl-cart-item-name {
    font-size: 12.5px;
  }

  .sl-product-upsell {
    margin: 22px 0;
  }

  .sl-product-upsell h3 {
    font-size: 16px;
  }

}


/* ============================================================
   SMALL MOBILE
   ============================================================ */

@media (max-width: 380px) {

  .sl-cart {
    width: 96vw;
  }

  .sl-cart-item {
    gap: 8px;
  }

  .sl-cart-item img {
    width: 54px;
    height: 54px;

    flex-basis: 54px;
  }

}