/* turafan.sk – katalóg /trasy a mapa /mapa (InstantSearch + Leaflet) */

/* ---------- lišta nástrojov ---------- */
.tf-search-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.tf-search-toolbar .tf-searchbox { flex: 1 1 220px; min-width: 0; }
.tf-search-toolbar .tf-sort { flex: 0 0 auto; }
.tf-stats { font-size: .85rem; color: var(--tf-muted); white-space: nowrap; }

/* InstantSearch searchbox → Bootstrap vzhľad */
.ais-SearchBox-form { position: relative; }
.ais-SearchBox-input {
  width: 100%; height: 42px; padding: 6px 40px 6px 38px; border: 1px solid var(--tf-border); border-radius: 12px;
  background: var(--tf-card-bg); font-size: 1rem; box-shadow: none;
}
.ais-SearchBox-input:focus { outline: none; border-color: var(--tf-accent); box-shadow: 0 0 0 .25rem rgba(47,143,91,.2); }
.ais-SearchBox-submit, .ais-SearchBox-reset { position: absolute; top: 0; height: 42px; width: 36px; border: 0; background: transparent; color: var(--tf-muted); }
.ais-SearchBox-submit { left: 2px; pointer-events: none; }
.ais-SearchBox-reset { right: 2px; }
.ais-SearchBox-submitIcon, .ais-SearchBox-resetIcon { width: 14px; height: 14px; fill: currentColor; }
.ais-SearchBox-loadingIndicator { display: none; }

.ais-SortBy-select {
  height: 42px; padding: 6px 32px 6px 12px; border: 1px solid var(--tf-border); border-radius: 12px; background: var(--tf-card-bg);
  font-size: .9rem; appearance: auto;
}

