/* Vouchery V1 Salon - nákup voucheru /vouchery/koupit/ (kroky 1 Barber a služba, 2 Věnování a doručení, 3 Platba, QR platba, Hotovo).
   Rozměry 1:1 z Figmy: Voucher / 1-5 desktop (36:4340, 36:5333, 37:3323, 38:695, 38:850) a mobil (38:5430, 38:5539, 39:5506, 39:5659, 39:5787). */

/* ---------- rozvržení: formulář vlevo, sticky náhled vpravo ---------- */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) clamp(440px, 47.2vw, 680px); max-width: var(--max); min-height: calc(100vh - 88px); margin: 0 auto; }
.flow__col { padding: 64px var(--pad-x) 96px; min-width: 0; }
.flow__in { container: fin / inline-size; display: flex; flex-direction: column; gap: 40px; max-width: 600px; }
.view { display: flex; flex-direction: column; gap: 40px; }
.flow [hidden] { display: none !important; }
.vh { display: flex; flex-direction: column; gap: 16px; }
.vh h1:focus { outline: 0; }
.blk { display: flex; flex-direction: column; gap: 12px; }
.blk--s16 { gap: 16px; }
.blk--s12 { gap: 12px; }

.flow__aside { position: relative; background: var(--bg-raised); box-shadow: 0 0 0 100vmax var(--bg-raised); clip-path: inset(0 -100vmax 0 0); }
.flow__sticky { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 24px; padding: 64px 40px; }
.flow__sticky > [data-card] { width: 100%; }

/* ---------- stepper ---------- */
.stepper { display: flex; align-items: center; gap: 40px; }
.step { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text-tertiary); font: 500 14px/20px var(--sans); }
.step:disabled { cursor: default; }
.step__c { position: relative; display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--line-subtle); border-radius: 50%; }
.step__c .icon { display: none; color: var(--text-secondary); }
.step[data-state="done"] { color: var(--text-secondary); }
.step[data-state="done"] .step__c { border-color: var(--line-strong); }
.step[data-state="done"] .step__n { display: none; }
.step[data-state="done"] .step__c .icon { display: block; }
.step[data-state="done"]:not(:disabled):hover .step__l { text-decoration: underline; text-underline-offset: 4px; }
.step[data-state="current"] { color: var(--text-primary); }
.step[data-state="current"] .step__c { border-color: var(--text-primary); background: var(--text-primary); color: var(--text-on-light); }
[data-view-now="hotovo"] .stepper { display: none; }

/* ---------- pole (TextField, TextArea) ---------- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field__label { display: flex; align-items: baseline; gap: 8px; font: 500 14px/20px var(--sans); }
.field__opt { font: 400 13px/18px var(--sans); color: var(--text-tertiary); }
.input {
  width: 100%; height: 52px; padding: 0 24px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  background: var(--bg-sunken); color: var(--text-primary); font: 400 16px/26px var(--sans); -webkit-appearance: none; appearance: none;
  transition: border-color .2s var(--ease);
}
.input::placeholder { color: var(--text-tertiary); opacity: 1; }
.input:hover { border-color: var(--text-tertiary); }
.input:focus, .input:focus-visible { outline: 0; border-color: var(--text-primary); box-shadow: 0 0 0 .5px var(--text-primary); }
.input[aria-invalid="true"] { border-color: var(--state-error); box-shadow: none; }
.input--area { height: auto; min-height: 128px; padding: 16px 24px; border-radius: var(--radius-field); resize: none; }
input[type="date"].input, input[type="time"].input { min-width: 0; text-align: left; }
input[type="date"].input::-webkit-date-and-time-value, input[type="time"].input::-webkit-date-and-time-value { text-align: left; }
.field__hint { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font: 400 13px/18px var(--sans); color: var(--text-tertiary); }
.field__error { font: 400 13px/18px var(--sans); color: var(--state-error); }
.field__error[hidden] { display: none; }
.count { color: var(--text-secondary); white-space: nowrap; }
.count.is-over { color: var(--state-error); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
[data-view="3"] .row2 { gap: 16px; }

/* ---------- výběrová pole: rádius 26, kroužek volby, vybraný stav zlatý rámeček ---------- */
.opt { position: relative; display: block; background: var(--bg-raised); border: 1px solid var(--line-subtle); border-radius: var(--radius-field); cursor: pointer; transition: border-color .2s var(--ease); }
.opt:hover { border-color: var(--line-strong); }
.opt:has(.opt__in:checked) { border-color: var(--gold); }
.opt:has(.opt__in:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }
.opt.is-disabled { cursor: not-allowed; border-color: var(--line-subtle); }
.opt.is-disabled:hover { border-color: var(--line-subtle); }
.opt.is-disabled .ui-m, .opt.is-disabled .svc__price { color: var(--text-tertiary); }
.opt__in { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.dot { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: 50%; transition: border-color .2s var(--ease); }
.dot::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); transform: scale(0); transition: transform .15s var(--ease); }
.opt:has(.opt__in:checked) .dot { border-color: var(--gold); }
.opt:has(.opt__in:checked) .dot::after { transform: scale(1); }
.opt__info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

