/* Wanderly Contact Calendar v2.1 — scoped progressive enhancement. */
body.contact-ui-v2-page .contact-main-card .form-field-date {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
body.contact-ui-v2-page .contact-main-card .form-field-date > label {
  display: block;
  margin: 0;
}
/* Native date input remains available when JavaScript is unavailable. */
body.contact-ui-v2-page .form-field-date.is-enhanced > input[data-date-input] {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
body.contact-ui-v2-page .form-field-date .w-date-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 12px 15px;
  border: 1.75px solid #9fb0a4;
  border-radius: 14px;
  background: #fff;
  color: #0a2e50;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(10,46,80,.035);
  transition: border-color .16s, box-shadow .16s;
}
body.contact-ui-v2-page .form-field-date .w-date-trigger[data-empty="true"] { color: #768797; }
body.contact-ui-v2-page .form-field-date .w-date-trigger:hover { border-color: #156c53; }
body.contact-ui-v2-page .form-field-date .w-date-trigger:focus-visible,
body.contact-ui-v2-page .w-date-popup button:focus-visible,
body.contact-ui-v2-page .w-date-popup select:focus-visible {
  outline: 3px solid rgba(21,108,83,.40);
  outline-offset: 2px;
}
body.contact-ui-v2-page .w-date-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: #156c53;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.contact-ui-v2-page .w-date-popup[hidden] { display: none !important; }
body.contact-ui-v2-page .w-date-popup {
  position: absolute;
  z-index: 100;
  top: calc(100% + 10px);
  left: 0;
  width: 350px;
  max-width: calc(100vw - 32px);
  min-width: 0;
  padding: 17px;
  border: 1px solid #cbd8d0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(10,46,80,.18), 0 4px 12px rgba(10,46,80,.08);
  color: #0a2e50;
  font-size: 14px;
  font-weight: 500;
}
body.contact-ui-v2-page .w-date-header {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) 38px;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
}
body.contact-ui-v2-page .w-date-arrow {
  display: grid;
  place-items: center;
  height: 38px;
  width: 38px;
  border: 1px solid #dde7e1;
  border-radius: 11px;
  background: #f7faf8;
  color: #156c53;
  font: inherit;
  font-size: 23px;
  cursor: pointer;
}
body.contact-ui-v2-page .w-date-arrow:hover:not(:disabled) { background: #eaf3ee; }
body.contact-ui-v2-page .w-date-arrow:disabled { opacity: .3; cursor: not-allowed; }
body.contact-ui-v2-page .w-date-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 6px;
  align-items: center;
}
body.contact-ui-v2-page .w-date-heading select {
  min-width: 0;
  width: 100%;
  padding: 7px 5px;
  color: #0a2e50;
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
body.contact-ui-v2-page .w-date-heading select:hover { border-color: #c5d6cb; }
body.contact-ui-v2-page .w-date-weekdays,
body.contact-ui-v2-page .w-date-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap: 3px;
}
body.contact-ui-v2-page .w-date-weekdays {
  margin-bottom: 6px;
  color: #5c6e7d;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
body.contact-ui-v2-page .w-date-weekdays span { padding: 7px 0; }
body.contact-ui-v2-page .w-date-day {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 35px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #18354b;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
body.contact-ui-v2-page .w-date-day:hover:not(:disabled) { background: #e9f4ee; color: #156c53; }
body.contact-ui-v2-page .w-date-day:disabled { color: #c2cbc5; cursor: not-allowed; }
body.contact-ui-v2-page .w-date-day[data-today="true"] { box-shadow: inset 0 0 0 1.5px #156c53; }
body.contact-ui-v2-page .w-date-day[aria-pressed="true"] { background: #156c53; color: #fff; }
body.contact-ui-v2-page .w-date-empty { display: block; min-height: 35px; }
body.contact-ui-v2-page .w-date-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  margin-top: 10px;
  border-top: 1px solid #e8ede9;
}
body.contact-ui-v2-page .w-date-footer button {
  padding: 9px 11px;
  border: 1px solid #cfe0d4;
  border-radius: 9px;
  background: #f7faf8;
  color: #156c53;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
body.contact-ui-v2-page .w-date-footer button:hover { background: #eaf3ee; }
/* Keeps Google's checkbox and the submit button left-aligned under Message. */
body.contact-ui-v2-page .form-actions {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
}
body.contact-ui-v2-page .form-actions .wanderly-recaptcha-check { order: 0; margin: 0 !important; }
body.contact-ui-v2-page .form-actions .btn { order: 1; margin: 0 !important; }
body.contact-ui-v2-page .form-actions .contact-response-note { order: 2; }
@media (max-width:640px) {
  body.contact-ui-v2-page .w-date-popup { width: min(350px, 100%); padding: 12px; }
  body.contact-ui-v2-page .w-date-day { min-height: 35px; }
  body.contact-ui-v2-page .form-actions { align-items: stretch; }
  body.contact-ui-v2-page .form-actions .wanderly-recaptcha-check { align-self: flex-start; max-width: 100%; }
}
@media (prefers-reduced-motion:reduce) {
  body.contact-ui-v2-page .w-date-trigger { transition: none; }
}

/* V2.3 — viewport-aware calendar overlay and legible selectors.
   Portal is appended to body: no clipping by surrounding form cards. */
body.contact-ui-v2-page .w-date-popup {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10020;
  width: 364px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 16px;
  visibility: visible;
}
body.contact-ui-v2-page .w-date-popup .w-date-header {
  grid-template-columns: 36px minmax(0,1fr) 36px;
  gap: 6px;
  margin-bottom: 12px;
}
body.contact-ui-v2-page .w-date-popup .w-date-heading {
  grid-template-columns: minmax(0,1fr) 98px;
  gap: 7px;
  min-width: 0;
}
/* Override the parent form's large select padding/height: this was
   truncating the displayed year to '202'. */
body.contact-ui-v2-page .w-date-popup .w-date-heading select {
  appearance: auto;
  -webkit-appearance: menulist;
  box-sizing: border-box;
  display: block;
  min-width: 0;
  width: 100%;
  min-height: 40px;
  height: 40px;
  max-height: 40px;
  padding: 6px 4px 6px 8px;
  font-size: 14px;
  line-height: normal;
  font-weight: 700;
  border: 1px solid #b6cabb;
  border-radius: 10px;
  background: white;
  color: #0a2e50;
  box-shadow: none;
}
body.contact-ui-v2-page .w-date-popup .w-date-arrow {
  width: 36px;
  height: 40px;
}
@media (max-width: 480px) {
  body.contact-ui-v2-page .w-date-popup {
    width: 350px;
    max-width: calc(100vw - 20px);
    padding: 13px;
  }
  body.contact-ui-v2-page .w-date-popup .w-date-heading {
    grid-template-columns: minmax(0,1fr) 94px;
    gap: 5px;
  }
}
