/* Anti dark mode Android Chrome */
html { color-scheme: light only; }
* { forced-color-adjust: none; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --coral:        #EB7D4B;
  --coral-dark:   #D4693A;
  --coral-light:  rgba(235,125,75,0.12);
  --yellow:       #FAC02D;
  --turquoise:    #0CACB1;
  --white:        #FFFFFF;
  --dark:         #1A1A2E;
  --gray:         #717171;
  --gray-light:   #EBEBEB;
  --bg:           #F7F7F7;

  --radius-card:  16px;
  --radius-input: 12px;
  --radius-pill:  32px;

  --shadow-card:  0 2px 12px rgba(0,0,0,0.10);
  --shadow-hover: 0 6px 20px rgba(0,0,0,0.16);
  --shadow-modal: 0 -4px 24px rgba(0,0,0,0.12);

  --header-h:     56px;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--white);
  color: var(--dark);
  padding-bottom: env(safe-area-inset-bottom);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sticky footer: <main> grows to fill any leftover space on short pages;
   on pages whose content already exceeds the viewport it has no effect,
   so the footer still just follows the normal flow as before. */
main { flex: 1 0 auto; }

/* ════════════════════════════════════════
   HEADER
════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--gray-light);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 16px;
  gap: 12px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon { width: 32px; height: 32px; object-fit: contain; }
.logo-text  { font-size: 20px; font-weight: 800; color: var(--coral); letter-spacing: -0.5px; }

/* Desktop nav tabs — hidden on mobile */
.nav-tabs {
  display: none;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.nav-tab.active { color: var(--dark); border-bottom-color: var(--dark); }
.nav-tab:hover  { color: var(--dark); }
.nav-tab-icon   { font-size: 16px; line-height: 1; }

.nav-badge {
  background: var(--yellow);
  color: var(--dark);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Header right */
.header-right { flex-shrink: 0; }

/* Lang toggle */
.lang-toggle {
  display: flex;
  gap: 2px;
  background: var(--gray-light);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.lang-btn {
  padding: 4px 7px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 18px;
  line-height: 1;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  opacity: 0.45;
}
.lang-btn.active { background: var(--white); opacity: 1; transform: scale(1.15); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }

/* ── Shared confirm modal (assets/confirm-modal.js) — never use native confirm()/alert() ── */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2001;
}
.confirm-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  z-index: 2002;
  background: var(--white);
  border-radius: 20px;
  padding: 28px 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.16);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.confirm-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
}
.confirm-modal-body {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 20px;
}
.confirm-modal-actions {
  display: flex;
  gap: 10px;
}
.confirm-modal-cancel,
.confirm-modal-confirm {
  flex: 1;
  padding: 12px;
  border-radius: 32px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
}
.confirm-modal-cancel {
  border: 1.5px solid var(--gray-light);
  background: var(--white);
  color: var(--dark);
  font-weight: 600;
}
.confirm-modal-confirm {
  border: none;
  background: var(--coral);
  color: var(--white);
}
.confirm-modal-confirm.confirm-modal-danger { background: #dc2626; }

/* Account dropdown menu (avatar) */
.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  padding: 6px;
  z-index: 1000;
}
.account-menu-item {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.account-menu-item:hover { background: var(--bg); }
.account-menu-divider { height: 1px; background: var(--gray-light); margin: 6px 4px; }
.account-menu-danger { color: #dc2626; }

/* Header actions (right side) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Add your activity button — hidden on mobile */
.btn-add-activity {
  display: none;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--dark);
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.btn-add-activity:hover {
  background: var(--gray-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

/* Mobile sticky "Add your activity" CTA (index.html only) — covers the
   logged-out case on mobile, where .btn-add-activity is hidden and the
   account-menu link isn't reachable (no menu without a session). Mirrors
   .btn-add-activity's breakpoint in reverse: shown by default (mobile-first),
   hidden once .btn-add-activity takes over at 768px. z-index 500 sits above
   the header (100) and page content but below every overlay/dropdown in the
   site (account-menu 1000, seg-dropdown 150 dropdown, search modal
   1999/2000, confirm/auth modals 2001/2002). */
.mobile-sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: var(--white);
  border-top: 1px solid var(--gray-light);
  box-shadow: var(--shadow-modal);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.mobile-sticky-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  background: var(--coral);
  color: var(--white);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.mobile-sticky-cta-btn:active { background: var(--coral-dark); }

/* Reserve room so the fixed footer never covers page content — added to the
   safe-area padding body already carries on mobile (see body rule above),
   not replacing it. 76px ≈ CTA's own padding + button height; reset to 0
   alongside .mobile-sticky-cta on desktop. */
body.has-mobile-cta {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* Back-to-homepage header link — same visual convention as .btn-add-activity,
   but always visible (no other way back on a standalone content page). */
.btn-back-home {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--dark);
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-back-home:hover {
  background: var(--gray-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

/* Desktop segmented search bar — hidden on mobile, shown ≥768px (see media query) */
.search-bar-desktop { display: none; }

.search-seg-wrap { position: relative; flex: 1; display: flex; }
.search-seg-wrap.align-right .seg-dropdown { left: auto; right: 0; }

.search-seg {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: var(--radius-pill);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.search-seg:hover { background: var(--gray-light); }
.search-seg[aria-expanded="true"] { background: var(--white); box-shadow: var(--shadow-hover); }

.seg-label { font-size: 11px; font-weight: 700; color: var(--dark); }
.seg-value {
  font-size: 13px;
  color: var(--gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.seg-divider { width: 1px; align-self: stretch; background: var(--gray-light); margin: 10px 0; flex-shrink: 0; }

.search-btn-coral {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--coral);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 4px;
  transition: background 0.15s;
}
.search-btn-coral:hover { background: var(--coral-dark); }

/* Per-segment dropdown — opens under its own segment, not a centered modal */
.seg-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  padding: 6px;
  z-index: 150;
}
.seg-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.seg-dropdown-item:hover { background: var(--bg); }
.seg-dropdown-item.active { color: var(--coral); font-weight: 700; }
.seg-dropdown-item-icon { font-size: 16px; line-height: 1; }

/* Age — multi-select checkboxes (shared between the desktop dropdown and
   the mobile modal, see ageCheckboxesHTML()/ageActionsHTML() in script.js) */
.seg-dropdown-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--gray-light);
}
.seg-dropdown-link {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--coral);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.seg-dropdown-actions-sep { font-size: 12px; color: var(--gray-light); }

.seg-dropdown-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
  cursor: pointer;
}
.seg-dropdown-checkbox:hover { background: var(--bg); }
.seg-dropdown-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--coral);
  cursor: pointer;
}

/* ════════════════════════════════════════
   MOBILE SEARCH PILL
════════════════════════════════════════ */
.search-bar-mobile {
  padding: 10px 16px;
  background: var(--white);
}
.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 16px;
  height: 48px;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-pill);
  background: var(--white);
  box-shadow: var(--shadow-card);
  font-family: inherit;
  font-size: 14px;
  color: var(--gray);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ════════════════════════════════════════
   CATEGORY PILLS
════════════════════════════════════════ */
.cat-pills {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 16px;
  border-bottom: 1px solid var(--gray-light);
}
.cat-pills::-webkit-scrollbar { display: none; }

.cat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 14px 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s ease;
  flex-shrink: 0;
}
.cat-pill.active { border-bottom-color: var(--dark); }

.pill-icon  { font-size: 20px; line-height: 1; }
.pill-label { font-size: 11px; font-weight: 500; color: var(--gray); }
.cat-pill.active .pill-label { color: var(--dark); font-weight: 700; }

/* ════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════ */
.main-content {
  padding: 0 0 32px;
}

/* Section */
.cards-section {
  margin-top: 28px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
  flex: 1;
}

/* Cards row — 2 columns grid on mobile */
.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 4px 16px 12px;
}

