/**
 * K12 Hero Search Modal - Airbnb Expandable Cards Pattern
 * Floating white cards on gray background with accordion behavior
 */

/* ================================================================
   OVERLAY & CONTAINER
   ================================================================ */
#heroSearchModal.hero-search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* BUG-205: Prevent scroll chaining to body and block pull-to-refresh (iOS Safari) */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#heroSearchModal .hero-search-modal-container {
  width: 100%;
  /* iOS Safari: avoid 100vh (layout viewport) so bottom controls don't clip on iPhone SE. */
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: transparent;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* BUG-205: Allow vertical scroll inside container, contain overscroll */
  touch-action: pan-y;
  overscroll-behavior: contain;
}

/* Desktop: centered card */
@media (min-width: 768px) {
  #heroSearchModal.hero-search-modal-overlay {
    padding: 24px;
  }
  #heroSearchModal .hero-search-modal-container {
    max-width: 420px;
    max-height: 720px;
    height: auto;
    border-radius: 24px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
    background: #f7f7f7;
  }
}

/* ================================================================
   MODAL STRUCTURE - Gray background for floating cards
   ================================================================ */
#heroSearchModal .k12-airbnb-search-modal {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #f7f7f7;
}

/* Scrollable body with stacked cards */
#heroSearchModal .k12-airbnb-search-modal__body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 64px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0; /* Fix iOS/Chrome flexbox scroll */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Mobile parity with Airbnb: WHERE stacked view - suggestions scroll, toggle stays visible at bottom */
@media (max-width: 767px) {
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="stacked"]
    .k12-airbnb-search-modal__body {
    overflow: hidden;
    -webkit-overflow-scrolling: auto;
  }

  /* Card becomes a flex column to properly contain its children */
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="stacked"]
    #modalWhereCard {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* Card content area fills the card and becomes a flex container */
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="stacked"]
    #modalWhereCard > .k12-expandable-card__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0; /* Remove padding so toggle is flush with card bottom */
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="stacked"]
    #modalWhereContent {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  /* Suggestions/autocomplete - no scroll in stacked mode */
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="stacked"]
    #modalAutocompleteResults,
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="stacked"]
    #modalSuggestions {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  /* Grab bar (inline toggle) stays fixed at bottom - never clipped */
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="stacked"]
    .k12-airbnb-where-inline-toggle {
    flex-shrink: 0;
  }
}

/* WHEN step: calendar scrolls inside the card (Airbnb-style) */
#heroSearchModal
  .k12-airbnb-search-modal[data-active-step="when"]
  .k12-airbnb-search-modal__body {
  overflow: hidden;
}

#heroSearchModal .k12-airbnb-search-modal[data-active-step="when"] #modalWhenCard {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#heroSearchModal .k12-airbnb-search-modal[data-active-step="when"] #modalWhenContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#heroSearchModal
  .k12-airbnb-search-modal[data-active-step="when"]
  #modalCalendarContainer.k12-airbnb-calendar {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ================================================================
   EXPANDABLE CARD - Core component
   ================================================================ */
#heroSearchModal .k12-expandable-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  flex-shrink: 0; /* Prevent flexbox from clipping expanded card content (enables scrolling like Airbnb) */
}

#heroSearchModal .k12-expandable-card:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Airbnb-style validation: red outline + helper text */
#heroSearchModal .k12-expandable-card.is-invalid {
  box-shadow:
    0 0 0 2px #d93025,
    0 2px 12px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.06);
}

#heroSearchModal .k12-inline-validation {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.3;
  color: #d93025;
}

/* Collapsed pill button */
#heroSearchModal .k12-expandable-card__pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

#heroSearchModal .k12-expandable-card__pill-label {
  font-size: 14px;
  font-weight: 400;
  color: #222222;
}

#heroSearchModal .k12-expandable-card__pill-value {
  font-size: 14px;
  font-weight: 400;
  color: #222222;
}

/* Expanded content area */
#heroSearchModal .k12-expandable-card__content {
  display: none;
  padding: 20px;
}

