/* Орто Пункт: прозорец за записване. Езикът на сайта (site/PROJECT.md, site/child-theme/style.css): тъмносиньо и
   кехлибар, Inter + Newsreader за заглавията + JetBrains Mono за малкия надпис, полетата като формата в /kontakti/,
   тъмносин текст върху кехлибарените бутони (контраст AA, както CTA-тата на сайта). Преглед:
   site/previews/booking-popup.html. Всичко е под .opb (прозорецът) и .op-booking-confirmation (шорткодът). */

.opb,
.op-booking-confirmation {
  --opb-navy: #0B1D3A;
  --opb-navy-2: #122B52;
  --opb-amber: #D4873A;
  --opb-amber-2: #C07830;
  --opb-amber-text: #A35A17;
  --opb-ink: #1A1A2E;
  --opb-ink-2: #4A4A5A;
  --opb-bg: #FFFFFF;
  --opb-bg-2: #F5F7FA;
  --opb-line: #E2E6EC;
  --opb-line-2: #CFD6E0;
  --opb-ok: #2D8A4E;
  --opb-err: #B42318;
  --opb-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --opb-serif: "Newsreader", Georgia, serif;
  --opb-mono: "JetBrains Mono", Inter, monospace;
}

/* Divi и темата стилизират p, h2, бутони и връзки глобално. Нулирането е с тежестта на един клас и стои първо,
   за да го надделяват класовете на прозореца по-долу. */
.opb *, .opb *::before, .opb *::after,
.op-booking-confirmation *, .op-booking-confirmation *::before, .op-booking-confirmation *::after { box-sizing: border-box; }
.opb :where(h2, p, ul, li),
.op-booking-confirmation :where(h2, p, ul, li) { margin: 0; padding: 0; }
.opb :where(ul) { list-style: none; }
.opb :where(button, input, select),
.op-booking-confirmation :where(button, input, select) { font-family: inherit; letter-spacing: normal; text-transform: none; text-shadow: none; box-shadow: none; }
.opb :where(a),
.op-booking-confirmation :where(a) { box-shadow: none; border-bottom: 0; }

/* ------------------------------------------------------------------ прозорецът */

.opb {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--opb-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--opb-ink);
}
.opb[hidden] { display: none !important; }
html.opb-open, html.opb-open body { overflow: hidden; }

.opb__scrim { position: absolute; inset: 0; background: rgba(11, 29, 58, .62); }

.opb__dialog {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--opb-bg);
  border-radius: 20px;
  overflow: hidden;
  outline: none;
}

.opb__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 0;
}
.opb__heading { min-width: 0; }

.opb__eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--opb-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--opb-amber-text);
}
.opb__eyebrow::before {
  content: "";
  flex: none;
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

.opb__title {
  margin-top: 12px;
  font-family: var(--opb-serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--opb-navy);
  text-wrap: balance;
}

.opb__x {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -6px -8px 0 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--opb-line);
  border-radius: 50%;
  background: var(--opb-bg);
  color: var(--opb-navy);
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease;
}
.opb__x:hover { border-color: var(--opb-navy); background: var(--opb-bg-2); }

.opb__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 32px 32px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--opb-line-2) transparent;
}

/* ------------------------------------------------------------------ текст */

.opb__label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--opb-navy);
}
.opb__lead { font-size: 17px; line-height: 1.6; color: var(--opb-ink); }
.opb__muted { font-size: 15px; line-height: 1.55; color: var(--opb-ink-2); }
.opb__tel { font-weight: 700; color: var(--opb-navy); text-decoration: underline; text-underline-offset: 3px; }

.opb__notice {
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.55;
  background: var(--opb-bg-2);
  border: 1px solid var(--opb-line);
  border-radius: 12px;
  color: var(--opb-ink);
}
.opb__notice--error { background: #FEF3F2; border-color: #F6D3CF; color: var(--opb-err); }

.opb__reassure {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--opb-ink-2);
}
.opb__reassure svg { flex: none; margin-top: 2px; color: var(--opb-amber-text); }
.opb__reassure--ok svg { color: var(--opb-ok); }

