/* Chalet Tré brand palette: forest green, olive and warm ivory. */
.ctub-primary-booking .wpbs-date[aria-disabled="true"] {
  opacity: 1;
}

/* WP Booking System may assign several source colors to unavailable dates. */
.ctub-primary-booking .wpbs-container .wpbs-date[aria-disabled="true"] .wpbs-legend-item-icon > .wpbs-legend-item-icon-color {
  background-color: #6d6d50 !important;
}

.ctub-primary-booking .wpbs-container .wpbs-date[aria-disabled="true"] .wpbs-legend-item-icon > .wpbs-legend-item-icon-color svg,
.ctub-primary-booking .wpbs-container .wpbs-date[aria-disabled="true"] .wpbs-legend-item-icon > .wpbs-legend-item-icon-color polygon {
  fill: #6d6d50 !important;
}

.ctub-primary-booking .wpbs-date[aria-disabled="true"] .wpbs-date-inner,
.ctub-primary-booking .wpbs-date[aria-disabled="true"] .wpbs-date-number {
  color: #f7f2ec !important;
}

/* Keep every calendar date number visually identical, regardless of status. */
.ctub-primary-booking .wpbs-container .wpbs-date .wpbs-date-number {
  color: #111 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 14px !important;
  text-shadow: none !important;
}

.ctub-primary-booking .wpbs-container .wpbs-date .wpbs-daily-price {
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 11px !important;
}

/*
 * Keep changeover dates diagonal: item 4 allows arrival after a previous
 * booking; item 3 allows departure before the next booking starts.
 */
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:nth-of-type(2),
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:first-of-type {
  background-color: #6d6d50 !important;
}

.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:nth-of-type(2) svg,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:nth-of-type(2) polygon,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:first-of-type svg,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:first-of-type polygon {
  fill: #6d6d50 !important;
}

.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:first-of-type,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:nth-of-type(2) {
  background-color: #ddffcc !important;
}

.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:first-of-type svg,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:first-of-type polygon,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:nth-of-type(2) svg,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4 .wpbs-legend-item-icon > .wpbs-legend-item-icon-color:nth-of-type(2) polygon {
  fill: #ddffcc !important;
}

.ctub-primary-booking .wpbs-date.wpbs-legend-item-3 .wpbs-date-inner,
.ctub-primary-booking .wpbs-date.wpbs-legend-item-3 .wpbs-date-number,
.ctub-primary-booking .wpbs-date.wpbs-legend-item-4 .wpbs-date-inner,
.ctub-primary-booking .wpbs-date.wpbs-legend-item-4 .wpbs-date-number {
  color: #111 !important;
  text-shadow: none !important;
}

.ctub-primary-booking .ctub-booking-legend .is-changeover {
  background: linear-gradient(135deg, #ddffcc 0 50%, #6d6d50 50% 100%) !important;
}

/*
 * Always show the selected, bookable half of a changeover day. Some browser
 * and WPBS combinations do not reliably paint the native SVG selection layer,
 * so this brand-neutral blue triangle provides the same visual state.
 */
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4.wpbs-selected-first:not([aria-disabled="true"]),
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3.wpbs-selected-last:not([aria-disabled="true"]),
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4.ctub-touch-selected:not([aria-disabled="true"]),
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3.ctub-touch-selected:not([aria-disabled="true"]) {
  position: relative;
  box-shadow: inset 0 0 0 3px #5aa7dd !important;
}

.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4.wpbs-selected-first:not([aria-disabled="true"])::after,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3.wpbs-selected-last:not([aria-disabled="true"])::after,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4.ctub-touch-selected:not([aria-disabled="true"])::after,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3.ctub-touch-selected:not([aria-disabled="true"])::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: #5aa7dd !important;
  box-shadow: none !important;
}

/* Arrival after the previous guest leaves: select the lower-right half. */
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4.wpbs-selected-first:not([aria-disabled="true"])::after,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4.ctub-touch-selected:not([aria-disabled="true"])::after {
  -webkit-clip-path: polygon(0 100%, 100% 0, 100% 100%);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* Departure before the next guest arrives: select the upper-left half. */
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3.wpbs-selected-last:not([aria-disabled="true"])::after,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3.ctub-touch-selected:not([aria-disabled="true"])::after {
  -webkit-clip-path: polygon(0 0, 100% 0, 0 100%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4.wpbs-selected-first .wpbs-date-inner,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3.wpbs-selected-last .wpbs-date-inner,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-4.ctub-touch-selected .wpbs-date-inner,
.ctub-primary-booking .wpbs-container .wpbs-date.wpbs-legend-item-3.ctub-touch-selected .wpbs-date-inner {
  position: relative;
  z-index: 3;
}

/* Match the native footer legend to the colors rendered in the calendar. */
.ctub-primary-booking .wpbs-container[class*="wpbs-calendar-"] .wpbs-legend .wpbs-legend-item-icon-1 > .wpbs-legend-item-icon-color:first-of-type {
  background-color: #ddffcc !important;
}

.ctub-primary-booking .wpbs-container[class*="wpbs-calendar-"] .wpbs-legend .wpbs-legend-item-icon-2 > .wpbs-legend-item-icon-color:first-of-type {
  background-color: #6d6d50 !important;
}

.ctub-primary-booking .wpbs-container[class*="wpbs-calendar-"] .wpbs-legend .wpbs-legend-item-icon-1 > .wpbs-legend-item-icon-color:first-of-type svg,
.ctub-primary-booking .wpbs-container[class*="wpbs-calendar-"] .wpbs-legend .wpbs-legend-item-icon-1 > .wpbs-legend-item-icon-color:first-of-type polygon {
  fill: #ddffcc !important;
}

.ctub-primary-booking .wpbs-container[class*="wpbs-calendar-"] .wpbs-legend .wpbs-legend-item-icon-2 > .wpbs-legend-item-icon-color:first-of-type svg,
.ctub-primary-booking .wpbs-container[class*="wpbs-calendar-"] .wpbs-legend .wpbs-legend-item-icon-2 > .wpbs-legend-item-icon-color:first-of-type polygon {
  fill: #6d6d50 !important;
}
