/* ---------- cart drawer ---------- */

.bs-cart-drawer {
  --bs-cream: #fbf6ec;
  --bs-cream-deep: #f4ebdc;
  --bs-ink: #332c26;
  --bs-ink-soft: #6c6055;
  --bs-terra: #c47158;
  --bs-terra-deep: #9d4f39;
  --bs-butter: #f0cd8d;
  --bs-font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --bs-font-latin: "Manrope", "Segoe UI", sans-serif;
  --bs-ease: cubic-bezier(.22, 1, .36, 1);
  --bs-drawer-width: min(432px, 100vw);

  position: fixed;
  inset: 0;
  z-index: 9999;
  direction: rtl;
  text-align: right;
  color: var(--bs-ink);
  font-family: var(--bs-font);
}

.bs-cart-drawer[hidden] {
  display: none !important;
}

.bs-cart-drawer *,
.bs-cart-drawer *::before,
.bs-cart-drawer *::after {
  box-sizing: border-box;
}

.bs-cart-drawer__scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(47, 37, 29, .48);
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s ease;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.bs-cart-drawer.is-open .bs-cart-drawer__scrim {
  opacity: 1;
}

.bs-cart-drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: var(--bs-drawer-width);
  max-width: 100%;
  height: 100dvh;
  max-height: 100vh;
  background: var(--bs-cream);
  box-shadow: 26px 0 70px -36px rgba(47, 35, 26, .65);
  transform: translateX(-100%);
  transition: transform .32s var(--bs-ease);
  outline: none;
}

body.admin-bar .bs-cart-drawer__panel {
  top: 32px;
  height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
}

@media (max-width: 782px) {
  body.admin-bar .bs-cart-drawer__panel {
    top: 46px;
    height: calc(100dvh - 46px);
    max-height: calc(100vh - 46px);
  }
}

.bs-cart-drawer.is-open .bs-cart-drawer__panel {
  transform: translateX(0);
}

.bs-cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid rgba(74, 59, 46, .1);
}

.bs-cart-drawer__heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.bs-cart-drawer__eyebrow {
  color: var(--bs-terra-deep);
  font-family: var(--bs-font-latin);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1;
  text-transform: uppercase;
}

.bs-cart-drawer__head h2 {
  margin: 0;
  color: var(--bs-ink);
  font-family: var(--bs-font);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.bs-cart-drawer__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(74, 59, 46, .12);
  border-radius: 50%;
  background: rgba(255, 251, 243, .78);
  color: var(--bs-ink-soft);
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.bs-cart-drawer__close:hover {
  border-color: rgba(157, 79, 57, .22);
  background: var(--bs-cream-deep);
  color: var(--bs-terra-deep);
}

.bs-cart-drawer__close svg {
  width: 18px;
  height: 18px;
}

.bs-cart-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 22px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(108, 96, 85, .35) transparent;
}

.bs-cart-drawer__body::-webkit-scrollbar {
  width: 6px;
}

.bs-cart-drawer__body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(108, 96, 85, .3);
}

.bs-cart-drawer__items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 2px;
  color: var(--bs-ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.bs-cart-drawer__items-count {
  color: var(--bs-terra-deep);
  font-weight: 700;
}

.bs-cart-drawer__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bs-cart-drawer__item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(74, 59, 46, .09);
  transition: opacity .2s ease;
}

.bs-cart-drawer__item:last-child {
  border-bottom: 0;
}

.bs-cart-drawer__item.is-busy {
  opacity: .55;
  pointer-events: none;
}

.bs-cart-drawer__thumb {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 17px;
  background: var(--bs-cream-deep);
  box-shadow: inset 0 0 0 1px rgba(74, 59, 46, .06);
}

