/* Self contained styles for the listing page */
/* Tokeny (kolory, fonty, promienie, cienie): mainapp/css/tokens.css */

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  margin: 0;
}
/* ===== Listing Page Layout ===== */
.listing-page {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 24px var(--gutter);
  min-height: calc(100vh - 64px);
}
.listing-main {
  flex: 1;
  min-width: 0;
}
.listing-sidebar {
  width: 320px;
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--sticky-top, 64px) + 16px); /* below navbar + category row */
  align-self: flex-start;
  padding-right: 4px;
}

/* .main-content sets overflow-x:hidden (without overflow-y) to stop horizontal
   scroll. Per the CSS overflow spec, when only one axis is non-visible the
   OTHER axis's computed value is forced to auto (never visible) REGARDLESS of
   what any rule declares for it — so overflow-y can't be fixed in isolation.
   An auto (non-visible) overflow anywhere in the ancestor chain makes that
   element the sticky containing block instead of the real viewport, breaking
   position:sticky on .listing-sidebar above. Same root cause already fixed
   for .detail-shell in mainapp/css/detail.css; scoped here to
   .listing-page so it doesn't affect unrelated pages. */
html:has(.listing-page),
body:has(.listing-page),
.main-content:has(.listing-page) {
  overflow: visible;
}

.listing-ad {
  display: block;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
}
.listing-ad:hover {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
/* Overlaid on the ad image itself (like .listing-badge-city on event photos),
   rather than sitting above it in normal flow. */
.listing-ad-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  padding: 3px 9px;
  border-radius: 999px;
}
.listing-ad img {
  width: 100%;
  display: block;
}
/* Duplicate ad rendered above the results for mobile (the sidebar copy is
   hidden by .listing-sidebar{display:none} below 1024px, see responsive
   section) — hidden by default, shown as a horizontal banner on mobile. */
.listing-ad.listing-ad-mobile {
  display: none;
  margin-bottom: 16px;
}
.listing-ad.listing-ad-mobile img {
  height: 300px;
  width: 100%;
  object-fit: cover;
}

/* ===== Top Bar ===== */
.listing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.listing-count {
  font-size: 16px;
  color: var(--muted-fg);
  text-align: center;
  margin: 10px 10px 20px 10px;
}
.listing-count strong {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--fg);
  margin-right: 4px;
}
.listing-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted-fg);
}
.listing-sort-select {
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
}

/* ===== Mobile Map Preview ===== */
.listing-mobile-map {
  display: none; /* Hidden by default */
  position: relative;
  width: 100%;
  height: 200px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mobile-map-expand {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: none;
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.mobile-map-expand:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

.mobile-map-expand svg {
  width: 20px;
  height: 20px;
}


/* ===== Search Bar ===== */
.listing-search {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  align-items: center;
}
.applied-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
}
.applied-filters-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-fg);
}
.applied-filters-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.applied-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--muted);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
}
.applied-filter-remove {
  border: none;
  background: transparent;
  color: var(--muted-fg);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.applied-filter-remove:hover { color: var(--destructive); }
.applied-filters-clear {
  margin-left: auto;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

/* ===== Search + sort bar =====
   Single card combining the search input, the sort dropdown, and (once
   something is active) a results-count + applied-filter-chips row below a
   divider — shared unchanged across the search results, events and
   attractions listing pages so all three look and behave identically. */
.listing-searchbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.listing-searchbar-row {
  display: flex;
  gap: 12px;
}
.listing-searchbar .search-field { margin-bottom: 0; }
.sort-field { flex: 0 0 220px; min-width: 0; }
.sort-field select {
  width: 100%;
  height: 48px;
  padding: 0 34px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center/14px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.sort-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
/* Nested in the card above, the chips row loses its own card look (that's
   .listing-searchbar's job now) and gets a plain top divider instead. */
.listing-searchbar .applied-filters {
  background: none;
  border: none;
  border-radius: 0;
  padding: 12px 0 0;
  margin-bottom: 0;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  justify-content: space-between;
}
/* Two independent groups so each gets its own room to wrap: the
   count/chips on the left grow and wrap freely (.applied-filters-info),
   while the action buttons on the right (.applied-filters-actions, e.g.
   search's "Zapisz to wyszukiwanie" + "Wyczyść wszystkie") stay together
   as one unit instead of getting tangled up with the chips when the row
   wraps. */
.applied-filters-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.applied-filters-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  margin-left: auto;
}
.applied-filters-count {
  font-size: 13px;
  color: var(--muted-fg);
  white-space: nowrap;
}
.applied-filters-count strong { color: var(--fg); }
.listing-searchbar .applied-filters-clear {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  height: auto;
  padding: 0;
}
.listing-searchbar .applied-filters-clear:hover { text-decoration: underline; }
.applied-filters-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.applied-filters-save:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  color: var(--primary);
}
.search-field {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.search-field svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--muted-fg);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--card);
  outline: none;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.search-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