#heroSearchModal .k12-expandable-card__title {
  font-size: 24px;
  font-weight: 800;
  color: #222222;
  margin: 0 0 20px 0;
}

/* ================================================================
   CARD VISIBILITY LOGIC - CSS-driven accordion
   Based on data-active-step attribute on modal
   ================================================================ */

/* WHERE active: expand WHERE card, collapse others */
#heroSearchModal
  .k12-airbnb-search-modal[data-active-step="where"]
  #modalWhereCard
  .k12-expandable-card__pill {
  display: none;
}
#heroSearchModal
  .k12-airbnb-search-modal[data-active-step="where"]
  #modalWhereCard
  .k12-expandable-card__content {
  display: block;
}

/* WHEN active: expand WHEN card, collapse others */
#heroSearchModal
  .k12-airbnb-search-modal[data-active-step="when"]
  #modalWhenCard
  .k12-expandable-card__pill {
  display: none;
}
#heroSearchModal
  .k12-airbnb-search-modal[data-active-step="when"]
  #modalWhenCard
  .k12-expandable-card__content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Airbnb: hide WHO pill entirely while WHEN is open (more calendar space) */
#heroSearchModal .k12-airbnb-search-modal[data-active-step="when"] #modalWhoCard {
  display: none;
}

/* WHO active: expand WHO card, collapse others */
#heroSearchModal
  .k12-airbnb-search-modal[data-active-step="who"]
  #modalWhoCard
  .k12-expandable-card__pill {
  display: none;
}
#heroSearchModal
  .k12-airbnb-search-modal[data-active-step="who"]
  #modalWhoCard
  .k12-expandable-card__content {
  display: block;
}

/* ================================================================
   WHERE CARD - Search Input & Suggestions
   ================================================================ */
#heroSearchModal .k12-airbnb-search-input-wrap {
  position: relative;
  margin-bottom: 16px;
}

#heroSearchModal .k12-airbnb-search-back {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #222222;
  -webkit-tap-highlight-color: transparent;
}

#heroSearchModal .k12-airbnb-search-back:active {
  opacity: 0.7;
}

#heroSearchModal .k12-airbnb-search-back svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

#heroSearchModal .k12-airbnb-search-input {
  width: 100%;
  height: 48px;
  border: 1px solid #dddddd;
  border-radius: 12px;
  padding: 0 48px 0 44px;
  font-size: 16px;
  color: #222222;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23717171' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

#heroSearchModal .k12-airbnb-search-input:focus {
  border-color: #222222;
  box-shadow: 0 0 0 2px rgba(34, 34, 34, 0.1);
}

#heroSearchModal .k12-airbnb-search-input::placeholder {
  color: #717171;
}

#heroSearchModal .k12-airbnb-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: #ebebeb;
  color: #222222;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

#heroSearchModal .k12-airbnb-search-clear[hidden] {
  display: none;
}

#heroSearchModal .k12-airbnb-search-clear:hover {
  background: #d8d8d8;
}

#heroSearchModal .k12-airbnb-search-clear:active {
  transform: translateY(-50%) scale(0.96);
}

#heroSearchModal .k12-airbnb-search-clear svg {
  width: 12px;
  height: 12px;
}

/* Suggestions */
#heroSearchModal .k12-airbnb-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#heroSearchModal .k12-airbnb-section-label {
  font-size: 12px;
  font-weight: 600;
  color: #717171;
  margin: 4px 4px 4px;
}

#heroSearchModal .k12-airbnb-recents[hidden] {
  display: none !important;
}

#heroSearchModal .k12-airbnb-recents-list {
  display: flex;
  flex-direction: column;
}

#heroSearchModal .k12-airbnb-suggestion-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-radius: 12px;
  transition: background 0.15s ease;
}

#heroSearchModal .k12-airbnb-suggestion-row:hover {
  background: #f7f7f7;
}

