.commerce-cart-trigger {
  position: fixed;
  z-index: 70;
  right: 24px;
  bottom: 24px;
  width: 282px;
  min-width: 282px;
  height: 66px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: radial-gradient(circle at 15% 0, rgba(231,0,11,.13), transparent 42%), rgba(20,20,20,.97);
  box-shadow: 0 20px 55px rgba(0,0,0,.32);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.commerce-cart-trigger[hidden] { display: none; }
.commerce-cart-trigger:hover {
  border-color: rgba(250,45,55,.48);
  transform: translateY(-2px);
  box-shadow: 0 24px 64px rgba(0,0,0,.38);
}

.commerce-cart-trigger-icon {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e7000b;
}

.commerce-cart-trigger-icon > svg { width: 19px; height: 19px; }
.commerce-cart-trigger-icon > strong {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #171717;
  border: 2px solid #171717;
  border-radius: 50%;
  background: #fff;
  font-size: 9px;
  line-height: 1;
}

.commerce-cart-trigger-copy {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.commerce-cart-trigger-copy > small {
  color: rgba(255,255,255,.76);
  font: 500 8px/12px "DM Mono", monospace;
  letter-spacing: .13em;
  white-space: nowrap;
}

.commerce-cart-trigger-copy > b {
  margin: 0;
  color: #fff;
  font: 700 13px/17px Syne, sans-serif;
}

.commerce-cart-trigger > i {
  margin-left: auto;
  color: rgba(255,255,255,.58);
  font-size: 16px;
  font-style: normal;
}

.commerce-cart-trigger.cart-updated { animation: cart-trigger-attention .48s cubic-bezier(.2,.85,.25,1); }

@keyframes cart-trigger-attention {
  0%, 100% { transform: translateY(0) scale(1); }
  42% { transform: translateY(-4px) scale(1.025); }
}

.commerce-cart-backdrop {
  position: fixed;
  z-index: 119;
  inset: 0;
  background: rgba(0,0,0,.54);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.commerce-cart-drawer {
  position: fixed;
  z-index: 120;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100%);
  padding: 28px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: #151515;
  box-shadow: -24px 0 70px rgba(0,0,0,.4);
  visibility: hidden;
  transform: translateX(105%);
  transition: transform .28s ease, visibility 0s linear .28s;
}

.commerce-cart-drawer.open {
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}

.commerce-cart-drawer > header {
  padding-bottom: 22px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.commerce-cart-drawer header small {
  color: #fa2d37;
  font:500 9px "DM Mono", monospace;
  letter-spacing: .25em;
}

.commerce-cart-drawer header h2 {
  margin: 8px 0 0;
  font: 700 25px Syne, sans-serif;
}

.commerce-cart-drawer header button {
  width: 44px;
  height: 44px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  font-size: 25px;
  cursor: pointer;
}

.commerce-cart-items {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.commerce-cart-item {
  padding: 17px 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 44px;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.commerce-cart-item img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.commerce-cart-item > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.commerce-cart-item small {
  color: #fa2d37;
  font:500 9px "DM Mono", monospace;
  letter-spacing: .12em;
}

.commerce-cart-item strong {
  margin-top: 6px;
  font-size: 13px;
  line-height: 18px;
}

.commerce-cart-item span {
  margin-top: 5px;
  color: rgba(255,255,255,.62);
  font-size: 11px;
}

.commerce-cart-item label {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.62);
  font-size: 10px;
}

.commerce-cart-item input {
  width: 58px;
  height: 44px;
  margin-left: 0;
  padding: 0 7px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: #1c1c1c;
}

.commerce-cart-item > button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: rgba(255,255,255,.45);
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.commerce-cart-empty {
  margin: auto;
  color: rgba(255,255,255,.44);
  text-align: center;
}

.commerce-cart-empty[hidden] { display: none; }
.commerce-cart-empty span {
  width: 54px;
  height: 54px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
}

.commerce-cart-empty strong {
  display: block;
  color: #fff;
  font-family: Syne, sans-serif;
}

.commerce-cart-empty p { font-size: 12px; }
.commerce-cart-drawer > footer {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.commerce-cart-drawer > footer > div {
  display: flex;
  justify-content: space-between;
}

.commerce-cart-drawer > footer > div span { color: rgba(255,255,255,.62); }
.commerce-cart-drawer > footer > a {
  min-height: 52px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  border-radius: 13px;
  background: #e7000b;
  font-size: 13px;
  font-weight: 700;
}

.commerce-cart-drawer > footer > button {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  color: rgba(255,255,255,.58);
  border: 0;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.cart-open { overflow: hidden; }
.commerce-cart-toast {
  position: fixed;
  z-index: 72;
  right: 24px;
  bottom: 100px;
  width: min(440px, calc(100vw - 32px));
  min-height: 82px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  color: #fff;
  border: 1px solid rgba(250,45,55,.26);
  border-radius: 17px;
  background: rgba(20,20,20,.97);
  box-shadow: 0 24px 70px rgba(0,0,0,.36);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.commerce-cart-toast[hidden],
.commerce-cart-toast-icon[hidden],
.commerce-cart-toast > img[hidden] { display: none; }
.commerce-cart-toast.visible { opacity: 1; transform: none; pointer-events: auto; }
.commerce-cart-toast-icon, .commerce-cart-toast > img { width: 48px; height: 48px; border-radius: 12px; }
.commerce-cart-toast-icon {
  display: grid;
  place-items: center;
  color: #fff;
  background: #e7000b;
}

.commerce-cart-toast-icon svg { width: 20px; }
.commerce-cart-toast > img { object-fit: contain; background: #fff; }
.commerce-cart-toast > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.commerce-cart-toast small {
  color: #fa2d37;
  font:500 8px "DM Mono", monospace;
  letter-spacing: .18em;
}

.commerce-cart-toast strong {
  margin-top: 5px;
  overflow: hidden;
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commerce-cart-toast > div > span {
  margin-top: 4px;
  color: rgba(255,255,255,.62);
  font-size: 10px;
}

.commerce-cart-toast > button {
  min-height: 44px;
  padding: 0 13px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.commerce-cart-toast > button:hover { background: rgba(255,255,255,.1); }
.commerce-cart-trigger:focus-visible,
.commerce-cart-drawer button:focus-visible,
.commerce-cart-drawer a:focus-visible,
.commerce-cart-drawer input:focus-visible,
.commerce-cart-toast > button:focus-visible {
  outline: 2px solid #fa2d37;
  outline-offset: 2px;
}

.route-checkout .commerce-cart-trigger,
.route-checkout .commerce-cart-toast { display: none !important; }

body:has(.privacy-consent.is-visible) .commerce-cart-trigger { bottom: 156px; }
body:has(.privacy-consent.is-visible) .commerce-cart-toast { bottom: 234px; }

@media (min-width: 1024px) {
  /* Keep the persistent cart clear of the product purchase controls. */
  .route-product_detail .commerce-cart-trigger { top: 96px; bottom: auto; }
  .route-product_detail .commerce-cart-toast { top: 174px; bottom: auto; }
}

@media (max-width: 820px) {
  body:has(.privacy-consent.is-visible) .commerce-cart-trigger { top: 88px; bottom: auto; }
  body:has(.privacy-consent.is-visible) .commerce-cart-toast { top: 158px; bottom: auto; }
}

@media (max-width: 767px) {
  body:has(.commerce-cart-trigger:not([hidden])) {
    padding-bottom: max(154px, calc(142px + env(safe-area-inset-bottom)));
  }

  .commerce-cart-trigger {
    right: 12px;
    bottom: max(94px, calc(82px + env(safe-area-inset-bottom)));
    left: 12px;
    width: auto;
    min-width: 0;
    height: 58px;
    padding: 0 14px;
    gap: 11px;
    border-radius: 16px;
  }

  .commerce-cart-trigger-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; }
  .commerce-cart-trigger-icon > svg { width: 17px; height: 17px; }
  .commerce-cart-trigger-copy > small { font-size: 7px; letter-spacing: .1em; }
  .commerce-cart-trigger-copy > b { font-size: 12px; }
  .commerce-cart-toast {
    right: 12px;
    bottom: max(164px, calc(152px + env(safe-area-inset-bottom)));
    width: calc(100vw - 24px);
    grid-template-columns: 42px minmax(0,1fr) auto;
  }

  .commerce-cart-toast-icon, .commerce-cart-toast > img { width: 42px; height: 42px; }
  .commerce-cart-toast > button { padding: 0 10px; }
  .commerce-cart-drawer {
    width: 100%;
    padding: max(18px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
  }

  .commerce-cart-item {
    grid-template-columns: 66px minmax(0,1fr) 44px;
    gap: 11px;
  }

  .commerce-cart-item img { width: 66px; height: 66px; }
}

@media (max-width: 360px) {
  .commerce-cart-trigger-copy > small { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
  .commerce-cart-toast { padding: 10px; gap: 9px; }
  .commerce-cart-toast > button { padding: 0 8px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .commerce-cart-trigger.cart-updated { animation: none; }
}
