/* Calendar widget styles per WA_PKT_BOOKING_PAGE_LIVE_CALENDAR_01.
   Rewritten over the WA_PKT_BOOKING_CALENDAR_WIDGET_01 baseline to
   match doc/design/P4_live_calendar/reference_mockup.html. The new
   class system uses the .wa-* prefix from the mockup. Where the
   mockup color matches a book.css design token, var() is used so a
   token change automatically propagates; tile-specific colors that
   are intentionally darker than form-input tokens (the day chip and
   slot pill backgrounds) stay as literals.

   Mount context: the widget renders inside <div id="widget-mount">
   which lives inside <form class="booking-form">. The outer book.css
   form-card already provides padding; .wa-frame is therefore stripped
   of its mockup background/padding/radius — only the inner .wa-card
   carries visible card chrome. */

/* ============================================================
   Outer wrappers — neutral inside the form context. */
.wa-tcal {
  width: 100%;
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wa-tcal *,
.wa-tcal *::before,
.wa-tcal *::after {
  box-sizing: border-box;
}
.wa-frame {
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.wa-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
}


/* ============================================================
   Title + sub */
.wa-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.wa-sub {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0 0 18px;
}


/* ============================================================
   Day grids (two rows of 7) */
.wa-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.wa-week:last-of-type {
  margin-bottom: 0;
}

.wa-day {
  padding: 14px 4px 12px;
  border-radius: var(--radius-pill);
  text-align: center;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  transition: border-color 0.12s, background 0.12s;
  font-family: inherit;
  /* Reset native <button> chrome */
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.wa-day:hover:not(.wa-day-sel) {
  border-color: var(--woytek-brand);
}
.wa-day:focus-visible {
  box-shadow: 0 0 0 3px var(--woytek-brand-ring);
}
.wa-day-today {
  border-color: var(--woytek-brand);
}
.wa-day-sel {
  background: var(--woytek-brand);
  border-color: var(--woytek-brand);
  color: var(--woytek-brand-text-on);
}
.wa-day-today.wa-day-sel {
  /* When today is also selected, the badge stays visible above. */
  border-color: var(--woytek-brand);
}

.wa-day-dow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 4px;
}
.wa-day-num {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}
.wa-day-mo {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin-top: 4px;
}

.wa-today-tag {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--woytek-brand);
  color: var(--woytek-brand-text-on);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 5px;
  line-height: 1.2;
  pointer-events: none;
}


/* ============================================================
   Divider + time-grid label */
.wa-divider {
  height: 1px;
  background: var(--divider);
  margin: 22px 0 18px;
}

.wa-tslabel {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0 0 12px;
}
.wa-tslabel strong {
  color: var(--text-primary);
  font-weight: 600;
}


/* ============================================================
   Time grid — 4 cols desktop, 3 cols mobile */
.wa-timegrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.wa-time {
  padding: 13px 10px;
  border-radius: var(--radius-pill);
  text-align: center;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.wa-time:hover:not(.wa-time-sel):not(.wa-time-taken) {
  border-color: var(--woytek-brand);
}
.wa-time:focus-visible {
  box-shadow: 0 0 0 3px var(--woytek-brand-ring);
}
.wa-time-sel {
  background: var(--woytek-brand);
  border-color: var(--woytek-brand);
  color: var(--woytek-brand-text-on);
}
.wa-time-taken {
  background: var(--divider);
  color: var(--text-tertiary);
  border-color: var(--input-border);
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-color: var(--text-tertiary);
}


/* ============================================================
   Foot caption */
.wa-foot {
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
}


/* ============================================================
   Empty state (no slots provided) */
.wa-empty {
  padding: 18px;
  color: var(--text-tertiary);
  font-style: italic;
  text-align: center;
  font-size: 14px;
}


/* ============================================================
   Hidden-fallback class — applied by book.js / book_new.js to the
   radio-fieldset on successful calendar mount. !important wins
   against any .booking-form fieldset { display: block } rule from
   book.css (verified necessary in the P3 hotfix). */
fieldset.hidden-slot-picker {
  display: none !important;
}


/* ============================================================
   Mobile (≤ 640px) */
@media (max-width: 640px) {
  .wa-card {
    padding: 18px;
  }
  .wa-week {
    gap: 6px;
  }
  .wa-day {
    padding: 12px 2px 10px;
  }
  .wa-day-num {
    font-size: 16px;
  }
  .wa-timegrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .wa-time {
    padding: 11px 8px;
    font-size: 14px;
  }
}
