#shop-dialog {
  --shop-paper: #f7f6f2;
  --shop-ink: #1b1a18;
  --shop-muted: #655f59;
  --shop-line: #d3cfc7;
  --shop-accent: #c74d2e;
  color-scheme: light;
  color: var(--shop-ink);
  background: var(--shop-paper);
  font-family: Inter, Arial, sans-serif;
  border: 1px solid var(--shop-line);
  border-radius: 0;
  padding: 0;
  width: min(880px, calc(100vw - 44px));
  max-width: 100%;
  max-height: calc(100dvh - 48px);
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 90px #17130f35;
}
#shop-dialog::backdrop { background: #15120f9c; }
body:has(#shop-dialog[open]) { overflow: hidden; }
#shop-dialog, #shop-dialog * { box-sizing: border-box; }
#shop-dialog button, #shop-dialog input { font: inherit; }
#shop-dialog button { cursor: pointer; }
#shop-dialog :focus-visible { outline: 2px solid var(--shop-accent); outline-offset: 3px; }
#shop-dialog #shop-title:focus { outline: none; }
#shop-dialog form[method="dialog"] > button {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--shop-line);
  border-radius: 50%;
  background: var(--shop-paper);
  color: var(--shop-ink);
  font: 400 1.5rem/1 Arial, sans-serif;
}
#shop-dialog form[method="dialog"] > button:hover { border-color: var(--shop-ink); }
.shop-detail { display: grid; grid-template-columns: 1fr 1fr; }
.shop-image { display: grid; align-items: center; min-width: 0; background: #e8e6e0; }
.shop-image img { display: block; width: 100%; max-height: min(560px, 75vh); object-fit: contain; }
.shop-detail-body { align-self: center; padding: 64px 36px 40px; }
.shop-brand { margin: 0 0 9px; font: 500 .75rem/1.3 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: .08em; }
#shop-title { margin: 0; font: 600 clamp(1.7rem, 3.3vw, 2.55rem)/1.08 Inter, Arial, sans-serif; letter-spacing: -.05em; overflow-wrap: anywhere; }
.shop-price { margin: 16px 0 0; font-size: 1.28rem; }
.shop-description { margin: 23px 0 28px; color: var(--shop-muted); font-size: 1rem; line-height: 1.55; }
.shop-sizes { padding: 0; margin: 0 0 24px; border: 0; }
.shop-sizes legend { padding: 0; margin-bottom: 8px; font-size: .9rem; }
.shop-size { display: inline-block; margin: 0 6px 6px 0; position: relative; cursor: pointer; }
.shop-size input { position: absolute; opacity: 0; left: 50%; top: 50%; margin: 0; }
.shop-size span { display: grid; place-items: center; min-width: 42px; min-height: 39px; padding: 3px 9px; border: 1px solid var(--shop-line); font-size: .875rem; }
.shop-size input:checked + span { background: var(--shop-ink); color: var(--shop-paper); border-color: var(--shop-ink); }
.shop-size input:focus-visible + span { outline: 2px solid var(--shop-accent); outline-offset: 2px; }
.shop-primary { display: block; padding: 13px 18px; min-height: 46px; width: 100%; background: var(--shop-ink); color: #fff; border: 0; border-radius: 0; text-align: center; }
.shop-primary:hover { background: #453d36; }
.shop-demo-note { margin-top: 15px; color: var(--shop-muted); font-size: .8125rem; }
.shop-source { display: inline-block; margin-top: 9px; color: var(--shop-muted); font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; }
.shop-source:hover { color: var(--shop-accent); }
#shop-dialog[data-view="cart"], #shop-dialog[data-view="complete"] {
  margin: 0 0 0 auto;
  width: min(515px, 100vw);
  min-height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  border-width: 0 0 0 1px;
}
.shop-bag { display: flex; flex-direction: column; min-height: calc(100dvh - 1px); padding: 75px clamp(20px, 3vw, 36px) 32px; }
.shop-bag > h2 { padding-bottom: 25px; border-bottom: 1px solid var(--shop-line); }
.shop-lines { list-style: none; padding: 0; margin: 0 0 26px; }
.shop-line { position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 13px; padding: 22px 0; border-bottom: 1px solid var(--shop-line); }
.shop-thumb { width: 100%; height: 94px; object-fit: contain; background: #e9e6e0; }
.shop-line-details { min-width: 0; }
.shop-line-details .shop-brand { font-size: .72rem; margin-bottom: 5px; }
.shop-line-name { margin: 0 0 4px; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.shop-muted { margin: 0; font-size: .875rem; line-height: 1.5; color: var(--shop-muted); }
.shop-line-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.shop-stepper { display: inline-flex; align-items: center; border: 1px solid var(--shop-line); }
.shop-stepper button, .shop-remove { border: 0; background: transparent; color: var(--shop-ink); }
.shop-stepper button { min-width: 30px; min-height: 33px; padding: 0 4px; }
.shop-stepper button:disabled { opacity: .35; cursor: default; }
.shop-stepper span { min-width: 14px; text-align: center; font-size: .88rem; }
#shop-dialog .shop-remove { padding: 7px 0; font-size: .8125rem; text-decoration: underline; text-underline-offset: 3px; color: var(--shop-muted); }
#shop-dialog .shop-remove:hover { color: var(--shop-accent); }
.shop-line-price { white-space: nowrap; font-size: .9rem; font-weight: 500; }
.shop-summary { margin-top: auto; }
.shop-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: 1.25rem; }
.shop-total strong { font-weight: 600; }
.shop-summary .shop-primary, .shop-empty .shop-primary, .shop-complete .shop-primary { margin-top: 22px; }
.shop-empty { margin-top: 8px; }
.shop-complete > p { color: var(--shop-muted); }
@media (max-width: 650px) {
  #shop-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .shop-detail { grid-template-columns: 1fr; }
  .shop-image img { height: 32dvh; min-height: 160px; max-height: 280px; }
  .shop-detail-body { padding: 24px; }
  .shop-description { margin: 15px 0 18px; }
  #shop-dialog[data-view="cart"], #shop-dialog[data-view="complete"] { width: min(515px, 100vw); }
}
@media (max-width: 380px) {
  .shop-line { grid-template-columns: 58px minmax(0, 1fr); }
  .shop-line-price { grid-column: 2; }
  .shop-line-tools { gap: 6px; }
}
