/* Rychlá rezervace z hero - panel vpravo (desktop) a spodní sheet (mobil) přes ztmavenou homepage.
   Rozměry 1:1 z Figmy (Rezervace / Rychlá z hero 1 Služba a kontakt, 2 Hotovo; desktop 1440 a mobil 390).
   Používá jen tokeny ze styles.css, načítá se na homepage vedle home.css. */

html.q-open { overflow: hidden; }
[data-q-alert]:empty { display: none; }
.q {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--text-primary); overflow: hidden;
}
.q:not([open]) { display: none; }
.q::backdrop { background: rgba(5, 5, 8, .72); }
.q__panel {
  position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: 520px; max-width: 100%;
  background: var(--bg-raised);
}
.q__root { display: contents; }
.q__handle { display: none; }
.q__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--s-32); padding: var(--s-32) var(--s-40) var(--s-32); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.q__foot { flex: none; display: flex; flex-direction: column; gap: var(--s-12); padding: var(--s-16) var(--s-40) var(--s-40); background: var(--bg-raised); }
.q__foot p { text-align: center; }
.q h2, .q h3, .q p, .q ul { margin: 0; }

.q__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-16); }
.q__close { display: grid; place-items: center; width: 44px; height: 44px; margin: -10px -10px -10px 0; }
.q__close .icon { width: 24px; height: 24px; }

/* vybraný termín */
.q__when { display: flex; flex-direction: column; gap: var(--s-16); }
.q__time { display: flex; flex-direction: column; gap: var(--s-4); }
.q__time h2 { font: 400 36px/44px var(--serif); }
.q__barber { display: flex; align-items: center; gap: var(--s-16); padding: var(--s-12) var(--s-16) var(--s-12) var(--s-12); background: var(--bg-page); border-radius: var(--radius-s); }
.q__barber-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.q__link { font: 500 14px/20px var(--sans); color: var(--text-secondary); text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.q__link:hover { color: var(--text-primary); }
.q__alert { display: flex; align-items: flex-start; gap: var(--s-12); padding: var(--s-16) var(--s-20); background: var(--bg-sunken); border: 1px solid var(--state-error); border-radius: var(--radius-s); }
.q__alert .icon { margin-top: 2px; color: var(--state-error); }
.q__alert > div { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.q__alert a { text-decoration: underline; text-underline-offset: 4px; }

/* služba (ServiceCard, rádius 26) */
.q__sec { display: flex; flex-direction: column; gap: var(--s-12); }
.q__sec--fields { gap: var(--s-16); }
.q__opts { display: flex; flex-direction: column; gap: var(--s-8); }
.q-opt {
  position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; gap: var(--s-16); padding: var(--s-16) var(--s-20);
  background: var(--bg-raised); border: 1px solid var(--line-subtle); border-radius: var(--radius-field); cursor: pointer; transition: border-color .2s var(--ease);
}
.q-opt:hover { border-color: var(--line-strong); }
.q-opt:has(input:checked) { border-color: var(--gold); }
.q-opt:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }
.q-opt__radio { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: 50%; }
.q-opt:has(input:checked) .q-opt__radio { border-color: var(--gold); }
.q-opt:has(input:checked) .q-opt__radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.q-opt__info { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.q-opt__meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-2); }
.q-opt__dur { display: inline-flex; align-items: center; gap: var(--s-4); }
.q-opt.is-off { cursor: default; }
.q-opt.is-off:hover { border-color: var(--line-subtle); }
.q-opt.is-off .ui-m, .q-opt.is-off .q-opt__dur { color: var(--text-tertiary); }
.q-opt.is-off .q-opt__radio { border-color: var(--line-subtle); }

