.booking-widget-section {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1440px;
  z-index: 100;
  margin-top: -100px;
  padding: 0 48px;
  background: transparent;
  box-sizing: border-box;
}

.booking-widget {
  width: 100%;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #003764;
}

/* When widget is placed inside hero's positioned div */
div[style*="background: #003764"] > .booking-widget {
  background: transparent;
}

div[style*="background: #003764"] .booking-widget__form {
  background: transparent;
  padding: 0;
  box-shadow: none;
  max-width: 100%;
  margin: 0;
}

/* ---------------------------------------------------------------------------
   Booking fields.

   The fields are "underlined", not boxed: transparent background, no border
   box, no radius, no shadow - just one hairline along the bottom that sits on
   the navy widget background. Everything that used to draw a filled, bordered,
   rounded input has been removed rather than layered over.
--------------------------------------------------------------------------- */

.booking-widget__form {
  background: #003764;
  border-radius: 8px;
  padding: 28px 32px 32px;
  width: 100%;
  max-width: 100%;
  margin: auto;
}

/* Desktop row: dates widest, guests narrower, CTA hugs its content.
   `align-items: end` lines the CTA up with the value rows, not the labels. */
.booking-widget__row {
  display: grid;
  grid-template-columns:
    minmax(250px, 1.2fr)
    minmax(250px, 1.2fr)
    minmax(145px, 0.55fr)
    auto;
  align-items: end;
  gap: 2rem;
}

.booking-widget__row--secondary {
  display: flex;
  align-items: center;
  margin-top: 20px;
  gap: 16px;
}

.booking-widget__field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.booking-widget__field--date {
  position: relative;
  min-width: 0;
}

/* Positioning context for the guests popover (see GuestsField.css). */
.booking-widget__field--guests {
  position: relative;
  min-width: 0;
}

/* --- labels -------------------------------------------------------------- */

.booking-widget__label {
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(211, 230, 242, 0.82);
}

/* --- the underlined field row -------------------------------------------- */

.booking-widget__date-trigger,
.booking-widget__guest-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 0 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(194, 220, 239, 0.35);
  border-radius: 0;
  box-shadow: none;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 16px;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.booking-widget__date-value {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
}

.booking-widget__date-trigger .booking-widget__icon,
.booking-widget__guest-trigger .booking-widget__icon {
  width: 20px;
  height: 20px;
  color: #A0C2E8;
  flex-shrink: 0;
  pointer-events: none;
}

.booking-widget__chevron {
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: #A0C2E8;
  flex-shrink: 0;
  pointer-events: none;
}

/* --- interaction states (no boxes) --------------------------------------- */

.booking-widget__date-trigger:hover,
.booking-widget__guest-trigger:hover {
  border-bottom-color: rgba(255, 255, 255, 0.8);
}

.booking-widget__date-trigger:hover .booking-widget__icon,
.booking-widget__guest-trigger:hover .booking-widget__icon,
.booking-widget__date-trigger:hover .booking-widget__chevron,
.booking-widget__guest-trigger:hover .booking-widget__chevron {
  color: #ffffff;
}

.booking-widget__date-trigger:focus {
  outline: none;
}

.booking-widget__date-trigger:focus-visible,
.booking-widget__guest-trigger:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 4px;
  border-bottom-color: #ffffff;
}

/* Open state: brighten the line only. `:has()` picks up the live date
   popover, so no JS wiring is needed there; the guest popover sets
   aria-expanded itself instead since it isn't a separate element the date
   field's :has() selector can see. */
.booking-widget__date-trigger[aria-expanded="true"],
.booking-widget__guest-trigger[aria-expanded="true"],
.booking-widget__field--date:has(.date-range-field__popover-wrapper) .booking-widget__date-trigger {
  border-bottom-color: #FAF9F2;
}

/* --- date picker plumbing ------------------------------------------------ */

/* The DateRangeField only exists to host the popover - its own inputs are
   hidden. Taking it out of the flow keeps the check-in column exactly as tall
   as the other two, so all three labels and underlines stay on one line. */
.booking-widget__field > .date-range-field {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 0;
}

.booking-widget__field .date-range-field__input-label {
  display: none;
}

.booking-widget__field .date-range-field__popover-wrapper {
  z-index: 500;
}

.booking-widget__button {
  padding: 12px 16px;
  background: #FAF9F2;
  color: #003764;
  border: none;
  border-radius: 32px;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: var(--btn-font-size, 16px);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

.booking-widget__button:hover {
  background: #f0ede4;
  opacity: 0.9;
}

.booking-widget__button:active {
  transform: scale(0.98);
}

.booking-widget__button-icon {
  width: 20px;
  height: 20px;
  color: #003764;
}

.booking-widget__checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.booking-widget__checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #ffffff;
}

.booking-widget__checkbox:hover {
  color: #ffffff;
}

