/*
 * SOS Booking — widget styles. Every selector is scoped under .sosb-widget (no global resets); the extra class also beats
 * the theme reset rules on button:hover/:focus and white-space: nowrap.
 *
 * Contrast (WCAG relative luminance, computed):
 *   white on rose #C86B7A ......... 3.60:1  FAILS for text  -> not used for text
 *   white on CTA  #A8505F ......... 5.28:1  OK (CTA background)
 *   ink #3D2B32 on white .......... 13.21:1 | on blush #FCEEF0 11.71:1 | on cream #FBF7F3 12.39:1
 *   muted #6B5860 on white ........ 6.58:1  | on blush 5.84:1 | on cream 6.18:1
 *   link/accent text #8F3F4E on white 7.03:1 | on blush 6.23:1
 *   ink on signature pink #FDAFBC . 7.57:1  (pink only as accent/fill behind ink text, never as text on white: 1.74:1)
 *   rose #C86B7A as border/focus vs white 3.60:1 (>= 3:1 for UI components)
 * SOS card (band #FDE6EA, tariff panel white):
 *   ink on band 11.12:1 | muted on band 5.54:1 | accent #8F3F4E on band 5.92:1 | ink on white panel 13.21:1
 *   white on CTA #A8505F (button, "SOS" badge) 5.28:1 | ink on pink badge #FDAFBC 7.57:1
 *   CTA border #A8505F vs band 4.45:1 and vs page cream >= 3:1 (UI component)
 */

.sosb-widget {
  --sosb-ink: #3D2B32;
  --sosb-muted: #6B5860;
  --sosb-rose: #C86B7A;
  --sosb-cta: #A8505F;
  --sosb-cta-hover: #8F3F4E;
  --sosb-accent-text: #8F3F4E;
  --sosb-pink: #FDAFBC;
  --sosb-blush: #FCEEF0;
  --sosb-cream: #FBF7F3;
  --sosb-line: #E4CDD2;
  --sosb-error: #A12B3F; /* 6.9:1 on white */
  --sosb-radius: 14px;
  --sosb-font-title: Georgia, "Times New Roman", serif;
  --sosb-font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  box-sizing: border-box;
  max-width: 920px;
  margin: 0 auto;
  padding: 16px;
  background: var(--sosb-cream);
  color: var(--sosb-ink);
  font-family: var(--sosb-font-ui);
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--sosb-radius);
  overflow-wrap: anywhere;
  /* Layout reacts to the widget width, not the viewport: inside the Elementor popup the viewport is wide but the widget is narrow. */
  container-type: inline-size;
  container-name: sosb;
}
.sosb-widget *, .sosb-widget *::before, .sosb-widget *::after { box-sizing: border-box; }
.sosb-widget :where(h2, h3, p, ul, ol, dl, dd, fieldset) { margin: 0; padding: 0; }
.sosb-widget :where(ul, ol) { list-style: none; }
.sosb-widget button, .sosb-widget input { font: inherit; color: inherit; }
/* Theme/Elementor kit styles buttons globally (white-space: nowrap, uppercase, letter-spacing): neutralise them
   inside the widget. Selectors carry class + element specificity to beat the theme reset. */
.sosb-widget button.sosb-card, .sosb-widget button.sosb-card *, .sosb-widget .sosb-btn, .sosb-widget .sosb-link {
  white-space: normal; text-transform: none; letter-spacing: normal; word-spacing: normal;
}
.sosb-widget button.sosb-card { font-weight: 400; line-height: 1.5; box-shadow: none; height: auto; }
.sosb-widget a { color: var(--sosb-accent-text); text-decoration: underline; text-underline-offset: 2px; }