.listing-locate-btn {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted-fg);
  transition: all var(--transition);
}
.listing-locate-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.listing-locate-btn svg { width: 20px; height: 20px; }
.listing-search-btn {
  height: 48px;
  padding: 0 20px;
  gap: 8px;
  font-weight: 600;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.listing-search-btn svg { width: 16px; height: 16px; }

/* ===== Grid ===== */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ===== Listing Card ===== */
.listing-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 250ms ease, transform 250ms ease;
  cursor: pointer;
  animation: fadeIn 300ms ease;
  text-decoration: none;
  color: inherit;
}
.listing-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Promoted Card - prosta złota ramka */
.listing-card--promoted {
  border: 2px solid #fbbf24;
  position: relative;
}

.listing-card--promoted:hover {
  box-shadow: 
    0 8px 32px rgba(251, 191, 36, 0.25),
    0 4px 16px rgba(251, 191, 36, 0.15);
  transform: translateY(-3px);
  border-color: #f59e0b;
}


/* Card Image */
.listing-card-img {
  position: relative;
  height: 170px;
  overflow: hidden;
}
.listing-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.listing-card:hover .listing-card-img img {
  transform: scale(1.05);
}

/* Image Overlays */
.listing-badge-city {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}
.listing-badge-city::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.listing-badge-distance {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  color: var(--fg);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.listing-badge-distance svg { width: 12px; height: 12px; color: var(--destructive); }

.listing-img-bottom {
  position: absolute;
  bottom: 8px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.listing-views {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
}
.listing-views svg { width: 14px; height: 14px; }

.listing-badge-date {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--secondary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}
.listing-badge-date svg { width: 12px; height: 12px; }

.listing-badge-time {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.listing-badge-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  color: white;
}
.listing-badge-status--open { background: hsl(142 71% 45%); }
.listing-badge-status--closed { background: var(--destructive); }

/* Card Body */
.listing-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 14px 16px 16px;
}
.listing-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-card-organizer {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted-fg);
  margin-bottom: 8px;
}
.listing-card-organizer svg { width: 12px; height: 12px; flex-shrink: 0; }
.listing-card-desc {
  font-size: 13px;
  color: var(--muted-fg);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.listing-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  margin-top: auto;
}
.listing-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.listing-tag--free {
  background: hsl(142 71% 45%);
  color: white;
}
.listing-tag--paid {
  background: var(--destructive);
  color: white;
}
.listing-tag--unspecified {
  background: var(--muted);
  color: var(--muted-fg);
}
.listing-tag--category {
  background: var(--muted);
  color: var(--fg);
  font-weight: 500;
  border: 1px solid var(--border);
}
.listing-tag--hash {
  background: transparent;
  color: var(--muted-fg);
  font-weight: 500;
  border: 1px solid var(--border);
}

