/* ==========================================================================
   Book a consultation — interaction layer for the Elementor-native page template
   (figma-templates/redesign/build-book.mjs; Figma 1:2117 desktop, 11:1632 mobile, booking
   form 1:1963). Loaded on that page only (body.nw-book, see functions.php).

   Layout, typography, colours and spacing are Elementor settings, including the Pro
   form's label / field / button styles. This file adds what those controls can't: the
   option cards (consultation type, times), the day strip and summary built by js/app.js
   "Book a consultation", the step headers and button icons, and the plain booking band
   on phones. Shared form field styling and the FAQ accordion: components.css.
   ========================================================================== */

/* Topic rows (icon + text): the text column fills what the icon leaves and wraps. Elementor's
   default container --width:100% (and a fixed flex basis) would push it past the row. */
.nw-book-intro__copy .e-con:has(> .elementor-widget-icon) > .e-con { flex: 1 1 0%; min-width: 0; }

/* "Before we connect" breaks after "we" on desktop (Figma); one line on tablet / phone. */
.nw-book .nw-book-connect h2.elementor-heading-title { max-width: 520px; }

/* Booking band: photo + scrim on tablet/desktop only; phones get the plain surface. */
@media (max-width: 767px) {
  .nw-book .e-con.nw-book-booking { background-image: none !important; }
  .nw-book .e-con.nw-book-booking::before { display: none; }
}

/* Fields: shared form styling is in components.css; the project notes box is taller here. */
.nw-book .nw-book-form textarea.elementor-field-textual { min-height: 244px; resize: vertical; }

/* Step header ("1 Your details"), an HTML field at the top of each step. */
.nw-book .nw-step { display: flex; align-items: center; gap: 10px; margin: 0 0 2px; color: var(--nw-ink); font: 600 16px/1.6 var(--nw-font-body); }
.nw-book .nw-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--nw-surface);
  color: var(--nw-navy-600);
  font: 600 12px/1.4 var(--nw-font-body);
}

/* Labels the Figma doesn't show (still read by screen readers). */
.nw-book .elementor-field-group-call_type > .elementor-field-label,
.nw-book .nw-book-form.is-enhanced .elementor-field-group-date > .elementor-field-label,
.nw-book .nw-book-form.is-enhanced .elementor-field-group-date input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0 !important;
}
/* "Times shown in Eastern Time" reads as a hint, not a field label. */
.nw-book .elementor-field-group-time > .elementor-field-label { color: var(--nw-body); font-size: 13px; }
.nw-book .elementor-field-group-time.elementor-mark-required > .elementor-field-label::after { content: none; }