.sosb-widget :focus-visible {
  outline: 3px solid var(--sosb-ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #fff;
}
.sosb-widget [tabindex="-1"]:focus { outline: none; }
.sosb-widget [tabindex="-1"]:focus-visible { outline: 3px solid var(--sosb-ink); outline-offset: 4px; box-shadow: none; }

.sosb-widget .sosb-sr, .sosb-widget .sosb-live {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sosb-widget .sosb-hp {
  position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden;
}

.sosb-widget .sosb-muted { color: var(--sosb-muted); font-size: .9375rem; }
.sosb-widget .sosb-icon { display: inline-block; margin-right: .35em; }

/* ---------- headings ---------- */
.sosb-widget .sosb-title { font-family: var(--sosb-font-title); font-weight: 400; font-size: 1.5rem; line-height: 1.25; margin: 4px 0 12px; color: var(--sosb-ink); }
.sosb-widget .sosb-title--ok { color: var(--sosb-accent-text); }
.sosb-widget .sosb-subtitle { font-family: var(--sosb-font-title); font-weight: 400; font-size: 1.125rem; margin: 20px 0 8px; }
.sosb-widget .sosb-lead { font-size: 1.0625rem; margin-bottom: 16px; }

/* ---------- stepper ---------- */
.sosb-widget .sosb-steps { display: flex; gap: 6px; margin-bottom: 12px; font-size: .8125rem; }
.sosb-widget .sosb-steps__item { flex: 1 1 0; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--sosb-line); color: var(--sosb-muted); }
.sosb-widget .sosb-steps__item.is-current { background: var(--sosb-blush); border-color: var(--sosb-rose); color: var(--sosb-ink); font-weight: 600; }
.sosb-widget .sosb-steps__item.is-done { color: var(--sosb-ink); }
.sosb-widget .sosb-steps__n { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sosb-pink); color: var(--sosb-ink); font-weight: 700; font-size: .75rem; }
.sosb-widget .sosb-steps__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .sosb-widget .sosb-steps__item:not(.is-current) .sosb-steps__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .sosb-widget .sosb-steps__item:not(.is-current) { flex: none; } }

/* ---------- buttons ---------- */
.sosb-widget .sosb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 48px; min-width: 44px; padding: 10px 20px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color .15s ease, border-color .15s ease;
}
.sosb-widget a.sosb-btn { text-decoration: none; }
.sosb-widget .sosb-btn--primary { background: var(--sosb-cta); color: #fff; }
.sosb-widget .sosb-btn--primary:hover:not(:disabled) { background: var(--sosb-cta-hover); }
.sosb-widget .sosb-btn--secondary { background: #fff; color: var(--sosb-accent-text); border-color: var(--sosb-rose); }
.sosb-widget .sosb-btn--secondary:hover { background: var(--sosb-blush); }
.sosb-widget .sosb-btn--block { width: 100%; }
.sosb-widget .sosb-btn:disabled { background: #EADDE0; color: #5E4B52; border-color: transparent; cursor: not-allowed; } /* #5E4B52 on #EADDE0 = 5.9:1 */
.sosb-widget .sosb-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; background: none; border: 0; color: var(--sosb-accent-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: .9375rem; }

/* ---------- alerts / notices ---------- */
.sosb-widget .sosb-alert, .sosb-widget .sosb-notice, .sosb-widget .sosb-errsum { padding: 12px 14px; margin: 8px 0 12px; border-radius: 10px; background: #fff; border: 2px solid var(--sosb-error); border-left-width: 6px; }
.sosb-widget .sosb-notice { border-color: var(--sosb-rose); background: var(--sosb-blush); }
.sosb-widget .sosb-alert > * + * { margin-top: 8px; }
.sosb-widget .sosb-errsum[hidden] { display: none; }
.sosb-widget .sosb-errsum__t { font-family: var(--sosb-font-title); font-weight: 700; font-size: 1.0625rem; margin-bottom: 4px; }
.sosb-widget .sosb-errsum ul { list-style: disc; padding-left: 1.2em; }
.sosb-widget .sosb-errsum a { color: var(--sosb-error); }
.sosb-widget .sosb-noscript { padding: 16px; background: var(--sosb-blush); border-radius: 10px; }

/* ---------- service cards ---------- */
.sosb-widget .sosb-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.sosb-widget .sosb-cards__li { min-width: 0; display: flex; }
.sosb-widget .sosb-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: 100%; min-width: 0; padding: 16px; text-align: left;
  background: #fff; border: 2px solid var(--sosb-line); border-radius: var(--sosb-radius); color: var(--sosb-ink);
}
.sosb-widget button.sosb-card { cursor: pointer; }
.sosb-widget button.sosb-card:hover { border-color: var(--sosb-rose); background: var(--sosb-blush); }
.sosb-widget .sosb-card__name { font-family: var(--sosb-font-title); font-size: 1.1875rem; line-height: 1.3; }
.sosb-widget .sosb-card__mod { font-size: .875rem; font-weight: 600; color: var(--sosb-accent-text); }
.sosb-widget .sosb-card__desc { color: var(--sosb-muted); font-size: .9375rem; }
.sosb-widget .sosb-card__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9375rem; }
.sosb-widget .sosb-card__price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sosb-widget .sosb-price { font-size: 1.375rem; font-weight: 700; }
.sosb-widget .sosb-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--sosb-pink); color: var(--sosb-ink); font-size: .8125rem; font-weight: 600; }
.sosb-widget .sosb-card__cta { margin-top: 4px; font-weight: 600; color: var(--sosb-accent-text); }
.sosb-widget .sosb-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.sosb-widget .sosb-card__how { flex-basis: 100%; font-weight: 600; }

