/* Hero custom planner — popovers & fields */
#hero-search-bar {
  position: relative;
  font-family: "Montserrat", sans-serif;
}

#hero-planner-form,
.qbh-hotels-search-form {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  min-height: 72px;
}

.qbh-planner-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 1.25rem;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-align: left;
  background: transparent;
  border-top: none;
  border-bottom: none;
  border-left: none;
  color: inherit;
  transition: background 0.2s;
  position: relative;
  font-family: inherit;
}

.qbh-planner-cell:first-of-type {
  border-radius: 10px 0 0 10px;
}

.qbh-planner-cell:hover,
.qbh-planner-cell.is-open {
  background: rgba(255, 255, 255, 0.05);
}

.qbh-planner-cell--passengers {
  flex: 1.15;
}

.qbh-planner-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.35rem;
}

.qbh-planner-label iconify-icon {
  color: #F8C400;
  font-size: 16px;
}

.qbh-planner-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 1.5rem;
  font-size: 14px;
  color: #a0a0a0;
}

.qbh-planner-value.has-value {
  color: #fff;
}

.qbh-planner-submit-wrap {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.5rem 0.5rem 0;
}

.qbh-planner-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 180px;
  padding: 1rem 1.5rem;
  background: #1a1a1a;
  border: 1px solid rgba(248, 196, 0, 0.4);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 0 15px rgba(248, 196, 0, 0.1);
  transition: background 0.2s;
}

.qbh-planner-submit:hover {
  background: rgba(248, 196, 0, 0.1);
}

.qbh-planner-submit iconify-icon {
  color: #F8C400;
}

.qbh-planner-popover:not(.is-visible) {
  overflow: hidden;
  max-height: 0;
  padding: 0;
  border-width: 0;
}

/* Popover */
.qbh-planner-popover {
  position: fixed;
  z-index: 1200;
  min-width: 280px;
  max-width: min(400px, calc(100vw - 2rem));
  max-height: min(480px, calc(100dvh - 24px));
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(248, 196, 0, 0.08);
  padding: 1.25rem 1.5rem 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  box-sizing: border-box;
}

.qbh-planner-popover.is-above {
  transform: translateY(-6px);
}

.qbh-planner-popover.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.qbh-planner-popover.is-above.is-visible {
  transform: translateY(0);
}