/* karty barberů */
.bgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bcard { container-type: inline-size; display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.bcard__ph { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 107 / 140; overflow: hidden; background: var(--bg-slate);
  border-radius: 54px 54px 2px 2px; border-radius: calc(50cqw - 16px) calc(50cqw - 16px) 2px 2px; }
.bcard__ph picture, .bcard__ph img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.bcard__ph img { object-fit: cover; object-position: 50% 20%; }
.bcard__ph--r { padding-top: 8px; font: 400 28px/36px var(--serif); }
.bcard__txt { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.bcard__name { flex: 1; min-height: 48px; }
.bcard .dot { position: absolute; right: 16px; bottom: 13px; }

/* karty služeb */
.svclist { display: flex; flex-direction: column; gap: 12px; }
.svc { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; column-gap: 16px; padding: 20px 24px; }
.svc__price { font: 500 16px/24px var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.svc__dur { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); white-space: nowrap; }
.svc__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

/* doručení a platba */
.optlist { display: flex; flex-direction: column; gap: 12px; }
.opt--del { padding: 0; }
.opt__row { display: flex; align-items: center; gap: 16px; padding: 20px 24px; cursor: pointer; border-radius: var(--radius-field); }
.opt__row .opt__info { min-height: 48px; justify-content: center; }
.opt__ic { color: var(--text-secondary); flex: none; }
.opt:has(.opt__in:checked) .opt__ic { color: var(--gold); }
.opt__detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0 24px 20px 104px; cursor: default; }
.opt__detail[hidden] { display: none; }
.opt--pay { display: flex; align-items: center; gap: 16px; padding: 20px 24px; }
.paylogos { display: flex; flex-direction: column; gap: 12px; }
.paylogos__row { display: flex; align-items: center; gap: 8px; flex: none; }
.paylogos__row img { height: 32px; width: auto; }
.pl { display: grid; place-items: center; width: 50px; height: 32px; border-radius: 2px; background: #fff; }
.pl img { height: auto; width: auto; max-width: 34px; max-height: 26px; }

/* segmentovaný přepínač */
.seg { display: inline-flex; align-self: flex-start; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); }
.seg__o { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 24px; border-radius: var(--radius-pill); color: var(--text-secondary); font: 500 14px/20px var(--sans); cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
.seg__o:has(.opt__in:checked) { background: var(--text-primary); color: var(--text-on-light); }
.seg__o:has(.opt__in:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }

/* souhlas */
.consent__l { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check { display: grid; place-items: center; flex: none; width: 20px; height: 20px; margin-top: 3px; border: 1px solid var(--line-strong); border-radius: 2px; color: transparent; }
.consent__l:has(.opt__in:checked) .check { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.consent__l:has(.opt__in:focus-visible) .check { outline: 2px solid var(--gold); outline-offset: 3px; }
.consent a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.consent.is-invalid .check { border-color: var(--state-error); }

/* tlačítka akcí */
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.actions > p { margin-left: 8px; }
.btn.is-busy { opacity: .7; pointer-events: none; }
.flow [hidden] { display: none !important; }
.turnstile { min-height: 65px; }

/* ---------- pravý sloupec: souhrn, poznámka ---------- */
.sum { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.sum > div { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.sum dt { font: 400 15px/22px var(--sans); color: var(--text-secondary); flex: none; }
.sum dd { margin: 0; font: 500 14px/20px var(--sans); text-align: right; }
.sum__total { align-items: baseline; padding-top: 8px; }
.sum__total dt { font: 500 16px/24px var(--sans); color: var(--text-primary); }
.sum__total dd { font: 300 32px/36px var(--sans); }
.sum__dph { font: 400 13px/18px var(--sans); color: var(--text-secondary); text-align: right; }
.anote { display: flex; align-items: flex-start; gap: 12px; }
.anote[hidden] { display: none; }
.anote .icon { margin-top: 1px; color: var(--text-tertiary); }

/* ---------- QR platba ---------- */
.qrbox { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: center; padding: 32px; background: var(--bg-raised); }
.qrbox__qr { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.qrtile { padding: 16px; border-radius: 2px; background: var(--text-primary); }
.qrtile img { width: 208px; height: auto; }
.qrbox__data { display: flex; flex-direction: column; gap: 20px; margin: 0; min-width: 0; }
.qrbox__data > div { display: flex; flex-direction: column; gap: 2px; }
.qrbox__data dd { margin: 0; }
.copyrow { display: flex; align-items: center; gap: 12px; }
.copybtn { display: grid; place-items: center; width: 24px; height: 24px; flex: none; color: var(--gold); }
.copybtn.is-done { color: var(--state-ok); }
.state { display: flex; align-items: flex-start; gap: 16px; }
.state__ic { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 1px solid var(--gold); border-radius: 50%; color: var(--text-primary); }
.state > div { display: flex; flex-direction: column; gap: 4px; }
.notice { display: flex; flex-direction: column; gap: 8px; padding: 24px; background: var(--bg-raised); }
.notice__h { display: flex; align-items: center; gap: 8px; }

/* ---------- Hotovo ---------- */
.seal { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); }
.detail { display: flex; flex-direction: column; gap: 20px; margin: 0; padding: 32px; background: var(--bg-raised); }
.detail > div { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.detail dt { font: 400 15px/22px var(--sans); color: var(--text-secondary); }
.detail dd { display: flex; align-items: center; gap: 12px; margin: 0; font: 500 16px/24px var(--sans); text-align: right; }
.more { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.changeform { display: flex; flex-direction: column; gap: 24px; padding: 32px; background: var(--bg-raised); }
.changeform[hidden] { display: none; }

/* úzký sloupec (mobil, užší tablet): barbeři 2 × 2, služby s cenou pod názvem */
@container fin (max-width: 559px) {
  .bgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bcard__ph { aspect-ratio: auto; height: 140px; }
  .bcard__ph img { transform: scale(1.12); transform-origin: 50% 0; }
  .bcard__name { min-height: 24px; }
  .svc { grid-template-columns: 24px minmax(0, 1fr); align-items: start; padding: 16px; column-gap: 12px; }
  .svc__meta { grid-column: 2; flex-direction: row; align-items: center; gap: 12px; padding-top: 6px; }
}
@container fin (min-width: 420px) and (max-width: 559px) { .bcard__ph { height: 200px; } }

/* ---------- spodní lišta (mobil) ---------- */
.bbar { display: none; }

/* ---------- tablet a mobil: náhled nahoře, lišta dole ---------- */
@media (max-width: 1180px) {
  .flow { grid-template-columns: minmax(0, 1fr) 440px; }
  .flow__sticky { padding: 48px 32px; }
}
@media (max-width: 1023px) {
  .flow { display: flex; flex-direction: column; min-height: 0; }
  .flow__aside { order: -1; box-shadow: none; clip-path: none; }
  .flow__sticky { position: static; align-items: center; gap: 0; padding: 24px 20px; }
  .flow__sticky > .label-s, .sum, .anote { display: none !important; }
  [data-view-now="3"] .flow__aside, [data-view-now="qr"] .flow__aside { display: none; }
  .flow__col { padding: 32px 20px 40px; }
  .flow__in { max-width: 640px; margin: 0 auto; gap: 32px; }
  .view { gap: 32px; }
  .vh { gap: 12px; }
  .vh h1 { font: 400 30px/38px var(--serif); letter-spacing: 0; }
  .vh .body-l { font: 400 16px/26px var(--sans); }
  .stepper { gap: 12px; }
  .step { gap: 8px; }
  .step:not([data-state="current"]) .step__l { display: none; }
  .actions--d { display: none; }
  .actions--col { flex-direction: column; align-items: stretch; gap: 12px; }
  .actions--col .btn, [data-view="qr"] .actions .btn, [data-view="1"] .actions .btn { width: 100%; }
  [data-view="1"] .actions, [data-view="1"] .paylogos { display: none; }
  .paylogos { gap: 12px; }
  [data-view="1"] .paylogos { display: flex; }
  .opt__detail { padding: 0 20px 20px; }
  input[type="date"].input::-webkit-calendar-picker-indicator, input[type="time"].input::-webkit-calendar-picker-indicator { display: none; }
  .opt__detail .input { padding: 0 16px; }
  .opt--del { padding: 0; }
  .row2 { gap: 16px; }
  .opt--pay { gap: 12px; padding: 20px; }
  .detail { padding: 24px 20px; gap: 16px; }
  .detail > div { flex-direction: column; align-items: flex-start; gap: 2px; }
  .detail dd { text-align: left; }
  .more { flex-direction: column; align-items: flex-start; gap: 32px; }
  .seal { width: 56px; height: 56px; }
  .seal .icon { width: 28px; height: 28px; }
  .qrbox { display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding: 0; background: none; }
  .qrbox__data { order: -1; gap: 16px; padding: 24px 20px; background: var(--bg-raised); }
  .state { gap: 16px; }
  .state__ic { width: 40px; height: 40px; }
  .state__ic .icon { width: 20px; height: 20px; }
  .notice { padding: 20px; }
  .changeform { padding: 24px 20px; }

  .bbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: none; align-items: center; gap: 16px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--bg-raised); box-shadow: 0 -12px 32px rgba(0, 0, 0, .4); }
  .flow[data-bar] .bbar { display: flex; }
  .flow[data-bar] .flow__col { padding-bottom: calc(72px + 40px + env(safe-area-inset-bottom)); }
  .bbar__sum { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .bbar__sum p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bbar .btn { flex: none; }
  .bbar .btn--apple { min-width: 175px; }
}
@media (max-width: 380px) {
  .bbar { gap: 12px; padding-left: 16px; padding-right: 16px; }
  .bbar .btn--m { padding: 0 20px; }
  .bbar .btn--apple { min-width: 150px; }
}

/* ---------- tisk: karta voucheru (PDF přes Uložit jako PDF) ---------- */
.print-sheet { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  :root { color-scheme: light; }
  html, body { background: #fff !important; }
  body.is-flow > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; width: 1032px; color: #16120E; }
  .print-sheet, .print-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-sheet__card { width: 1032px; height: 542px; overflow: hidden; }
  .print-sheet .vcard { width: 1200px; max-width: none; transform: scale(.86); transform-origin: 0 0; }
  .print-sheet__how { margin-top: 24px; font: 400 14px/22px var(--sans); color: #4A4036; }
}