/* ---------- SOS card (dedicated, full width, above the standard grid) ---------- */
.sosb-widget .sosb-sos-list { display: grid; gap: 12px; margin-bottom: 20px; }
.sosb-widget .sosb-sos {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px;
  background: #FDE6EA; border: 4px solid var(--sosb-cta); border-radius: var(--sosb-radius); color: var(--sosb-ink);
}
.sosb-widget .sosb-sos__main > * + * { margin-top: 8px; }
.sosb-widget .sosb-sos__tag { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .875rem; font-weight: 600; color: var(--sosb-accent-text); }
.sosb-widget .sosb-sos__badge, .sosb-widget .sosb-badge--sos { display: inline-block; padding: 2px 10px; border-radius: 6px; background: var(--sosb-cta); color: #fff; font-weight: 700; letter-spacing: .08em; font-size: .8125rem; }
.sosb-widget .sosb-sos__title { font-family: var(--sosb-font-title); font-weight: 400; font-size: 1.375rem; line-height: 1.25; color: var(--sosb-ink); margin: 0; }
.sosb-widget .sosb-sos__desc { color: var(--sosb-ink); font-size: .9375rem; }
.sosb-widget .sosb-sos__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9375rem; font-weight: 600; }
.sosb-widget .sosb-sos__side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sosb-widget .sosb-sos__tariff { padding: 10px 14px; background: #fff; border: 2px dashed var(--sosb-cta); border-radius: 10px; text-align: center; }
.sosb-widget .sosb-sos__label { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sosb-accent-text); }
.sosb-widget .sosb-sos__price { font-family: var(--sosb-font-title); font-size: 2.25rem; line-height: 1.1; font-weight: 700; color: var(--sosb-ink); }
.sosb-widget .sosb-sos__tariff .sosb-badge { margin-top: 4px; }
.sosb-widget .sosb-sos__avail { font-size: .9375rem; text-align: center; }
.sosb-widget .sosb-sos__avail[hidden], .sosb-widget .sosb-sos__tel[hidden] { display: none; }
.sosb-widget .sosb-sos__tel { align-self: center; font-weight: 600; }
.sosb-widget .sosb-sos__note { font-size: .8125rem; color: var(--sosb-muted); }
.sosb-widget .sosb-sos__cta { font-size: 1.0625rem; }
.sosb-widget .sosb-others { margin-top: 4px; }
@container sosb (min-width: 600px) {
  .sosb-widget .sosb-sos { grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); column-gap: 24px; align-items: center; padding: 20px; }
  .sosb-widget .sosb-sos__note { grid-column: 1 / -1; }
  .sosb-widget .sosb-sos__title { font-size: 1.625rem; }
}

