/* OnTable CAMP 4.0 – paleta i układ zgodne z ontable.pl */
:root {
  --red: #c80000;
  --red-dark: #9e0000;
  --paper: #f4f4f4;
  --card: #ffffff;
  --ink: #333333;
  --text: #555555;
  --muted: #777777;
  --line: #dddddd;
  --line-soft: #e8e8e8;
  --cyan: #12c6f3;
  --cyan-tint: #e8f8fd;

  --font-head: 'Oswald', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 3px;
  --gutter: clamp(16px, 4vw, 32px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.55 var(--font-body);
}

img { max-width: 100%; display: block; }

h1, h2, h3 { color: var(--ink); font-family: var(--font-head); font-weight: 600; margin: 0; }

button, input { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

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

[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-inline: var(--gutter); }
body > main { flex: 1 0 auto; }

/* ---------- Nagłówek jak na ontable.pl: biały pasek z logo + czerwony pas ---------- */
.site-head { background: var(--card); border-bottom: 1px solid var(--line-soft); }
.site-head__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.site-head__logo img { height: 48px; width: auto; }
.site-head__meta { color: var(--muted); font-size: 14px; text-align: right; }

.band { background: var(--red); color: #fff; }
.band__inner {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-block: clamp(28px, 5vw, 48px);
}
.band__title {
  color: #fff;
  font-weight: 700;
  font-size: clamp(44px, 9vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.01em;
}
.band__side { position: relative; flex: none; display: flex; align-items: flex-end; }
.hand { position: relative; width: 300px; height: 210px; }
.hand img {
  position: absolute; bottom: 0; left: 50%;
  width: 132px; aspect-ratio: 5 / 7; object-fit: cover;
  background: #fff; border: 5px solid #fff; border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  transform-origin: 50% 120%;
}
.hand img:nth-child(1) { transform: translateX(-112%) rotate(-14deg); }
.hand img:nth-child(2) { transform: translateX(-50%) translateY(-12px); z-index: 1; }
.hand img:nth-child(3) { transform: translateX(12%) rotate(14deg); }
.nobr { white-space: nowrap; }
.band__side .band__price { position: absolute; z-index: 2; right: -8px; bottom: -8px; background: var(--red); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28); }
.band__lead { margin: 18px 0 0; max-width: 34em; font-size: 17px; color: rgba(255, 255, 255, 0.92); }
.band__price {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1;
  white-space: nowrap;
  padding: 10px 18px 12px;
  border: 2px solid #fff;
  border-radius: var(--radius);
}

/* ---------- Układ ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
  padding-block: 32px 56px;
}

.closed, .done { grid-column: 1 / -1; background: var(--card); padding: 32px; border-radius: var(--radius); }
.closed h2, .done h2 { font-size: 34px; margin-bottom: 8px; }

/* ---------- Kroki formularza ---------- */
.order { display: grid; gap: 16px; min-width: 0; }

.step { background: var(--card); padding: clamp(18px, 3vw, 28px); border-radius: var(--radius); }

.step__title { display: flex; align-items: baseline; gap: 12px; font-size: 26px; margin-bottom: 16px; }
.step__no {
  flex: none;
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--red); color: #fff;
  border-radius: 50%;
  font-size: 18px; font-weight: 600;
  transform: translateY(-3px);
}
.step__value { font-family: var(--font-body); font-size: 15px; font-weight: 400; color: var(--muted); }

.field { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field__label { display: block; padding: 0; margin-bottom: 8px; color: var(--ink); font-weight: 500; }
.field__error { margin: 6px 0 0; color: var(--red); font-size: 14px; font-weight: 500; }
.field__error:empty { display: none; }
.hint { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.field .hint:last-of-type:not(:first-child) { margin: 6px 0 0; }

/* Radio jako kafelki: input ukryty wizualnie, dostępny z klawiatury */
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt input:focus-visible + * { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* Płeć */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented .opt span {
  display: block; padding: 10px 22px; cursor: pointer;
  border-right: 1px solid var(--line);
  color: var(--ink); font-weight: 500;
}
.segmented .opt:last-child span { border-right: 0; }
.segmented input:checked + span { background: var(--ink); color: #fff; }

/* Fason */
.fits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fit {
  display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center;
  padding: 12px; height: 100%;
  border: 2px solid var(--line); border-radius: var(--radius);
  cursor: pointer; background: var(--card);
}
.fit img { width: 76px; height: 90px; object-fit: contain; object-position: top; }
.fit__name { display: block; font-family: var(--font-head); font-size: 22px; color: var(--ink); line-height: 1.1; }
.fit__desc { display: block; font-size: 14px; margin-top: 2px; }
.fit__spec {
  position: relative; z-index: 1;
  margin-top: 6px; padding: 0; border: 0; background: none;
  color: var(--red); font-size: 14px; text-decoration: underline; cursor: pointer;
}
.opt input:checked + .fit { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }

/* Kolory */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  display: block; width: 38px; height: 38px; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.opt input:checked + .swatch { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 0 3px var(--card), 0 0 0 5px var(--red); }
.opt input:focus-visible + .swatch { outline-offset: 5px; }
.swatches--big .swatch { width: 52px; height: 52px; }

/* Rozmiary */
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size {
  display: grid; place-items: center;
  min-width: 56px; height: 44px; padding: 0 12px;
  border: 2px solid var(--line); border-radius: var(--radius);
  color: var(--ink); font-weight: 500; cursor: pointer;
}
.opt input:checked + .size { background: var(--red); border-color: var(--red); color: #fff; }

.fallback {
  margin-top: 18px; padding: 16px 18px;
  background: var(--cyan-tint);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius);
}
.fallback__text { margin: 0 0 12px; color: var(--ink); }
.fallback .field { margin: 14px 0 0; }
.fallback .size { background: var(--card); }

.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--red); flex: none; }

/* Grafiki */
.designs__group { margin: 0 0 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-bottom: 18px; }
.designs:last-child { margin-bottom: 0; }
.design {
  display: block; padding: 6px 6px 8px;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; cursor: pointer; text-align: center;
}
.design img { aspect-ratio: 1; width: 100%; height: auto; object-fit: contain; }
.design__name { display: block; margin-top: 4px; font-size: 14px; color: var(--ink); font-weight: 500; }
.opt input:checked + .design { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.design__zoom {
  position: absolute; z-index: 1; top: 8px; right: 8px;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(51, 51, 51, 0.8); color: #fff;
  cursor: pointer; display: grid; place-items: center;
}
.design__zoom svg { width: 16px; height: 16px; }

/* Nick i e-mail */
input[type='text'], input[type='email'] {
  width: 100%; height: 48px; padding: 0 14px;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink);
}
input[type='text']:focus, input[type='email']:focus { border-color: var(--ink); outline: none; }
input[aria-invalid='true'] { border-color: var(--red); }
.input-count { position: relative; }
.input-count input { padding-right: 64px; font-family: var(--font-head); font-size: 20px; letter-spacing: 0.02em; }
.input-count__n { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-error { margin: 0 0 12px; color: var(--red); font-weight: 500; }
.form-error:empty { display: none; }
.slow {
  margin: 0 0 12px; padding: 10px 14px;
  background: var(--cyan-tint); border-left: 4px solid var(--cyan); border-radius: var(--radius);
  color: var(--ink); font-weight: 500;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 56px; padding: 0 24px;
  background: var(--red); color: #fff;
  border: 0; border-radius: var(--radius);
  font-family: var(--font-head); font-size: 22px; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer;
}
.btn:hover { background: var(--red-dark); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn--ghost { width: auto; background: none; color: var(--red); border: 2px solid var(--red); font-size: 18px; min-height: 48px; }
.btn--ghost:hover { background: var(--red); color: #fff; }

/* ---------- Podgląd ---------- */
.preview { position: sticky; top: 16px; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.preview__stage { display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.preview__shirt { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; object-position: center top; padding: 12px 6px; }

.proof {
  --shirt: #ffffff;
  --ink-on-shirt: #333333;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 12px;
  background: var(--shirt);
  transition: background-color 0.25s ease;
}
.proof__art { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; }
.proof--light .proof__art { mix-blend-mode: multiply; }
.proof__nick {
  font-family: var(--font-head); font-weight: 700;
  font-size: 22px; line-height: 1.1; text-align: center;
  color: var(--ink-on-shirt);
  overflow-wrap: anywhere;
}
.proof__nick:empty::before { content: 'Twój nick'; opacity: 0.35; }

.preview__note { margin: 0; padding: 8px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-soft); }

.summary { margin: 0; padding: 12px 16px 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; color: var(--ink); font-weight: 500; }
.summary dd.is-empty { color: var(--line); font-weight: 400; }

/* ---------- Po zamówieniu ---------- */
.done { max-width: 900px; justify-self: center; width: 100%; }
.done:focus { outline: none; }
.done__id { font-family: var(--font-head); font-size: 22px; color: var(--red); letter-spacing: 0.04em; }
.done .summary { padding: 16px 0; border-block: 1px solid var(--line-soft); margin: 16px 0; font-size: 15px; }
.payment { background: var(--paper); border-left: 4px solid var(--red); padding: 16px 18px; margin-bottom: 20px; border-radius: var(--radius); }
.payment p { margin: 0; }
.payment__amount { color: var(--ink); }
.payment__info { margin-top: 6px !important; font-family: var(--font-head); font-size: 24px; color: var(--ink); }

/* Metody płatności */
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; margin-bottom: 12px; }
.pay { border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.pay__title { font-size: 22px; margin-bottom: 4px; }
.pay__how { margin: 0 0 10px; font-size: 14px; }
.pay__qr { width: 200px; max-width: 100%; margin: 8px auto 12px; }
.pay__qr svg { display: block; width: 100%; height: auto; }
.pay__small { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.pay__small--block { margin: 0 0 20px; }

.copylist { margin: 0; display: grid; gap: 8px; }
.copylist__row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.copylist__row:last-child { border-bottom: 0; padding-bottom: 0; }
.copylist dt { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.copylist dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.copy {
  padding: 5px 10px; min-width: 88px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer;
}
.copy:hover { border-color: var(--ink); }
.copy.is-done { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Stopka ---------- */
.site-foot { background: var(--ink); color: #ccc; font-size: 14px; }
.site-foot .wrap { padding-block: 18px; }

/* ---------- Tabela rozmiarów ---------- */
.step__link {
  margin-left: auto; padding: 0; border: 0; background: none;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--red); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.field__label .step__link { margin-left: 10px; }

.sheet {
  width: min(92vw, 560px); max-height: 90vh; padding: 24px;
  border: 0; border-radius: var(--radius); background: #fff; color: var(--text);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.7); }
.sheet__title { font-size: 28px; margin: 0 48px 4px 0; }
.sheet__subtitle { margin: 18px 0 8px; font-weight: 500; color: var(--ink); }
.sheet__subtitle:first-child { margin-top: 8px; }
.sheet__note { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.size-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.size-table th, .size-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.size-table th:first-child, .size-table td:first-child { text-align: left; }
.size-table thead th { color: var(--ink); font-weight: 500; border-bottom: 2px solid var(--ink); }
.size-table thead th span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.size-table tbody th { color: var(--ink); font-weight: 700; }
.size-table tr.is-selected { background: #fdecec; }
.size-table tr.is-selected th { color: var(--red); }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; max-width: min(92vw, 760px); border-radius: var(--radius); background: #fff; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.7); }
.lightbox img { width: 100%; max-height: 80vh; object-fit: contain; }
.lightbox__caption { margin: 0; padding: 10px 16px 14px; font-family: var(--font-head); font-size: 20px; color: var(--ink); }
.lightbox__close {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: var(--ink); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}

/* ---------- Responsywność ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; order: -1; }
  .preview__stage { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .band__inner { flex-direction: column; align-items: flex-start; }
  .band__side { align-self: stretch; justify-content: center; }
  .hand { width: 210px; height: 140px; }
  .hand img { width: 86px; border-width: 3px; }
  .site-head__meta { font-size: 13px; }
  .site-head__logo img { height: 40px; }
  .fits { grid-template-columns: minmax(0, 1fr); }
  .designs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary { font-size: 13px; }
  .proof__nick { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