/* ===== Map Placeholder ===== */
.listing-map {
  min-height: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border);
  position: relative;
  flex: 0 0 auto;
  margin-bottom: 4px;
}
.map-fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  z-index: 10;
}
.map-fullscreen-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.map-fullscreen-btn svg { width: 18px; height: 18px; }
.map-placeholder-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted-fg);
  opacity: 0.5;
}
.map-placeholder-inner svg { width: 36px; height: 36px; }
.map-placeholder-inner span { font-size: 13px; font-weight: 500; }

/* Klastry, piny i popupy Leafletu → mainapp/css/leaflet.css */

/* Fullscreen map overlay — desktop */
.map-fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  background: var(--bg);
}
.map-fs-panel {
  width: fit-content;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 2px 0 16px rgba(0,0,0,0.07);
  padding: 10px;
}
.map-fs-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 10px;
}
.map-fs-panel-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
.map-fs-panel-header h3 svg { width: 18px; height: 18px; flex-shrink: 0; }
.map-fs-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
}
.map-fs-close:hover { border-color: var(--primary); background: var(--muted); }
.map-fs-close svg { width: 17px; height: 17px; }
.map-fs-panel-body {
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px 24px;
}
.map-fs-map {
  flex: 1;
  position: relative;
  min-width: 0;
}
/* ===== Promoted mini-cards on fullscreen map ===== */
.map-promoted-strip {
  position: absolute;
  bottom: 24px;
  left: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.map-promo-card {
  display: flex;
  width: 300px;
  flex-shrink: 0;
  background: var(--card);
  border: 2px solid #fbbf24;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  pointer-events: auto;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.map-promo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(251,191,36,0.3);
}
.map-promo-card-img {
  width: 90px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.map-promo-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.map-promo-card-body {
  flex: 1;
  padding: 8px 10px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.map-promo-card-label {
  font-size: 10px;
  font-weight: 700;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.map-promo-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.map-promo-card-meta {
  font-size: 12px;
  color: var(--muted-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Filters Panel ===== */
.filters-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}
.filter-group {
  margin-bottom: 14px;
}
.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-fg);
  margin-bottom: 6px;
}
.filter-group select,
.filter-group input[type="date"],
.filter-group input[type="number"] {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-body);
}
.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}
.filter-row {
  display: flex;
  gap: 8px;
}
.filter-row > * { flex: 1; }
.listing-filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.listing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.listing-btn--primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.listing-btn--primary:hover { filter: brightness(0.95); }
.listing-btn--ghost {
  background: transparent;
  color: var(--muted-fg);
  border-color: var(--border);
}
.listing-btn--ghost:hover { color: var(--fg); border-color: var(--muted-fg); }
.listing-btn--full { width: 100%; }


/* ===== Map Placeholder ===== */
.listing-map {
  height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border);
}
.map-placeholder-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted-fg);
  opacity: 0.5;
}
.map-placeholder-inner svg { width: 36px; height: 36px; }
.map-placeholder-inner span { font-size: 13px; font-weight: 500; }

/* ===== Filters Panel ===== */
.filters-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}
.filter-group {
  margin-bottom: 14px;
}
.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-fg);
  margin-bottom: 6px;
}
.filter-group select,
.filter-group input[type="date"],
.filter-group input[type="number"] {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-body);
}
.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}
.filter-row {
  display: flex;
  gap: 8px;
}
.filter-row > * { flex: 1; }
.filter-apply { margin-top: 8px; }
.filter-clear { margin-top: 6px; }

