.cart-drawer {
  position: fixed;
  z-index: 1000;
  inset-inline-start: 0;
  inset-block-start: 0;
  width: 100vw;
  height: 100%;
  display: flex;
  justify-content: flex-end;
  background-color: rgba(var(--color-mask), 0.5);
  transition: visibility 200ms ease;
}

.cart-drawer {
  visibility: hidden;
}

.cart-drawer.active {
  visibility: visible;
}

.cart-drawer__inner {
  height: 100%;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 200ms ease;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background-color: rgb(var(--color-page-background));
}

.cart-drawer__fixed-checkout {
  transform: translateX(100%);
  transition: transform 200ms ease;
}

.cart-drawer__inner .cart-drawer__inner-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cart-drawer__warnings {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
}

.cart-drawer.active .cart-drawer__inner,
.cart-drawer.active .cart-drawer__fixed-checkout {
  transform: translateX(0);
}

.cart-drawer__header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block-end: 20px;
}

.cart-drawer__header::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: -20px;
  width: calc(100% + 40px);
  height: 1px;
  background-color: rgb(var(--color-entry-line));
}

.cart-drawer__close {
  color: rgb(var(--color-text));
  cursor: pointer;
  width: 24px;
  height: 24px;
  line-height: 0;
  inset-block-start: 2px;
  inset-inline-end: -4px;
  padding: 6px;
  position: absolute;
}

cart-drawer {
  display: block;
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100vw;
  height: 100%;
}

.cart-drawer-container {
  width: 440px;
}

.cart-drawer__overlay {
  position: fixed;
  inset: 0;
}

.cart-drawer__overlay:empty {
  display: block;
}

/* cart-drawer-items {
  overflow: auto;
  flex: 1;
} */

.cart-drawer__inner {
  overflow-y: scroll;
}

@media screen and (max-height: 650px) {
  cart-drawer-items {
    overflow: visible;
  }

  .cart-drawer__inner {
    overflow-y: scroll;
  }
}

@media (max-width: 959px) {
  .cart-drawer-container {
    width: 90%;
  }
}

cart-drawer-items::-webkit-scrollbar {
  width: 3px;
}

cart-drawer-items::-webkit-scrollbar-thumb {
  background-color: rgba(18, 18, 18, 0.7);
  border-radius: 100px;
}

cart-drawer-items::-webkit-scrollbar-track-piece {
  margin-block-start: 20px;
}

/* cart-drawer-footer */

.cart-drawer__footer__container {
  display: flex;
  justify-content: flex-end;
  padding-block: 40px;
}

.cart-drawer__checkout-container {
  width: 100%;
  position: relative;
  padding: 40px 0;
}

.cart-drawer__checkout-container::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: -20px;
  width: calc(100% + 40px);
  height: 1px;
  background-color: rgb(var(--color-entry-line));
}

.cart-drawer__amount-wrapper {
  margin: 0;
  padding: 0;
}

.cart-drawer__amount-wrapper li {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgb(var(--color-text));
  margin-block-end: 8px;
}

.cart-drawer__amount-wrapper li em {
  font-style: normal;
  margin-inline-end: 12px;
}

.cart-drawer__amount-wrapper .cart__discount span {
  color: rgb(var(--color-discount));
}

.cart-drawer__discount span {
  color: rgb(var(--color-discount));
}

#checkout {
  width: 100%;
}

.cart-drawer__checkout {
  margin-block-start: 15px;
}

.cart-drawer__taxes__desc {
  text-align: center;
}

.cart-drawer__body {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
}

.cart-drawer__body .cart-drawer__inner {
  flex: 1;
}

.cart-drawer__body .cart-fixed-checkout {
  position: static;
}

/* Empty Cart Styles */
.cart-empty div {
    margin-top: 0 !important;
}

.cart__empty-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.cart__empty-text {
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 400;
    color: rgb(var(--color-text));
}

.cart__empty-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 300px;
    margin-bottom: 40px;
}

.cart__empty-category-item {
    display: block;
    padding: 16px 24px;
    border: 1px solid rgb(var(--color-entry-line));
    border-radius: 4px;
    text-decoration: none;
    color: rgb(var(--color-text));
    background-color: transparent;
    transition: all 0.2s ease;
    text-align: center;
}

.cart__empty-category-item:hover {
    background-color: rgba(var(--color-text), 0.05);
    border-color: rgb(var(--color-text));
}

.cart__empty-category-item.sale-item {
    color: #e74c3c;
    border-color: #e74c3c;
}

.cart__empty-category-item.sale-item:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

.cart__empty-discounts {
    width: 100%;
    background-color: #8B4513;
    color: white;
    padding: 24px;
    border-radius: 8px;
    margin-top: 20px;
}

.discount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.discount-item {
    flex: 1;
    text-align: center;
}

.discount-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.discount-percentage {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.discount-condition {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.discount-code-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
}

.discount-code {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.discount-divider {
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    font-weight: 300;
}

@media (max-width: 480px) {
    .cart__empty-discounts {
        padding: 16px;
    }

    .discount-row {
        flex-direction: column;
        gap: 16px;
    }

    .discount-divider {
        display: none;
    }

    .cart__empty-categories {
        max-width: 100%;
    }

    .cart__empty-text {
        font-size: 20px;
    }
}

/* The ipad end responds to the mobile end in vertical screen */

/* @custom-media --tablet (max-width: 959px); */

/* @custom-media --gt-mobile (min-width: 751px); */

/* detectingScreen need to consider the configuration of the tablet */
