/* Month calendar and per-booking-type capacity overview. */
.booking-calendar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.booking-calendar-head h2 {
  margin: 0 0 4px;
  text-transform: capitalize;
}

.booking-calendar-head p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
}

.booking-calendar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.booking-calendar-controls .icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.35rem;
}

.booking-calendar-controls .icon-button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.booking-month-scroll {
  container: booking-month / inline-size;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
}

.booking-month {
  min-width: 0;
}

.booking-calendar-weekdays,
.booking-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.booking-calendar-weekdays {
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.booking-calendar-grid > .loading {
  grid-column: 1 / -1;
  min-height: 360px;
}

.booking-calendar-weekdays span {
  padding: 10px 8px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-align: center;
  text-transform: uppercase;
}

.booking-calendar-blank,
.booking-calendar-cell {
  min-height: 150px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.booking-calendar-cell {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.booking-calendar-cell:nth-child(7n),
.booking-calendar-blank:nth-child(7n) {
  border-right: 0;
}

.booking-calendar-cell:hover,
.booking-calendar-cell:focus-visible {
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  outline: none;
}

.booking-calendar-cell:focus-visible {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.booking-calendar-cell.selected {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  box-shadow: inset 0 0 0 2px var(--brand);
}

.booking-calendar-cell:nth-child(7n + 6):not(.selected),
.booking-calendar-cell:nth-child(7n):not(.selected),
.booking-calendar-blank:nth-child(7n + 6),
.booking-calendar-blank:nth-child(7n) {
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
}

.booking-calendar-date {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-size: .82rem;
}

.booking-calendar-cell.today .booking-calendar-date {
  background: var(--brand);
  color: #fff;
}

.booking-calendar-types {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.booking-calendar-type {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.booking-calendar-type-head,
.booking-calendar-type-label {
  display: flex;
  align-items: center;
  min-width: 0;
}

.booking-calendar-type-head {
  justify-content: space-between;
  gap: 5px;
}

.booking-calendar-type-label {
  gap: 5px;
  overflow: hidden;
}

.booking-calendar-type-label i {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--booking-accent, var(--brand));
}

.booking-calendar-type b {
  overflow: hidden;
  font-size: .62rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-calendar-type em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .58rem;
  font-style: normal;
  font-weight: 800;
}

.booking-calendar-meter {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.booking-calendar-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--booking-accent, var(--brand));
}

.booking-calendar-no-times {
  color: var(--line);
  font-size: 1.1rem;
}

.booking-calendar-load-error {
  grid-column: 1 / -1;
  min-height: 240px;
  margin: 0;
  padding: 32px;
  color: var(--danger);
}

.booking-calendar-details {
  display: grid;
  gap: 10px;
}

.booking-calendar-details > header h3,
.booking-calendar-details > header p,
.booking-calendar-day-empty {
  margin: 0;
}

.booking-calendar-details > header h3 {
  text-transform: capitalize;
}

.booking-calendar-details > header p,
.booking-calendar-day-empty {
  color: var(--muted);
  font-size: .78rem;
}

.booking-calendar-details .booking-slot {
  border-left: 4px solid var(--booking-accent, var(--brand));
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
}

.booking-calendar-details .booking-slot .booking-capacity span {
  background: var(--booking-accent, var(--brand));
}

.booking-slot-bookings {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.booking-slot-bookings summary,
.booking-slot-bookings p {
  margin: 0;
}

.booking-slot-bookings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: .82rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.booking-slot-bookings summary::-webkit-details-marker {
  display: none;
}

.booking-slot-bookings summary::after {
  content: '⌄';
  color: var(--muted);
  font-size: 1rem;
  transition: transform .16s ease;
}

.booking-slot-bookings[open] summary::after {
  transform: rotate(180deg);
}

.booking-slot-bookings-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.booking-slot-warning {
  color: var(--muted);
  font-size: .72rem;
}

.booking-slot-booking-list {
  display: grid;
  gap: 8px;
}

.booking-calendar-details .booking-card {
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
}

@media (max-width: 700px) {
  .booking-calendar-head {
    align-items: stretch;
    flex-direction: column;
  }

  .booking-calendar-controls {
    justify-content: space-between;
  }

  .booking-calendar-controls .secondary {
    flex: 1;
  }
}

/* Keep the complete month visible. Selecting a day shows its full names and
   capacity details below the grid; its accessible label also retains them. */
@container booking-month (max-width: 700px) {
  .booking-calendar-weekdays span {
    padding: 10px 2px;
    letter-spacing: 0;
  }

  .booking-calendar-blank,
  .booking-calendar-cell {
    min-height: 64px;
  }

  .booking-calendar-cell {
    padding: 6px 3px;
    align-items: stretch;
    gap: 5px;
  }

  .booking-calendar-date { align-self: center; }
  .booking-calendar-types { gap: 4px; }
  .booking-calendar-type-head { display: none; }
  .booking-calendar-no-times { text-align: center; }
}