#heroSearchModal .k12-airbnb-suggestion-row__icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#heroSearchModal .k12-airbnb-suggestion-row__icon--nearby {
  background: linear-gradient(135deg, #e8f5f5 0%, #d4eded 100%);
}

#heroSearchModal .k12-airbnb-suggestion-row__icon svg {
  width: 18px;
  height: 18px;
  stroke: #222222;
}

#heroSearchModal .k12-airbnb-suggestion-row__text {
  min-width: 0;
  flex: 1;
}

#heroSearchModal .k12-airbnb-suggestion-row__title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #222222;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#heroSearchModal .k12-airbnb-suggestion-row__subtitle {
  display: block;
  font-size: 13px;
  color: #717171;
  margin-top: 2px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Expand button */
#heroSearchModal .k12-airbnb-expand-btn {
  display: flex;
  justify-content: center;
  padding: 8px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

#heroSearchModal .k12-airbnb-expand-btn:hover {
  opacity: 1;
}

#heroSearchModal .k12-airbnb-expand-btn svg {
  width: 18px;
  height: 18px;
  stroke: #717171;
}

/* Inline toggle (chevron only, minimal) */
#heroSearchModal .k12-airbnb-where-inline-toggle {
  width: 100%;
  height: 28px;
  min-height: 28px; /* Override mobile.css 44px touch target */
  border: none;
  border-top: 1px solid #ebebeb;
  border-radius: 0 0 12px 12px;
  background: #ffffff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 0;
  padding: 5px 0 0 0; /* Push chevron down to minimize space below */
  cursor: pointer;
  color: #717171;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

/* Remove the horizontal bar - chevron only */
#heroSearchModal .k12-airbnb-where-inline-toggle::before {
  display: none;
  content: '';
  width: 64px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
}

#heroSearchModal .k12-airbnb-where-inline-toggle:hover {
  background: #f7f7f7;
}

#heroSearchModal .k12-airbnb-where-inline-toggle:active {
  transform: translateY(1px);
}

#heroSearchModal .k12-airbnb-where-inline-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* WHERE inline layout (Airbnb "expand list" behavior) */
@media (max-width: 767px) {
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    .k12-airbnb-search-modal__body {
    overflow: hidden;
    padding: 0;
    gap: 0;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    .hero-modal-mobile-title,
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    .hero-modal-close-btn,
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    .k12-airbnb-search-modal__footer {
    display: none !important;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    .k12-airbnb-search-back {
    display: flex;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    .k12-airbnb-search-input {
    background-image: none;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    .k12-airbnb-where-inline-toggle {
    display: none;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    #modalWhenCard,
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    #modalWhoCard {
    display: none;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    #modalWhereCard {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 22px 22px 0 0;
    margin-top: 8px;
    width: 100%;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    #modalWhereContent {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 16px 16px 8px;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    #modalAutocompleteResults,
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    #modalSuggestions {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: none; /* Firefox */
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    #modalAutocompleteResults::-webkit-scrollbar,
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="where"][data-where-layout="inline"]
    #modalSuggestions::-webkit-scrollbar {
    display: none;
  }

  /* In inline mode we use the back arrow in the input (Airbnb pattern), not the bottom handle. */
}

/* ================================================================
   WHEN CARD - Date Presets & Calendar
   ================================================================ */
#heroSearchModal .k12-airbnb-date-presets {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#heroSearchModal .k12-airbnb-date-preset {
  flex: 1;
  padding: 14px 10px;
  border: 1px solid #dddddd;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.15s ease,
    transform 0.1s ease;
}

#heroSearchModal .k12-airbnb-date-preset:hover {
  border-color: #222222;
}

#heroSearchModal .k12-airbnb-date-preset:active {
  transform: scale(0.98);
}

#heroSearchModal .k12-airbnb-date-preset.is-selected {
  border-color: #222222;
  border-width: 2px;
  background: #f7f7f7;
}

#heroSearchModal .k12-airbnb-date-preset__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #222222;
}

#heroSearchModal .k12-airbnb-date-preset__date {
  display: block;
  font-size: 12px;
  color: #717171;
  margin-top: 4px;
}

