/* =========================================================
   ISS PROGRAMM CALENDAR BASE
   Structure only. Theme skin owns colors, borders, radii,
   shadows, and button/link appearance.
   Public plugin CSS consumes --iss-* tokens with fallbacks;
   it does not define the global token contract.
   ========================================================= */

.is-tour-calendar {
  width: min(var(--iss-content-width, 1720px), calc(100% - (var(--iss-container-pad, 1rem) * 2)));
  margin: var(--iss-section-pad-y, clamp(2rem, 4vw, 3.5rem)) auto;
}

.is-tour-calendar__inner {
  gap: var(--iss-gap, 1.5rem);
}

.is-tour-calendar__header {
  max-width: 42rem;
  gap: 0.25rem;
}

.is-tour-calendar__eyebrow {
  margin: 0 0 0.35rem;
}

.is-tour-calendar__heading {
  margin: 0;
  line-height: 1.08;
}

.is-tour-calendar__status {
  margin: 0.4rem 0 0;
}

.is-tour-calendar__fallback {
  margin: 0.35rem 0 0;
}

.is-tour-calendar__fallback.is-hidden {
  display: none;
}

.is-tour-calendar__layout {
  display: block;
}

.is-tour-calendar--no-slots .is-tour-calendar__layout {
  display: none;
}

.is-tour-calendar__calendar {
  width: 100%;
  max-width: 100%;
  padding: var(--iss-space-md, 1rem);
  box-sizing: border-box;
}

.is-tour-calendar__slots-panel {
  padding: 0;
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  overflow: hidden;
  transition:
    max-height 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 0.2s ease,
    transform 0.2s ease,
    margin-top 0.2s ease;
  will-change: max-height, opacity, transform;
  pointer-events: none;
}

.is-tour-calendar.is-details-open .is-tour-calendar__slots-panel {
  margin-top: 1rem;
  max-height: 2000px;
  opacity: 1;
  transform: none;
  overflow: visible;
  pointer-events: auto;
}

.is-tour-calendar__date-input {
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.5rem 0.6rem;
}

.is-tour-calendar.is-has-flatpickr .is-tour-calendar__date-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.is-tour-calendar__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.is-tour-calendar__month-label {
  flex: 1;
  margin: 0;
  text-align: center;
}

.is-tour-calendar__weekdays,
.is-tour-calendar__month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}

.is-tour-calendar__weekdays {
  margin-bottom: 0.45rem;
}

.is-tour-calendar__weekday {
  padding: 0.5rem 0;
  text-align: center;
}

.is-tour-calendar__day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.5rem;
  gap: 4px;
}

.is-tour-calendar__day-cell--empty {
  visibility: hidden;
}

.is-tour-calendar__day-cell--active {
  cursor: pointer;
}

.is-tour-calendar__day-number {
  line-height: 1;
}

.is-tour-calendar__day-dot {
  width: 0.5rem;
  height: 0.5rem;
}

.is-tour-calendar__slots-head {
  margin-bottom: 0.85rem;
}

.is-tour-calendar__selected-date {
  margin: 0;
}

.is-tour-calendar__slot-select-wrap {
  display: none;
  margin-top: 0.85rem;
}

.is-tour-calendar__slot-label {
  display: block;
  margin-bottom: 0.35rem;
}

.is-tour-calendar__slot-select {
  width: 100%;
  padding: 0.55rem 0.7rem;
}

.is-tour-calendar__appointments {
  margin-top: 0.85rem;
  padding: 1rem;
}

.is-tour-calendar__appointments-title {
  margin: 0;
  text-align: center;
}

.is-tour-calendar__appointments-title-label,
.is-tour-calendar__appointments-title-date {
  display: block;
}

.is-tour-calendar__appointments-divider {
  height: 1px;
  margin: 0.9rem 0;
}

.is-tour-calendar__appointments-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.is-tour-calendar__time-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.is-tour-calendar__single-time {
  display: none;
  width: 100%;
  padding: 0.35rem 0;
  text-align: center;
}

.is-tour-calendar__appointment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.is-tour-calendar__appointments-list > .is-tour-calendar__appointment:first-child {
  border-top: 0;
}

.is-tour-calendar__appointment-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.is-tour-calendar__appointment-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
}

.is-tour-calendar__time-btn,
.is-tour-calendar__appointment-btn,
.is-tour-calendar__slot-card {
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.is-tour-calendar__appointment-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8.5rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.is-tour-calendar__slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.is-tour-calendar__slot-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 8.6rem;
  padding: 0.8rem 0.95rem;
  cursor: pointer;
}