/* ===== Mobile Tabs Bar ===== */
.mob-tabs-bar {
  display: none;
  position: fixed;
  top: 64px;
  z-index: 90;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  left: 0;
  right: 0;
}
.mob-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-fg);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 200ms ease;
  cursor: pointer;
}
.mob-tab:hover, .mob-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.mob-tab svg { width: 16px; height: 16px; }
.mob-tab-count {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.mob-active-filters {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.mob-active-filters:empty { display: none !important; }
.mob-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
  animation: mobBadgeIn 200ms ease;
}
@keyframes mobBadgeIn { from { opacity:0; transform: scale(0.8); } to { opacity:1; transform: scale(1); } }
.mob-filter-badge button {
  background: none; border: none; color: white; font-size: 14px;
  line-height: 1; cursor: pointer; opacity: 0.8; padding: 0; margin-left: 2px;
}
.mob-filter-badge button:hover { opacity: 1; }
.mob-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 200;
}
.mob-overlay.open { display: block; }
.mob-sort-popup {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card); border-radius: 16px 16px 0 0; z-index: 201;
  transform: translateY(100%); animation: mobSlideUp 250ms ease forwards;
}
.mob-sort-popup.open { display: block; }
@keyframes mobSlideUp { to { transform: translateY(0); } }
.mob-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
}
.mob-popup-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.mob-popup-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--muted); border: none; font-size: 18px;
  color: var(--fg); cursor: pointer; transition: background 200ms;
}
.mob-popup-close:hover { background: var(--border); }
.mob-sort-options { padding: 8px 12px 16px; }
.mob-sort-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 8px;
  border-radius: 10px; cursor: pointer; transition: background 150ms;
  font-size: 14px; color: var(--fg);
}
.mob-sort-option:hover { background: var(--muted); }
.mob-sort-option input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; }
.mob-sort-option span { font-weight: 500; }
.mob-filter-modal {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  max-height: 85vh; background: var(--card); border-radius: 16px 16px 0 0;
  z-index: 201; flex-direction: column;
  transform: translateY(100%); animation: mobSlideUp 250ms ease forwards;
}
.mob-filter-modal.open { display: flex; }
.mob-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.mob-modal-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.mob-modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.mob-filter-section { margin-bottom: 16px; }
.mob-filter-section label {
  display: block; font-size: 12px; font-weight: 600; color: var(--muted-fg);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.mob-filter-section select,
.mob-filter-section input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 14px;
  background: var(--bg); color: var(--fg); outline: none;
  font-family: var(--font-body); transition: border-color 200ms;
}
.mob-filter-section select:focus,
.mob-filter-section input:focus { border-color: var(--primary); }
.mob-filter-section .checkbox { padding: 0; }
.mob-filter-row { display: flex; gap: 8px; }
.mob-filter-row > * { flex: 1; }
.mob-modal-footer {
  display: flex; gap: 10px; padding: 12px 20px 20px;
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.mob-modal-footer .btn { flex: 1; height: 44px; border-radius: 10px; font-weight: 600; }
.mob-map-fullscreen {
  display: none; position: fixed; inset: 0; background: var(--card);
  z-index: 201; flex-direction: column;
}
.mob-map-fullscreen.open { display: flex; }
.mob-map-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.mob-map-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.mob-map-body {
  flex: 1; display: flex; align-items: center; justify-content: center; background: var(--muted);
}


/* ===== Checkbox ===== */
input[type="checkbox"].checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
}
input[type="checkbox"].checkbox:checked {
  background: var(--primary);
  border-color: var(--primary);
}
input[type="checkbox"].checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
input[type="checkbox"].checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}


