/**
 * Прототип: фільтри + видача (референс-дизайн)
 */

:root {
  --atsp-content-width: 1280px;
  --sf-radius-panel: 24px;
  --sf-radius-chip: 999px;
  --sf-radius-input: 14px;
  --sf-blue: #1a5dc8;
  --sf-blue-soft: #eef4fc;
  --sf-blue-border: #2d5ea8;
  --sf-gold: #c5a059;
  --sf-shadow: 0 18px 46px rgba(15, 32, 68, 0.1);
  --sf-shadow-hover: 0 22px 52px rgba(15, 32, 68, 0.13);
  --sf-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sf-font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sf-heading-size: 32px;
  --sf-heading-weight: 600;
  --sf-subheading-size: 16px;
  --sf-subheading-weight: 600;
  --sf-body-size: 16px;
  --sf-body-weight: 400;
}

body:has(.search-results-page) .proto-hero {
  min-height: auto;
  padding-bottom: 36px;
}

/* Standalone /katalog/ — білий фон */
body.atsp-scope {
  background: #fff;
}

body.atsp-scope .proto-hero {
  background: #fff;
}

body.atsp-scope .search-hero-copy h1 {
  color: var(--anex-text, #1a2233);
  text-shadow: none;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

body.atsp-scope .search-hero-copy__lead {
  color: #5b6470;
  text-shadow: none;
}

body.atsp-scope .search-hero-support {
  border-top-color: #e8ecf2;
  margin-top: 20px;
  padding-top: 18px;
}

body.atsp-scope .search-hero-support__line--primary {
  display: inline-block;
  max-width: 56ch;
  margin: 0;
  padding: 10px 16px;
  border-radius: 8px;
  background: #cfe0f5 !important;
  color: #12213a !important;
  text-shadow: none;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.55;
}

body.atsp-scope .search-hero-support__line--muted {
  color: #8b95a8;
  text-shadow: none;
  font-size: 16px;
  font-weight: 400;
  margin: 0;
}

body.atsp-scope .search-results-page {
  background: #fff;
}

.search-results-page {
  padding: 28px 0 56px;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  font-family: var(--sf-font);
  font-size: var(--sf-body-size);
  font-weight: var(--sf-body-weight);
  line-height: 1.45;
}

.search-results-page .search-results-inner {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 24px 32px;
  align-items: start;
  position: relative;
}

/* ——— Фільтри (панель) ——— */
.search-filters {
  position: sticky;
  top: 18px;
  z-index: 20;
}

.search-filters-sheet {
  padding: 18px 18px 20px;
  border-radius: var(--sf-radius-panel);
  border: 1px solid #e8ecf2;
  background: #fff;
  box-shadow: var(--sf-shadow);
  overflow: hidden;
}

.search-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  padding: 4px 2px 16px;
  border-bottom: 1px solid #edf1f6;
}

.search-filters-head h2 {
  margin: 0;
  font-size: var(--sf-subheading-size);
  font-weight: var(--sf-subheading-weight);
  letter-spacing: 0;
}

.search-filters-reset {
  border: 0;
  padding: 0;
  margin-left: auto;
  background: none;
  color: var(--sf-blue);
  font-family: inherit;
  font-size: var(--sf-subheading-size);
  font-weight: var(--sf-subheading-weight);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s var(--sf-ease), opacity 0.25s var(--sf-ease);
}

.search-filters-reset:hover {
  color: #134a9e;
}

.sf-filters-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--sf-blue-soft);
  color: var(--sf-blue);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s var(--sf-ease), transform 0.25s var(--sf-ease);
}

.sf-filters-close:hover {
  background: #e3edfa;
  transform: scale(1.04);
}

.filter-block {
  padding: 14px 0;
  border-bottom: 1px solid #edf1f6;
  transition: padding 0.28s var(--sf-ease);
}

.filter-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.filter-block[hidden] {
  display: none !important;
}

.filter-label-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  min-height: 48px;
  padding: 4px 6px 4px 0;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--anex-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.24s var(--sf-ease),
    color 0.24s var(--sf-ease);
}

.filter-label-row:hover {
  background: rgba(26, 93, 200, 0.06);
}

.filter-label-row:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(26, 93, 200, 0.12);
}

.filter-label-row::after {
  content: "";
  width: 18px;
  height: 18px;
  margin-left: auto;
  margin-right: 2px;
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7 9 11l4-4' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7 9 11l4-4' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
  transform: rotate(180deg);
  transition:
    transform 0.28s var(--sf-ease),
    opacity 0.28s var(--sf-ease);
}