/* ---------- filtre ---------- */
.tf-filters { font-size: .92rem; }
.tf-filters .tf-filter-group { padding: 12px 0; border-bottom: 1px solid var(--tf-border); }
.tf-filters .tf-filter-group:last-child { border-bottom: 0; }
.tf-filters .tf-filter-title { font-weight: 600; font-size: .9rem; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.tf-filters .tf-filter-title i { color: var(--tf-accent); }
.tf-filters .tf-filter-sub { font-size: .8rem; color: var(--tf-muted); margin: 8px 0 4px; }
.tf-filters .ais-RefinementList-list, .tf-filters .ais-Menu-list { list-style: none; margin: 0; padding: 0; }
.tf-filters .ais-RefinementList-item { margin: 0; padding: 0; }
.tf-filters .ais-RefinementList-label { display: flex; align-items: center; gap: 8px; padding: 5px 2px; cursor: pointer; border-radius: 8px; }
.tf-filters .ais-RefinementList-label:hover { background: var(--tf-accent-soft); }
.tf-filters .ais-RefinementList-checkbox { width: 16px; height: 16px; accent-color: var(--tf-accent); flex: 0 0 auto; margin: 0; }
.tf-filters .ais-RefinementList-labelText { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-filters .ais-RefinementList-count { font-size: .72rem; color: var(--tf-muted); background: var(--tf-bg); border-radius: 10px; padding: 1px 7px; }
.tf-filters .ais-RefinementList-item--selected .ais-RefinementList-labelText { font-weight: 600; color: var(--tf-accent-dark); }
.tf-filters .ais-RefinementList-showMore, .tf-filters .ais-ClearRefinements-button {
  margin-top: 4px; padding: 4px 10px; border: 1px solid var(--tf-border); border-radius: 8px; background: var(--tf-card-bg); font-size: .8rem; color: var(--tf-accent-dark);
}
.tf-filters .ais-RefinementList-showMore--disabled { display: none; }
.tf-filters .ais-RefinementList-searchBox .ais-SearchBox-input { height: 34px; font-size: .85rem; padding-left: 32px; border-radius: 8px; margin-bottom: 6px; }
.tf-filters .ais-RefinementList-searchBox .ais-SearchBox-submit, .tf-filters .ais-RefinementList-searchBox .ais-SearchBox-reset { height: 34px; width: 30px; }
.tf-filters .ais-RefinementList-noResults { font-size: .8rem; color: var(--tf-muted); }
.tf-filters .ais-ToggleRefinement-label { display: flex; align-items: center; gap: 8px; padding: 5px 2px; cursor: pointer; border-radius: 8px; }
.tf-filters .ais-ToggleRefinement-label:hover { background: var(--tf-accent-soft); }
.tf-filters .ais-ToggleRefinement-checkbox { width: 16px; height: 16px; accent-color: var(--tf-accent); margin: 0; }
.tf-filters .ais-ToggleRefinement-count { font-size: .72rem; color: var(--tf-muted); margin-left: auto; background: var(--tf-bg); border-radius: 10px; padding: 1px 7px; }
.tf-filters .ais-ClearRefinements-button--disabled { display: none; }
.tf-filters .ais-RangeInput-form { display: flex; align-items: center; gap: 6px; }
.tf-filters .ais-RangeInput-input {
  width: 100%; min-width: 0; height: 34px; padding: 4px 8px; border: 1px solid var(--tf-border); border-radius: 8px; font-size: .85rem;
}
.tf-filters .ais-RangeInput-separator { color: var(--tf-muted); }
.tf-filters .ais-RangeInput-submit {
  height: 34px; padding: 0 10px; border: 1px solid var(--tf-accent); border-radius: 8px; background: var(--tf-accent); color: #fff; font-size: .8rem;
}
.tf-filters .ais-RangeSlider { padding: 0 24px; }
.tf-filters .ais-RangeSlider .rheostat { margin: 26px 0 8px; }
.tf-filters .ais-RangeSlider .rheostat-progress { background: var(--tf-accent); }
.tf-filters .ais-RangeSlider .rheostat-handle { border-color: var(--tf-accent); }
.tf-filters .ais-RangeSlider .rheostat-tooltip { font-size: .75rem; }
.tf-filters .ais-RangeSlider .rheostat-marker--large { display: none; }
.tf-filters .ais-RangeSlider .rheostat-value { font-size: .72rem; color: var(--tf-muted); }
.tf-filters .ais-RangeSlider--disabled { opacity: .4; }
.tf-filter-count { background: var(--tf-accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.tf-filter-count:empty { display: none; }

/* offcanvas s filtrami */
.tf-filters-offcanvas .offcanvas-body { padding-top: 0; }

/* ---------- karty výsledkov ---------- */
.tf-hits .ais-InfiniteHits-list, .tf-hits .ais-Hits-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
.tf-hits .ais-InfiniteHits-item, .tf-hits .ais-Hits-item { margin: 0; padding: 0; box-shadow: none; border: 0; background: none; display: block; }
.tf-hits .ais-InfiniteHits-loadMore {
  display: block; margin: 16px auto 0; padding: 8px 20px; border: 1px solid var(--tf-accent); border-radius: 10px; background: var(--tf-card-bg); color: var(--tf-accent-dark); font-weight: 600;
}
.tf-hits .ais-InfiniteHits-loadMore--disabled { display: none; }
.tf-hits .ais-InfiniteHits-loadPrevious { display: none; }

.tf-hit {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--tf-card-bg); border: 1px solid var(--tf-border); border-radius: var(--tf-radius); box-shadow: var(--tf-shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tf-hit:hover, .tf-hit.is-active { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,30,25,.12); color: inherit; border-color: var(--tf-accent); }
.tf-hit-img { position: relative; aspect-ratio: 3 / 2; background: var(--tf-accent-soft); overflow: hidden; }
.tf-hit-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-hit-img .tf-hit-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--tf-accent); font-size: 2.2rem; opacity: .6; }
.tf-hit-badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.tf-hit-badges .badge { font-weight: 600; font-size: .7rem; padding: 4px 8px; border-radius: 8px; }
.tf-badge-diff-easy { background: #2f8f5b; } .tf-badge-diff-moderate { background: #2b7bb9; } .tf-badge-diff-hard { background: #d9742b; } .tf-badge-diff-expert { background: #b23a3a; }
.tf-hit-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.tf-hit-title { font-weight: 700; font-size: 1rem; line-height: 1.25; margin: 0; }
.tf-hit-title mark, .tf-hit-sub mark { background: #fff2b8; padding: 0; }
.tf-hit-sub { font-size: .8rem; color: var(--tf-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-hit-stats { display: flex; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--tf-text); }
.tf-hit-stats span { display: inline-flex; align-items: center; gap: 3px; }
.tf-hit-stats i { color: var(--tf-accent); }
.tf-hit-rating { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--tf-muted); }
.tf-hit-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.tf-hit-tags .tf-chip { font-size: .7rem; padding: 2px 8px; border-radius: 10px; background: var(--tf-bg); color: var(--tf-muted); border: 1px solid var(--tf-border); }
.tf-empty { text-align: center; color: var(--tf-muted); padding: 40px 12px; }
.tf-empty i { font-size: 2rem; display: block; margin-bottom: 8px; color: var(--tf-accent); }

@media (min-width: 576px) { .tf-hits .ais-InfiniteHits-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .tf-hits .ais-InfiniteHits-list { grid-template-columns: repeat(3, 1fr); } }

/* ---------- stránka mapy ---------- */
.tf-map-page { position: relative; height: calc(100vh - var(--tf-topbar-h) - var(--tf-tabbar-h) - env(safe-area-inset-bottom, 0px)); height: calc(100dvh - var(--tf-topbar-h) - var(--tf-tabbar-h) - env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; overflow: hidden; }
.tf-map-page .tf-flash { position: absolute; z-index: 1001; left: 12px; right: 12px; top: 56px; }
.tf-map-top { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--tf-card-bg); border-bottom: 1px solid var(--tf-border); z-index: 2; }
.tf-map-top .tf-searchbox { flex: 1 1 auto; min-width: 0; }
.tf-map-top .ais-SearchBox-input { height: 38px; border-radius: 10px; }
.tf-map-top .ais-SearchBox-submit, .tf-map-top .ais-SearchBox-reset { height: 38px; }
.tf-map-body { flex: 1 1 auto; position: relative; min-height: 0; display: flex; flex-direction: column; }
.tf-map-canvas { flex: 1 1 auto; min-width: 0; position: relative; }
.tf-map-canvas .leaflet-container { width: 100%; height: 100%; background: #e9eeeb; }
.tf-map-area {
  position: absolute; z-index: 800; top: 10px; left: 50%; transform: translateX(-50%);
  background: var(--tf-card-bg); border: 1px solid var(--tf-border); border-radius: 20px; padding: 4px 12px 4px 10px; box-shadow: var(--tf-shadow);
  font-size: .82rem; display: flex; align-items: center; gap: 6px; white-space: nowrap; max-width: calc(100% - 24px);
}
.tf-map-area .form-check-input { margin: 0; cursor: pointer; }
.tf-map-area label { cursor: pointer; margin: 0; }
.tf-map-list { flex: 0 0 auto; max-height: 45%; overflow: hidden; background: var(--tf-card-bg); }
.tf-map-list .tf-stats { padding: 6px 12px; border-bottom: 1px solid var(--tf-border); }
.tf-map-list .ais-Hits-list { display: flex; gap: 10px; padding: 10px 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.tf-map-list .ais-Hits-item { flex: 0 0 240px; scroll-snap-align: start; }
.tf-map-list .tf-hit { flex-direction: row; height: 96px; }
.tf-map-list .tf-hit-img { flex: 0 0 96px; aspect-ratio: auto; }
.tf-map-list .tf-hit-img .tf-hit-noimg { font-size: 1.6rem; }
.tf-map-list .tf-hit-badges { top: 4px; left: 4px; right: 4px; }
.tf-map-list .tf-hit-badges .badge { font-size: .6rem; padding: 2px 5px; }
.tf-map-list .tf-hit-body { padding: 8px 10px; gap: 2px; min-width: 0; overflow: hidden; }
.tf-map-list .tf-hit-title { font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tf-map-list .tf-hit-stats { font-size: .72rem; gap: 6px; }
.tf-map-list .tf-hit-tags, .tf-map-list .tf-hit-sub { display: none; }
.tf-map-list .tf-hit-rating { font-size: .72rem; }
.tf-map-list .tf-empty { padding: 14px 12px; font-size: .85rem; }
.tf-map-list .tf-empty i { font-size: 1.4rem; margin-bottom: 2px; }

.tf-map-popup .leaflet-popup-content { margin: 0; width: 240px !important; }
.tf-map-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 12px; overflow: hidden; }
.tf-map-popup .tf-hit { border: 0; box-shadow: none; border-radius: 0; }
.tf-map-popup .tf-hit:hover { transform: none; }
.tf-map-popup .tf-hit-tags { display: none; }

.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(47,143,91,.3); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: var(--tf-accent); color: #fff; font-weight: 700; }

@media (min-width: 992px) {
  .tf-map-body { flex-direction: row; }
  .tf-map-list { flex: 0 0 380px; max-height: none; border-left: 1px solid var(--tf-border); display: flex; flex-direction: column; min-height: 0; }
  .tf-map-list .tf-hits { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
  .tf-map-list .ais-Hits-list { flex-direction: column; overflow-x: visible; scroll-snap-type: none; padding: 12px; }
  .tf-map-list .ais-Hits-item { flex: 0 0 auto; }
  .tf-map-list .tf-hit { height: auto; min-height: 96px; }
  .tf-map-list .tf-hit-sub { display: block; }
  .tf-map-list .tf-hit-img { flex: 0 0 120px; }
}

/* ---------- rangeSlider (rheostat markup InstantSearch) ---------- */
.rheostat { position: relative; height: 26px; margin: 22px 8px 4px; }
.rheostat-background { position: absolute; top: 11px; left: 0; right: 0; height: 4px; background: var(--tf-border); border-radius: 2px; }
.rheostat-progress { position: absolute; top: 11px; height: 4px; background: var(--tf-accent); border-radius: 2px; }
.rheostat-handle { position: absolute; top: 3px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: #fff; border: 2px solid var(--tf-accent); cursor: grab; z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.rheostat-handle:focus { outline: none; box-shadow: 0 0 0 .2rem rgba(47,143,91,.3); }
.rheostat-tooltip { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font-size: .7rem; background: #1f2a24; color: #fff; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.rheostat-marker { display: none; }
.tf-filters .tf-range-legend { display: flex; justify-content: space-between; font-size: .72rem; color: var(--tf-muted); padding: 0 2px; }

/* katalóg: filtre ako karta na desktope */
@media (min-width: 992px) {
  .tf-filters-card { background: var(--tf-card-bg); border: 1px solid var(--tf-border); border-radius: var(--tf-radius); box-shadow: var(--tf-shadow); padding: 4px 14px; position: sticky; top: calc(var(--tf-topbar-h) + 16px); max-height: calc(100vh - var(--tf-topbar-h) - var(--tf-tabbar-h) - 32px); overflow-y: auto; }
}

/* kompaktný pás na mobile: len hviezdičky bez textu */
@media (max-width: 991.98px) { .tf-map-list .tf-hit-rating > span:not(.tf-stars) { display: none; } }