/* ===== Responsive ===== */
@media (max-width: 1280px) {
  .listing-sidebar { width: 280px; }
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .listing-sidebar { display: none; }
  .listing-main { margin-right: 0; }
  .listing-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  
  /* .navbar-subrow is sticky (navbar.css), so the tab bar docks right under it. */
  .mob-tabs-bar { display: flex; top: var(--sticky-top, 116px); }
  /* Superseded by .applied-filters below, which now shows on mobile too and
     already gets kept live by listing.js/attractions.js/search_results.js -
     showing both would duplicate the same "active filters" chips twice. */
  .mob-active-filters { display: none !important; }
  .listing-page { padding: 16px; }
  .listing-main { padding-top: 40px; }
  /* Single column so the horizontal (image-left) card below has room to
     breathe — matches the row layout used on the mobile homepage (home.css'
     .home-grid--4), instead of squeezing it into a half-width column. */
  .listing-grid { grid-template-columns: 1fr; gap: 12px; }
  .listing-ad.listing-ad-mobile { display: flex; }

  /* Hide desktop search/filter elements on mobile */
  .listing-top,
  .listing-search {
    display: none !important;
  }
  /* Sorting is handled by the "Sortuj" tab + popup in .mob-tabs-bar instead
     - the native <select> would be tiny and awkward to tap here anyway. */
  .sort-field { display: none; }

  /* Results count + active-filter chips + clear/save-search bar: same markup
     and JS-driven data as desktop (#eventCount/#resultsCount,
     #appliedFiltersList, #resetFiltersInline, #saveSearchBtn are updated
     regardless of viewport). Laid out as two rows: count + clear (+ save,
     search page only) share the top row, and the filter chips wrap onto
     their own full-width row below - instead of desktop's single wide row.
     .applied-filters-info is unwrapped via display:contents so its two
     children (count, chip list) become direct flex items here and can be
     put on different rows via `order`, alongside .applied-filters-actions
     (search page) or .applied-filters-clear (events/attractions, which has
     no wrapper - count/list/clear are already direct children there). */
  .listing-searchbar .applied-filters {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px 10px;
  }
  .applied-filters-info {
    display: contents;
  }
  .applied-filters-count {
    order: 1;
  }
  .applied-filters-actions {
    order: 2;
    margin-left: 0;
  }
  .listing-searchbar .applied-filters-clear {
    order: 2;
  }
  .applied-filters-list {
    order: 3;
    flex: 1 1 100%;
  }
  .listing-searchbar { padding: 10px; margin-bottom: 12px; }

  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  .listing-mobile-map {
    display: block;
  }

  .listing-count {
    font-size: 14px;
    margin: 6px;
  }
}
@media (max-width: 480px) {
  .listing-grid { grid-template-columns: 1fr; }
}

/* Tablet (769–1024px): the desktop sidebar (map + filters) is hidden at
   ≤1024px, so the mobile "Sortuj / Filtry / Mapa" bar and its bottom sheets
   take over here as well — otherwise this range had no filters and no map at
   all. The rest of the layout (search bar, card grid) stays desktop-like.
   `body` prefix: attraction_list loads attractions.css after this file, and
   its own base `.mob-tabs-bar { display: none }` would win otherwise. */
@media (min-width: 769px) and (max-width: 1024px) {
  body .mob-tabs-bar { display: flex; top: var(--sticky-top, 119px); }
  body .listing-main { padding-top: 52px; }
  body .sort-field { display: none; }
  body .mob-active-filters { display: none !important; }
  body .mob-sort-popup,
  body .mob-filter-modal {
    max-width: 640px;
    margin: 0 auto;
  }
}

/* Desktop: Hide mobile components */
@media (min-width: 1025px) {
  .mob-tabs-bar,
  .mob-active-filters,
  .mob-overlay,
  .mob-sort-popup,
  .mob-filter-modal,
  .mob-map-fullscreen {
    display: none !important;
  }
}
/* ===== Przełącznik widoku: Lista / Kalendarz ===== */
.listing-viewswitch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--muted);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.listing-viewswitch-item {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-fg);
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}
.listing-viewswitch-item:hover {
  background: #fff;
  color: var(--fg);
}
.listing-viewswitch-item--active {
  background: var(--primary);
  color: #fff;
}
.listing-viewswitch-item--active:hover {
  background: var(--primary);
  color: #fff;
}
.listing-viewswitch-item--solo {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  align-self: center;
}
.listing-viewswitch-item--solo:hover {
  border-color: var(--primary);
  background: var(--muted);
  color: var(--primary);
}
@media (max-width: 858px) {
  .listing-viewswitch,
  .listing-viewswitch-item--solo {
    display: none;
  }
}

/* ===== SEO: nagłówek strony, nagłówek siatki, paginacja bez JS ===== */
.listing-h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 14px;
}
.listing-grid-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) {
  .listing-h1 {
    font-size: 19px;
  }
}
