.slidecart-overlay {
  position: fixed;
  top: 0px;
  bottom: 0px;
  right: 0px;
  left: 0px;
  height: 100%;
  height: 100dvh;
  /* Dynamic viewport height - modern solution */
  height: calc(var(--vh, 1vh) * 100);
  /* Custom property for dynamic viewport height */
  z-index: -1;
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0;
  width: 100%;
  transition: all 1s, z-index 0s;

  &.active {
    opacity: 1;
    z-index: 100000001;
  }
}

.cart-link,
.slidecart-overlay {
  cursor: pointer;
}

.close-cart-icon {
  position: relative;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: inherit;

  &:hover {
    color: rgba(var(--color-foreground), 0.75);
  }
}

.close-cart-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  // stroke-width: 1.5;
  display: block;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.close-cart-icon:hover svg {
  transform: rotate(90deg);
}

.slidecart-inner {
  height: fit-content;
}

.slidecart-wrapper {
  font-family: var(--FONT-STACK-HEADING);
  font-style: var(--FONT-STYLE-HEADING);
  position: fixed;
  overflow: hidden;
  top: 0px;
  bottom: 0px;
  height: 100vh;
  /* Fallback for browsers that do not support custom properties */
  height: -webkit-fill-available;
  height: -moz-available;
  height: stretch;
  height: 100dvh;
  /* Dynamic viewport height - modern solution */
  height: calc(var(--vh, 1vh) * 100);
  /* Custom property for dynamic viewport height */
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  right: 0px;
  transform: translate(100%, 0);
  z-index: 100000002;
  transition: all 0.5s;
  background-color: #ffffff;
  box-shadow: 0 0 14px 0 rgba(0, 0, 0, 0.09), 0 0 4px 0 rgba(0, 0, 0, 0.21),
    0 0 0 1px rgba(0, 0, 0, 0.09);
  padding: 0;
  display: flex;
  flex-direction: column;

  &.active {
    transform: translate(0, 0);
  }

  .slidecart-upsell {
    text-align: center;
    width: 100%;
    max-width: 100%;
    display: block;
  }

  .slidecart-item-wrapper,
  .slidecart-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .slidecart-title-wrapper {
    padding: 0 20px 0;
  }

  .slidecart-title {
    margin: 0 30px 0 0;
    font-weight: var(--FONT-WEIGHT-HEADING-BOLD);
    font-size: calc(1.375rem * var(--adjust-heading));
    display: block;
    font-family: var(--FONT-STACK-HEADING);
    font-style: var(--FONT-STYLE-HEADING);
    text-transform: uppercase;

    .cart-drawer__item-qty {
      display: inline-block;
      vertical-align: middle;
      font-size: calc(0.815rem * var(--adjust-heading));
      text-transform: none;
      font-weight: normal;

      &.hidden {
        display: none;
      }
    }
  }

  .slidecart-item-image-wrapper {
    img {
      max-width: 100px;
      max-height: 70px;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .slidecart-shipping-bar {
    padding: 0 20px 13px;
  }

  .slidecart-shipping-progress-text {
    // text-align: center;
    font-size: calc(0.815rem * var(--adjust-body));
    font-family: var(--FONT-STACK-BODY) !important;
    font-weight: 500;
    padding-bottom: 2px;
    color: var(--color-foreground);
  }

  .slidecart-shipping-bar-wrapper {
    width: 100%;
    height: 7px;
    border-radius: 6px;
    background-color: var(--text-alpha-10);
    color: var(--PRIMARY-BUTTONS-COLOR-BG);

    .slidecart-shipping-bar-percent {
      animation: gradient 8s ease infinite;
      background: #a6f0df;
      height: 7px;
      border-radius: 6px;
    }
  }
}

.slidecart-upsell-image-wrapper {
  img.slidecart-upsell-image {
    max-width: 200px;
    height: auto;
    width: 100%;
    max-height: 100%;
  }
}

.small-cart-note {
  text-align: center;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  margin-top: 20px;
}

.cart-footer {
  position: sticky;
  bottom: 0px;
  left: 0px;
  right: 0px;
  width: 100%;
  top: auto;
  background: #ffffff;
  padding: 13px 20px 16px;
  padding-bottom: max(16px, calc(16px + env(safe-area-inset-bottom)));
  font-size: 13px;
  font-weight: 400;
  line-height: normal;
}

.slidecart-header {
  position: sticky;
  top: 0px;
  left: 0px;
  right: 0px;
  width: 100%;
  bottom: auto;
  // padding-top: 40px;
}

.slidecart-inner-wrapper {
  overflow-y: scroll;
  flex-grow: 1;
  flex-shrink: 1;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* Internet Explorer 10+ */

  &::-webkit-scrollbar {
    display: none;
    /* WebKit */
  }
}

.slidecart-wrapper .slidecart-item-wrapper {
  padding: 10px 20px 0 20px;
  // gap: 20px;
  justify-content: flex-start;
  align-items: flex-start;
  display: flex;
}

// .slidecart-wrapper .slidecart-item-wrapper:not(:last-child) {
//   padding-bottom: 26px;
// }
.slidecart-item-image-wrapper {
  width: 140px;
  flex-shrink: 0;
  // margin-right: 15px;
}

.slidecart-item-title h2 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  padding-right: 20px;
}

.cart-item-bundle-items {
  list-style: none;
  font-size: 14px;
  line-height: 1.5;
  margin: 8px 0;
  padding-left: 0;
}

.cart-item-bundle-el {
  margin-bottom: 6px;
  color: #666;
  font-weight: 400;
}

.cart_item_selling_plan {
  background: 0;
  padding: 0.4rem;
  appearance: auto;
  font-size: 14px;
  margin-bottom: 5px;
}

.slidecart-item-qty-wrapper {
  margin-top: 15px;
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;
  align-items: center;
  justify-content: start;
  width: 80px;
  height: 30px;
  max-height: fit-content;
}

.slidecart-item-purchase-frequency {
  font-size: 14px;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.slidecart-item-qty-wrapper .removeItem {
  position: static;
  font-size: 12px;
  line-height: 1;
  background: none;
  width: auto;
  height: auto;
  cursor: pointer;
  color: #666;
  text-decoration: underline;
  border: none;
  font-family: var(--FONT-STACK-BODY);

  &:hover {
    color: #333;
  }

  &.disabled {
    color: #999;
    cursor: not-allowed;
    text-decoration: none;

    &:hover {
      color: #999;
    }
  }
}

.slidecart-item-details-wrapper {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: fit-content;
}

.slidecart-item-details-top {
  flex-grow: 1;
}

.slidecart-item-description-wrapper {
  margin-bottom: 10px;
  font-weight: 400 !important;
}

.slidecart-item-price {
  font-size: calc(0.815rem * var(--adjust-body));
  text-transform: uppercase;
  line-height: 1.25;
  font-weight: normal;
  font-family: var(--FONT-STACK-BODY);
  color: #231f20;
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
}

.slidecart-item-price p {
  font: inherit;
  margin: 0;
  line-height: inherit;
}

.slidecart-item-compare-price {
  font-size: 0.85em;
  color: rgba(35, 31, 32, 0.6);
  text-decoration: line-through;
  font-weight: normal;
  text-align: right;
}

.slidecart-qty-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.slidecart-qty-wrapper .qty-button {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44px;
  background: transparent;
  color: rgb(var(--color-foreground));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.slidecart-qty-wrapper .qty-button:first-child {
  left: 0;
  border-right: 0;
}

.slidecart-qty-wrapper .qty-button:last-child {
  right: 0;
  border-left: 0;
}

.slidecart-qty-wrapper .qty-button:hover {
  background: rgba(var(--color-foreground), 0.04);
}

.slidecart-wrapper
  .slidecart-item-qty-wrapper
  .slidecart-qty-wrapper
  .cart-qty-input::-webkit-outer-spin-button,
.slidecart-wrapper
  .slidecart-item-qty-wrapper
  .slidecart-qty-wrapper
  .cart-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.slidecart-wrapper
  .slidecart-item-qty-wrapper
  .slidecart-qty-wrapper
  .cart-qty-input {
  -moz-appearance: textfield;
  width: 80px;
  max-height: 30px;
  height: 30px;
  padding: 0 30px;
  // border: 1px solid rgba(var(--color-foreground), 0.2);
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 12px;
  line-height: calc(1 + 0.2 / var(--font-body-scale));
  color: rgb(var(--color-foreground));
  border-radius: 0;
}

.cart-shipping-info {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}

.cart-subtotal-info {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  padding: 5px 0;
}

.cart-subtotal-info h2 {
  font: inherit;
  margin: 0;
}

.cart-subtotal-info p {
  font: inherit;
  margin: 0;
}

/* Enhanced cart totals styling */
.cart-totals-enhanced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.cart-totals-left {
  font-weight: normal;
}

.cart-totals-right {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.cart-savings-message {
  background-color: #33d670;
  color: white;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.cart-totals-section {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 2px;
}

.cart-original-total {
  font-size: 14px;
  color: #999;
}

.cart-original-total del {
  color: #999;
  text-decoration: line-through;
}

.cart-discounted-total {
  font-size: 14px;
}

.slidecart-wrapper .button {
  margin-top: 15px;
  display: block;
  font-size: 23px;
  line-height: 1.43;
  border-radius: 500px;
  padding: 9px;
  text-align: center;
  background: #555;
  color: white;
}

.slidecart-wrapper .button:hover {
  background: #555;
}

.slidecart-wrapper .button ~ a {
  text-decoration: underline;
  margin-top: 15px;
  display: block;
  text-align: center;
  cursor: pointer;
}

.slidecart-checkout-wrapper {
  // padding: 20px 0 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.slidecart-checkout-button {
  font-family: var(--FONT-STACK-HEADING) !important;
  font-style: var(--FONT-STYLE-HEADING) !important;
  padding: 0 0;
  background: #231f20;
  width: 100%;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slidecart-checkout-button:hover {
  background: #231f20 !important;
}

.slidecart-checkout-button:hover::before {
  animation: slideInBottom 0.3s ease forwards;
}

.slidecart-checkout-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(128, 128, 128, 0.3);
  transform: translateY(100%);
  z-index: 1;
  animation: slideOutTop 0.3s ease forwards;
}

@keyframes slideInBottom {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes slideOutTop {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-100%);
  }
}

.checkout-text {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
}

.checkout-subtotal {
  font-size: 18px;
  font-weight: 700;
}

.checkout-subtotal p {
  margin: 0px;
}

.checkout-subtotal-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.cart-item-payment-options__button {
  font-size: 12px;
  line-height: normal;
  margin-top: 10px;
  position: relative;
  text-transform: uppercase;
  text-decoration: underline;
  border-radius: 6px;
  font-family: "HK Grotesk Wide Light";
  align-self: flex-start;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;

  @media screen and (max-width: 767px) {
    font-size: 11px;
  }
}

.cart-item-payment-options__button:hover {
  transform: translateY(-1px);
}

.cart-item-payment-options__button:active {
  transform: translateY(0);
}

.slidecart-payment-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.slidecart-payment-icons .payment-icon-list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.slidecart-payment-icons .payment-icon-list li {
  display: flex;
  align-items: center;
  justify-content: center;
}

.slidecart-payment-icons .payment-icon {
  height: 20px;
  width: auto;
  opacity: 1;
  transition: opacity 0.2s ease;
}

/* Trustpilot Widget Styling */
.slidecart-trustpilot-widget {
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.slidecart-trustpilot-widget .trustpilot-widget {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.slidecart-trustpilot-widget .trustpilot-widget a {
  color: #00b67a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.slidecart-trustpilot-widget .trustpilot-widget a:hover {
  text-decoration: underline;
}

.slidecart-wrapper .slidecart-upsell {
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
}

.slidecart-upsell-image-wrapper {
  width: 50px;
}

.slidecart-upsell-image-wrapper img {
  border-radius: 3px;
}

.trustpilot-widget iframe {
  transform: scale(0.8);
}

.slidecart-upsell-wrapper {
  padding: 15px 36px;
  max-width: calc(100% - 80px);
  margin: auto;
  background: rgba(0, 0, 0, 0.05);
  position: relative;
  margin-bottom: 28px;

  @media (max-width: 767px) {
    max-width: calc(100% - 32px);
  }
}

.slidecart-upsell-title {
  font: inherit;
  color: black;
  font-weight: 600;
  margin-bottom: 5px;
}

.slidecart-upsell-price {
  font: inherit;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.4);
  margin-bottom: 0;
}

button[add-upsell] {
  font-size: 12px;
  display: flex;
  white-space: nowrap;
  background: #000;
  color: white;
  font-weight: 700;
  border-radius: 3px;
  transition: all 0.2s ease-in;
  padding: 5px 7px;
  text-transform: uppercase;
}

button[add-upsell]:hover {
  background-color: #555;
}

.slidecart-upsell-wrapper .flickity-button.flickity-prev-next-button {
  width: 1rem;
  height: 1rem;
}

.slidecart-upsell-wrapper .flickity-button.flickity-prev-next-button.previous {
  left: 5px;
}

.slidecart-upsell-wrapper .flickity-button.flickity-prev-next-button.next {
  right: 5px;
}

.slidecart-upsell-wrapper .flickity-page-dots {
  position: static;
  margin-top: 5px;
}

.slidecart-upsell-wrapper .flickity-page-dots .dot {
  margin: 0 4px;
}

.slidecart-upsell-wrapper:empty {
  display: none;
}

.slidecart-item-image-wrapper {
  flex-shrink: 0;
}

.slidecart-item-title {
  color: inherit;
  text-decoration: none;
  font-size: calc(0.815rem * var(--adjust-body)) !important;
}

.slidecart-item-title h2 {
  margin-top: 0;
  margin-bottom: 0.5em;
  font-size: calc(0.815rem * var(--adjust-body)) !important;
  font-weight: 400;
  max-width: 150px;
}

.slidecart-item-title--bonus {
  cursor: default;

  h2 {
    color: inherit;
  }
}

.cart-item-bundle-items {
  list-style: none;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  line-height: normal;
}

.cart-item-bundle-el {
  margin-bottom: 0.2rem;
}

.cart_item_selling_plan {
  padding: 0.5rem 1.5rem 0.5rem 0.5rem;
  margin-bottom: 0.5rem;
}

.slidecart-item-price p {
  margin: auto;
}

/* Empty cart state styling */
.slidecart-empty-message {
  text-align: center;
  padding: 40px 20px;
  margin: 20px 0;
}

.slidecart-empty-text {
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
  line-height: 1.5;
}

.slidecart-empty-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.slidecart-empty-buttons .btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: inline-block;
  width: 400px;
  text-align: center;
}

@media screen and (max-width: 767px) {
  .slidecart-empty-buttons a {
    max-width: 100%;
    margin: auto;
  }
}

.slidecart-empty-buttons .btn--primary {
  background-color: #231f20;
  color: white;
  border: 2px solid #231f20;
}

.slidecart-empty-buttons .btn--primary:hover {
  background-color: transparent;
  color: #231f20;
}

.slidecart-empty-message.hidden {
  display: none;
}

// Countdown Timer Styling
.slidecart-countdown-message {
  padding: 12px 15px;
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 6px;
  margin: 15px 10px;
  font-size: 14px;
  border: 1px solid #e9ecef;
  font-weight: 500;
  transition: all 0.3s ease;

  #countdown-timer {
    background-color: #333;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    // font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 80px;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 11px;
    white-space: nowrap;
  }
}

// Pulse animation for last chance warning
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