/* Benefits section */
.booking-widget__benefits {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 32px 32px;
  justify-content: space-between;
  width: 100%;
  max-width: 1344px;
  margin: auto;
  box-sizing: border-box;
}

.booking-widget__benefit {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #D5E9FF;
  white-space: nowrap;
}

.booking-widget__benefit-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #D5E9FF;
}

/* ---------------------------------------------------------------------------
   Responsive.

   The underlined-field pattern is preserved at every width - columns reduce,
   then wrap, then stack. No breakpoint reintroduces a boxed input.
--------------------------------------------------------------------------- */

/* Laptop: same four columns, tighter. */
@media (max-width: 1180px) {
  .booking-widget__form {
    padding: 24px 24px 28px;
  }

  .booking-widget__row {
    grid-template-columns:
      minmax(200px, 1.2fr)
      minmax(200px, 1.2fr)
      minmax(130px, 0.6fr)
      auto;
    gap: 1.5rem;
  }
}

/* Tablet: dates share a row, guests below, CTA full width. */
@media (max-width: 900px) {
  .booking-widget__row {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
  }

  .booking-widget__button {
    grid-column: 1 / -1;
    width: 100%;
  }

  /* Five nowrap benefit items don't all fit on one line at this width -
     wrap them instead of letting the row overflow the widget. */
  .booking-widget__benefits {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 10px;
    padding: 0 24px 28px;
  }
}

@media (max-width: 768px) {
  /* The bar is pinned to the viewport, so the section must stop being a
     containing block for it: `position: absolute` + `transform` on the section
     would otherwise anchor the fixed bar to the section instead of the screen.
     With both forms and the benefits row out of flow, the section collapses. */
  .booking-widget-section {
    position: static;
    transform: none;
    margin-top: 0;
    padding: 0;
    max-width: none;
  }

  .booking-widget {
    border-radius: 0;
    background: transparent;
  }

  /* Sticky booking bar - one row: dates | guests | search.

     It was two rows (fields, then a full-width button) at ~150px plus the
     safe area; with the header it left too little screen for the page. One
     row with small labels is ~78px and keeps every field labelled. */
  .booking-widget__form--mobile {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    margin: 0;
    max-width: none;
    box-sizing: border-box;
    background: #003764;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 25, 55, 0.35);
    padding: 12px 16px;
    /* Add the bottom safe area on top of the normal padding, so the bar
       stays clear of the home indicator and of an in-app browser's toolbar
       strip. Needs viewport-fit=cover (theme header.php) to be non-zero. */
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .booking-widget__form--mobile .booking-widget__row {
    grid-template-columns: minmax(0, 1fr) minmax(64px, auto) auto;
    align-items: end;
    gap: 14px;
  }

  .booking-widget__form--mobile .booking-widget__field {
    gap: 2px;
  }

  .booking-widget__form--mobile .booking-widget__label {
    font-size: 10px;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .booking-widget__form--mobile .booking-widget__date-trigger,
  .booking-widget__form--mobile .booking-widget__guest-trigger {
    min-height: 36px;
    padding-bottom: 6px;
    gap: 8px;
  }

  .booking-widget__form--mobile .booking-widget__date-value {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 44px round search button, bottom-aligned with the field lines. */
  .booking-widget__form--mobile .booking-widget__button {
    grid-column: auto;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
  }

  .booking-widget__form--mobile .booking-widget__button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  /* The trust row is not part of the sticky bar. */
  .booking-widget__benefits {
    display: none;
  }

}

/* Phone: one field per row, label -> icon/value/chevron -> line. */
@media (max-width: 640px) {
  .booking-widget__row {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .booking-widget__field {
    gap: 8px;
  }

  .booking-widget__date-trigger,
  .booking-widget__guest-trigger {
    min-height: 46px;
    padding-bottom: 12px;
  }

  .booking-widget__button {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;
  }

}

@media (max-width: 480px) {
  .booking-widget__label {
    font-size: 0.6875rem;
  }

  .booking-widget__date-value,
  .booking-widget__date-trigger,
  .booking-widget__guest-trigger {
    font-size: 15px;
  }

  .booking-widget__button {
    font-size: var(--btn-font-size, 16px);
  }

  .booking-widget__benefit {
    font-size: 11px;
  }
}

/* Desktop and mobile form versions */
@media (min-width: 769px) {
  .booking-widget__form--mobile {
    display: none;
  }
}

@media (max-width: 768px) {
  .booking-widget__form--desktop {
    display: none;
  }

  /* Hide 5th benefit on mobile */
  .booking-widget__benefit:nth-child(5) {
    display: none !important;
  }
}

/* Smallest phones: the whole field is the tap target, so the chevrons can go
   and give the date range its room back. */
@media (max-width: 360px) {
  .booking-widget__form--mobile .booking-widget__chevron {
    display: none;
  }

  .booking-widget__form--mobile .booking-widget__row {
    gap: 10px;
  }
}