/* ─── Catalog list/map split (Yelp-style) ───
   Hidden entirely by default — only #section-popular.filter-active (added
   by updateFilterVisibility() in script.js once category/age narrows the
   catalog) reveals it. On the default homepage load (currentCat 'all',
   full age set) the list stays alone at full width, no map at all.
   Mobile (<1024px): one pane visible at a time via the List/Map toggle.
   Desktop (>=1024px, see media query below): both panes side by side,
   permanently visible once active, no toggle. */
.catalog-view-toggle {
  display: none;
  gap: 8px;
  padding: 0 16px 12px;
}
#section-popular.filter-active .catalog-view-toggle {
  display: flex;
}
.view-toggle-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gray-light);
  background: var(--white);
  color: var(--gray);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.view-toggle-btn.active {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}

.catalog-map-pane { display: none; }
.catalog-split.show-map .catalog-list-pane { display: none; }
.catalog-split.show-map .catalog-map-pane { display: block; }

#catalog-map {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border-radius: var(--radius-card);
}

/* ─── Subcategory filter — horizontal chip row above the "Popular
   activities" title (assets/script.js: renderSubcatChips()). display:none
   by default (same convention as .catalog-map-pane above) so it never
   shows on mobile — mobile has its own "Filter" row inside the search
   modal instead (renderModalSubcatRow(), unrelated markup/styles below).
   Only switched to a visible row inside the >=1024px breakpoint, and only
   when renderSubcatChips() hasn't set the `hidden` attribute (i.e. the
   active category actually has matching SUBCATEGORIES entries). ─── */
