.shop-dialog-open { overflow: hidden; }

.shop-cart-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 31rem);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--stroke, #383c40);
  border-block: 0;
  border-right: 0;
  background: var(--surface, #161616);
  color: var(--text, #f4f4f3);
  box-shadow: -1.2rem 0 4rem #0005;
}
.shop-cart-drawer::backdrop { background: #090a0cbd; }
.shop-cart-drawer[open] { animation: shop-drawer-enter 220ms ease-out; }
@keyframes shop-drawer-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }

.shop-cart-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 100%; height: 100%; }
.shop-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 1.8rem);
  padding-top: max(1rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--stroke, #383c40);
  background: var(--surface-soft, #191c1e);
}
.shop-cart-header h2 { font-size: clamp(1.38rem, 3vw, 1.7rem); line-height: 1.1; letter-spacing: -.04em; }
.shop-cart-header button, .shop-cart-stepper button {
  display: grid;
  align-items: center;
  justify-items: center;
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
}
.shop-cart-header button {
  border: 1px solid var(--stroke, #383c40);
  border-radius: 50%;
  font-size: 1.55rem;
  font-weight: 400;
}
.shop-cart-header button:hover, .shop-cart-stepper button:not(:disabled):hover { background: var(--surface-hover, #2d3033); }
.shop-cart-drawer :focus-visible { outline: 2px solid var(--accent, #bcc7d1); outline-offset: 3px; }
.shop-cart-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.35rem clamp(1rem, 4vw, 1.8rem) max(1.5rem, env(safe-area-inset-bottom));
}
.shop-cart-empty { display: grid; justify-items: start; gap: .9rem; padding: .75rem 0 1.2rem; }
.shop-cart-empty p, .shop-cart-help { color: var(--text-muted, #b9bec3); }
.shop-cart-help { font-size: .9rem; line-height: 1.5; }
.shop-cart-help a, .shop-cart-qr-links a { text-decoration: underline; text-underline-offset: .2em; }
.shop-cart-status { color: var(--text, #f4f4f3); font-size: .9rem; line-height: 1.45; }
.shop-cart-status:not(:empty) { padding-block: .55rem; }

.shop-cart-list { display: grid; margin: 0; padding: 0; list-style: none; }
.shop-cart-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid var(--stroke, #383c40); }
.shop-cart-item h3 { font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.shop-cart-item p { margin-top: .3rem; color: var(--text-muted, #b9bec3); font-size: .87rem; }
.shop-cart-controls { display: grid; justify-items: end; }
.shop-cart-stepper {
  display: grid;
  grid-template-columns: 2.75rem minmax(1.65rem, auto) 2.75rem;
  align-items: center;
  text-align: center;
  overflow: hidden;
  border: 1px solid var(--stroke, #383c40);
  border-radius: .38rem;
  background: var(--surface-raised, #242628);
  font-variant-numeric: tabular-nums;
}
.shop-cart-stepper button:focus-visible { outline-offset: -3px; }
.shop-cart-stepper button:disabled { color: var(--control-line, #73787d); cursor: default; }
.shop-cart-text-action, .shop-cart-controls > button {
  min-height: 2.75rem;
  padding: .25rem .35rem;
  background: transparent;
  border: 0;
  color: var(--text-muted, #b9bec3);
  text-decoration: underline;
  text-underline-offset: .2em;
  font-size: .87rem;
}
.shop-cart-text-action:hover, .shop-cart-controls > button:hover { color: var(--text, #f4f4f3); }
.shop-cart-summary { display: grid; gap: .65rem; padding-top: 1.35rem; }
.shop-cart-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.shop-cart-primary, .shop-cart-secondary {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem .85rem;
  border: 1px solid var(--action, #d9dfe4);
  border-radius: .37rem;
  text-align: center;
  font-size: .92rem;
  font-weight: 700;
}
.shop-cart-primary { background: var(--action, #d9dfe4); color: var(--on-action, #191c1e); }
.shop-cart-primary:hover:not(:disabled) { background: var(--action-hover, #edf0f2); }
.shop-cart-primary:disabled { opacity: .55; cursor: default; }
.shop-cart-secondary { border-color: var(--control-line, #73787d); }
.shop-cart-secondary:hover { background: var(--surface-hover, #2d3033); }

.shop-cart-form h3, .shop-cart-receipt h3 { margin: .15rem 0 .85rem; font-size: 1.32rem; }
.shop-cart-form fieldset { display: grid; gap: .7rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.shop-cart-form label { display: grid; gap: .35rem; font-size: .92rem; font-weight: 650; }
.shop-cart-form :is(input, textarea) {
  width: 100%;
  min-height: 2.75rem;
  padding: .6rem .68rem;
  border: 1px solid var(--control-line, #73787d);
  border-radius: .35rem;
  background: var(--surface-soft, #191c1e);
  color: var(--text, #f4f4f3);
  font-size: 1rem;
  font-weight: 400;
}
.shop-cart-form textarea { resize: vertical; }
.shop-cart-submit-actions { display: grid; gap: .3rem; margin-top: .4rem; }
.shop-cart-receipt { display: grid; gap: .85rem; }
.shop-cart-receipt h3 { margin-bottom: 0; }
.shop-cart-reference { color: var(--accent, #bcc7d1); font-weight: 700; overflow-wrap: anywhere; }
.shop-cart-receipt-item { padding: .72rem 0; border-bottom: 1px solid var(--stroke, #383c40); line-height: 1.45; overflow-wrap: anywhere; }
.shop-cart-deuna { border: 1px solid var(--stroke, #383c40); border-radius: .4rem; padding: .8rem .85rem; background: var(--surface-soft, #191c1e); }
.shop-cart-deuna summary { min-height: 1.45rem; font-weight: 700; }
.shop-cart-deuna[open] summary { margin-bottom: .75rem; }
.shop-cart-deuna img { display: block; width: min(100%, 13.125rem); height: auto; margin: .75rem auto; border-radius: .25rem; }
.shop-cart-recipient { display: grid; gap: .25rem; margin-top: .8rem; font-size: .87rem; }
.shop-cart-recipient span { color: var(--text-muted, #b9bec3); }
.shop-cart-qr-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem 1rem; padding-bottom: .85rem; font-size: .88rem; }

@media (max-width: 360px) {
  .shop-cart-row { grid-template-columns: minmax(0, 1fr); }
  .shop-cart-controls { display: flex; align-items: center; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-cart-drawer[open] { animation: none; }
}
