/* ---------------------------------------------------------------------------
   D2 — Components
   Buttons, fields, badges, rows, states. The design's inline styles were canvas
   convenience; the repeats are consolidated into classes here so a change lands
   in one place instead of twenty screens.
--------------------------------------------------------------------------- */

/* --- Layout --------------------------------------------------------------- */

.page {
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--paper);
}

.sec {
  padding: var(--pad-y) var(--pad-x);
}
.sec--tight {
  padding: var(--s5) var(--pad-x);
}
.sec--flush {
  padding-top: 0;
}
.sec--rule {
  border-bottom: var(--hair);
}
.sec--invert {
  background: var(--ink);
  color: var(--paper);
}
.sec--wash {
  background: var(--wash);
  border-top: var(--hair);
  border-bottom: var(--hair);
}

.stack > * + * {
  margin-top: var(--s3);
}
.stack-lg > * + * {
  margin-top: var(--s5);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.row--between {
  justify-content: space-between;
}
.row--baseline {
  align-items: baseline;
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  width: 100%;
  min-height: var(--cta-height);
  padding: 17px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--ac);
  color: var(--acf);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn--secondary {
  background: var(--paper);
  color: var(--ink);
  border: var(--structural);
  font-weight: 700;
}

.btn--ghost {
  background: none;
  color: var(--ink);
  border: 0;
  text-decoration: underline;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  min-height: 48px;
}

.btn--invert {
  background: var(--paper);
  color: var(--ink);
}

.btn--sm {
  min-height: var(--hit);
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  width: auto;
}

.btn--inline {
  width: auto;
}

.btn[disabled],
.btn--disabled {
  background: var(--paper);
  color: var(--ink-4);
  border: 1px solid var(--line-2);
  cursor: not-allowed;
  pointer-events: none;
}

.btn .spin {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  display: none;
}
.btn.is-working .spin {
  display: block;
}
.btn.is-working {
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Fields --------------------------------------------------------------- */

.field {
  margin-bottom: var(--s2);
}

.field label,
.label {
  display: block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: var(--s1);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 52px;
  padding: 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--wash-2);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

.textarea {
  min-height: 120px;
  line-height: 1.55;
  resize: vertical;
}

.select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--ink);
  background: var(--paper);
  outline: none;
}

.input.is-error,
.textarea.is-error {
  border: 2px solid var(--ink);
}

/* Helper text sits tight under the field, never in a tooltip. */
.help {
  font-weight: 500;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 4px 0 var(--s2);
}

.err {
  font-weight: 600;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink);
  margin: 4px 0 var(--s2);
}
.err::before {
  content: '✕ ';
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  padding: var(--s3);
  border: var(--structural);
  cursor: pointer;
  min-height: var(--hit);
}
.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--ac);
}

/* --- Badges --------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 6px 9px;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.badge--fill {
  background: var(--ac);
  color: var(--acf);
  border-color: transparent;
}
.badge--solid {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.badge--quiet {
  border-color: var(--line-2);
  color: var(--ink-4);
}
.badge--wash {
  background: var(--wash);
  border-color: var(--line);
  color: var(--ink-2);
}

/* --- Rows ----------------------------------------------------------------- */

.list > .lrow {
  border-top: var(--hair);
}
.list > .lrow:last-child {
  border-bottom: var(--hair);
}

.lrow {
  display: flex;
  gap: var(--s3);
  align-items: center;
  padding: var(--s3) 0;
  min-height: var(--hit);
  text-decoration: none;
}
.lrow__thumb {
  width: 38px;
  height: 48px;
  flex: none;
  border: var(--structural);
  background: repeating-linear-gradient(135deg, #ececec 0 8px, #f6f6f6 8px 16px);
  object-fit: cover;
}
.lrow__main {
  flex: 1;
  min-width: 0;
}
.lrow__title {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lrow__meta {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--ink-4);
  margin-top: 3px;
}
.lrow__chev {
  color: var(--ink-4);
  font-size: 16px;
}

.srow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s3) 0;
  border-top: var(--hair);
  font-weight: 600;
  font-size: 12.5px;
  min-height: var(--hit);
  text-decoration: none;
}

.strow {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-top: var(--hair);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.4;
}
.strow > span:first-child {
  color: var(--ink-3);
}

/* --- Placeholders --------------------------------------------------------- */

.ph-img {
  background: repeating-linear-gradient(135deg, #ececec 0 9px, #f6f6f6 9px 18px);
  border: var(--structural);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* --- Notices -------------------------------------------------------------- */

.note {
  padding: var(--s3) var(--s4);
  border: var(--structural);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.55;
}
.note--quiet {
  border: var(--hair);
  background: var(--wash);
}
.note--loud {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.flash {
  padding: var(--s3) var(--pad-x);
  border-bottom: var(--structural);
  font-weight: 600;
  font-size: 13px;
}
.flash--ok {
  background: var(--wash);
}
.flash--bad {
  background: var(--ink);
  color: var(--paper);
}

/* --- Progress ------------------------------------------------------------- */

.meter {
  height: 6px;
  background: var(--line);
}
.meter__fill {
  height: 6px;
  background: var(--ac);
}

/* --- Sticky buy bar ------------------------------------------------------- */

.sticky {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 12px 14px;
  background: var(--paper);
  border-top: var(--structural);
}
.sticky .btn {
  flex: 1;
  min-height: 52px;
  padding: 16px;
  font-size: 13px;
}

/* --- Accordion (FAQ) ------------------------------------------------------ */

.acc__item {
  border-bottom: var(--hair);
}
.acc__q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: 15px 0;
  min-height: 52px;
  background: none;
  border: 0;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
}
.acc__sign {
  font-weight: 400;
  font-size: 18px;
  color: var(--ink-4);
  flex: none;
}
.acc__a {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease;
}
.acc__item[open] .acc__a,
.acc__item.is-open .acc__a {
  max-height: 600px;
}
.acc__a p {
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  padding: 0 0 15px;
}

/* --- Tables --------------------------------------------------------------- */

.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th,
.tbl td {
  padding: 12px 10px;
  text-align: left;
  border-top: var(--hair);
  vertical-align: top;
}
.tbl th {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-top: 0;
  border-bottom: var(--structural);
  white-space: nowrap;
}
.tbl td.num,
.tbl th.num {
  text-align: right;
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* --- Price ---------------------------------------------------------------- */

.price {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
}
.price__now {
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1;
}
.price__was {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-4);
  text-decoration: line-through;
}