.filter-label-row[aria-expanded="false"]::after {
  transform: rotate(0deg);
}

.filter-label-row:hover::after {
  opacity: 0.78;
}

.filter-label-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--sf-blue-soft);
  color: var(--sf-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(26, 93, 200, 0.08);
  transition:
    background 0.24s var(--sf-ease),
    color 0.24s var(--sf-ease),
    box-shadow 0.24s var(--sf-ease);
}

.filter-label-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.filter-label {
  flex: 1;
  font-size: var(--sf-subheading-size);
  font-weight: var(--sf-subheading-weight);
  letter-spacing: 0;
  color: var(--anex-text);
}

.filter-block-body {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: 10px;
  padding-left: 52px;
  overflow: hidden;
  opacity: 1;
  transition:
    grid-template-rows 0.34s var(--sf-ease),
    margin-top 0.34s var(--sf-ease),
    opacity 0.24s ease;
}

.filter-block-body > * {
  min-height: 0;
  overflow: hidden;
}

.filter-block.is-collapsed .filter-block-body {
  grid-template-rows: 0fr;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
}

.sf-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sf-chip-grid label {
  cursor: pointer;
}

.sf-chip-grid label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sf-chip-grid label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--sf-radius-chip);
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-size: var(--sf-body-size);
  font-weight: var(--sf-body-weight);
  color: var(--anex-text);
  user-select: none;
  transition:
    border-color 0.28s var(--sf-ease),
    background 0.28s var(--sf-ease),
    color 0.28s var(--sf-ease),
    box-shadow 0.28s var(--sf-ease),
    transform 0.28s var(--sf-ease);
}

.sf-chip-grid label:hover span {
  border-color: #b8c9e8;
  background: #fafbfd;
  transform: translateY(-1px);
}

.sf-chip-grid label input:focus-visible + span {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(26, 93, 200, 0.12);
}

.sf-chip-grid label input:checked + span {
  border-color: var(--sf-blue-border);
  background: var(--sf-blue-soft);
  color: var(--sf-blue-border);
  font-weight: var(--sf-subheading-weight);
  box-shadow:
    inset 0 0 0 1px rgba(26, 93, 200, 0.08),
    0 4px 14px rgba(26, 93, 200, 0.12);
}

.sf-budget-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sf-budget-row > span {
  color: var(--anex-label);
  font-size: var(--sf-body-size);
  font-weight: var(--sf-body-weight);
}

.sf-budget-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--sf-radius-input);
  border: 1.5px solid #e2e8f0;
  font-family: inherit;
  font-size: var(--sf-body-size);
  font-weight: var(--sf-body-weight);
  background: #fff;
  transition:
    border-color 0.28s var(--sf-ease),
    box-shadow 0.28s var(--sf-ease);
}

.sf-budget-row input::placeholder {
  color: #8b95a8;
}

.sf-budget-row input:hover {
  border-color: #c5d4ea;
}

.sf-budget-row input:focus {
  outline: none;
  border-color: var(--sf-gold);
  box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.18);
}

/* ——— Мобільний язичок + drawer ——— */
.sf-filters-tab,
.sf-filters-backdrop {
  display: none;
}

/* ——— Результати ——— */
.search-results-main {
  min-width: 0;
}

.search-results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: 18px;
}

.search-results-count {
  margin: 0;
  font-size: var(--sf-heading-size);
  font-weight: var(--sf-heading-weight);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.search-results-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-layout-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 32, 68, 0.05);
}

.search-layout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #8b95a8;
  cursor: pointer;
  transition:
    background 0.28s var(--sf-ease),
    color 0.28s var(--sf-ease),
    transform 0.28s var(--sf-ease);
}

.search-layout-btn:hover {
  color: var(--sf-blue);
  background: var(--sf-blue-soft);
}

.search-layout-btn.is-active {
  background: var(--sf-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 93, 200, 0.28);
}

.search-sort {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  font-family: inherit;
  font-size: var(--sf-subheading-size);
  font-weight: var(--sf-subheading-weight);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(15, 32, 68, 0.05);
  transition: border-color 0.25s var(--sf-ease), box-shadow 0.25s var(--sf-ease);
}

.search-sort:focus {
  outline: none;
  border-color: var(--sf-blue);
  box-shadow: 0 0 0 4px rgba(26, 93, 200, 0.12);
}