.bs-cart-drawer__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.bs-cart-drawer__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.bs-cart-drawer__name {
  display: block;
  max-width: 100%;
  color: var(--bs-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.bs-cart-drawer__name:hover {
  color: var(--bs-terra-deep);
}

.bs-cart-drawer__variant {
  color: var(--bs-ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.bs-cart-drawer__qty {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin-top: 5px;
  border: 1px solid rgba(74, 59, 46, .14);
  border-radius: 999px;
  background: rgba(255, 251, 243, .72);
  overflow: hidden;
}

.bs-cart-drawer__step {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bs-ink-soft);
  font-family: var(--bs-font);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.bs-cart-drawer__step:hover:not(:disabled) {
  background: rgba(157, 79, 57, .09);
  color: var(--bs-terra-deep);
}

.bs-cart-drawer__step:disabled {
  opacity: .3;
  cursor: default;
}

.bs-cart-drawer__qty-value {
  min-width: 20px;
  color: var(--bs-ink);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.bs-cart-drawer__line {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
}

.bs-cart-drawer__price {
  color: var(--bs-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.bs-cart-drawer__price .screen-reader-text,
.bs-cart-drawer__price del {
  display: none;
}

.bs-cart-drawer__remove {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bs-ink-soft);
  font-family: var(--bs-font);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color .2s ease;
}

.bs-cart-drawer__remove:hover {
  color: var(--bs-terra-deep);
}

.bs-cart-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42vh;
  padding: 44px 20px;
  text-align: center;
}

.bs-cart-drawer__empty-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bs-cream-deep);
  color: var(--bs-terra-deep);
}

.bs-cart-drawer__empty-mark svg {
  width: 26px;
  height: 26px;
}

.bs-cart-drawer__empty p {
  margin: 0;
  color: var(--bs-ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.bs-cart-drawer__shop-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 20px;
  border: 1px solid rgba(157, 79, 57, .28);
  border-radius: 999px;
  color: var(--bs-terra-deep);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease;
}

.bs-cart-drawer__shop-link:hover {
  background: var(--bs-terra-deep);
  color: #fff8eb;
}

.bs-cart-drawer__error {
  margin: 0 22px 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(196, 113, 88, .12);
  color: var(--bs-terra-deep);
  font-size: 11px;
  line-height: 1.7;
}

.bs-cart-drawer__error[hidden] {
  display: none;
}

.bs-cart-drawer__foot {
  flex: none;
  padding: 16px 22px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(74, 59, 46, .1);
  background: rgba(255, 251, 243, .9);
  box-shadow: 0 -20px 40px -38px rgba(63, 46, 33, .55);
}

.bs-cart-drawer__foot[hidden] {
  display: none !important;
}

.bs-cart-drawer__subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--bs-ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.bs-cart-drawer__subtotal strong {
  color: var(--bs-ink);
  font-size: 17px;
  font-weight: 800;
}

.bs-cart-drawer__note {
  margin: 4px 0 14px;
  color: var(--bs-ink-soft);
  font-size: 10.5px;
  line-height: 1.8;
}

.bs-cart-drawer__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.bs-cart-drawer__checkout,
.bs-cart-drawer__cart-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

.bs-cart-drawer__checkout {
  background: var(--bs-terra-deep);
  color: #fff8eb;
  box-shadow: 0 14px 26px -20px rgba(157, 79, 57, .8);
}

.bs-cart-drawer__checkout:hover {
  background: #8d432f;
  color: #fff8eb;
}

.bs-cart-drawer__cart-link {
  border: 1px solid rgba(74, 59, 46, .16);
  background: transparent;
  color: var(--bs-ink);
}

.bs-cart-drawer__cart-link:hover {
  border-color: rgba(157, 79, 57, .3);
  background: rgba(157, 79, 57, .06);
  color: var(--bs-terra-deep);
}

.bs-cart-drawer a:focus-visible,
.bs-cart-drawer button:focus-visible,
.bs-cart-drawer__panel:focus-visible {
  outline: 2px solid var(--bs-terra);
  outline-offset: 3px;
}

body.bs-cart-is-open {
  overflow: hidden;
}

@media (max-width: 380px) {
  .bs-cart-drawer__item {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
  }

  .bs-cart-drawer__thumb {
    width: 58px;
    height: 58px;
    border-radius: 15px;
  }

  .bs-cart-drawer__line {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bs-cart-drawer__scrim,
  .bs-cart-drawer__panel {
    transition: none;
  }
}

.wc-block-cart__empty-cart__title.with-empty-cart-icon::before,
.wp-block-woocommerce-empty-cart-block .with-empty-cart-icon::before {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  background-color: #9d4f39;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' d='M5.5 8.5h13l-1 11.2a1.8 1.8 0 0 1-1.8 1.6H8.3a1.8 1.8 0 0 1-1.8-1.6L5.5 8.5Z'/%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' d='M9 9V7.2a3 3 0 0 1 6 0V9'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.3' stroke-linejoin='round' d='M5.5 8.5h13l-1 11.2a1.8 1.8 0 0 1-1.8 1.6H8.3a1.8 1.8 0 0 1-1.8-1.6L5.5 8.5Z'/%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' d='M9 9V7.2a3 3 0 0 1 6 0V9'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  opacity: .72;
}

/* ---------- responsive cart page ---------- */

@media (max-width: 600px) {
  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items,
  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items tbody,
  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items tr,
  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items td {
    box-sizing: border-box;
    max-width: 100%;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    column-gap: 12px;
    width: 100%;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    padding-right: 0;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 0;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    min-width: 0;
    text-align: start;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-components-product-name {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-item__prices {
    flex-wrap: wrap;
    gap: 2px 8px;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-item__total-price-and-sale-badge-wrapper {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-components-sale-badge {
    font-size: 9.5px;
    line-height: 1.6;
  }

  .woocommerce-cart .wp-block-woocommerce-cart .wp-block-woocommerce-cart-items-block,
  .woocommerce-cart .wp-block-woocommerce-cart .wp-block-woocommerce-cart-totals-block {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row {
    grid-template-columns: 64px minmax(0, 1fr);
    row-gap: 10px;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-item__prices {
    display: none;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total {
    grid-column: 2;
    grid-row: 2;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px 10px;
  }

  .woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items .wc-block-cart-item__total-price-and-sale-badge-wrapper {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
  }
}
