/* forms — storefront styles. Bootstrap 5 classes of the theme do most of the work. */
.forms-page {
  max-width: 46rem;
}

.forms-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.forms-field__star {
  color: var(--bs-danger, #dc3545);
}

.forms-field fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.forms-field legend.form-label {
  float: none;
  width: auto;
  font-size: inherit;
}

.forms-form__product img {
  border-radius: 0.25rem;
}

/* Date fields: read-only text field + calendar */
.forms-date {
  position: relative;
}

.forms-date .js-forms-date-display {
  cursor: pointer;
  background-color: var(--bs-body-bg, #fff);
}

.forms-cal {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  width: 19.5rem;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem;
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.forms-cal[hidden] {
  display: none;
}

.forms-cal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.forms-cal__title {
  font-weight: 700;
}

.forms-cal__nav {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.forms-cal__nav:hover:not(:disabled) {
  background: var(--bs-secondary-bg, #e9ecef);
}

.forms-cal__nav:disabled {
  opacity: 0.25;
  cursor: default;
}

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

.forms-cal__weekday {
  padding: 0.25rem 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  color: var(--bs-secondary-color, #6c757d);
}

.forms-cal__day {
  aspect-ratio: 1;
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.forms-cal__day:hover:not(:disabled) {
  background: var(--bs-secondary-bg, #e9ecef);
}

.forms-cal__day.is-today {
  border-color: var(--bs-primary, #0d6efd);
}

.forms-cal__day.is-selected,
.forms-cal__day.is-selected:hover {
  color: #fff;
  background: var(--bs-primary, #0d6efd);
  border-color: var(--bs-primary, #0d6efd);
}

/* Days that cannot be chosen (closed, past, out of range) */
.forms-cal__day:disabled {
  color: #c8ccd0;
  text-decoration: line-through;
  cursor: default;
}

.forms-cal__day:focus-visible,
.forms-cal__nav:focus-visible,
.forms-slot__button:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.4);
  outline-offset: 1px;
}

.forms-cal__clear {
  display: block;
  margin: 0.5rem 0 0 auto;
  padding: 0.15rem 0.5rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--bs-secondary-color, #6c757d);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

/* Appointment field: start times as buttons under the date */
.forms-slot__time {
  margin-top: 0.5rem;
}

.forms-slot__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.forms-slot__buttons[hidden] {
  display: none;
}

.forms-slot__button {
  min-width: 4.5rem;
  padding: 0.4rem 0.9rem;
  font: inherit;
  color: var(--bs-primary, #0d6efd);
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-primary, #0d6efd);
  border-radius: 0.375rem;
  cursor: pointer;
}

.forms-slot__button:hover {
  background: var(--bs-primary-bg-subtle, #e7f1ff);
}

.forms-slot__button[aria-pressed="true"] {
  color: #fff;
  background: var(--bs-primary, #0d6efd);
}

.is-invalid ~ .forms-slot__time .forms-slot__button {
  border-color: var(--bs-danger, #dc3545);
}

/* Turnstile: the holders take no room while the check runs unseen. */
.forms-ps-turnstile.is-interactive,
.forms-form__turnstile.is-interactive {
  margin: 1rem 0;
}

/* Popup */
.forms-popup-open {
  overflow: hidden;
}

.forms-popup {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.5);
}

.forms-popup[hidden] {
  display: none;
}

.forms-popup__dialog {
  width: 100%;
  max-width: 40rem;
  margin: auto;
  padding: 1.25rem;
  background: var(--bs-body-bg, #fff);
  border-radius: 0.5rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
}

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

/* Button that leads to a form. Own margin (not a Bootstrap utility), so a theme can change it. */
.forms-button {
  margin-top: 1rem;
}

/* Icon and text are centred on one line. The icon box is exactly as high as the glyph, so the glyph
   is not drawn above the middle of the button. */
.forms-button .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.forms-button__icon {
  width: 1em;
  height: 1em;
  margin-right: 0.35rem;
  font-size: 1.15em;
  line-height: 1;
}