.search-results-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: var(--sf-radius-chip);
  background: var(--sf-blue-soft);
  color: var(--sf-blue);
  font-size: 12px;
  font-weight: 800;
}

.search-results-list[hidden] {
  display: none !important;
}

.search-results-pagination {
  margin: 28px 0 8px;
}

.search-results-pagination[hidden] {
  display: none !important;
}

.search-results-pagination__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
}

.search-results-pagination__pages {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.search-results-pagination__btn,
.search-results-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #0f2044;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.search-results-pagination__page {
  min-width: 40px;
  padding: 0 10px;
}

.search-results-pagination__btn:hover:not(:disabled),
.search-results-pagination__page:hover:not(.is-active) {
  border-color: #c7d2e3;
  background: #f8fafc;
}

.search-results-pagination__page.is-active {
  border-color: #0f6fff;
  background: #0f6fff;
  color: #fff;
  cursor: default;
}

.search-results-pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.search-results-pagination__ellipsis {
  padding: 0 4px;
  color: #64748b;
  font-weight: 600;
}

.search-results-pagination__meta {
  margin: 12px 0 0;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 640px) {
  .search-results-pagination__inner {
    gap: 8px;
  }

  .search-results-pagination__btn {
    flex: 1 1 calc(50% - 8px);
    max-width: calc(50% - 4px);
  }

  .search-results-pagination__pages {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

/* Список — 1 в ряд (горизонтальна картка) */
.search-results-list.is-layout-list .search-result-row {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr) minmax(0, 200px);
  gap: 16px 18px;
  padding: 18px;
  margin-bottom: 16px;
  border-radius: 22px;
  border: 1px solid #e8ecf2;
  background: #fff;
  align-items: stretch;
  transition:
    border-color 0.32s var(--sf-ease),
    box-shadow 0.32s var(--sf-ease),
    transform 0.32s var(--sf-ease);
}

.search-results-list.is-layout-list .search-result-row:hover {
  border-color: rgba(26, 93, 200, 0.35);
  box-shadow: var(--sf-shadow-hover);
  transform: translateY(-3px);
}

/* Сітка — 2 в ряд (десктоп) */
.search-results-list.is-layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.search-results-list.is-layout-grid .search-result-row {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border-radius: 22px;
  border: 1px solid #e8ecf2;
  background: #fff;
  overflow: hidden;
  transition:
    border-color 0.32s var(--sf-ease),
    box-shadow 0.32s var(--sf-ease),
    transform 0.32s var(--sf-ease);
}

.search-results-list.is-layout-grid .search-result-row:hover {
  border-color: rgba(26, 93, 200, 0.35);
  box-shadow: var(--sf-shadow-hover);
  transform: translateY(-4px);
}

.search-results-list.is-layout-grid .search-result-photo {
  min-height: 168px;
  border-radius: 0;
}

.search-results-list.is-layout-grid .search-result-body {
  padding: 16px 16px 0;
  flex: 1;
}

.search-results-list.is-layout-grid .search-result-side {
  padding: 12px 16px 18px;
  align-items: flex-start;
  text-align: left;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #f0f3f8;
  margin-top: auto;
}

.search-results-list.is-layout-grid .search-result-cta {
  margin-left: auto;
}

.search-result-photo {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 140px;
  background: linear-gradient(145deg, #dce8f8 0%, #f2f6fb 100%);
}

.search-results-list.is-layout-list .search-result-photo {
  align-self: stretch;
}

.search-result-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--sf-ease);
}

.search-result-row:hover .search-result-img {
  transform: scale(1.05);
}

.search-result-rate-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(12, 22, 42, 0.78);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.search-results-list.is-layout-list .search-result-photo {
  min-height: 150px;
}

.search-result-old {
  display: inline-block;
  margin-right: 6px;
  color: #aab3c2;
  font-size: 13px;
  font-weight: 700;
  text-decoration: line-through;
}

.search-result-body h3 {
  margin: 0 0 8px;
  font-size: var(--sf-subheading-size);
  font-weight: var(--sf-subheading-weight);
  line-height: 1.3;
  letter-spacing: 0;
}

.search-result-meta {
  font-size: var(--sf-body-size);
  color: var(--anex-label);
  font-weight: var(--sf-body-weight);
  margin-bottom: 10px;
  line-height: 1.45;
}

.search-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.search-result-tag {
  padding: 5px 11px;
  border-radius: var(--sf-radius-chip);
  background: #f3f6fb;
  font-size: var(--sf-body-size);
  font-weight: var(--sf-body-weight);
  color: #44506b;
}

