.booking-schedule-block {
  margin-top: 10px;
}

.booking-schedule-block > label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}

.booking-schedule-hint {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
  line-height: 1.4;
}

.booking-schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 10px;
  font-size: 13px;
  color: #555;
}

.booking-schedule-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.booking-schedule-swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 3px;
  border: 1px solid #ccc;
  flex-shrink: 0;
}

.booking-schedule-swatch.available {
  background: #fff;
}

.booking-schedule-swatch.mine {
  background: #ffcc80;
  border-color: #ffa726;
}

.booking-schedule-swatch.booked {
  background: #ef9a9a;
  border-color: #e57373;
}

.booking-schedule-swatch.selected {
  background: #bbdefb;
  border-color: #64b5f6;
}

.booking-schedule-swatch.weekend {
  background: #e0e0e0;
  border-color: #bdbdbd;
}

.booking-schedule-swatch.range {
  background: #c8e6c9;
  border-color: #81c784;
}

.booking-schedule-table th.weekend-date {
  background: #ececec;
  color: #888;
}

.booking-schedule-table td.slot.weekend,
.booking-schedule-table td.slot.buffer {
  background: #ececec;
  color: #888;
  cursor: not-allowed;
}

.booking-schedule-scroll {
  overflow-x: auto;
  margin: 0 -5px;
  padding: 0 5px 5px;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
}

.booking-schedule-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
}

.booking-schedule-table th,
.booking-schedule-table td {
  border: 1px solid #ccc;
  padding: 0.35rem 0.35rem;
  text-align: center;
  min-width: 48px;
}

.booking-schedule-table th {
  background: #f5f5f5;
  color: #222;
  font-weight: 600;
  white-space: nowrap;
}

/* Override .cabinet th { color: #fff } on cabinet page */
.cabinet .booking-schedule-table th {
  background: #f5f5f5;
  color: #222;
}

.cabinet .booking-schedule-table th.weekend-date {
  background: #ececec;
  color: #888;
}

.cabinet .booking-schedule-table th.active-date {
  background: #fff8e1;
  color: #ec8e1c;
}

.booking-schedule-table th.time-header,
.booking-schedule-table td.time-label {
  position: sticky;
  left: 0;
  z-index: 2;
}

.booking-schedule-table th.time-header {
  z-index: 3;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.booking-schedule-table td.time-label {
  text-align: left;
  font-weight: 500;
  background: #fafafa;
  white-space: nowrap;
  padding-left: 0.6rem;
  min-width: 96px;
  font-size: 11px;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.booking-schedule-table td.slot {
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.booking-schedule-table td.slot.available {
  background: #fff;
}

.booking-schedule-table td.slot.available:hover {
  background: #e8f5e9;
}

.booking-schedule-table td.slot.mine {
  background: #ffcc80;
  color: #e65100;
  font-weight: 500;
  cursor: not-allowed;
}

.booking-schedule-table td.slot.booked {
  background: #ef9a9a;
  color: #5d1f1f;
  font-weight: 500;
  cursor: not-allowed;
}

.booking-schedule-table td.slot.selected-start,
.booking-schedule-table td.slot.selected-end {
  background: #bbdefb;
  color: #0d47a1;
  font-weight: 600;
}

.booking-schedule-table td.slot.in-range {
  background: #c8e6c9;
  color: #1b5e20;
}

.booking-schedule-summary {
  margin-top: 12px;
  font-size: 14px;
  color: #333;
  min-height: 1.4em;
}

.booking-schedule-summary.has-selection {
  color: #ec8e1c;
  font-weight: 600;
}

.booking-schedule-block.error .booking-schedule-scroll {
  outline: 2px solid #aa0000;
  border-radius: 4px;
}

.booking-schedule-table th.active-date,
.booking-schedule-table td.active-date-col {
  background: #fff8e1;
}

.booking-schedule-table th.active-date {
  color: #ec8e1c;
}

.fancybox-content .booking-schedule-block {
  max-width: 100%;
}

.fancybox-content.form-modal--booking,
.fancybox-slide--html .fancybox-content:has(.booking-schedule-block) {
  max-width: 920px;
  width: calc(100% - 40px);
}

@media screen and (max-width: 480px) {
  .booking-schedule-table th,
  .booking-schedule-table td {
    padding: 0.4rem 0.25rem;
    min-width: 44px;
    font-size: 12px;
  }
}

/* Пока календарь загружает занятость и нерабочие дни — приглушён и не кликается */
.booking-schedule.is-loading .booking-schedule-table {
  opacity: 0.55;
  pointer-events: none;
}
