.overlay {
  z-index: 60;
  background: rgb(12 13 15 / 54%);
  backdrop-filter: blur(3px);
}

.drawer {
  left: 50%;
  right: auto;
  bottom: 0;
  top: auto;
  width: min(100%, 720px);
  height: min(88dvh, 820px);
  max-height: 88dvh;
  border: 1px solid #e6e6e3;
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  overflow: hidden;
  transform: translate(-50%, 105%);
  transition: transform .38s cubic-bezier(.22,.8,.25,1);
  z-index: 61;
  box-shadow: 0 -18px 70px rgb(0 0 0 / 20%);
}

.drawer.open {
  transform: translate(-50%, 0);
}

.drawer-handle {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  cursor: grab;
  touch-action: none;
}

.drawer-handle span {
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 9px;
  background: #d2d2cf;
}

.drawer-head {
  padding: 9px 26px 17px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.drawer-head h2 {
  margin: 4px 0 2px;
  font-size: 22px;
  letter-spacing: -.04em;
}

.drawer-head h2 span { color: #878787; font-size: 16px; font-weight: 500; }
.drawer-head p { margin: 0; color: #777a80; font-size: 11px; }
.drawer-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.drawer-list { padding: 16px 26px 10px; overflow: visible; }

.empty {
  min-height: 155px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: none;
  margin: 0;
  text-align: center;
}

.empty-cart-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 3px;
  border-radius: 50%;
  background: #f1f1ef;
  color: #999;
  font-size: 22px;
}

.empty b { color: var(--ink); font-size: 14px; }
.empty p { max-width: 300px; margin: 0 0 8px; color: #777a80; font-size: 12px; }

.cart-row {
  display: grid;
  grid-template-columns: 88px minmax(0,1fr);
  gap: 16px;
  padding: 14px;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.cart-row img { width: 88px; height: 88px; border-radius: 9px; object-fit: cover; }
.cart-row-body { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cart-category { overflow: hidden; color: #8a8a88; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.cart-row h3 { margin: 4px 0 11px; color: var(--ink); font-size: 13px; line-height: 1.35; }
.cart-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 12px; }
.qty { gap: 11px; }
.qty span { min-width: 13px; text-align: center; }
.qty button { width: 27px; height: 27px; font-size: 15px; transition: background .16s,color .16s,border-color .16s; }
.qty button:hover { border-color: var(--ink); background: var(--ink); color: white; }
.remove-item { align-self: flex-start; margin-top: 7px; padding: 0; border: 0; background: transparent; color: #888; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.remove-item:hover { color: var(--red); }

.cart-summary {
  margin: 0 26px 12px;
  padding: 15px 0 4px;
  border-top: 1px solid var(--line);
}

.cart-summary h3 { margin: 0 0 11px; font-size: 12px; font-weight: 800; }
.summary-line,.summary-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 11px; }
.summary-muted { color: #888; }
.discount-line { color: #17804b; }
.summary-total { margin-top: 5px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 800; }
.promo-row { margin-top: 12px; }
.promo-row label { display: block; margin-bottom: 6px; color: #666; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.promo-row>div { display: flex; gap: 8px; }
.promo-row input { min-width: 0; height: 38px; flex: 1; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; outline: 0; font-size: 11px; }
.promo-row input:focus { border-color: var(--red); }
.promo-apply { height: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 10px; font-weight: 800; }
.promo-apply:hover { border-color: var(--ink); }
.promo-row p { min-height: 12px; margin: 5px 0 0; color: #777; font-size: 10px; }

.drawer-foot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  flex: 0 0 auto;
  padding: 13px 26px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: white;
}

.drawer-foot .btn { width: 100%; min-height: 44px; font-size: 11px; }
.drawer-foot .btn-light { justify-content: center; }
.drawer-foot button:disabled { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }
.drawer [hidden] { display: none !important; }

@media (max-width: 640px) {
  .drawer { width: 100%; height: min(90dvh, 820px); max-height: 90dvh; border-radius: 22px 22px 0 0; }
  .drawer-head { padding: 7px 20px 14px; }
  .drawer-list { padding: 12px 16px 6px; }
  .cart-row { grid-template-columns: 72px minmax(0,1fr); gap: 12px; padding: 10px; border-radius: 11px; }
  .cart-row img { width: 72px; height: 78px; }
  .cart-row h3 { font-size: 12px; }
  .cart-row-bottom { font-size: 11px; }
  .qty { gap: 8px; }
  .cart-summary { margin-inline: 20px; }
  .drawer-foot { padding-inline: 16px; gap: 8px; }
  .drawer-foot .btn { padding-inline: 10px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
}
