.availability-calendar {
  border: 1px solid var(--line);
  background: var(--ivory-50);
  margin: 0 0 2rem;
  padding: 1.25rem;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-kicker {
  color: var(--copper-600);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.66rem;
  font-weight: 750;
}

.calendar-toolbar h3 {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 500;
  line-height: 1.1;
  margin: 0.25rem 0 0;
  text-transform: capitalize;
}

.calendar-controls {
  display: flex;
  gap: 0.4rem;
}

.calendar-button {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--sage-200);
  background: #fff;
  color: var(--forest-900);
  cursor: pointer;
  font-size: 1.15rem;
}

.calendar-button:hover:not(:disabled),
.calendar-button:focus-visible {
  background: var(--forest-900);
  color: #fff;
}

.calendar-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

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

.calendar-weekdays {
  margin-bottom: 0.35rem;
}

.calendar-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 750;
  text-transform: uppercase;
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid #d7dbd4;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.15s;
}

.calendar-day:hover:not(:disabled) {
  border-color: var(--copper-500);
  transform: translateY(-1px);
}

.calendar-day-empty {
  visibility: hidden;
}

.calendar-day.is-busy {
  background: repeating-linear-gradient(
    135deg,
    #eee 0,
    #eee 5px,
    #e3e3e3 5px,
    #e3e3e3 10px
  );
  color: #8d918d;
  border-color: #dedfdd;
  text-decoration: line-through;
}

.calendar-day.is-past {
  background: #f1f1ee;
  color: #b5b7b3;
}

.calendar-day.is-arrival,
.calendar-day.is-departure {
  background: var(--forest-900);
  border-color: var(--forest-900);
  color: #fff;
  font-weight: 800;
}

.calendar-day.is-in-range {
  background: var(--sage-100);
  border-color: var(--sage-200);
  color: var(--forest-900);
}

.calendar-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.calendar-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.calendar-legend i {
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid var(--line);
  display: inline-block;
}

.legend-free {
  background: #fff;
}

.legend-busy {
  background: #e5e5e3;
}

.legend-selected {
  background: var(--forest-900);
}

.calendar-refresh {
  margin-left: auto;
  border: 0;
  border-bottom: 1px solid var(--forest-800);
  background: transparent;
  color: var(--forest-800);
  cursor: pointer;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 750;
}

.booking-terms {
  background: var(--ivory-50);
  border-left: 3px solid var(--copper-500);
  margin-top: 1rem;
  padding: 1rem 1.15rem;
}

.booking-terms strong {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
}

.booking-terms p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
  white-space: pre-line;
}

.inline-terms-button {
  border: 0;
  border-bottom: 1px solid;
  background: transparent;
  color: var(--forest-800);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
}

.payment-methods {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.payment-methods span {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--forest-900);
  border-radius: 2rem;
  padding: 0.42rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 750;
}

.payment-methods small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.68rem;
}

.booking-result {
  border: 1px solid var(--line);
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  font-size: 0.86rem;
  font-weight: 650;
}

.booking-result.is-paid,
.booking-result.is-authorized {
  background: #e6f5e9;
  border-color: #b7ddc0;
  color: #21643c;
}

.booking-result.is-pending {
  background: #fff6df;
  border-color: #ecd398;
  color: #7f5b14;
}

.booking-result.is-failed,
.booking-result.is-canceled,
.booking-result.is-expired {
  background: #fae9e5;
  border-color: #e4bdb4;
  color: #8c342a;
}

.button-text {
  background: transparent;
  color: var(--forest-800);
  border-color: transparent;
  text-transform: none;
  letter-spacing: 0.02em;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.booking-form[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.82;
}

@media (max-width: 560px) {
  .availability-calendar {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding: 0.85rem;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 0.18rem;
  }

  .calendar-day {
    font-size: 0.73rem;
  }

  .calendar-refresh {
    flex-basis: 100%;
    margin-left: 0;
  }

  .payment-methods span {
    font-size: 0.68rem;
  }
}
