/* ============================================================
   Week-view appointment calendar
   Lives inside the "Schedule an appointment" .action-block.
   Uses existing tokens: --outline-white, --white, --blue-subtle.
   ============================================================ */

/* Date-card header: tighter bottom padding (combo class) */
.action-service-block.schedule {
  padding-bottom: 16px;
}

.cal {
  z-index: 1;
  position: relative;
  padding: 24px;
  color: var(--white);
  overflow: hidden;                                       /* clip while height animates */
  transition: height .32s cubic-bezier(.4, 0, .2, 1);
}

/* Each wizard step is its own column; only one is shown at a time */
.cal-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 1;
  transition: opacity .22s ease .1s;                      /* fade in after the box grows */
}

.cal-step[hidden] { display: none; }

/* While a step-switch animation is running, the newly-revealed step starts
   fully transparent (no transition — it's just its entry state) so it can
   fade in once .is-animating is removed (see js/calendar.js). */
.cal.is-animating .cal-step:not([hidden]) {
  opacity: 0;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .cal, .cal-step { transition: none; }
}

/* Spacer to keep the chosen-date label centred opposite the back button */
.cal-nav-spacer {
  width: 36px;
  height: 36px;
  flex: none;
}

/* ---- Header: week range + prev/next ---- */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cal-range {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
}

.cal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--white);
  background-color: transparent;
  border: 1px solid var(--outline-white);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}

.cal-nav svg { width: 18px; height: 18px; }

.cal-nav:hover { background-color: #0000001f; }          /* slight dark overlay */

.cal-nav:disabled {
  opacity: .3;
  cursor: not-allowed;
  background-color: transparent;
}

/* ---- Week strip: 7 day cells ---- */
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 0;
  min-height: 60px;
  color: var(--white);
  background-color: transparent;                          /* transparent bg */
  border: 1px solid var(--outline-white);                 /* light outline */
  border-radius: 4px;                                     /* rounded */
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.cal-dow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .65;
}

.cal-dnum {
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

/* Available (hoverable) — slight dark overlay on hover */
.cal-day.is-available:hover {
  background-color: #0000001f;
}

/* Unavailable — muted, not interactive */
.cal-day.is-unavailable {
  opacity: .3;
  cursor: not-allowed;
  border-style: dashed;
}

/* Selected — filled, inverse colours */
.cal-day.is-selected {
  background-color: var(--white);
  border-color: var(--white);
  color: var(--blue-subtle);
}

.cal-day.is-selected .cal-dow { opacity: .7; }

/* Hovering the selected date darkens the cell, so keep its text white */
.cal-day.is-selected:hover,
.cal-day.is-selected:hover .cal-dow {
  color: var(--white);
}

/* ---- Time slots (step 2) ---- */
.cal-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cal-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  min-height: 44px;
  color: var(--white);
  background-color: transparent;                          /* transparent bg */
  border: 1px solid var(--outline-white);                 /* light outline */
  border-radius: 4px;                                     /* match date cells */
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.cal-slot.is-available:hover { background-color: #0000001f; }   /* slight dark overlay */

.cal-slot.is-unavailable {
  opacity: .3;
  cursor: not-allowed;
  border-style: dashed;
}

.cal-slot.is-selected {
  background-color: var(--white);
  border-color: var(--white);
  color: var(--blue-subtle);
}

/* ---- Book button ---- */
.cal-book {
  align-self: stretch;
  margin-top: 32px;                                       /* extra gap above button */
  padding: 14px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--blue-subtle);
  background-color: var(--white);
  border: 1px solid var(--outline-white);
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .15s ease, filter .15s ease;
}

.cal-book:hover:not(:disabled) { filter: brightness(.94); }

.cal-book:disabled {
  opacity: .45;
  cursor: not-allowed;
  color: var(--white);
  background-color: transparent;
  border-color: var(--outline-white);
}

/* ---- Confirmation / status line ---- */
.cal-status {
  min-height: 18px;
  font-size: 13px;
  line-height: 1.3;
  opacity: .85;
}

.cal-status.is-booked { font-weight: 500; opacity: 1; }

/* ============================================================
   Booking modal (clones the appointment card)
   ============================================================ */
.cal-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .2s ease;
}

.cal-modal[hidden] { display: none; }
.cal-modal.is-open { opacity: 1; }

.cal-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, .55);
}

.cal-modal__dialog {
  position: relative;
  z-index: 1;
  width: 440px;
  max-width: 100%;
  transform: translateY(8px);
  transition: transform .2s ease;
}

.cal-modal.is-open .cal-modal__dialog { transform: translateY(0); }

/* Cloned card fills the dialog width */
.cal-modal__card { width: 100%; }

.cal-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  /* Sits on the card's own corner (the card fills the dialog), and the
     card is light gray, so this needs a dark-on-light treatment rather
     than the light-on-dark one it'd want over a plain backdrop. */
  color: var(--black);
  background-color: #0000000f;
  border: 1px solid var(--_outline---black);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .15s ease;
}

.cal-modal__close svg { width: 18px; height: 18px; }
.cal-modal__close:hover { background-color: #0000001f; }

/* ============================================================
   Light-card theme override
   The "Schedule an appointment" card is now `.action-block.appoitment`,
   which the latest Webflow export gives a light gray background
   (#f0f2f5) with black text — different from the dark card this widget
   was originally designed for (white text/borders, which was nearly
   invisible here). These overrides swap the white-on-dark palette for
   a black/blue-on-light one, scoped so they only apply wherever this
   card shows up (the inline card and its modal clone both carry the
   same .action-block.appoitment classes).
   ============================================================ */
.action-block.appoitment .cal,
.action-block.appoitment .cal-nav,
.action-block.appoitment .cal-day,
.action-block.appoitment .cal-slot {
  color: var(--black);
}

.action-block.appoitment .cal-nav,
.action-block.appoitment .cal-day,
.action-block.appoitment .cal-slot,
.action-block.appoitment .cal-book:disabled {
  border-color: var(--_outline---black);
}

.action-block.appoitment .cal-day.is-selected,
.action-block.appoitment .cal-slot.is-selected {
  background-color: var(--blue-subtle);
  border-color: var(--blue-subtle);
  color: var(--white);
}

.action-block.appoitment .cal-day.is-selected:hover,
.action-block.appoitment .cal-day.is-selected:hover .cal-dow {
  color: var(--white);
}

.action-block.appoitment .cal-book {
  color: var(--white);
  background-color: var(--blue-subtle);
  border-color: var(--blue-subtle);
}

.action-block.appoitment .cal-book:hover:not(:disabled) {
  background-color: var(--blue-main);
  filter: none;
}

.action-block.appoitment .cal-book:disabled {
  color: var(--black);
  background-color: transparent;
}

/* ---- Responsive ---- */
@media screen and (max-width: 479px) {
  .cal { padding: 20px; gap: 12px; }
  .cal-week { gap: 6px; }
  .cal-day { min-height: 52px; padding: 8px 0; }
  .cal-dnum { font-size: 16px; }
  .cal-modal { padding: 16px; }
}
