cart-notification {
  --nyys-cart-line: #e2e2e2;
  --nyys-cart-muted: #666;
  --nyys-cart-surface: #fff;
  display: block;
}

body.nyys-cart-drawer-open {
  overflow: hidden;
}

body.nyys-cart-drawer-open .easystore-chat-button,
body.nyys-cart-drawer-open .easystore-widget-window {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.nyys-cart-toast {
  position: fixed;
  z-index: 10060;
  left: 50%;
  bottom: 2rem;
  display: flex;
  max-width: calc(100vw - 3.2rem);
  min-height: 4.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 1rem 1.6rem;
  color: #fff;
  background: #171717;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  font-size: 1.3rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.8rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.nyys-cart-toast[hidden] {
  display: none;
}

.nyys-cart-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.nyys-cart-drawer__backdrop {
  position: fixed;
  z-index: 10030;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: rgba(10, 10, 10, 0.46);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

.nyys-cart-drawer {
  position: fixed;
  z-index: 10040;
  top: 0;
  right: 0;
  display: grid;
  width: min(46rem, 100vw);
  height: 100dvh;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  color: #171717;
  background: var(--nyys-cart-surface);
  box-shadow: -18px 0 54px rgba(0, 0, 0, 0.18);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

cart-notification.is-active .nyys-cart-drawer__backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 180ms ease;
}

cart-notification.is-active .nyys-cart-drawer {
  transform: translateX(0);
  visibility: visible;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.nyys-cart-drawer__header {
  grid-row: 1;
  display: flex;
  min-height: 8rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--nyys-cart-line);
  padding: 1.6rem 2rem;
}

.nyys-cart-drawer__header h2,
.nyys-cart-drawer__header p,
.nyys-cart-drawer__empty h3,
.nyys-cart-drawer__empty p {
  margin: 0;
}

.nyys-cart-drawer__header h2 {
  font-size: 2.4rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.nyys-cart-drawer__header p {
  margin-top: 0.3rem;
  color: var(--nyys-cart-muted);
  font-size: 1.2rem;
}

.nyys-cart-drawer__close {
  display: grid;
  width: 4.4rem;
  height: 4.4rem;
  flex: 0 0 4.4rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 1.3rem;
  color: #171717;
  background: #f1f1f1;
  cursor: pointer;
}

.nyys-cart-drawer__close .icon {
  width: 100%;
  height: 100%;
}

.nyys-cart-drawer__status {
  grid-row: 2;
  min-height: 0;
  margin: 0;
  padding: 0 2rem;
  color: #175f45;
  background: #eef8f3;
  font-size: 1.3rem;
  line-height: 1.45;
}

.nyys-cart-drawer__status:not(:empty) {
  min-height: 4rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nyys-cart-drawer__status.is-error {
  color: #8a1c16;
  background: #fff1f0;
}

.nyys-cart-drawer__scroll {
  grid-row: 3;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2rem 2rem;
  scrollbar-color: #aaa transparent;
  scrollbar-width: thin;
}

.nyys-cart-drawer__scroll::-webkit-scrollbar {
  width: 0.8rem;
}

.nyys-cart-drawer__scroll::-webkit-scrollbar-thumb {
  border-radius: 0.8rem;
  background: #aaa;
}

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

.nyys-cart-drawer__item {
  display: grid;
  grid-template-columns: 8.8rem minmax(0, 1fr);
  gap: 1.4rem;
  border-bottom: 1px solid var(--nyys-cart-line);
  padding: 1.8rem 0;
}

.nyys-cart-drawer__image {
  display: block;
  width: 8.8rem;
  height: 8.8rem;
  overflow: hidden;
  border-radius: 1.2rem;
  background: #f5f5f5;
}

.nyys-cart-drawer__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nyys-cart-drawer__item-copy {
  min-width: 0;
}

.nyys-cart-drawer__item-name {
  display: block;
  color: #171717;
  font-size: 1.4rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

.nyys-cart-drawer__variant,
.nyys-cart-drawer__price {
  margin: 0.4rem 0 0;
  font-size: 1.2rem;
  line-height: 1.4;
}

.nyys-cart-drawer__variant {
  color: var(--nyys-cart-muted);
}

.nyys-cart-drawer__price {
  color: #171717;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.nyys-cart-drawer__item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 1rem;
}

.nyys-cart-drawer__quantity {
  position: relative;
  display: grid;
  grid-template-columns: 4.4rem 5.6rem 4.4rem;
  border: 1px solid #d4d4d4;
  border-radius: 1.2rem;
  overflow: hidden;
}

.nyys-cart-drawer__quantity.is-updating::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.82);
  pointer-events: none;
}

.nyys-cart-drawer__quantity.is-updating::after {
  content: '';
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 1.8rem;
  height: 1.8rem;
  margin: -0.9rem 0 0 -0.9rem;
  border: 2px solid #c9c9c9;
  border-top-color: #171717;
  border-radius: 50%;
  animation: nyys-cart-quantity-spin 650ms linear infinite;
  pointer-events: none;
}

@keyframes nyys-cart-quantity-spin {
  to {
    transform: rotate(360deg);
  }
}

.nyys-cart-drawer__quantity button,
.nyys-cart-drawer__quantity input {
  width: 100%;
  height: 4.4rem;
  border: 0;
  padding: 0;
  color: #171717;
  background: #fff;
  text-align: center;
}

.nyys-cart-drawer__quantity button {
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nyys-cart-drawer__quantity .icon {
  width: 1.4rem;
  height: 1.4rem;
}

.nyys-cart-drawer__quantity input {
  appearance: textfield;
  background: #f5f5f5;
  caret-color: #171717;
  font-size: 1.6rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.nyys-cart-drawer__quantity input:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px #171717;
  background: #fff;
}

.nyys-cart-drawer__quantity input::selection {
  color: #fff;
  background: #171717;
}

.nyys-cart-drawer__quantity input::-webkit-inner-spin-button,
.nyys-cart-drawer__quantity input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.nyys-cart-drawer__remove {
  min-height: 4.4rem;
  border: 0;
  padding: 0.8rem 0;
  color: #6a3b35;
  background: transparent;
  font-size: 1.2rem;
  text-decoration: underline;
  text-underline-offset: 0.3rem;
  cursor: pointer;
}

.nyys-cart-drawer__subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.8rem 0;
  font-size: 1.4rem;
}

.nyys-cart-drawer__subtotal strong {
  font-size: 1.7rem;
  font-variant-numeric: tabular-nums;
}

.nyys-cart-drawer__empty {
  padding: 6rem 1rem;
  text-align: center;
}

.nyys-cart-drawer__empty h3 {
  font-size: 2rem;
}

.nyys-cart-drawer__empty p {
  margin-top: 0.8rem;
  color: var(--nyys-cart-muted);
  font-size: 1.3rem;
}

.nyys-cart-drawer__empty .button {
  margin-top: 2rem;
}

.nyys-cart-drawer__footer {
  grid-row: 4;
  border-top: 1px solid var(--nyys-cart-line);
  padding: 1.4rem 2rem calc(1.6rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
}

.nyys-cart-drawer__footer p {
  margin: 0 0 1rem;
  color: var(--nyys-cart-muted);
  font-size: 1.1rem;
  line-height: 1.45;
  text-align: center;
}

.nyys-cart-drawer__footer .button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.nyys-cart-drawer button:focus-visible,
.nyys-cart-drawer a:focus-visible,
.nyys-cart-drawer input:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

@media (min-width: 721px) {
  .nyys-cart-drawer__header h2 {
    font-size: 2.7rem;
  }

  .nyys-cart-drawer__header p,
  .nyys-cart-drawer__status {
    font-size: 1.45rem;
  }

  .nyys-cart-drawer__item-name {
    font-size: 1.6rem;
  }

  .nyys-cart-drawer__variant,
  .nyys-cart-drawer__price {
    font-size: 1.4rem;
  }

  .nyys-cart-drawer__remove {
    font-size: 1.4rem;
  }

  .nyys-cart-drawer__subtotal {
    font-size: 1.6rem;
  }

  .nyys-cart-drawer__subtotal strong {
    font-size: 1.9rem;
  }

  .nyys-cart-drawer__footer p {
    font-size: 1.3rem;
  }
}

@media (max-width: 720px) {
  .nyys-cart-toast {
    bottom: calc(var(--nyys-mobile-nav-height, 64px) + 1.2rem + env(safe-area-inset-bottom, 0px));
  }

  .nyys-cart-drawer {
    top: 0;
    bottom: calc(var(--nyys-mobile-nav-height, 64px) + env(safe-area-inset-bottom, 0px));
    width: 100vw;
    height: auto;
  }

  .nyys-cart-drawer__header,
  .nyys-cart-drawer__scroll,
  .nyys-cart-drawer__footer {
    padding-right: 1.6rem;
    padding-left: 1.6rem;
  }

  .nyys-cart-drawer__item {
    grid-template-columns: 7.6rem minmax(0, 1fr);
  }

  .nyys-cart-drawer__image {
    width: 7.6rem;
    height: 7.6rem;
  }

  .nyys-cart-drawer__quantity {
    grid-template-columns: 4.4rem 5.2rem 4.4rem;
  }

  .nyys-cart-drawer__quantity input {
    background: #fff;
  }

  .nyys-cart-drawer__footer {
    padding-bottom: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nyys-cart-drawer,
  .nyys-cart-drawer__backdrop,
  .nyys-cart-toast {
    transition-duration: 0.01ms !important;
  }

  .nyys-cart-drawer__quantity.is-updating::after {
    animation: none;
  }
}