/* Calendar container */
#heroSearchModal .k12-airbnb-calendar {
  min-height: 280px;
  max-height: none;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
  border-radius: 12px;
  background: #ffffff;
}

#heroSearchModal .k12-airbnb-calendar-loading {
  display: none;
  text-align: center;
  padding: 40px 0;
  color: #717171;
}

#heroSearchModal .k12-airbnb-calendar-loading.is-loading {
  display: block;
}

/* ================================================================
   EMBEDDED TRANSPORTATION CALENDAR (Inside HeroSearchModal)
   Avoid sidebar-style header/overlay; render calendar inline.
   ================================================================ */
#heroSearchModal #transportationCalendarModal.transportation-calendar-modal {
  position: static !important;
  inset: auto !important;
  height: 100% !important;
  padding: 0 !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transition: none !important;
  z-index: auto !important;
  background: transparent !important;
}

#heroSearchModal #transportationCalendarModal .apple-nav-btn {
  display: none !important; /* Airbnb mobile: no left/right arrows */
}

#heroSearchModal #transportationCalendarModal .modal-backdrop {
  display: none !important;
}

#heroSearchModal #transportationCalendarModal .modal-container {
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  max-height: 100% !important;
  height: 100% !important;
  transform: none !important;
  border-radius: 0;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-sizing: border-box;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#heroSearchModal #transportationCalendarModal .modal-content-scrollable {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  max-width: 100% !important;
  box-sizing: border-box;
  min-height: 0 !important;
}

#heroSearchModal #transportationCalendarModal .apple-footer,
#heroSearchModal #transportationCalendarModal .modal-footer-mobile {
  display: none !important;
}

#heroSearchModal #transportationCalendarModal .modal-header {
  padding: 0 0 16px !important;
  border-bottom: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#heroSearchModal #transportationCalendarModal .service-info,
#heroSearchModal #transportationCalendarModal #modalCloseBtn {
  display: none !important;
}

#heroSearchModal #transportationCalendarModal .header-content {
  justify-content: center;
  align-items: center !important;
  width: 100%;
}

/* Slimmer tab pills (Dates / Presets / Recharge) to match Airbnb */
#heroSearchModal #transportationCalendarModal .cal-tabs {
  padding: 3px !important;
  border-radius: 999px !important;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  flex-wrap: nowrap;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

#heroSearchModal #transportationCalendarModal .cal-tabs::-webkit-scrollbar {
  display: none;
}

#heroSearchModal #transportationCalendarModal .cal-tabs .nav-item {
  flex: 0 0 auto;
}

#heroSearchModal #transportationCalendarModal .cal-tab-pill {
  height: 32px !important;
  padding: 0 10px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px !important;
  line-height: 1 !important;
  border-radius: 999px !important;
  min-width: 0;
  min-height: 0 !important;
}

#heroSearchModal #transportationCalendarModal .cal-tab-pill .tab-count {
  display: none;
}

/* Remove Bootstrap spacing that creates extra blank space in the embedded card */
#heroSearchModal #transportationCalendarModal .container.mt-3 {
  margin-top: 0 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

#heroSearchModal #transportationCalendarModal .container.mt-3 > .row {
  flex: 1;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  min-height: 0;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

#heroSearchModal #transportationCalendarModal .container.mt-3 > .row > .col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#heroSearchModal #transportationCalendarModal .tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#heroSearchModal #transportationCalendarModal .tab-pane.active {
  flex: 1;
  min-height: 0;
}

/* Presets/Recharge panes still need to scroll inside the embedded calendar */
#heroSearchModal #transportationCalendarModal .tab-pane.active:not(#dates) {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

#heroSearchModal #transportationCalendarModal .tab-pane.active:not(#dates)::-webkit-scrollbar {
  display: none !important; /* Chrome/Safari/WebKit */
  width: 0 !important;
  height: 0 !important;
}

#heroSearchModal #transportationCalendarModal .tab-pane.mt-5 {
  margin-top: 0 !important;
}

