.cart-drawer {
  --sheet-width: min(100dvw, 440px);
}

.cart-drawer > button:first-child {
  position: relative;
}

.cart-drawer > button:first-child [ui-slot=badge] {
  position: absolute;
  inset-block: -5px auto;
  inset-inline-end: -6px;
  min-width: 20px;
  height: 20px;
  padding-inline: 4px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #a4086e;
  color: #fff;
  font-weight: 700;
}

.cart-drawer #cart[popover] {
  background: #f7f3fc;
  color: #231638;
  max-height: 100dvh;
  margin: 0;
  box-shadow: 0 16px 48px #1e0b3d55;
}

.cart-drawer #cart[popover]:not(:popover-open) {
  display: none;
}

.cart-drawer #cart:popover-open {
  inset-inline-end: 0;
}

.cart-drawer #cart::backdrop {
  background: #160d2b88;
  backdrop-filter: blur(3px);
}

.cart-drawer #cart [ui-slot=sheet-header] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  padding: 16px 18px;
  background: #211436;
  color: #fff;
}

.cart-drawer #cart [ui-slot=sheet-header] h2 {
  font-size: 1.3rem;
  font-weight: 750;
}

.cart-drawer #cart [ui-slot=sheet-body] {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px;
}

.cart-drawer #cart ui-cart-drawer-items:has(.item) {
  display: grid;
  gap: 8px;
}

.cart-drawer #cart ui-cart-drawer-items .item,
.cart-drawer #cart [ui-slot=sheet-body] .footer {
  padding: 12px;
  border: 1px solid #e5dbef;
  border-radius: 14px;
  background: #fff;
}

.cart-drawer #cart [ui-slot=sheet-body] .footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #eee3f8;
  color: #3a1d53;
  font-weight: 750;
}

.cart-drawer #cart [ui-slot=sheet-footer] {
  gap: 8px;
  background: #fff;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
}

.cart-drawer #cart [ui-slot=sheet-footer] > a {
  background: #66185b;
  color: #fff;
}

@media (max-width: 769px) {
  .cart-drawer #cart[popover] {
    inset: auto 0 0;
    width: min(100%, 440px);
    height: auto;
    min-height: min(42vh, 380px);
    max-height: 86dvh;
    margin-inline: auto;
    border-radius: 22px 22px 0 0;
    overflow: hidden;
  }
}