.search-result-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}

.search-result-price {
  font-size: var(--sf-body-size);
  color: var(--anex-label);
  font-weight: var(--sf-body-weight);
}

.search-result-price strong {
  display: block;
  font-size: var(--sf-subheading-size);
  color: var(--anex-text);
  font-weight: var(--sf-subheading-weight);
  line-height: 1.25;
  letter-spacing: 0;
}

.search-result-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--anex-red);
  color: #fff !important;
  font-family: inherit;
  font-size: var(--sf-subheading-size);
  font-weight: var(--sf-subheading-weight);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.28s var(--sf-ease), transform 0.28s var(--sf-ease);
}

.search-result-cta:hover {
  background: var(--anex-red-hover);
  transform: scale(1.02);
}

.search-result-row--excursion .search-result-photo {
  background: linear-gradient(145deg, #e8f0ea 0%, #f2f6f8 100%);
}

.search-result-route {
  font-size: 13px;
  font-weight: 600;
  color: #44506b;
  line-height: 1.45;
  margin-bottom: 8px;
}

/* ——— Планшет ——— */
@media (max-width: 1024px) {
  .search-results-page .search-results-inner {
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    gap: 20px;
  }

  .filter-block-body {
    padding-left: 0;
    margin-top: 12px;
  }

  .search-results-list.is-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Мобільний сайдбар фільтрів ——— */
@media (max-width: 767px) {
  .search-results-page .search-results-inner {
    grid-template-columns: 1fr;
  }

  .sf-filters-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0;
    top: 50%;
    z-index: 1320;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 0 16px 16px 0;
    background: var(--sf-blue);
    color: #fff;
    box-shadow: 8px 0 24px rgba(26, 93, 200, 0.34);
    cursor: pointer;
    transition:
      opacity 0.28s var(--sf-ease),
      box-shadow 0.4s var(--sf-ease),
      background 0.3s var(--sf-ease);
  }

  .sf-filters-tab:hover {
    transform: translateY(-50%);
    box-shadow: 8px 0 24px rgba(26, 93, 200, 0.34);
  }

  .sf-filters-tab:focus-visible {
    outline: 0;
    box-shadow:
      0 0 0 4px rgba(26, 93, 200, 0.18),
      8px 0 24px rgba(26, 93, 200, 0.34);
  }

  .sf-filters-tab__icon {
    width: 24px;
    height: 24px;
    display: block;
  }

  body.sf-filters-open .sf-filters-tab {
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
  }

  .sf-filters-tab__text {
    display: none !important;
  }

  .sf-filters-tab__count {
    display: none !important;
  }

  .sf-filters-tab__count:not([hidden]) {
    display: none !important;
  }

  .sf-filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(12, 22, 42, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.4s var(--sf-ease),
      visibility 0.4s var(--sf-ease);
  }

  body.sf-filters-open .sf-filters-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .search-filters {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1310;
    width: min(360px, 92vw);
    max-width: 100%;
    transform: translateX(-105%);
    transition:
      transform 0.44s var(--sf-ease),
      box-shadow 0.44s var(--sf-ease);
    pointer-events: none;
    will-change: transform;
  }

  body.sf-filters-open .search-filters {
    transform: translateX(0);
    pointer-events: auto;
    box-shadow: 18px 0 48px rgba(15, 32, 68, 0.14);
  }

  .search-filters-sheet {
    height: 100%;
    border-radius: 0 24px 24px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .search-filters-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
  }

  .sf-filters-close {
    display: inline-flex;
  }

  .search-layout-toggle {
    display: none;
  }

  .search-results-list.is-layout-list .search-result-row {
    grid-template-columns: 1fr;
  }

  .search-result-side {
    align-items: flex-start;
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .search-results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-results-actions {
    width: 100%;
    justify-content: space-between;
  }

  .search-sort {
    flex: 1;
    min-width: 0;
  }
}

@media (min-width: 768px) {
  .sf-filters-close {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-result-row,
  .filter-label-row,
  .filter-label-row::after,
  .filter-block,
  .filter-block-body,
  .sf-chip-grid label span,
  .sf-filters-tab,
  .search-filters,
  .sf-filters-backdrop,
  .search-result-img,
  .tour-modal,
  .tour-modal__dialog,
  .tm-track {
    transition: none;
  }
}

/* ——— Сворачиваемые фільтри (закриті за замовчуванням) ——— */
.filter-block-body {
  overflow: hidden;
  transition: max-height 0.34s var(--sf-ease), opacity 0.28s var(--sf-ease), margin-top 0.28s var(--sf-ease);
  max-height: 320px;
  opacity: 1;
}

.filter-block.is-collapsed .filter-block-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

body.atsp-in-iframe {
  overflow-x: hidden;
  overflow-y: visible;
  height: auto;
}

html.atsp-in-iframe {
  overflow-x: hidden;
  overflow-y: visible;
  height: auto;
}

body.atsp-in-iframe .tour-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  z-index: 10200;
}

body.atsp-in-iframe .tour-modal__dialog {
  top: 50%;
  max-height: min(calc(100dvh - 32px), calc(100vh - 32px));
}

body.atsp-in-iframe.tour-modal-open {
  overflow: hidden;
}

/* ——— ПОПАП деталей туру (вище фільтрів, гарячих, FAB) ——— */
.tour-modal {
  position: fixed;
  inset: 0;
  z-index: 10200;
}

.tour-modal[hidden] {
  display: none;
}

.tour-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 16, 34, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s var(--sf-ease);
}

.tour-modal.is-open .tour-modal__backdrop {
  opacity: 1;
}

.tour-modal__dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1080px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  transform: translate(-50%, -46%) scale(0.97);
  opacity: 0;
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(8, 18, 42, 0.4);
  transition: transform 0.36s var(--sf-ease), opacity 0.3s var(--sf-ease);
  display: flex;
  flex-direction: column;
}