.subcat-chips-row { display: none; }

/* Same visible checkbox + label as the original vertical panel
   (.seg-dropdown-checkbox, used elsewhere for the Age filter and the
   mobile modal's own Filter row) — just laid out as individual bordered
   boxes in a row instead of stacked full-width rows. The checkbox itself
   carries the "selected" state (native checked look, coral accent) —
   no separate active/checked style needed on the box itself. */
.subcat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--gray-light);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.subcat-chip:hover { background: var(--bg); }
.subcat-chip input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--coral);
  cursor: pointer;
}

/* ─── Leaflet marker popup content (catalog map) ─── */
.map-popup { width: 180px; }
.map-popup-img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.map-popup-title { font-size: 14px; font-weight: 700; color: var(--dark); margin: 0 0 2px; }
.map-popup-cat { font-size: 12px; color: var(--gray); margin: 0 0 6px; }
.map-popup-travel { font-size: 12px; font-weight: 600; color: #B8860B; margin: 0 0 6px; }
.map-popup-link { font-size: 13px; font-weight: 600; color: var(--coral); text-decoration: none; }
.map-popup-link:hover { text-decoration: underline; }

/* ─── Card ─── */
.activity-card {
  flex-shrink: 0;
  width: auto;
  background: var(--white);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.activity-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--gray-light);
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.activity-card:hover .card-img { transform: scale(1.04); }

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 11px;
  font-weight: 700;
  color: var(--dark);
  padding: 3px 8px 3px 6px;
  border-radius: var(--radius-badge, 20px);
}
.card-badge.badge-camp    { background: var(--yellow); }
.card-badge.badge-verified { background: #34A853; color: #fff; }

.activity-card.card-verified {
  box-shadow: 0 0 0 6px #34A853, var(--shadow-card);
}

.acad-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #34A853;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px 3px 7px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.acad-travel-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--yellow);
  color: #6B4E00;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.card-time-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.75);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-badge, 20px);
}

.card-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--white);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
  background: none;
  border: none;
  cursor: pointer;
}

.card-body {
  padding: 10px 12px 12px;
}
.card-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 6px;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.card-rating {
  font-size: 12px;
  color: var(--gray);
}
.card-rating .star { color: var(--coral); font-weight: 700; }
.card-price {
  text-align: right;
}
.card-price-from {
  font-size: 10px;
  color: var(--gray);
  display: block;
}
.card-price-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
}
.card-price-na {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--gray);
  font-size: 15px;
}

