/**
 * Project overlays for the public front (dropdowns etc.).
 * Keep out of /front/assets/css — design sync owns those files.
 */

/* Shared dropdown (topbar city picker, search, catalog sort) */
.dropdown {
  position: relative;
  flex: 0 0 auto;
}
.dropdown__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.dropdown__chev {
  flex: 0 0 auto;
  transition: transform .15s ease;
}
.dropdown.is-open .dropdown__chev {
  transform: rotate(180deg);
}
.dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  min-width: 240px;
  width: max-content;
  max-width: min(320px, 70vw);
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-raised);
}
.dropdown__menu--end {
  left: auto;
  right: 0;
}
.dropdown__menu[hidden] {
  display: none !important;
}
.dropdown__menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.dropdown__menu a,
.dropdown__menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink) !important;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.dropdown__menu a:hover,
.dropdown__menu button:hover {
  background: var(--brand-tint);
  color: var(--brand) !important;
  text-decoration: none;
}
.dropdown__menu a[aria-current="true"],
.dropdown__menu button[aria-selected="true"] {
  background: var(--brand-tint);
  color: var(--brand) !important;
}
.dropdown__meta {
  color: var(--ink-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.city-picker {
  height: 36px;
  display: flex;
  align-items: center;
  align-self: center;
}
.city-picker .dropdown__btn {
  color: var(--on-night);
  font-size: 13px;
  min-height: 36px;
}

.book__body .subscribe__input {
  border: 1px solid var(--line-strong);
}
.book__body .flatpickr-calendar {
  font-family: var(--font-sans);
}
body > .flatpickr-calendar.open {
  position: fixed;
  z-index: 10050;
}
.flatpickr-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(6, 40, 44, .42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.flatpickr-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.book__body .flatpickr-alt {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
/* Flatpickr adds .active on open; listing.css used to hide :empty .active (inputs). */
.flatpickr-input.active,
.flatpickr-alt.active,
input.book__date.active {
  display: block;
}
.flatpickr-calendar--sheet {
  border-radius: 16px !important;
  box-shadow: 0 18px 48px rgba(6, 40, 44, .28) !important;
  max-width: calc(100vw - 24px);
}
.flatpickr-calendar--sheet .flatpickr-months,
.flatpickr-calendar--sheet .flatpickr-weekdays,
.flatpickr-calendar--sheet .flatpickr-days {
  width: 100%;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--brand);
  border-color: var(--brand);
}


body .np-tour-wrapper table{
  overflow-x: auto;
  max-width: 100%;
  display: block;
}
body .np-tour-wrapper {
  max-width: 100%;
}

@media (min-width: 1024px) {
  .topbar {
    overflow: visible;
  }
}

/* Hero clips for the photo bg; open the stack so the city menu can paint over trust-bar */
.hero:has(.dropdown.is-open),
.hero--photo:has(.dropdown.is-open) {
  overflow: visible;
  z-index: 30;
}
.hero:has(.dropdown.is-open) > .container {
  position: relative;
  z-index: 2;
}
.hero:has(.dropdown.is-open) .wave--hero {
  z-index: 0;
}
.hero:has(.dropdown.is-open) .search {
  position: relative;
  z-index: 2;
  overflow: visible;
}

.search__field--dropdown {
  cursor: pointer;
  position: relative;
  overflow: visible;
  z-index: 1;
}
.search__field--dropdown:has(.dropdown.is-open) {
  z-index: 40;
}
.search__dropdown {
  position: static;
  display: block;
  width: 100%;
  min-width: 0;
  flex: 0 1 auto;
}
.search__dropdown-btn {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}
.search__dropdown-btn > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search__dropdown-btn .dropdown__chev {
  color: var(--ink-muted);
  flex: 0 0 auto;
}
.search__field--dropdown .dropdown__menu {
  left: 0;
  right: auto;
  top: calc(100% + 6px);
  min-width: max(100%, 280px);
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  max-height: min(320px, 70vh);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 50;
}
.search__field--dropdown .dropdown__menu a,
.search__field--dropdown .dropdown__menu button {
  white-space: normal;
}

/* Guests picker (adults / children steppers) */
.guests-menu {
  display: block;
  padding: 0 !important;
  min-width: 280px;
  max-height: none !important;
  overflow: visible !important;
}
.guests-menu__backdrop {
  display: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.guests-menu__panel {
  display: grid;
  gap: 4px;
  padding: 10px;
}
.guests-menu__grab,
.guests-menu__head {
  display: none;
}
.guests-menu__body {
  display: grid;
  gap: 4px;
}
.guests-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px;
}
.guests-row__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.guests-stepper {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.guests-menu .guests-stepper button,
.search__field--dropdown .guests-menu .guests-stepper button {
  display: inline-grid !important;
  place-items: center;
  justify-content: center !important;
  align-items: center !important;
  flex: 0 0 40px;
  width: 40px !important;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  min-height: 40px !important;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--brand) !important;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  text-align: center !important;
  white-space: nowrap !important;
  cursor: pointer;
}
.guests-menu .guests-stepper button:hover,
.search__field--dropdown .guests-menu .guests-stepper button:hover {
  background: var(--brand-tint);
  color: var(--brand) !important;
}
.guests-menu .guests-stepper button:disabled,
.search__field--dropdown .guests-menu .guests-stepper button:disabled {
  color: var(--line-strong) !important;
  cursor: not-allowed;
  background: transparent;
}
.guests-stepper__value {
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 40px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
}

/* Mobile: native-style bottom sheet — only while open, otherwise it blocks the form */
@media (max-width: 1023px) {
  .search__submit {
    position: relative;
    z-index: 2;
  }
  .header__actions .header__favorites { display: none !important; }
  .search__field--dropdown:has([data-guests-picker].is-open) {
    z-index: 120;
  }
  .guests-menu[hidden] {
    display: none !important;
    pointer-events: none !important;
  }
  .dropdown.is-open[data-guests-picker] .guests-menu {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 120;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
    pointer-events: auto;
  }
  .dropdown.is-open[data-guests-picker] .guests-menu__backdrop {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: rgba(6, 40, 44, .48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: guests-backdrop-in .2s ease-out;
  }
  .guests-menu__panel {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0;
    width: 100%;
    padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    box-shadow: 0 -12px 40px -16px rgba(6, 40, 44, .35);
    animation: guests-sheet-in .24s cubic-bezier(.2, .8, .2, 1);
  }
  .guests-menu__grab {
    display: block;
    width: 36px;
    height: 4px;
    margin: 4px auto 10px;
    border-radius: 999px;
    background: var(--line-strong);
  }
  .guests-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    margin-bottom: 4px;
  }
  .guests-menu__title {
    margin: 0;
    font: 600 18px/24px var(--font-display);
    letter-spacing: -.01em;
    color: var(--ink-head);
  }
  .guests-menu__done {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 36px !important;
    height: auto !important;
    padding: 0 12px !important;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--brand-tint);
    color: var(--brand) !important;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap !important;
    cursor: pointer;
  }
  .guests-menu__done:hover {
    background: var(--brand-tint);
    color: var(--brand) !important;
  }
  .guests-menu__body {
    gap: 0;
  }
  .guests-row {
    min-height: 56px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .guests-row:last-child {
    border-bottom: 0;
  }
  .guests-row__label {
    font-size: 16px;
  }
  .guests-menu .guests-stepper button,
  .search__field--dropdown .guests-menu .guests-stepper button {
    flex-basis: 44px;
    width: 44px !important;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px !important;
    font-size: 22px;
  }
  .guests-stepper__value {
    flex-basis: 36px;
    width: 36px;
    height: 44px;
    font-size: 17px;
  }
  html.guests-sheet-open,
  html.guests-sheet-open body {
    overflow: hidden;
  }
}
@keyframes guests-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes guests-sheet-in {
  from { transform: translateY(24px); opacity: .96; }
  to { transform: translateY(0); opacity: 1; }
}

/* Site search page (/poisk) */
.site-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  margin-top: var(--space-4);
  max-width: 640px;
}
.site-search__input {
  width: 100%;
}
.site-search__cards {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) {
  .site-search__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .site-search__cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

/* Contact microdata wrappers — keep previous flex/grid gaps */
.topbar__contacts {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.footer__contacts {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
}
.drawer__contacts {
  display: grid;
  gap: var(--space-3);
}

/* Popups: keep [hidden] above .is-open / display:grid after partial close */
.drawer[hidden],
.auth[hidden],
.cityp[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* Catalog filter: departure city as a select */
.fselect {
  position: relative;
  display: grid;
  min-width: 0;
}
.ways { 
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1023px) {
  .ways {
      grid-template-columns: 1fr;
  }
}
.fselect select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  /* ≥16px: иначе iOS/Android зумят страницу при фокусе */
  font-size: 16px;
  cursor: pointer;
}
.fselect select:focus {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.fselect select:hover {
  border-color: var(--brand);
}
.fselect__chev {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink-muted);
}

/* Favorites page: listing layout without filters column */
.results-wrap--solo {
  padding-bottom: var(--space-12);
}
@media (min-width: 1024px) {
  .results-wrap--solo {
    padding-bottom: var(--space-16);
  }
}

/* Tour listing: equal-height cover images (listing.css stretches media to card height) */
.result__media {
  overflow: hidden;
  aspect-ratio: revert-rule !important;
  align-self: normal !important;
}
.result__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 639px) {
  .result__media {
    align-self: start;
    width: 100%;
    height: 150px;
    min-height: 150px;
    max-height: 150px;
    aspect-ratio: auto;
  }
  
  body .np-price-block {
    padding: 25px 0;
  }
}
@media (min-width: 640px) {
  .result__media {
    align-self: start;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
    height: 180px;
  }
}
@media (min-width: 1100px) {
  .result__media {
    grid-row: auto;
    align-self: start;
    aspect-ratio: 4 / 3;
  }
}

/* Tour page: dates list controls */
.dates--scroll {
  max-height: 12.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
}
.dates-more {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: 600 14px/20px var(--font-sans);
  padding: 4px 0 0;
  cursor: pointer;
  text-align: left;
  width: fit-content;
}
.dates-more:hover {
  text-decoration: underline;
}

/* Tour page: booking request modal */
.book-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.book-modal.is-open {
  display: block;
}
.book-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 35, 43, .5);
}
.book-modal__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(92vh, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-raised);
  animation: book-modal-in .2s ease-out;
  overflow: hidden;
}
.book-modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-shrink: 0;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.book-modal__title {
  font: 600 20px/26px var(--font-display);
  margin: 0;
}
.book.book--modal {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
  scroll-margin-top: 0;
}
.book.book--modal .book__body {
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
@keyframes book-modal-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
@media (min-width: 640px) {
  .book-modal__panel {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(440px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    border-radius: var(--radius-lg);
    transform: translate(-50%, -50%);
    animation-name: book-modal-in-center;
  }
  @keyframes book-modal-in-center {
    from {
      transform: translate(-50%, -46%);
      opacity: 0;
    }
  }
}
body:has(.book-modal.is-open) {
  overflow: hidden;
}

/* Contacts page */
.contacts {
  padding-bottom: var(--space-8);
}
.contacts__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
@media (min-width: 900px) {
  .contacts__grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
    gap: var(--space-8);
  }
}
.contacts__h {
  margin: 0 0 var(--space-4);
  font: 600 20px/26px var(--font-display);
  letter-spacing: -.01em;
  color: var(--ink-head);
}
.contacts__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}
.contacts__label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-muted);
}
.contacts__value {
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
  color: var(--ink-head);
  text-decoration: none;
}
a.contacts__value:hover {
  color: var(--brand);
  text-decoration: underline;
}
.contacts__form-hint {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-muted);
}
.contacts__legal {
  max-width: 52rem;
}
.contacts__legal-more {
  margin: var(--space-4) 0 0;
  font-size: 14px;
  line-height: 22px;
}
.contacts__legal-more a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.contacts__legal-more a:hover {
  text-decoration: underline;
}

/* Catalog pager: Livewire uses <button>, listing.css only styles a/span */
.pager ol {
  align-items: center;
}
.pager a,
.pager button,
.pager span {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.pager a:hover,
.pager button:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.pager [aria-current] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  cursor: default;
}
.pager .pager__gap {
  border: 0;
  background: transparent;
  min-width: auto;
  color: var(--ink-muted);
  cursor: default;
}