.tour-modal.is-open .tour-modal__dialog {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Деталі туру — нічого з боків не перекриває попап */
body.tour-modal-open .sf-filters-tab,
body.tour-modal-open .atsp-fab {
  visibility: hidden;
  pointer-events: none;
}

body.tour-modal-open .atsp-hot-drawer {
  pointer-events: none;
}

.tour-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1a2233;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(8, 18, 42, 0.18);
  transition: transform 0.25s var(--sf-ease), background 0.25s var(--sf-ease);
}

.tour-modal__close:hover {
  transform: rotate(90deg) scale(1.05);
  background: #fff;
}

.tour-modal__scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* медіа / карусель */
.tm-media {
  background: #0d1626;
}

.tm-carousel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 8;
  background: #0d1626;
}

.tm-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s var(--sf-ease);
}

.tm-slide {
  flex: 0 0 100%;
  height: 100%;
}

.tm-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tm-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #1a2233;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(8, 18, 42, 0.25);
  transition: background 0.25s var(--sf-ease), transform 0.25s var(--sf-ease);
}

.tm-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}

.tm-nav--prev { left: 16px; }
.tm-nav--next { right: 16px; }

.tm-counter {
  position: absolute;
  bottom: 14px;
  right: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 16, 34, 0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.tm-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #0d1626;
  overflow-x: auto;
  scrollbar-width: none;
}

.tm-thumbs::-webkit-scrollbar { display: none; }

.tm-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  background: none;
  transition: opacity 0.25s var(--sf-ease), border-color 0.25s var(--sf-ease);
}

.tm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-thumb:hover { opacity: 0.85; }
.tm-thumb.is-active { opacity: 1; border-color: #fff; }

/* тіло попапа */
.tm-body {
  padding: 26px 28px 30px;
}

.tm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 32px;
  align-items: start;
}

.tm-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--sf-blue-soft);
  color: var(--sf-blue);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}

.tm-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tm-meta {
  margin: 0 0 16px;
  color: var(--anex-label);
  font-size: 14px;
  font-weight: 600;
}

.tm-rating {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 10px 16px;
  border-radius: 16px;
  background: #f4f8ff;
}

.tm-rating__score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 40px;
  border-radius: 12px;
  background: var(--sf-blue);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.tm-rating__word {
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 800;
  color: var(--anex-text);
}

.tm-rating__word small {
  font-size: 12px;
  font-weight: 600;
  color: var(--anex-label);
}

.tm-subhead {
  margin: 24px 0 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.tm-col--info .tm-subhead:first-of-type {
  margin-top: 0;
}

.tm-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #44506b;
}

.tm-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.tm-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--anex-text);
}

.tm-feature svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #2f9e6b;
  background: #e7f7ee;
  border-radius: 50%;
  padding: 3px;
}

/* картка бронювання */
.tm-col--booking {
  position: sticky;
  top: 12px;
}

