/**
 * Reservation form extras — keeps original .res-form template look.
 * Layout geometry comes from theme styles.css:
 *   .grid-2 / .grid-3 desktop grids
 *   @media (max-width: 600px): .res-form 2-col + display:contents on grids
 *
 * Field order mobile (display:contents flatten):
 *   Full Name | Mobile
 *   Email     | Guests
 *   Date      | Time
 */

.amadio-reservation-form {
  position: relative;
  max-width: 100%;
}

.amadio-reservation-form .amadio-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.amadio-reservation-form .amadio-field-error {
  display: none;
  margin-top: 6px;
  font-family: var(--ui, Raleway, sans-serif);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #8b1a1a;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.amadio-reservation-form .amadio-field-error:not(:empty) {
  display: block;
}

.amadio-reservation-form .field.is-invalid input:not([type="checkbox"]):not([type="radio"]),
.amadio-reservation-form .field.is-invalid select,
.amadio-reservation-form .field.is-invalid textarea {
  border-bottom-color: #8b1a1a !important;
}

/* Keep fields from blowing out the template 2-col grid */
.amadio-reservation-form .field,
.amadio-reservation-form .amadio-form-field {
  min-width: 0;
  max-width: 100%;
}

.amadio-reservation-form input,
.amadio-reservation-form select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.amadio-reservation-form input[type="date"],
.amadio-reservation-form input[type="time"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Select matches underline input style from template */
.amadio-reservation-form select {
  font-family: var(--serif, "Playfair Display", Georgia, serif);
  font-weight: 300;
  font-size: 24px;
  color: var(--ink, #1c1c1c);
  background: transparent;
  border: none;
  border-bottom: 0.75px solid rgba(28, 28, 28, 0.3);
  border-radius: 0;
  padding: 8px 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.amadio-reservation-form select:focus {
  border-bottom-color: var(--red, #4d0406);
}

.amadio-reservation-form select:invalid {
  color: rgba(28, 28, 28, 0.35);
}

.amadio-reservation-form select option {
  color: var(--ink, #1c1c1c);
}

/* Full-width blocks under the grid rows (mobile form is 2-col) */
.amadio-reservation-form .amadio-form-response.field--full,
.amadio-reservation-form .amadio-consent-field {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
}

.amadio-consent-field {
  margin-top: 8px;
  margin-bottom: 8px;
}

.amadio-consent-field.is-invalid .amadio-consent {
  color: #8b1a1a;
}

.amadio-consent {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-family: var(--ui, Raleway, sans-serif);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: var(--ink-muted, #6b6560);
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 0;
  text-transform: none;
}

.amadio-consent > span {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 1px;
}

.amadio-reservation-form .amadio-consent input[type="checkbox"],
.res-form .amadio-consent input[type="checkbox"],
.amadio-consent input[type="checkbox"] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
  display: inline-block !important;
  flex: 0 0 18px !important;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 1px 0 0 !important;
  padding: 0 !important;
  background-color: #fff !important;
  border: 1.5px solid rgba(28, 28, 28, 0.45) !important;
  border-radius: 3px !important;
  cursor: pointer !important;
  outline: none !important;
  box-shadow: none !important;
  position: relative !important;
}

.amadio-reservation-form .amadio-consent input[type="checkbox"]::before,
.res-form .amadio-consent input[type="checkbox"]::before,
.amadio-consent input[type="checkbox"]::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 6px;
  height: 11px;
  border: solid transparent;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg) scale(0);
  transition: transform 0.15s ease, border-color 0.15s ease;
  pointer-events: none;
}

.amadio-reservation-form .amadio-consent input[type="checkbox"]:checked,
.res-form .amadio-consent input[type="checkbox"]:checked,
.amadio-consent input[type="checkbox"]:checked {
  background-color: var(--red, #4d0406) !important;
  border-color: var(--red, #4d0406) !important;
}

.amadio-reservation-form .amadio-consent input[type="checkbox"]:checked::before,
.res-form .amadio-consent input[type="checkbox"]:checked::before,
.amadio-consent input[type="checkbox"]:checked::before {
  border-color: #fff;
  transform: translateY(-1px) rotate(45deg) scale(1);
}

.amadio-reservation-form .amadio-consent input[type="checkbox"]:focus-visible {
  border-color: var(--red, #4d0406) !important;
  box-shadow: 0 0 0 3px rgba(77, 4, 6, 0.15) !important;
}

.amadio-form-response {
  margin: 8px 0 18px;
  font-family: var(--ui, Raleway, sans-serif);
  font-size: 14px;
  line-height: 1.5;
  min-height: 0;
  outline: none;
  font-weight: 500;
}

.amadio-form-response.is-success {
  color: #2f5d3a;
}

.amadio-form-response.is-error {
  color: #8b1a1a;
}

.amadio-reservation-form button[type="submit"][disabled] {
  opacity: 0.65;
  cursor: wait;
}

.amadio-noscript {
  margin-top: 12px;
  font-family: var(--ui, Raleway, sans-serif);
  font-size: 13px;
  color: #8b1a1a;
}

/* Theme mobile form is ≤600px; match select size with theme input rules */
@media (max-width: 600px) {
  .amadio-reservation-form select {
    font-size: 16px;
    padding: 6px 0;
  }

  .amadio-consent {
    font-size: 13px;
    gap: 12px;
  }
}