/* ---------- layout (summary stays visible) ---------- */
.sosb-widget .sosb-layout { display: grid; gap: 16px; }
.sosb-widget .sosb-layout__side > * + * { margin-top: 12px; }
@container sosb (min-width: 600px) {
  .sosb-widget .sosb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container sosb (min-width: 780px) {
  .sosb-widget .sosb-layout { grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr); align-items: start; }
  .sosb-widget .sosb-layout__side { position: sticky; top: 16px; }
}
@media (min-width: 820px) {
  .sosb-widget { padding: 28px; }
}

/* ---------- calendar ---------- */
.sosb-widget .sosb-cal { background: #fff; border: 1px solid var(--sosb-line); border-radius: var(--sosb-radius); padding: 12px; }
.sosb-widget .sosb-cal__nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sosb-widget .sosb-cal__month { font-family: var(--sosb-font-title); font-weight: 400; font-size: 1.1875rem; text-transform: capitalize; text-align: center; flex: 1; }
.sosb-widget .sosb-cal__btn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--sosb-rose); background: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.sosb-widget .sosb-cal__btn:hover:not(:disabled) { background: var(--sosb-blush); }
.sosb-widget .sosb-cal__btn:disabled { opacity: .4; cursor: not-allowed; }
.sosb-widget .sosb-grid { display: grid; gap: 2px; }
.sosb-widget .sosb-grid__row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.sosb-widget .sosb-grid__dow { text-align: center; font-size: .75rem; font-weight: 700; color: var(--sosb-muted); padding: 4px 0; }
.sosb-widget .sosb-grid__pad { min-height: 44px; }
.sosb-widget .sosb-day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 48px; min-width: 0; padding: 2px; border-radius: 10px; border: 2px solid transparent;
  background: #fff; cursor: pointer; font-weight: 600;
}
.sosb-widget .sosb-day__n { font-size: 1rem; }
.sosb-widget .sosb-day.is-available { background: var(--sosb-blush); border-color: var(--sosb-pink); }
.sosb-widget .sosb-day.is-available:hover { border-color: var(--sosb-rose); }
.sosb-widget .sosb-day.is-off { color: #5E4B52; font-weight: 400; cursor: not-allowed; background: #fff; }
.sosb-widget .sosb-day.is-off .sosb-day__n { text-decoration: line-through; text-decoration-thickness: 1px; }
.sosb-widget .sosb-day__off { font-size: .5625rem; line-height: 1.05; text-align: center; color: var(--sosb-muted); max-width: 100%; }
.sosb-widget .sosb-day.is-selected { background: var(--sosb-cta); border-color: var(--sosb-ink); color: #fff; }
.sosb-widget .sosb-day__tick { position: absolute; top: 1px; right: 4px; font-size: .75rem; }
.sosb-widget .sosb-cal__legend { margin-top: 8px; font-size: .8125rem; }
@media (max-width: 360px) { .sosb-widget { padding: 12px; } .sosb-widget .sosb-cal { padding: 8px; } .sosb-widget .sosb-day__off { display: none; } }

/* ---------- slots ---------- */
.sosb-widget .sosb-slotlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.sosb-widget .sosb-slot { display: block; position: relative; }
.sosb-widget .sosb-slot__input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sosb-widget .sosb-slot__box {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; min-width: 44px; padding: 8px 10px;
  background: #fff; border: 2px solid var(--sosb-rose); border-radius: 10px; font-weight: 600; font-size: 1.0625rem;
}
.sosb-widget .sosb-slot__tick { display: none; }
.sosb-widget .sosb-slot__input:hover + .sosb-slot__box { background: var(--sosb-blush); }
.sosb-widget .sosb-slot__input:checked + .sosb-slot__box { background: var(--sosb-cta); border-color: var(--sosb-ink); color: #fff; }
.sosb-widget .sosb-slot__input:checked + .sosb-slot__box .sosb-slot__tick { display: inline; }
.sosb-widget .sosb-slot__input:focus-visible + .sosb-slot__box { outline: 3px solid var(--sosb-ink); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
.sosb-widget .sosb-slot__input:focus-visible { outline: none; box-shadow: none; }

/* ---------- summary ---------- */
.sosb-widget .sosb-summary { padding: 14px 16px; background: #fff; border: 2px solid var(--sosb-pink); border-radius: var(--sosb-radius); }
.sosb-widget .sosb-summary__title { font-family: var(--sosb-font-title); font-weight: 400; font-size: 1.125rem; margin-bottom: 6px; }
.sosb-widget .sosb-summary__row { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--sosb-blush); }
.sosb-widget .sosb-summary__row:last-child { border-bottom: 0; }
.sosb-widget .sosb-summary dt { flex: 0 0 6.5em; color: var(--sosb-muted); font-size: .9375rem; }
.sosb-widget .sosb-summary dd { flex: 1; font-weight: 600; min-width: 0; }
.sosb-widget .sosb-note { margin-top: 8px; font-size: .875rem; color: var(--sosb-muted); }
.sosb-widget .sosb-form .sosb-summary { margin: 20px 0 14px; }

/* ---------- form ---------- */
.sosb-widget .sosb-form { margin-top: 8px; }
.sosb-widget .sosb-field, .sosb-widget .sosb-fieldset, .sosb-widget .sosb-phonewrap { margin-bottom: 16px; }
.sosb-widget .sosb-fieldset { border: 0; min-width: 0; }
.sosb-widget .sosb-label { display: block; font-weight: 600; margin-bottom: 4px; padding: 0; }
.sosb-widget .sosb-req { color: var(--sosb-error); }
.sosb-widget .sosb-hint { color: var(--sosb-muted); font-size: .875rem; margin-bottom: 4px; }
.sosb-widget .sosb-input {
  display: block; width: 100%; min-height: 48px; padding: 10px 12px; background: #fff;
  border: 2px solid #8C7078; /* 4.5:1 on white */ border-radius: 10px;
}
.sosb-widget .sosb-field.has-error .sosb-input { border-color: var(--sosb-error); }
.sosb-widget .sosb-error { margin-top: 4px; color: var(--sosb-error); font-weight: 600; font-size: .9375rem; }
.sosb-widget .sosb-choice { display: block; position: relative; margin-bottom: 8px; }
.sosb-widget .sosb-choice input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sosb-widget .sosb-choice__box { display: flex; flex-direction: column; min-height: 52px; padding: 10px 14px 10px 44px; background: #fff; border: 2px solid var(--sosb-line); border-radius: 10px; position: relative; }
.sosb-widget .sosb-choice__box::before { content: ""; position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border: 2px solid var(--sosb-ink); border-radius: 50%; background: #fff; }
.sosb-widget .sosb-choice__t { font-weight: 600; }
.sosb-widget .sosb-choice__s { font-size: .875rem; color: var(--sosb-muted); }
.sosb-widget .sosb-choice input:checked + .sosb-choice__box { border-color: var(--sosb-ink); background: var(--sosb-blush); }
.sosb-widget .sosb-choice input:checked + .sosb-choice__box::before { background: radial-gradient(circle, var(--sosb-cta) 0 5px, #fff 5.5px); }
.sosb-widget .sosb-choice input:focus-visible + .sosb-choice__box { outline: 3px solid var(--sosb-ink); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
.sosb-widget .sosb-choice input:focus-visible { outline: none; box-shadow: none; }
.sosb-widget .sosb-check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.sosb-widget .sosb-check input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--sosb-cta); }
.sosb-widget .sosb-field--check.has-error .sosb-check { outline: 2px solid var(--sosb-error); outline-offset: 4px; border-radius: 6px; }

/* ---------- success ---------- */
.sosb-widget .sosb-next { list-style: disc !important; padding-left: 1.2em !important; display: grid; gap: 6px; }
.sosb-widget .sosb-pay { margin-top: 12px; padding: 14px 16px; background: var(--sosb-blush); border-radius: 10px; }
.sosb-widget .sosb-pay .sosb-subtitle { margin-top: 0; }
.sosb-widget .sosb-pay__t { white-space: pre-line; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .sosb-widget *, .sosb-widget *::before, .sosb-widget *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .sosb-widget .sosb-day.is-selected, .sosb-widget .sosb-slot__input:checked + .sosb-slot__box { outline: 3px solid Highlight; }
}