.tm-book-card {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid #e8ecf2;
  background: #fff;
  box-shadow: var(--sf-shadow);
}

.tm-book-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--anex-label);
}

.tm-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
}

.tm-price__old {
  width: 100%;
  color: #aab3c2;
  font-size: 14px;
  font-weight: 700;
  text-decoration: line-through;
}

.tm-price__from { color: var(--anex-label); font-size: 14px; font-weight: 700; }
.tm-price strong { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.tm-price__per { color: var(--anex-label); font-size: 13px; font-weight: 600; }

.tm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s var(--sf-ease), background 0.25s var(--sf-ease), box-shadow 0.25s var(--sf-ease);
}

.tm-btn--primary {
  background: var(--anex-red);
  color: #fff;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 10px 24px rgba(243, 22, 36, 0.28);
  margin-bottom: 10px;
}

.tm-btn--primary:hover {
  background: var(--anex-red-hover);
  color: #fff;
  -webkit-text-fill-color: #fff;
  transform: translateY(-2px);
}

.tm-btn--ghost {
  background: #fff;
  color: var(--anex-text);
  border: 1.5px solid #e2e8f0;
}

.tm-btn--ghost:hover { border-color: var(--sf-blue); color: var(--sf-blue); }

.tm-book-perks {
  list-style: none;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid #eef2f7;
  display: grid;
  gap: 10px;
}

.tm-book-perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #44506b;
}

.tm-book-perks svg {
  width: 18px;
  height: 18px;
  color: #2f9e6b;
  flex-shrink: 0;
}

/* секції-рейли */
.tm-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #eef2f7;
}

.tm-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tm-section__head .tm-subhead { margin: 0; }

.tm-arrows { display: flex; gap: 8px; }

.tm-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  color: var(--anex-text);
  cursor: pointer;
  transition: border-color 0.25s var(--sf-ease), color 0.25s var(--sf-ease), background 0.25s var(--sf-ease);
}

.tm-arrow:hover { border-color: var(--sf-blue); color: var(--sf-blue); background: var(--sf-blue-soft); }

.tm-rail {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.tm-rail::-webkit-scrollbar { display: none; }

.tm-review {
  flex: 0 0 min(340px, 82%);
  scroll-snap-align: start;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #e8ecf2;
  background: #fbfcfe;
}

.tm-review__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tm-review__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sf-blue);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
}

.tm-review__name { display: block; font-size: 14px; font-weight: 800; }
.tm-review__date { font-size: 12px; color: var(--anex-label); font-weight: 600; }

.tm-review__score {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 32px;
  border-radius: 10px;
  background: #e7f7ee;
  color: #1f9d63;
  font-size: 14px;
  font-weight: 800;
}

.tm-review__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #44506b;
}

.tm-similar-card {
  flex: 0 0 min(260px, 78%);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid #e8ecf2;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.25s var(--sf-ease), box-shadow 0.25s var(--sf-ease), transform 0.25s var(--sf-ease);
}

.tm-similar-card:hover {
  background: #fff;
  border-color: rgba(26, 93, 200, 0.35);
  box-shadow: var(--sf-shadow);
  transform: translateY(-3px);
}

.tm-similar-photo {
  display: block;
  height: 130px;
  background: #eef2f8;
}

.tm-similar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tm-similar-body { display: block; padding: 14px; }
.tm-similar-name { display: block; font-size: 15px; font-weight: 800; line-height: 1.3; margin-bottom: 4px; }
.tm-similar-meta { display: block; font-size: 12px; color: var(--anex-label); font-weight: 600; margin-bottom: 8px; }
.tm-similar-price { display: block; font-size: 13px; color: var(--anex-label); font-weight: 600; }
.tm-similar-price strong { color: var(--anex-text); font-size: 17px; font-weight: 800; }

/* планшет/мобайл попапа */
@media (max-width: 880px) {
  .tm-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .tm-col--booking {
    position: static;
    order: -1;
  }
}

@media (max-width: 767px) {
  .tour-modal__dialog {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: translateY(40px);
  }
  .tour-modal.is-open .tour-modal__dialog {
    transform: translateY(0);
  }
  .tm-carousel { aspect-ratio: 4 / 3; }
  .tm-body { padding: 20px 18px 28px; }
  .tm-title { font-size: 23px; }
  .tm-features { grid-template-columns: 1fr; }
  .tm-nav { width: 40px; height: 40px; }
  .tm-nav--prev { left: 10px; }
  .tm-nav--next { right: 10px; }
}