/* Remove extra padding inside embedded calendar to match Airbnb spacing */
#heroSearchModal #transportationCalendarModal .calendar-section {
  padding: 0 !important;
  background: transparent !important;
}

/* Dates tab becomes a flex column; month list scrolls between pinned top/bottom rows (Airbnb) */
#heroSearchModal #transportationCalendarModal #dates.tab-pane.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding-bottom: 0 !important;
}

/* Weekday header row (S M T W T F S) pinned under the tab pills */
#heroSearchModal #transportationCalendarModal .calendar-weekdays-sticky {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 8px 0;
  margin: 0 0 6px;
  flex-shrink: 0;
  position: static;
  background: #ffffff;
  border-bottom: 1px solid #ebebeb;
}

/* Scrollable month list (cards move underneath pinned header/footer) */
#heroSearchModal #transportationCalendarModal #dates .calendar-section {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding-bottom: 12px !important;
}

#heroSearchModal #transportationCalendarModal #dates .calendar-section::-webkit-scrollbar {
  display: none !important; /* Chrome/Safari/WebKit */
  width: 0 !important;
  height: 0 !important;
}

#heroSearchModal #transportationCalendarModal .calendar-weekday {
  font-size: 12px;
  font-weight: 600;
  color: #717171;
  text-align: center;
  line-height: 1;
}

/* Avoid repeating weekdays on every month when the sticky header is present */
#heroSearchModal #transportationCalendarModal .calendar-day.header {
  display: none !important;
}

/* Keep end-date selections perfectly circular on narrow devices (iPhone SE) */
#heroSearchModal #transportationCalendarModal .calendar-day {
  min-height: 0 !important;
}

/* Lock embedded calendar width (no side-to-side shifting) */
#heroSearchModal #transportationCalendarModal .dual-calendar-container,
#heroSearchModal #transportationCalendarModal .calendar-panel,
#heroSearchModal #transportationCalendarModal .apple-calendar-grid {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Override desktop search-overlay calendar sizing when embedded in the hero modal (mobile) */
#heroSearchModal #transportationCalendarModal .calendar-panel {
  min-width: 0 !important;
  padding: 0 !important;
}

#heroSearchModal #transportationCalendarModal .dual-calendar-container {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow-x: hidden;
}

/* Airbnb-like month typography and tighter grid spacing */
#heroSearchModal #transportationCalendarModal .calendar-month {
  text-align: left !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #222222 !important;
}

#heroSearchModal #transportationCalendarModal .apple-calendar-grid {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  gap: 4px !important;
}

/* Airbnb-style pagination buttons (Load earlier / Load more) */
#heroSearchModal #transportationCalendarModal .load-more-dates-btn,
#heroSearchModal #transportationCalendarModal .load-earlier-dates-btn {
  width: 100%;
  height: 44px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #dddddd;
  border-radius: 12px;
  background: #ffffff;
  color: #222222;
  font-size: 15px;
  font-weight: 600;
  line-height: 1 !important;
  margin: 12px 0 0;
}

#heroSearchModal #transportationCalendarModal .load-earlier-dates-btn {
  margin: 0 0 12px;
}

/* Replace Airbnb ± chips row with weekdays + trip type controls */
#heroSearchModal #transportationCalendarModal .calendar-controls-row {
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 4px 0 !important;
  margin-top: 0 !important;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  background: #ffffff;
  border-top: 1px solid #ebebeb;
}

#heroSearchModal #transportationCalendarModal .calendar-controls-row::-webkit-scrollbar {
  display: none;
}

/* Tighten bottom controls (no lifted circles) */
#heroSearchModal #transportationCalendarModal .weekday-selector-inline {
  margin-top: 0 !important;
  padding: 0 !important;
}

#heroSearchModal #transportationCalendarModal .weekday-pill-inline {
  top: 0 !important;
}

/* ================================================================
   WHO CARD - Guest Rows & Steppers
   ================================================================ */