/* pole formuláře */
.q-field { display: flex; flex-direction: column; gap: var(--s-8); }
.q-field__label { display: flex; align-items: baseline; gap: var(--s-8); font: 500 14px/20px var(--sans); }
.q-field__opt { font: 400 13px/18px var(--sans); color: var(--text-tertiary); }
.q-field__ctl { display: flex; align-items: center; gap: var(--s-12); height: 52px; padding: 0 var(--s-24); background: var(--bg-sunken); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.q-field__ctl input { flex: 1; min-width: 0; height: 100%; padding: 0; background: none; border: 0; outline: 0; font: 400 16px/26px var(--sans); color: var(--text-primary); }
.q-field__ctl input::placeholder { color: var(--text-tertiary); opacity: 1; }
.q-field__ctl input:-webkit-autofill { -webkit-text-fill-color: var(--text-primary); box-shadow: 0 0 0 100px var(--bg-sunken) inset; }
.q-field__ctl:hover { border-color: var(--text-secondary); }
.q-field__ctl:focus-within { border-color: var(--text-primary); box-shadow: 0 0 0 .5px var(--text-primary); }
.q-field__err { display: none; color: var(--state-error); }
.q-field.is-invalid .q-field__ctl { border-color: var(--state-error); box-shadow: 0 0 0 .5px var(--state-error); }
.q-field.is-invalid .q-field__err { display: block; }
.q-field__help { display: flex; align-items: flex-start; gap: var(--s-8); font: 400 13px/18px var(--sans); color: var(--text-tertiary); }
.q-field__help[hidden] { display: none; }
.q-field.is-invalid .q-field__help { color: var(--state-error); }
.q-addnote { display: inline-flex; align-items: center; gap: var(--s-8); align-self: flex-start; font: 500 14px/20px var(--sans); color: var(--text-secondary); }
.q-addnote:hover { color: var(--text-primary); }
.q-check { display: flex; align-items: flex-start; gap: var(--s-12); cursor: pointer; }
.q-check__box { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border: 1px solid var(--line-strong); border-radius: var(--radius-s); color: transparent; }
.q-check:has(input:checked) .q-check__box { background: var(--text-primary); border-color: var(--text-primary); color: var(--text-on-light); }
.q-check:has(input:focus-visible) .q-check__box { outline: 2px solid var(--gold); outline-offset: 3px; }
.q-check a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 4px; }
.q-field--check.is-invalid .q-check__box { border-color: var(--state-error); }
.q .btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.q .btn:disabled { opacity: .45; pointer-events: none; }
.q .btn[hidden] { display: none; }

/* krok 2: Hotovo */
.q__state { display: inline-flex; align-items: center; gap: var(--s-12); }
.q__tick { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); }
.q__done-head { display: flex; flex-direction: column; gap: var(--s-16); }
.q__done-title { font: 400 48px/56px var(--serif); letter-spacing: -.005em; }
.q__sum { display: flex; flex-direction: column; gap: var(--s-20); padding: var(--s-24); background: var(--bg-page); border-radius: var(--radius-s); }
.q__sum h3 { font: 400 28px/36px var(--serif); }
.q__sum dl { display: flex; flex-direction: column; gap: var(--s-20); }
.q__sum dl > div { display: flex; flex-direction: column; gap: var(--s-4); }
.q__sum dd { margin: 0; }
.q__actions { display: flex; flex-direction: column; gap: var(--s-12); }
.q__info { display: flex; flex-direction: column; gap: var(--s-12); }
.q__info li { display: flex; align-items: flex-start; gap: var(--s-8); }
.q__info .icon { margin-top: 1px; color: var(--text-secondary); }
.q__gift { display: inline-flex; align-items: center; align-self: flex-start; gap: var(--s-12); }
.q__gift > .icon { color: var(--text-secondary); }
.q__gift > span { display: flex; flex-direction: column; gap: var(--s-2); }
.q__gift-t { display: inline-flex; align-items: center; gap: var(--s-8); }
.q__gift:hover .q__gift-t { text-decoration: underline; text-underline-offset: 4px; }
.q__scroll--done { padding-bottom: var(--s-40); }

@media (prefers-reduced-motion: no-preference) {
  .q[open] .q__panel { animation: q-in-x .28s var(--ease); }
  .q[open]::backdrop { animation: q-fade .2s ease-out; }
  @keyframes q-in-x { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes q-in-y { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes q-fade { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- mobil: spodní sheet (Figma 390) ---------- */
@media (max-width: 767px) {
  .q__panel { top: auto; left: 0; width: 100%; max-height: calc(100dvh - 64px); border-radius: var(--radius-s) var(--radius-s) 0 0; }
  .q[open] .q__panel { animation-name: q-in-y; }
  .q__handle { display: flex; justify-content: center; padding: var(--s-12) 0 var(--s-4); flex: none; }
  .q__handle::before { content: ""; width: 40px; height: 4px; border-radius: var(--radius-pill); background: var(--line-strong); }
  .q__scroll { gap: var(--s-24); padding: var(--s-8) var(--s-20) var(--s-24); }
  .q__foot { padding: var(--s-12) var(--s-20) calc(var(--s-20) + env(safe-area-inset-bottom)); }
  .q__time h2 { font: 400 30px/38px var(--serif); letter-spacing: 0; }
  .q__when { gap: var(--s-12); }
  .q__barber { gap: var(--s-12); }
  .q__sec-lead { display: none; }
  .q-opt { grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: var(--s-12); padding: var(--s-16); }
  .q-opt__meta { grid-column: 2; flex-direction: row; align-items: center; gap: var(--s-12); padding-top: var(--s-4); }
  .q__done-title { font: 400 30px/38px var(--serif); }
  .q__done-head { gap: var(--s-12); }
  .q__sum { gap: var(--s-16); padding: var(--s-20); }
  .q__sum dl { gap: var(--s-16); }
  .q__sum h3 { font: 400 28px/36px var(--serif); }
  .q__scroll--done { padding-bottom: calc(var(--s-32) + env(safe-area-inset-bottom)); }
}