/* ---- Option cards: consultation type + time slots ----------------------- */
.nw-book .elementor-field-group-call_type .elementor-field-subgroup,
.nw-book .elementor-field-group-time .elementor-field-subgroup { display: grid; gap: 10px; width: 100%; }
.nw-book .elementor-field-group-call_type .elementor-field-subgroup { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.nw-book .elementor-field-group-time .elementor-field-subgroup { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.nw-book .elementor-field-group-call_type .elementor-field-option,
.nw-book .elementor-field-group-time .elementor-field-option { position: relative; display: block; margin: 0; padding: 0; }
.nw-book .elementor-field-group-call_type .elementor-field-option input,
.nw-book .elementor-field-group-time .elementor-field-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.nw-book .elementor-field-group-call_type .elementor-field-option label,
.nw-book .elementor-field-group-time .elementor-field-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--nw-line-strong);
  border-radius: 4px;
  background: var(--nw-white);
  color: var(--nw-body);
  font: 400 14px/1.5 var(--nw-font-body);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.nw-book .elementor-field-group-call_type .elementor-field-option label { min-height: 44px; }
.nw-book .elementor-field-option input:checked + label { border-color: var(--nw-navy-600); background: var(--nw-tint); color: var(--nw-navy-600); }
.nw-book .elementor-field-option input:focus-visible + label { outline: 2px solid var(--nw-navy-600); outline-offset: 2px; }
.nw-book .elementor-field-option input:hover + label { border-color: var(--nw-navy-600); }
.nw-book .elementor-field-group-call_type .elementor-field-option label::before,
.nw-book .elementor-field-group-call_type .elementor-field-option input:checked + label::after,
.nw-book .nw-dates__nav button::before,
.nw-book .nw-book-summary::before,
.nw-book .nw-book-form .e-form__buttons__wrapper__button-next::after {
  content: "";
  flex: none;
  display: inline-block;
  background: currentColor;
  -webkit-mask: var(--nw-icon) center / contain no-repeat;
          mask: var(--nw-icon) center / contain no-repeat;
}
.nw-book .elementor-field-group-call_type .elementor-field-option label::before { --nw-icon: url(../images/icons/video.svg); width: 18px; height: 18px; }
.nw-book .elementor-field-group-call_type .elementor-field-option:nth-child(2) label::before { --nw-icon: url(../images/icons/phone.svg); }
.nw-book .elementor-field-group-call_type .elementor-field-option input:checked + label::after { --nw-icon: url(../images/icons/check.svg); width: 16px; height: 16px; }

/* ---- Day strip (js/app.js builds it in the date field's group) ------------ */
.nw-book .nw-dates { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.nw-book .nw-dates__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nw-book .nw-dates__month { margin: 0; color: var(--nw-ink); font: 600 16px/1.2 var(--nw-font-body); }
.nw-book .nw-dates__nav { display: flex; gap: 16px; }
.nw-book .nw-dates__nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -5px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: none;
  color: var(--nw-navy-600);
  cursor: pointer;
}
.nw-book .nw-dates__nav button:hover,
.nw-book .nw-dates__nav button:focus { background: var(--nw-tint); color: var(--nw-navy-600); }
.nw-book .nw-dates__nav button:disabled { background: none; color: #8f8f8f; cursor: default; }
.nw-book .nw-dates__nav button::before { width: 18px; height: 18px; }
.nw-book .nw-dates__prev::before { --nw-icon: url(../images/icons/chev-left.svg); }
.nw-book .nw-dates__next::before { --nw-icon: url(../images/icons/chev-right.svg); }
.nw-book .nw-dates__days { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.nw-book .nw-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 66px;
  padding: 8px 4px;
  border: 1px solid var(--nw-line-strong);
  border-radius: 4px;
  background: var(--nw-white);
  color: var(--nw-ink);
  font-family: var(--nw-font-body);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.nw-book .nw-day__wd { color: var(--nw-body); font-size: 12px; line-height: 1.25; }
.nw-book .nw-day__num { font-size: 21px; line-height: 1.2; }
.nw-book .nw-day:hover,
.nw-book .nw-day:focus { border-color: var(--nw-navy-600); background: var(--nw-white); color: var(--nw-ink); }
.nw-book .nw-day[aria-pressed="true"] { border-color: var(--nw-navy-600); background: var(--nw-navy-600); color: var(--nw-white); }
.nw-book .nw-day[aria-pressed="true"] .nw-day__wd { color: var(--nw-white); }
.nw-book .nw-day:focus-visible { outline: 2px solid var(--nw-navy-600); outline-offset: 2px; }

/* Appointment summary (HTML field, filled by js/app.js once a day and time are picked). */
.nw-book .nw-book-summary { display: flex; align-items: center; gap: 12px; width: 100%; padding: 20px 16px; border-radius: 4px; background: var(--nw-surface); }
.nw-book .nw-book-summary[hidden] { display: none; }
.nw-book .nw-book-summary::before { --nw-icon: url(../images/icons/calendar-check.svg); width: 22px; height: 22px; color: var(--nw-navy-600); }
.nw-book .nw-book-summary strong { display: block; color: var(--nw-ink); font: 400 15px/1.2 var(--nw-font-body); }
.nw-book .nw-book-summary span { display: block; margin-top: 4px; color: var(--nw-body); font: 400 13px/1.25 var(--nw-font-body); }

/* ---- Buttons: full-width Next / Book, quiet Back underneath --------------- */
.nw-book .nw-book-form .e-form__buttons { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 8px; }
.nw-book .nw-book-form .e-form__buttons > * { flex: none; width: 100%; max-width: 100%; margin: 0; }
.nw-book .nw-book-form .e-form__buttons__wrapper__button-next { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; }
.nw-book .nw-book-form .e-form__buttons__wrapper__button-next::after { --nw-icon: url(../images/icons/arrow-right.svg); width: 16px; height: 16px; margin-left: 16px; }
.nw-book .nw-book-form .e-form__buttons__wrapper:has(.e-form__buttons__wrapper__button-previous) { display: flex; justify-content: center; }
.nw-book .nw-book-form .e-form__buttons__wrapper__button-previous { width: auto; min-height: 0; padding: 4px 8px; font-size: 14px; }
.nw-book .nw-book-form .e-form__buttons__wrapper__button-previous:hover { text-decoration: underline; }

/* ---- Phones -------------------------------------------------------------- */
@media (max-width: 767px) {
  .nw-book .nw-dates__days { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .nw-book .elementor-field-group-time .elementor-field-subgroup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