#heroSearchModal .k12-airbnb-guest-rows {
  display: flex;
  flex-direction: column;
}

#heroSearchModal .k12-airbnb-guest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #ebebeb;
}

#heroSearchModal .k12-airbnb-guest-row:last-child {
  border-bottom: none;
}

#heroSearchModal .k12-airbnb-guest-row__title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #222222;
}

#heroSearchModal .k12-airbnb-guest-row__subtitle {
  display: block;
  font-size: 14px;
  color: #717171;
  margin-top: 2px;
}

#heroSearchModal .k12-airbnb-guest-row__controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

#heroSearchModal .k12-airbnb-stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #b0b0b0;
  background: #ffffff;
  color: #717171;
  font-size: 18px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

#heroSearchModal .k12-airbnb-stepper-btn:hover:not(:disabled) {
  border-color: #222222;
  color: #222222;
}

#heroSearchModal .k12-airbnb-stepper-btn:active:not(:disabled) {
  transform: scale(0.95);
}

#heroSearchModal .k12-airbnb-stepper-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

#heroSearchModal .k12-airbnb-stepper-count {
  min-width: 24px;
  text-align: center;
  font-size: 17px;
  font-weight: 500;
  color: #222222;
}

/* iPhone SE: ensure WHO options fit without scrolling */
@media (max-width: 767px) and (max-height: 700px) {
  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="who"]
    .k12-airbnb-search-modal__body {
    padding: 60px 14px 12px;
    gap: 10px;
  }

  #heroSearchModal .k12-airbnb-search-modal[data-active-step="who"] #modalWhoContent {
    padding: 16px 18px;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="who"]
    #modalWhoContent
    .k12-expandable-card__title {
    font-size: 20px;
    margin: 0 0 12px 0;
  }

  #heroSearchModal .k12-airbnb-search-modal[data-active-step="who"] .k12-airbnb-guest-row {
    padding: 12px 0;
  }

  #heroSearchModal
    .k12-airbnb-search-modal[data-active-step="who"]
    .k12-airbnb-guest-row__subtitle {
    margin-top: 0;
  }
}

/* ================================================================
   FOOTER - Clear all + Pink Search button
   ================================================================ */
#heroSearchModal .k12-airbnb-search-modal__footer {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  border-top: 1px solid #ebebeb;
  flex-shrink: 0;
  position: relative;
  z-index: 1000;
  isolation: isolate;
}

#heroSearchModal .k12-airbnb-footer__clear {
  border: none;
  background: transparent;
  padding: 10px 4px;
  font-size: 16px;
  font-weight: 600;
  color: #222222;
  text-decoration: underline;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

#heroSearchModal .k12-airbnb-footer__clear:hover {
  opacity: 0.7;
}

/* Primary button uses Buggy dark turquoise (Search/Next). */
#heroSearchModal .k12-airbnb-footer__primary {
  height: 48px;
  min-width: 100px;
  padding: 0 24px;
  border: none;
  border-radius: 8px;
  background: var(--loveform-rausch-hover, #289a96);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    transform 0.1s ease,
    background 0.15s ease;
}

#heroSearchModal .k12-airbnb-footer__primary.is-search {
  background: var(--loveform-rausch-hover, #289a96);
}

#heroSearchModal .k12-airbnb-footer__primary.is-search:hover {
  background: #1f7d79;
}

#heroSearchModal .k12-airbnb-footer__primary:hover {
  background: #1f7d79;
}

#heroSearchModal .k12-airbnb-footer__primary:active {
  transform: scale(0.98);
}

/* Search icon for primary button (optional, add via JS) */
#heroSearchModal .k12-airbnb-footer__primary svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
}

/* ================================================================
   AUTOCOMPLETE RESULTS
   ================================================================ */
#heroSearchModal .k12-airbnb-autocomplete {
  display: none;
}

#heroSearchModal .k12-airbnb-autocomplete.is-visible {
  display: block;
}

