/* ARM-01 reservations (#buy on arm.html). Loads after site.css and arm.css and uses
   only site tokens. Everything is prefixed buy- so nothing collides with them.
   One filled primary in this section: the Reserve button. Flat cards, sharp radius. */

#buy [hidden] { display: none !important; }
.buy-label { margin-bottom: 16px; }

/* ---------- the three options: radio cards, three-up on desktop ---------- */
.buy-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.buy-options > legend { float: left; width: 100%; padding: 0; margin: 0 0 16px; }
.buy-options > legend + * { clear: both; }
.buy-legend { font: 500 13px/20px var(--sans); color: var(--muted); }
.buy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--col-gap); align-items: stretch; }
@media (max-width: 1023px) { .buy-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } }

.buy-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  padding: 24px 24px 20px; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color var(--t-out) var(--ease-ui), box-shadow var(--t-out) var(--ease-ui), opacity var(--t-out) var(--ease-ui);
}
@media (max-width: 639px) { .buy-card { padding: 20px 20px 16px; } }
.buy-card-top { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 14px; align-items: start; }
.buy-radio { width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--accent); cursor: pointer; }
.buy-card-label { display: grid; gap: 10px; min-width: 0; cursor: pointer; }
/* the label covers the whole card, so a click anywhere on it picks the option */
.buy-card-label::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.buy-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 500 var(--fs-lead)/1.35 var(--sans); letter-spacing: -0.005em; color: var(--ink); }
.buy-flag { font: 500 12px/1 var(--mono); letter-spacing: 0; padding: 5px 7px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.buy-price { font: 500 var(--fs-h3)/1.1 var(--sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.buy-desc { margin-top: 16px; padding-left: 34px; }
.buy-sum { font-size: 15px; line-height: 24px; color: var(--ink-2); }
.buy-list { margin-top: 12px; border-top: 1px solid var(--line); }
.buy-list li {
  display: grid; grid-template-columns: 6px minmax(0, 1fr); gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 22px; color: var(--ink-2);
}
.buy-list li::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--line-2); transform: translateY(-2px); }
.buy-foot { margin-top: auto; padding: 16px 0 0 34px; font: 400 13px/20px var(--mono); color: var(--muted); max-width: none; }
@media (max-width: 1023px) { .buy-foot { margin-top: 0; } }
@media (max-width: 479px) { .buy-desc, .buy-foot { padding-left: 0; } }

@media (hover: hover) and (pointer: fine) {
  .buy-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); transition-duration: var(--t-in); }
}
/* selected: reserve.js sets .is-selected (and :has() covers the moment before it runs) */
.buy-card.is-selected, .buy-card:has(.buy-radio:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.buy-card.is-selected .buy-list li::before, .buy-card:has(.buy-radio:checked) .buy-list li::before { background: var(--accent); }
@supports selector(:has(*)) {
  .buy-radio:focus-visible { outline: none; }
  .buy-card:has(.buy-radio:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
}
/* after a reservation: the cards stay readable, the reserved one stands out */
.buy-options:disabled .buy-card-label, .buy-options:disabled .buy-radio { cursor: default; }
.buy-options:disabled .buy-card:not(.is-selected) { opacity: .55; }
@media (hover: hover) and (pointer: fine) { .buy-options:disabled .buy-card:not(.is-selected):hover { border-color: var(--line-2); } }

/* ---------- terms and the details panel ---------- */
.buy-split { margin-top: 64px; }
@media (max-width: 1023px) { .buy-split { margin-top: 48px; } }
.buy-terms .v a { white-space: nowrap; }
.buy-panel .title + .buy-fields, .buy-panel .title + noscript + .buy-fields { margin-top: 20px; }
html:not(.js) .buy-fields { display: none; }
.buy-noscript { margin-top: 12px; }

.buy-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.buy-span { grid-column: 1 / -1; }
@media (max-width: 479px) { .buy-grid2 { grid-template-columns: minmax(0, 1fr); } }
.buy-field { min-width: 0; }
.buy-field label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; font: 500 14px/20px var(--sans); color: var(--ink); }
.buy-opt { font: 400 13px/20px var(--sans); color: var(--muted); white-space: nowrap; }
.buy-field input, .buy-field select, .buy-field textarea {
  display: block; width: 100%; margin: 0;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--bg); color: var(--ink);
  font: 400 16px/24px var(--sans); /* 16 px: no zoom on iOS */
  transition: border-color var(--t-out) var(--ease-ui);
}
.buy-field input, .buy-field select { height: 48px; padding: 0 14px; }
.buy-field select {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer; font-family: var(--mono); font-variant-numeric: tabular-nums;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898391' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.buy-field textarea { min-height: 96px; padding: 12px 14px; resize: vertical; }
@media (hover: hover) and (pointer: fine) { .buy-field :is(input, select, textarea):hover { border-color: var(--muted); } }
.buy-field :is(input, select, textarea):focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
.buy-field [aria-invalid="true"] { border-color: var(--fail); }
.buy-field [aria-invalid="true"]:focus { outline-color: var(--fail); }
.buy-hint { margin-top: 8px; font-size: 13px; line-height: 20px; color: var(--muted); max-width: none; }
.buy-err { margin-top: 8px; font: 500 14px/20px var(--sans); color: var(--fail); max-width: none; }
.buy-err:empty { display: none; }
.buy-options > .buy-err { margin-top: 12px; }
.buy-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* the running summary above the button, like an instrument readout */
.buy-summary {
  margin-top: 24px; padding: 12px 16px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  font-size: 15px; line-height: 24px; color: var(--muted); max-width: none;
}
.buy-summary b { font-weight: 500; color: var(--ink); }
.buy-summary .num { font-size: 15px; color: var(--ink); }
.buy-summary.is-on { background: var(--accent-soft); color: var(--ink-2); }
.buy-status {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--fail-soft); border: 1px solid color-mix(in srgb, var(--fail) 30%, transparent);
  font-size: 15px; line-height: 24px; color: var(--ink); max-width: none;
}
.buy-status:empty { display: none; }
.buy-status .title { font-size: 16px; line-height: 24px; }
.buy-status p { max-width: none; }
.buy-status .title + p { margin-top: 4px; }
.buy-submit { width: 100%; margin-top: 16px; }
.buy-submit[aria-disabled="true"] { opacity: .62; cursor: progress; transform: none; }
.buy-fine { margin-top: 16px; font-size: 13px; line-height: 20px; color: var(--muted); max-width: none; }

/* ---------- confirmation ---------- */
.buy-done .label { margin-bottom: 8px; }
.buy-done-title { font-size: var(--fs-h3); line-height: 1.22; letter-spacing: -0.015em; }
.buy-done-title:focus { outline: none; }
.buy-done-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.buy-done-rows { margin-top: 20px; }
.buy-done-rows > li { grid-template-columns: minmax(0, 8em) minmax(0, 1fr); }
.buy-done-rows code { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 479px) { .buy-done-rows > li { grid-template-columns: minmax(0, 1fr); } }
.buy-sub { margin-top: 28px; margin-bottom: 8px; font: 500 15px/24px var(--sans); letter-spacing: 0; }
.buy-next h4 { font-size: 15px; line-height: 24px; }
.buy-link {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0; border: 0; background: none;
  font: 500 15px/1 var(--sans); color: var(--accent); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
}
@media (hover: hover) and (pointer: fine) { .buy-link:hover { color: color-mix(in srgb, var(--accent), var(--ink) 14%); } }
