/* Airbnb-style date range popover for the search bars. */
.csq-dates {
  position: absolute;
  z-index: 10000;
  box-sizing: border-box;
  padding: 24px 28px 18px;
  background: #fff;
  border-radius: 32px;
  box-shadow: 0 12px 48px rgba(22, 50, 79, 0.24);
  color: #16324f;
  font-family: inherit;
}

.csq-dates[hidden] {
  display: none;
}

.csq-dates__head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.csq-dates__months {
  display: flex;
  flex: 1;
  gap: 40px;
  justify-content: center;
}

.csq-dates__month {
  flex: 1;
  min-width: 0;
}

.csq-dates__title {
  margin-bottom: 14px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

.csq-dates__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
}

.csq-dates__dow {
  padding-bottom: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #7c8b99;
}

.csq-dates__nav {
  flex: none;
  width: 34px;
  height: 34px;
  margin-top: -2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #16324f;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.csq-dates__nav:hover:not(:disabled) {
  background: #f0f1f3;
}

.csq-dates__nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.csq-dates__day {
  position: relative;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #16324f;
  cursor: pointer;
}

.csq-dates__day > span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 1px solid transparent;
  border-radius: 50%;
}

.csq-dates__day:hover:not(:disabled):not(.is-start):not(.is-end) > span {
  border-color: #16324f;
}

.csq-dates__day.is-today > span {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.csq-dates__day.is-past {
  color: #b9c1c9;
  cursor: default;
  text-decoration: line-through;
}

.csq-dates__day.in-range {
  background: #eef1f4;
}

.csq-dates__day.is-start > span,
.csq-dates__day.is-end > span {
  background: #16324f;
  color: #fff;
  border-color: #16324f;
}

.csq-dates__day.is-preview > span {
  background: #fff;
  color: #16324f;
  border-color: #16324f;
}

/* The shaded band runs into the start and out of the end. */
.csq-dates__day.is-start.has-range {
  background: linear-gradient(to right, transparent 50%, #eef1f4 50%);
}

.csq-dates__day.is-end {
  background: linear-gradient(to left, transparent 50%, #eef1f4 50%);
}

.csq-dates__day.is-start.is-end,
.csq-dates__day.is-end:not(.is-preview):first-child {
  background: transparent;
}

.csq-dates__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ececec;
  font-size: 14px;
}

.csq-dates__summary {
  color: #5b6b7c;
}

.csq-dates__clear {
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: #16324f;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.csq-dates__clear:disabled {
  opacity: 0.35;
  cursor: default;
}

.csq-dates button:focus-visible {
  outline: 2px solid #16324f;
  outline-offset: 1px;
}

/* The date controls read as one tappable block while the popover is open. */
.banner-form__control.csq-dates-active {
  background: #f5f6f7;
}

.banner-form__control .start-date-input,
.banner-form__control .end-date-input {
  cursor: pointer;
}

@media (max-width: 899px) {
  .csq-dates {
    padding: 18px 16px 14px;
    border-radius: 24px;
  }
}

/* Phone: a sheet pinned to the bottom of the screen. */
.csq-dates.csq-dates--sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(22, 50, 79, 0.28);
}

.csq-dates--sheet .csq-dates__months { gap: 0; }
.csq-dates--sheet .csq-dates__month { min-width: 0; }

/* Phone sheet: arrows sit over the month title so the grid gets the full width. */
.csq-dates--sheet .csq-dates__head { position: relative; display: block; }
.csq-dates--sheet .csq-dates__nav { position: absolute; top: -4px; z-index: 2; }
.csq-dates--sheet .csq-dates__nav:first-child { left: 0; }
.csq-dates--sheet .csq-dates__nav:last-child { right: 0; }
.csq-dates--sheet .csq-dates__day > span { width: min(44px, 100%); }