/* Mobile Modal Headline - Airbnb Style Centered Tabs */
#heroSearchModal .hero-modal-mobile-title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none; /* Allow clicks to pass through to close button if overlapping */
  /* Keep headline centered without overlapping the X button.
     Use asymmetric padding so the headline starts slightly more left while preserving the close hit-area. */
  padding: 0 84px 0 12px;
}

body #heroSearchModal .hero-modal-mobile-title .hero-nav-title {
  font-size: 20px !important; /* Match landing mobile size */
  font-weight: 700 !important;
  color: #222222 !important;
  white-space: nowrap !important;
  margin: 0 !important;
  text-align: center !important;
  line-height: 1.15 !important;
  letter-spacing: -0.01em !important;
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Close Button - Airbnb Premium Style */
#heroSearchModal .hero-modal-close-btn {
  position: absolute;
  top: 14px;
  /* Desktop/tablet: align the visible 32px close circle with the 16px modal body padding
     (44px hit-area leaves 6px inset on each side → 16px - 6px = 10px). */
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
  padding: 0;
  color: #222222;
}

/* Narrow devices (e.g., iPhone SE): ensure the headline never truncates (\"Ride\" stays visible). */
@media (max-width: 360px) {
  #heroSearchModal .hero-modal-mobile-title {
    padding: 0 76px 0 12px;
  }

  #heroSearchModal .hero-modal-close-btn {
    right: calc(env(safe-area-inset-right, 0px) + 10px);
  }
}

#heroSearchModal .hero-modal-close-btn::before {
  content: '';
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#heroSearchModal .hero-modal-close-btn:hover {
  transform: scale(1.05);
}

#heroSearchModal .hero-modal-close-btn:hover::before {
  background: #f7f7f7;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#heroSearchModal .hero-modal-close-btn:active {
  transform: scale(0.95);
}

#heroSearchModal .hero-modal-close-btn svg {
  width: 12px;
  height: 12px;
  position: relative;
  z-index: 1;
  stroke: currentColor;
  stroke-width: 3.5;
}

#heroSearchModal .k12-airbnb-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 4px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.15s ease;
}

#heroSearchModal .k12-airbnb-autocomplete-item:hover {
  background: #f7f7f7;
}

#heroSearchModal .k12-airbnb-autocomplete-item__icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#heroSearchModal .k12-airbnb-autocomplete-item__icon svg {
  width: 18px;
  height: 18px;
  stroke: #222222;
  fill: none;
  stroke-width: 2;
}

#heroSearchModal .k12-airbnb-autocomplete-item__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#heroSearchModal .k12-airbnb-autocomplete-item__title {
  font-size: 15px;
  font-weight: 600;
  color: #222222;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#heroSearchModal .k12-airbnb-autocomplete-item__subtitle {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: #717171;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#heroSearchModal .k12-airbnb-autocomplete-item__text strong {
  font-weight: 600;
}

#heroSearchModal .k12-airbnb-autocomplete-powered {
  padding: 12px 4px;
  font-size: 12px;
  color: #717171;
  text-align: center;
  border-top: 1px solid #ebebeb;
  margin-top: 8px;
}

#heroSearchModal .autocomplete-no-results {
  padding: 20px 4px;
  font-size: 14px;
  color: #717171;
  text-align: center;
}

/* ================================================================
   MOBILE RESPONSIVE
   ================================================================ */
@media (max-width: 767px) {
  #heroSearchModal .k12-airbnb-search-modal__body {
    padding-top: 64px;
    padding-left: 12px;
    padding-right: 12px;
    gap: 10px;
  }

  /* Mobile: align the visible close circle with the 12px body padding. */
  #heroSearchModal .hero-modal-close-btn {
    right: calc(env(safe-area-inset-right, 0px) + 6px);
  }

  #heroSearchModal .k12-expandable-card {
    border-radius: 14px;
  }

  #heroSearchModal .k12-expandable-card__content {
    padding: 16px;
  }

  #heroSearchModal .k12-expandable-card__title {
    font-size: 22px;
    margin-bottom: 16px;
  }
}