.qbh-planner-popover-title {
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #F8C400;
  margin: 0 0 0.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.qbh-planner-popover-hint {
  font-size: 0.75rem;
  color: #a0a0a0;
  margin: 0 0 1rem;
  line-height: 1.45;
}

/* City list — scrollable but no visible scrollbar */
.qbh-planner-cities,
.qbh-planner-cities--grouped {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.qbh-planner-cities::-webkit-scrollbar,
.qbh-planner-cities--grouped::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.qbh-planner-city {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.qbh-planner-city:hover,
.qbh-planner-city.is-selected {
  background: rgba(248, 196, 0, 0.12);
  color: #F8C400;
}

/* Hero / planner multi-select tiles (same as book journey wizard) */
.qbh-planner-tile {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.qbh-planner-tile:hover {
  border-color: rgba(248, 196, 0, 0.45);
}

.qbh-planner-tile.is-selected {
  background: #f8c400;
  border-color: #f8c400;
  color: #0a0a0a;
  font-weight: 700;
}

.qbh-planner-cell .qbh-planner-value.has-value {
  color: #f8c400;
}

.qbh-planner-cities--countries {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qbh-planner-cities--grouped {
  gap: 1.25rem;
  max-height: min(320px, 45vh);
  padding-right: 0;
}

.qbh-planner-city-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.qbh-planner-city-group-title {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f8c400;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.qbh-planner-city-group-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

@media (min-width: 480px) {
  .qbh-planner-city-group-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Calendar */
.qbh-planner-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.qbh-planner-cal-head span {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.qbh-planner-cal-nav {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-size: 1.25rem;
}

.qbh-planner-cal-nav:hover {
  border-color: #F8C400;
  background: rgba(248, 196, 0, 0.1);
}

.qbh-planner-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.35rem;
}

.qbh-planner-cal-weekdays span {
  font-size: 0.65rem;
  text-align: center;
  color: #a0a0a0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qbh-planner-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.qbh-planner-cal-day {
  aspect-ratio: 1;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.qbh-planner-cal-day:hover:not(:disabled):not(.is-range-start):not(.is-range-end):not(.is-in-range):not(.is-range-preview-end) {
  background: rgba(255, 255, 255, 0.08);
}

.qbh-planner-cal-day.is-range-start:hover,
.qbh-planner-cal-day.is-range-end:hover,
.qbh-planner-cal-day.is-range-preview-end:hover,
.qbh-planner-cal-day.is-in-range:hover {
  background: #f8c400;
  color: #0a0a0a;
}

.qbh-planner-cal-day.is-today {
  border: 1px solid rgba(248, 196, 0, 0.4);
}

.qbh-planner-cal-day.is-selected,
.qbh-planner-cal-day.is-range-start,
.qbh-planner-cal-day.is-range-end,
.qbh-planner-cal-day.is-in-range {
  background: #f8c400;
  color: #0a0a0a;
  font-weight: 600;
}

.qbh-planner-cal-day.is-in-range {
  border-radius: 0;
}

.qbh-planner-cal-day.is-range-start {
  border-radius: 8px 0 0 8px;
}

.qbh-planner-cal-day.is-range-end,
.qbh-planner-cal-day.is-range-preview-end {
  border-radius: 0 8px 8px 0;
}

.qbh-planner-cal-day.is-range-start.is-range-end,
.qbh-planner-cal-day.is-range-start.is-range-preview-end {
  border-radius: 8px;
}

.qbh-planner-cal-day.is-range-preview-end {
  background: #f8c400;
  color: #0a0a0a;
  box-shadow: inset 0 0 0 2px rgba(10, 10, 10, 0.35);
}

.qbh-planner-popover--range {
  min-width: 300px;
  overflow: hidden;
}

.qbh-planner-popover--range.is-visible {
  max-height: none;
}

.qbh-planner-range-summary {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #fff;
  text-align: center;
  font-weight: 600;
}

.qbh-planner-range-clear {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: transparent;
  color: #a0a0a0;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}

.qbh-planner-range-clear:hover {
  color: #fff;
  border-color: rgba(248, 196, 0, 0.4);
}

.qbh-planner-cell--dates {
  flex: 1.35;
}

.qbh-planner-cal-day.is-other-month {
  color: rgba(255, 255, 255, 0.25);
}

.qbh-planner-cal-day:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Passengers */
.qbh-planner-pax-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.qbh-planner-pax-row:last-of-type {
  border-bottom: none;
  margin-bottom: 0.75rem;
}

.qbh-planner-pax-label {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 500;
}

.qbh-planner-pax-label small {
  display: block;
  font-size: 0.75rem;
  color: #a0a0a0;
  font-weight: 400;
  margin-top: 0.15rem;
}

.qbh-planner-pax-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qbh-planner-pax-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  line-height: 1;
}

.qbh-planner-pax-btn:hover:not(:disabled) {
  border-color: #F8C400;
  background: rgba(248, 196, 0, 0.15);
  color: #F8C400;
}

.qbh-planner-pax-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qbh-planner-pax-count {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
}

.qbh-planner-done {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1.25rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(248, 196, 0, 0.35), rgba(248, 196, 0, 0.15));
  border: 1px solid rgba(248, 196, 0, 0.5);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
}

.qbh-planner-done:hover {
  background: rgba(248, 196, 0, 0.25);
}

/* Hero tabs — prevent overflow on small screens */
@media (max-width: 768px) {
  #hero {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  #hero .qbh-hero-heading {
    font-size: clamp(2rem, 9vw, 3.25rem) !important;
    line-height: 1.15 !important;
  }

  #hero-tabs {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    padding: 0.35rem !important;
    overflow: hidden;
  }

  #hero-tabs button {
    min-width: 0 !important;
    flex: 1 1 0;
    padding: 0.55rem 0.4rem !important;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  #hero-search-bar {
    max-width: 100%;
    border-radius: 10px;
  }
}

/* Mobile planner: 2×2 cells + full-width search */
@media (max-width: 640px) {
  #hero-planner-form,
  .qbh-hotels-search-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 0;
  }

  .qbh-planner-cell {
    flex: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem 0.75rem;
    min-width: 0;
  }

  /* Index hero: countries · cities · dates · passengers */
  .qbh-planner-cell[data-field="countries"] {
    grid-column: 1;
    grid-row: 1;
    border-radius: 10px 0 0 0;
  }

  .qbh-planner-cell[data-field="cities"] {
    grid-column: 2;
    grid-row: 1;
  }

  .qbh-planner-cell[data-field="dates"],
  .qbh-planner-cell--dates {
    grid-column: 1;
    grid-row: 2;
  }

  .qbh-planner-cell[data-field="passengers"],
  .qbh-planner-cell--passengers {
    grid-column: 2;
    grid-row: 2;
    flex: none;
  }

  /* Booking flow: entry · exit · from · to */
  .qbh-planner-cell[data-field="entry"] {
    grid-column: 1;
    grid-row: 1;
    border-radius: 10px 0 0 0;
  }

  .qbh-planner-cell[data-field="exit"] {
    grid-column: 2;
    grid-row: 1;
  }

  .qbh-planner-cell[data-field="from"] {
    grid-column: 1;
    grid-row: 2;
  }

  .qbh-planner-cell[data-field="to"] {
    grid-column: 2;
    grid-row: 2;
  }

  .qbh-planner-submit-wrap {
    grid-column: 1 / -1;
    grid-row: 3;
    flex: none;
    width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
  }

  .qbh-planner-submit {
    width: 100%;
    min-width: 0;
  }

  .qbh-planner-label {
    font-size: 0.72rem;
  }

  .qbh-planner-value {
    padding-left: 0;
    font-size: 12px;
  }

  .qbh-planner-value-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  .qbh-planner-cal-day {
    min-height: 40px;
    font-size: 0.8rem;
  }

  .qbh-planner-cal-grid {
    gap: 4px;
  }

  .qbh-planner-popover--range {
    min-width: 0;
    padding: 1rem 1rem 1.15rem;
  }

  .qbh-planner-popover--range .qbh-planner-cal-nav {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .qbh-planner-popover--range .qbh-planner-popover-hint {
    font-size: 0.7rem;
    line-height: 1.35;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  #hero-planner-form,
.qbh-hotels-search-form {
    flex-wrap: wrap;
  }

  .qbh-planner-cell {
    flex: 1 1 45%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .qbh-planner-submit-wrap {
    flex: 1 1 100%;
    padding: 0.5rem;
  }

  .qbh-planner-submit {
    width: 100%;
  }
}
