/* The receipt button: a small dark printer on a black page, and the white receipt that comes out of its slot. */
:root {
  --page: #000000;          /* the page */
  --body: #1c1e24;          /* the printer */
  --body-dark: #121318;
  --ink: #eef0f4;           /* the words on the printer */
  --muted: #8a8d96;
  --paper: #fbfaf6;         /* the receipt */
  --print: #2b2a28;         /* what is printed on it */
  --w: 212px;               /* the receipt's width */
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap */
html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Wix Madefor Display Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.printer {
  position: relative;
  display: grid;
  justify-items: center;
}

/* the room above the printer where the receipt comes out */
.printer__out {
  position: relative;
  z-index: 2;
  width: min(280px, calc(100vw - 48px));
  height: 300px;
  margin-bottom: -16px;
  pointer-events: none;
}

/* the receipt: the outer box leans and carries the shadow; the sheet inside grows upwards out of the slot, and what is
   printed is pinned to its top, so the first line comes out first */
.paper {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--w);
  margin-left: calc(var(--w) / -2);
  transform-origin: 50% 100%;
}

.paper__sheet {
  position: relative;
  height: 0;
  overflow: hidden;
  background: var(--paper);
}

.paper__body {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 16px 16px 20px;
  color: var(--print);
  font-family: 'Victor Mono Variable', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.paper__body p {
  margin: 0;
}

.r__shop {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.r__meta {
  color: #77736b;
  text-align: center;
}

.r__rule {
  height: 0;
  margin: 8px 0;
  border-top: 1.5px dashed #c9c3b7;
}

.r__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.r__total {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
}

.r__code {
  display: block;
  width: 120px;
  height: 26px;
  margin: 10px auto 6px;
}

.r__thanks {
  font-style: italic;
  text-align: center;
}

/* ---------------------------------------------------------------- the printer: it is the button */
.printer__btn {
  position: relative;
  z-index: 1;
  display: block;
  width: min(280px, calc(100vw - 48px));
  height: 92px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--body) 80%, #fff 6%), var(--body) 30%, var(--body-dark));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 18px 34px -18px rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* the slot the paper comes out of */
.printer__slot {
  position: absolute;
  left: 50%;
  top: 13px;
  width: calc(var(--w) + 24px);
  height: 6px;
  margin-left: calc((var(--w) + 24px) / -2);
  border-radius: 3px;
  background: #050506;
  box-shadow: inset 0 2px 2px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.09);
}

.printer__face {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.printer__icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.printer__label {
  display: block;
  height: 1.3em;
  overflow: hidden;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
}

.printer__label span {
  display: block;
}

.printer__btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

html[data-using='pointer'] .printer__btn:focus-visible {
  outline: none;
}