/* ════════════════════════════════════════
   SEARCH MODAL (bottom sheet)
════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1999; /* above Leaflet panes/controls (up to z-index 1000) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.search-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -44%);
  z-index: 2000; /* above Leaflet panes/controls (up to z-index 1000) */
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16,1,0.3,1);
}
.search-modal:not([hidden]) {
  transform: translate(-50%, -50%);
  opacity: 1;
  pointer-events: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-light);
  flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--dark); }
.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-light);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--dark);
}

.modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 20px 16px;
}

/* Modal row items */
.modal-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-light);
}
.modal-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}
.modal-row-select {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--coral);
  background: transparent;
  border: none;
  outline: none;
  text-align: right;
  cursor: pointer;
  max-width: 160px;
  appearance: none;
  -webkit-appearance: none;
}

/* Age row — multi-select checkboxes stacked below the label instead of the
   usual single value on the right (reuses .seg-dropdown-checkbox/.seg-dropdown-link) */
.modal-row-age { flex-direction: column; align-items: stretch; gap: 10px; }
.modal-age-checkboxes { display: flex; flex-direction: column; }

/* Filter (subcategory) row — collapsible, hidden entirely when the picked
   Activity has no SUBCATEGORIES entries (renderModalSubcatRow() in
   script.js). .modal-row-item already sets `display: flex` unconditionally,
   so hiding THIS row needs its own higher-specificity [hidden] override —
   a class selector alone can't win against another class selector of equal
   specificity regardless of source order. Same reasoning applies to
   .modal-filter-checkboxes below, toggled independently by the collapse
   toggle rather than by category. */
.modal-row-filter { flex-direction: column; align-items: stretch; gap: 0; }
.modal-row-filter[hidden] { display: none; }
.modal-filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.modal-filter-chevron { flex-shrink: 0; transition: transform 0.2s; }
.modal-filter-toggle.open .modal-filter-chevron { transform: rotate(180deg); }
/* :not([hidden]) rather than an unconditional `display: flex` + separate
   [hidden] override — simpler here since nothing else declares `display`
   on this element to begin with (unlike .modal-row-filter above, which
   has to fight .modal-row-item's own unconditional display: flex). */
.modal-filter-checkboxes:not([hidden]) { display: flex; flex-direction: column; margin-top: 10px; }


/* Modal footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--gray-light);
  flex-shrink: 0;
  background: var(--white);
}
.btn-clear {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  background: transparent;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 0;
}
.btn-search-modal {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--coral);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-search-modal:active { background: var(--coral-dark); }
.btn-search-modal:disabled { background: var(--gray); cursor: not-allowed; }

/* ════════════════════════════════════════
   THANK-YOU PAGE
════════════════════════════════════════ */
.page-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 64px;
}
.thankyou-wrap {
  text-align: center;
  padding-top: 80px;
}
.check-circle {
  width: 72px; height: 72px;
  background: #D1FAE5;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}
.thankyou-title { font-size: 26px; font-weight: 800; color: var(--dark); margin-bottom: 12px; }
.thankyou-body  { font-size: 16px; color: var(--gray); margin-bottom: 32px; line-height: 1.6; }
.btn-back {
  display: inline-block;
  padding: 12px 28px;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  background: var(--white);
  transition: border-color 0.2s;
}
.btn-back:hover { border-color: var(--coral); }

/* ════════════════════════════════════════
   DESKTOP (≥ 768px)
════════════════════════════════════════ */
@media (min-width: 768px) {
  :root { --header-h: 72px; }

  body { padding-bottom: 0; }
  body.has-mobile-cta { padding-bottom: 0; }

  .header-top { padding: 0 24px; }

  .nav-tabs { display: flex; }

  .btn-add-activity { display: flex; }

  .mobile-sticky-cta { display: none; }

  /* Desktop segmented search bar — centred, replaces the mobile pill */
  .search-bar-desktop {
    display: flex;
    align-items: stretch;
    width: calc(100% - 48px);
    max-width: 760px;
    margin: 0 auto 16px;
    padding: 4px;
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-card);
  }
  .search-bar-mobile { display: none; }

  .cat-pills { display: none; }

  /* Cards grid on desktop */
  .cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    overflow: visible;
    padding: 4px 24px 12px;
  }
  .activity-card { width: auto; }
  .section-header { padding: 0 24px; }

}

