/* Shipping radio buttons with the dot that slides between the options: native radios, one drop for the dot */

*, *::before, *::after { box-sizing: border-box; margin: 0; }

:root {
  --page: #000000;            /* the page */
  --panel-top: #141417;       /* the top of the panel */
  --panel-bottom: #0b0b0d;    /* the bottom of the panel */
  --card: #17171b;            /* an option card at rest */
  --card-on: #1c1d24;         /* the chosen card */
  --line: rgba(255, 255, 255, 0.08); /* the thin edges */
  --ink: #f3f3f6;             /* the main words */
  --muted: #8d8d99;           /* the small words */
  --accent: #9db4ff;          /* the dot, the lit edge, the focus ring */
  --acc-12: rgba(157, 180, 255, 0.12); /* the accent, faint (set again by script.js) */
  --acc-16: rgba(157, 180, 255, 0.16);
  --acc-35: rgba(157, 180, 255, 0.35);
  --acc-60: rgba(157, 180, 255, 0.6);
}

html, body { height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* the panel of the checkout step */
.ship {
  position: relative;
  width: min(384px, calc(100vw - 32px));
  padding: clamp(12px, 3.4vh, 20px) clamp(12px, 4vw, 18px);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px var(--line),
    0 24px 60px -20px rgba(0, 0, 0, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.6);
}

.ship__set { border: 0; padding: 0; min-width: 0; }

.ship__head {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 2px clamp(8px, 2.2vh, 14px);
  float: left;
}
.ship__head + * { clear: both; }
.ship__title { font-size: 14px; font-weight: 640; font-stretch: 104%; letter-spacing: -0.005em; }
.ship__shop { font-size: 11.5px; color: var(--muted); font-weight: 500; font-stretch: 112%; letter-spacing: 0.02em; }

.list {
  position: relative;
  display: grid;
  gap: clamp(5px, 1.5vh, 9px);
}

/* one option: a card with the ring, the words, the icon and the price */
.opt {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  align-items: center;
  gap: 12px;
  height: clamp(44px, 11.6vh, 58px);
  padding: 0 14px 0 14px;
  border-radius: 13px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}
.opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: inherit;
}
.opt.is-on {
  background: var(--card-on);
  box-shadow: inset 0 0 0 1px var(--acc-16), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 24px -14px rgba(0, 0, 0, 0.9);
}

/* the lit edge of the chosen card: a 1px ring of accent, brighter at the top, that fades in */
.opt__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, var(--accent), var(--acc-35) 55%, var(--acc-60));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  pointer-events: none;
}
/* a soft wash of light along the top of the chosen card */
.opt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 18% 0%, var(--acc-12), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.opt.is-on::after { opacity: 1; }

/* the empty radio circle */
.opt__ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.22);
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.05), transparent 70%);
  transition: box-shadow 0.3s ease;
}
.opt.is-on .opt__ring { box-shadow: inset 0 0 0 1.5px var(--accent); }

.opt__text { display: grid; gap: 2px; min-width: 0; }
.opt__name { font-size: 14px; font-weight: 600; font-stretch: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: font-stretch 0.4s ease; }
.opt.is-on .opt__name { font-stretch: 108%; }
.opt__meta { font-size: 12px; color: var(--muted); font-weight: 470; }
.opt__ic {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.35s ease;
}
.opt.is-on .opt__ic { stroke: var(--ink); }
.opt__price {
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

/* the option that cannot be chosen */
.opt.is-off { cursor: not-allowed; background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.opt.is-off .opt__ring { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.1); background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 4px); }
.opt.is-off .opt__name, .opt.is-off .opt__price { color: #5f5f69; }
.opt.is-off .opt__meta { color: #4d4d56; }
.opt.is-off .opt__ic { stroke: #45454d; }
.opt.is-off s { text-decoration-thickness: 1px; text-decoration-color: rgba(255, 255, 255, 0.35); }

/* the keyboard focus: a ring outside the card */
.opt.is-focus { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (hover: hover) {
  .opt:not(.is-off):not(.is-on):hover { background: #1a1a1f; }
  .opt:not(.is-off):not(.is-on):hover .opt__ring { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4); }
}

/* the one dot of all the radios, redrawn as a drop while it travels */
.drop {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.drop__body { fill: var(--accent); }

/* the summary under the options */
.sum {
  margin-top: clamp(10px, 2.6vh, 16px);
  padding: clamp(8px, 2.2vh, 12px) 4px 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: clamp(3px, 0.9vh, 6px);
}
.sum__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sum__val { color: #c9c9d2; }
.sum__flip { display: inline-block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.sum__flipin { display: inline-block; }
.sum__total { margin-top: 2px; color: var(--ink); font-size: 14px; font-weight: 600; }

/* the rolling total: one column of digits per place */
.odo {
  display: inline-flex;
  font-size: 19px;
  font-weight: 650;
  font-stretch: 104%;
  font-variant-numeric: tabular-nums;
  line-height: 1.2em;
  height: 1.2em;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.odo__ch { display: inline-block; }
.odo__col { display: inline-flex; flex-direction: column; }
.odo__col > span { height: 1.2em; }
.odo__wrap { display: inline-block; height: 1.2em; overflow: hidden; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #f6f6f8;
  stroke: #0b0b0d;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  opacity: 0;
  z-index: 5;
}

@media (max-width: 380px) {
  .opt { gap: 10px; padding: 0 12px; }
  .opt__ic { display: none; }
  .opt { grid-template-columns: 22px 1fr auto; }
}