.is-tour-calendar__slot-time {
  line-height: 1.1;
}

.is-tour-calendar__slot-meta {
  margin-top: 0.18rem;
  line-height: 1.25;
}

.is-tour-calendar__booking {
  margin-top: 1rem;
  padding-top: 1rem;
}

.is-tour-calendar-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  isolation: isolate;
}

.is-tour-calendar-modal[hidden] {
  display: none;
}

.is-tour-calendar-modal__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.is-tour-calendar-modal__panel {
  position: relative;
  z-index: 2;
  width: min(680px, calc(100% - 1rem));
  max-height: min(88vh, 920px);
  padding: 0;
  overflow: auto;
  pointer-events: auto;
}

.is-tour-calendar-modal__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.25rem;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.is-tour-calendar-modal__content {
  padding-top: 0;
}

.is-tour-calendar-modal-open {
  overflow: hidden;
}

.is-tour-calendar__booking-sheet {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.is-tour-calendar__booking-topbar {
  padding: 0.9rem 4rem 0.9rem 1.4rem;
}

.is-tour-calendar__booking-kicker,
.is-tour-calendar__booking-intro,
.is-tour-calendar__booking-summary-title,
.is-tour-calendar__booking-summary-meta,
.is-tour-calendar__form-title,
.is-tour-calendar__form-copy,
.is-tour-calendar__field-label {
  margin: 0;
}

.is-tour-calendar__booking-body {
  padding: 1.5rem 1.5rem 1.85rem;
}

.is-tour-calendar__booking-intro {
  margin-bottom: 1.25rem;
}

.is-tour-calendar__booking-summary {
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
}

.is-tour-calendar__booking-summary-meta {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.is-tour-calendar__form {
  display: grid;
  gap: 1.35rem;
}

.is-tour-calendar__form-section {
  display: grid;
  gap: 0.85rem;
}

.is-tour-calendar__form-heading {
  display: grid;
  gap: 0.35rem;
}

.is-tour-calendar__form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 0.85rem;
}

.is-tour-calendar__form-grid--compact {
  grid-template-columns: minmax(0, 14rem);
}

.is-tour-calendar__field {
  display: grid;
  gap: 0.4rem;
}

.is-tour-calendar__field--full {
  grid-column: 1 / -1;
}

.is-tour-calendar__field-required {
  margin-left: 0.15rem;
}

.is-tour-calendar__form-row,
.is-tour-calendar__form-row fieldset {
  margin: 0;
  padding: 0;
}

.is-tour-calendar__form-row label,
.is-tour-calendar__form-row legend {
  display: block;
  margin-bottom: 0.4rem;
}

.is-tour-calendar__form-row input:not([type="radio"], [type="checkbox"]),
.is-tour-calendar__field input:not([type="radio"], [type="checkbox"]),
.is-tour-calendar__field select {
  width: 100%;
  padding: 0.8rem 1rem;
  box-sizing: border-box;
  min-height: 3rem;
  font: inherit;
}

.is-tour-calendar__form-row fieldset label + label {
  margin-top: 0.65rem;
}

.is-tour-calendar__form-row input[type="radio"] {
  width: 1rem;
  height: 1rem;
  min-height: 0;
  padding: 0;
  margin-right: 0.5rem;
  box-sizing: border-box;
  accent-color: var(--iss-accent, #e81d25);
  vertical-align: -0.12em;
}

.is-tour-calendar__form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.2rem;
}

.is-tour-calendar__form-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.72rem 1.4rem;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.is-tour-calendar__form-status,
.is-tour-calendar__empty {
  margin: 0;
}

@media (max-width: 900px) {
  .is-tour-calendar {
    width: min(100%, calc(100% - 1.5rem));
  }

  .is-tour-calendar__slots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .is-tour-calendar__slot-card {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .is-tour-calendar__slots {
    grid-template-columns: 1fr;
  }

  .is-tour-calendar-modal {
    padding: 0.75rem;
  }

  .is-tour-calendar__booking-topbar {
    padding-right: 3.4rem;
  }

  .is-tour-calendar__booking-body {
    padding: 1.2rem;
  }

  .is-tour-calendar__form-grid,
  .is-tour-calendar__form-grid--compact {
    grid-template-columns: 1fr;
  }
}