@media (min-width: 1024px) {
  .cards-row { grid-template-columns: repeat(4, 1fr); }
}

/* Desktop split view — list alone at full width by default; the map pane
   only appears once #section-popular.filter-active is set (a real filter
   narrowed the catalog). No toggle on desktop either way. */
@media (min-width: 1024px) {
  /* Both selectors needed: #section-popular.filter-active .catalog-view-toggle
     (base rule, mobile-intended) has higher specificity than a plain class
     selector — a plain ".catalog-view-toggle { display: none }" here would
     lose to it on desktop once filter-active is set. Matching the ID-based
     selector's specificity is what actually wins. */
  .catalog-view-toggle,
  #section-popular.filter-active .catalog-view-toggle {
    display: none;
  }

  .catalog-split {
    display: flex;
    gap: 20px;
    align-items: flex-start;
  }
  .catalog-split .catalog-list-pane {
    flex: 1 1 100%;
    max-width: 100%;
  }
  #section-popular.filter-active .catalog-split .catalog-list-pane {
    flex: 0 0 58%;
    max-width: 58%;
  }
  #section-popular.filter-active .catalog-split .catalog-map-pane {
    display: block;
    flex: 0 0 40%;
    max-width: 40%;
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }

  /* Subcategory chip row — see .subcat-chips-row's base rule (display:none
     default) for why :not([hidden]) is required here instead of a plain
     unconditional display. margin-top matches .cards-section's own
     margin-top (search bar → section spacing elsewhere on the page) —
     this row sits before #section-popular now (see index.html), so it no
     longer inherits that spacing just by being inside the section. */
  .subcat-chips-row:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    margin-bottom: 16px;
  }
  /* Narrower list pane once the map is showing — 4 columns would be too
     cramped. Full-width (no filter, no map) keeps the original 4-column
     grid from the rule above. */
  #section-popular.filter-active .catalog-list-pane .cards-row { grid-template-columns: repeat(2, 1fr); }

  #catalog-map { height: calc(100vh - var(--header-h) - 32px); }
}

@media (min-width: 1280px) {
  .main-content { max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
  .section-header { padding: 0; }
  .cards-row { padding-left: 0; padding-right: 0; }
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--gray-light);
  padding: 24px 16px;
  margin-top: 32px;
  flex-shrink: 0;
}
.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.site-footer-links a {
  color: var(--gray);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.site-footer-links a:hover { color: var(--coral); text-decoration: underline; }
.site-footer-copy { font-size: 12px; color: var(--gray); }

@media (min-width: 768px) {
  .site-footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* ════════════════════════════════════════
   LEGAL PAGES (Privacy Policy / Legal Notice)
════════════════════════════════════════ */
.legal-page { background: var(--bg); }
.legal-content {
  max-width: 720px;
  width: 100%;
  margin: 32px auto 64px;
  padding: 40px 32px 48px;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.legal-content h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-light);
}
.legal-content .legal-updated { font-size: 13px; color: var(--gray); margin: 16px 0 28px; }
.legal-content h2 { font-size: 17px; font-weight: 700; color: var(--coral-dark); margin: 32px 0 12px; }
.legal-content p { font-size: 14px; color: var(--dark); line-height: 1.75; margin-bottom: 14px; }
.legal-content ul { margin: 0 0 16px; padding-left: 0; list-style: none; }
.legal-content li {
  font-size: 14px;
  color: var(--dark);
  line-height: 1.7;
  margin-bottom: 10px;
  padding-left: 22px;
  position: relative;
}
.legal-content li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
}
.legal-content a { color: var(--coral); font-weight: 600; text-decoration: none; }
.legal-content a:hover { text-decoration: underline; }

@media (min-width: 768px) {
  .legal-content { margin: 48px auto 80px; padding: 48px 56px 56px; }
}