/* ------------------------------------------------------------------ услуги */

.opb__services {
  border: 1px solid var(--opb-line);
  border-radius: 14px;
  overflow: hidden;
}
.opb__services li + li { border-top: 1px solid var(--opb-line); }
.opb__service {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 0;
  background: var(--opb-bg);
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  color: var(--opb-ink);
  cursor: pointer;
  transition: background-color .25s ease;
}
.opb__service:hover { background: var(--opb-bg-2); }
.opb__service-name { flex: 1 1 auto; font-weight: 600; color: var(--opb-navy); }
.opb__service-price {
  flex: none;
  font-weight: 600;
  color: var(--opb-ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.opb__service svg { flex: none; color: var(--opb-amber-text); }

.opb__summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: var(--opb-bg-2);
  border: 1px solid var(--opb-line);
  border-radius: 14px;
}
.opb__summary-main { min-width: 0; }
.opb__summary-name,
.opb__price {
  font-family: var(--opb-serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--opb-navy);
}
.opb__summary-meta { margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--opb-ink-2); }
.opb__summary-side { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.opb__price { white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.opb__link {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--opb-amber-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.opb__alt { font-size: 15px; line-height: 1.5; color: var(--opb-ink-2); }
.opb__alt a { font-weight: 600; color: var(--opb-amber-text); text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ ден и час */

.opb__group { min-width: 0; }
.opb__days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -2px;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--opb-line-2) transparent;
}
.opb__day {
  flex: none;
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px 8px;
  border: 1px solid var(--opb-line);
  border-radius: 12px;
  background: var(--opb-bg);
  color: var(--opb-ink);
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color .25s ease, background-color .25s ease;
}
.opb__day:hover { border-color: var(--opb-navy); }
.opb__day-w, .opb__day-m { font-size: 15px; line-height: 1.2; color: var(--opb-ink-2); }
.opb__day-n {
  font-family: var(--opb-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--opb-navy);
  font-variant-numeric: lining-nums tabular-nums;
}
.opb__day[aria-pressed="true"] { background: var(--opb-navy); border-color: var(--opb-navy); }
.opb__day[aria-pressed="true"] .opb__day-n { color: #FFFFFF; }
.opb__day[aria-pressed="true"] .opb__day-w,
.opb__day[aria-pressed="true"] .opb__day-m { color: #CBD3E0; }

.opb__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.opb__slot {
  min-height: 48px;
  padding: 0;
  border: 1px solid var(--opb-line);
  border-radius: 10px;
  background: var(--opb-bg);
  font-size: 16px;
  font-weight: 600;
  color: var(--opb-navy);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color .25s ease, background-color .25s ease;
}
.opb__slot:hover { border-color: var(--opb-amber); }
.opb__slot[aria-pressed="true"] { background: var(--opb-amber); border-color: var(--opb-amber); color: var(--opb-navy); }

/* ------------------------------------------------------------------ бутони (като .contact__submit на сайта) */

.opb__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 28px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease;
}
.opb__btn svg { flex: none; }
.opb__btn--primary { background: var(--opb-amber); color: var(--opb-navy); }
.opb__btn--primary:hover { background: var(--opb-amber-2); color: var(--opb-navy); }
.opb__btn--primary:disabled { background: #EBD3B8; color: #6B5A48; cursor: not-allowed; }
.opb__btn--ghost { background: var(--opb-bg); border-color: var(--opb-line-2); color: var(--opb-navy); }
.opb__btn--ghost:hover { border-color: var(--opb-navy); }
.opb__btn--wide { width: 100%; }
.opb__actions { display: flex; gap: 12px; }
.opb__actions .opb__btn--primary { flex: 1 1 auto; }

/* ------------------------------------------------------------------ данни */

.opb__form { display: flex; flex-direction: column; gap: 20px; }
.opb__field { display: flex; flex-direction: column; }
/* Тежест .opb .opb__input: темата стилизира input[type=text/email/tel] глобално и иначе сменя шрифта в полетата. */
.opb .opb__input {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 13px 16px;
  border: 1px solid var(--opb-line);
  border-radius: 10px;
  background: var(--opb-bg);
  font-family: var(--opb-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--opb-ink);
  appearance: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.opb .opb__input::placeholder { color: var(--opb-ink-2); opacity: .85; }
.opb .opb__input:focus { outline: none; border-color: var(--opb-amber); box-shadow: 0 0 0 3px rgba(212, 135, 58, .14); }
.opb .opb__input[aria-invalid="true"] { border-color: var(--opb-err); }
.opb__field-err { margin-top: 6px; font-size: 15px; line-height: 1.45; color: var(--opb-err); }

.opb__consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--opb-ink-2);
  cursor: pointer;
}
.opb__consent a { color: var(--opb-amber-text); text-decoration: underline; text-underline-offset: 2px; }
.opb__check { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--opb-amber); cursor: pointer; }

.opb__msg { display: flex; flex-direction: column; gap: 12px; }
.opb__msg:empty { display: none; }
.opb__hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; }

/* ------------------------------------------------------------------ потвърждение: тъмносиният „билет“ (като панела на процедурите) */

.opb__ticket {
  position: relative;
  overflow: hidden;
  padding: 24px 24px 20px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--opb-navy) 0%, var(--opb-navy-2) 100%);
  color: #FFFFFF;
}
.opb__ticket::before {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212, 135, 58, .13) 0%, rgba(212, 135, 58, 0) 65%);
  pointer-events: none;
}
.opb__body-status { display: flex; flex-direction: column; gap: 16px; }
.opb__ticket > * { position: relative; }
.opb__ticket-label {
  font-family: var(--opb-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--opb-amber);
}
.opb__ticket-date {
  margin-top: 12px;
  font-family: var(--opb-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  color: #FFFFFF;
}
.opb__ticket-time {
  font-family: var(--opb-serif);
  font-size: 48px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: #FFFFFF;
  font-variant-numeric: lining-nums tabular-nums;
}
.opb__ticket-service { margin-top: 8px; font-size: 16px; font-weight: 600; line-height: 1.4; color: #CBD3E0; }
.opb__ticket-no {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 15px;
  color: #9FB0C8;
}
.opb__ticket-code { font-family: var(--opb-mono); letter-spacing: .04em; color: #FFFFFF; }

.opb__wait { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 1.5; color: var(--opb-ink-2); }
.opb__spinner {
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--opb-line);
  border-top-color: var(--opb-amber);
  border-radius: 50%;
  animation: opb-spin .9s linear infinite;
}
@keyframes opb-spin { to { transform: rotate(360deg); } }

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

/* Фокус от клавиатура: тъмносин контур (кехлибареният не се вижда върху кехлибарените бутони). Полетата имат своя. */
.opb :is(button, a, .opb__check):focus-visible,
.op-booking-confirmation :is(button, a):focus-visible {
  outline: 3px solid var(--opb-navy);
  outline-offset: 2px;
}
.opb__service:focus-visible { outline-offset: -3px; }

@media (max-width: 600px) {
  .opb { padding: 0; align-items: stretch; }
  .opb__dialog { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .opb__head { padding: 20px 20px 0; }
  .opb__title { font-size: 26px; }
  .opb__body { padding: 20px 20px 28px; }
  .opb__grid { grid-template-columns: repeat(3, 1fr); }
  .opb__actions { flex-direction: column-reverse; }
  .opb__actions .opb__btn { width: 100%; }
  .opb__ticket-time { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .opb *, .op-booking-confirmation * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ шорткодове на страница */

.op-booking-confirmation {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 0;
  font-family: var(--opb-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--opb-ink);
}
.op-booking-confirmation .opb__title { margin-top: 0; }

.op-booking-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 24px;
  border-radius: 12px;
  background: #D4873A;
  color: #0B1D3A;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}
.op-booking-btn:hover { background: #C07830; color: #0B1D3A; }
