/* ============================================================
   CTC — page-specific styles for tours.html
   Extracted from inline <style> block. Loads AFTER the shared
   styles.css so any rule here can override shared defaults.
   ============================================================ */

  /* ============================================================
     LISTING PAGE — page-specific styles only.
     Header / footer / tour cards / mobile drawer come from styles.css.
     ============================================================ */

  /* ---------- PAGE HEADER ---------- */
  .listing-head {
    padding: 32px 0 28px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--rule);
  }

  .listing-head .breadcrumb { margin-bottom: 18px; }

  .listing-head-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
  }

  .listing-head h1 {
    font-size: clamp(36px, 5vw, 60px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ink);
  }
  .listing-head h1 em {
    font-style: normal;
    color: var(--blue);
  }

  .listing-head-meta {
    font-size: 14px;
    color: var(--mute);
    margin-top: 12px;
  }
  .listing-head-meta strong {
    color: var(--ink);
    font-weight: 600;
  }

  /* Sort + mobile filter trigger */
  .listing-controls {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .sort-select {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 10px 36px 10px 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230a0a0a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--t-fast);
  }
  .sort-select:hover { border-color: var(--ink); }

  /* "Filters" button — only visible on mobile */
  .filters-trigger {
    display: none;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    cursor: pointer;
  }
  .filters-trigger .badge {
    background: var(--orange);
    color: #fff;
    font-family: var(--mono);
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
  }

  @media (max-width: 960px) {
    .filters-trigger { display: inline-flex; }
  }

  /* ---------- LISTING BODY (sidebar + grid) ---------- */
  .listing-body {
    padding: 40px 0 80px;
  }

  .listing-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
  }
  @media (max-width: 960px) {
    .listing-grid { grid-template-columns: 1fr; gap: 0; }
  }

  /* ---------- FILTER SIDEBAR ---------- */
  .filter-sidebar {
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: sticky;
    top: 90px;             /* clears the sticky header */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }

  /* Filter backdrop — only visible as overlay on mobile when drawer is open.
     IMPORTANT: kept display:none by default so it doesn't consume a grid cell
     on desktop (which would shove the layout out of place). */
  .filter-backdrop {
    display: none;
  }

  /* On mobile, sidebar becomes a slide-in drawer */
  @media (max-width: 960px) {
    .filter-sidebar {
      position: fixed;
      top: 0; right: 0; bottom: 0;
      width: 88%;
      max-width: 380px;
      max-height: 100vh;
      border-radius: 0;
      border: none;
      transform: translateX(100%);
      transition: transform var(--t-med);
      z-index: 1000;
      padding: 22px 26px 32px;
      box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
    }
    .filter-sidebar.is-open { transform: translateX(0); }

    .filter-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.55);
      z-index: 999;
    }
    .filter-backdrop.is-open { display: block; }
  }

  .filter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--rule);
  }
  .filter-head h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
  }
  .filter-reset {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--blue);
    background: none;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .filter-reset:hover { color: var(--blue-deep); }

  .filter-close {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-soft);
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
  }
  @media (max-width: 960px) {
    .filter-close { display: flex; align-items: center; justify-content: center; }
  }

  .filter-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rule);
  }
  .filter-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .filter-group-title {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 14px;
  }

  /* ---------- Collapsible facet ("Show all / Show less") ----------
     Used on long facets (Collection, Destination) to cap visible items
     at the first N. Items past that point carry `data-facet-overflow`
     and are hidden until the .filter-group gets `is-expanded`. The
     expand button has two label spans we cross-fade via CSS — no per-
     state DOM rewrite needed. */
  .filter-group [data-facet-overflow] { display: none; }
  .filter-group.is-expanded [data-facet-overflow] { display: flex; }

  .filter-expand {
    margin-top: 8px;
    background: transparent;
    border: none;
    padding: 4px 0;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blue);
    cursor: pointer;
    transition: color var(--t-fast);
  }
  .filter-expand:hover { color: var(--blue-deep); }

  /* Cross-fade between the two label states via display: none. The
     button keeps its width because there's always exactly one of the
     two spans rendered as inline. */
  .filter-expand .expand-show { display: inline; }
  .filter-expand .expand-hide { display: none; }
  .filter-group.is-expanded .filter-expand .expand-show { display: none; }
  .filter-group.is-expanded .filter-expand .expand-hide { display: inline; }

  /* Search input inside filter */
  .filter-search {
    position: relative;
  }
  .filter-search input {
    width: 100%;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--ink);
    background: var(--bg-soft);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 14px 10px 38px;
    outline: none;
    transition: border-color var(--t-fast);
  }
  .filter-search input:focus { border-color: var(--blue); background: var(--bg); }
  .filter-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mute);
  }

  /* ---------- Price range slider — dual-thumb ----------
     Two stacked native <input type="range"> drive the values; the visual track,
     fill and handles are pure CSS positioned via custom props --min-pct /
     --max-pct (set by the slider JS in Offers/default.latte).
     The native inputs are visually transparent — only their thumbs are clickable
     (pointer-events trick) so both can be dragged independently on the same track.
  */
  .price-range {
    margin-top: 8px;
    --min-pct: 0%;
    --max-pct: 100%;
  }
  .price-range-track {
    position: relative;
    height: 4px;
    background: var(--rule);
    border-radius: 2px;
    margin: 18px 0 12px;
  }
  .price-range-fill {
    position: absolute;
    left: var(--min-pct);
    right: calc(100% - var(--max-pct));
    top: 0;
    bottom: 0;
    background: var(--ink);
    border-radius: 2px;
    pointer-events: none;
  }
  .price-range-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: 50%;
    top: -6px;
    transform: translateX(-50%);
    pointer-events: none; /* native input thumb handles the drag */
    z-index: 2;
  }
  .price-range-handle.min { left: var(--min-pct); }
  .price-range-handle.max { left: var(--max-pct); }
  /* Invisible native inputs overlapping the same track — each captures drag
     for one thumb. pointer-events:none on the input so clicks on the empty
     track don't snap; pointer-events:auto on the ::thumb only. */
  .price-range-input {
    position: absolute;
    /* Extend 10px past each end (half the 20px thumb) so the native thumb
       centre travels edge-to-edge of the track, lining up with the % positioned
       visual handles. Without this the thumb sits ~10px inside each end, so the
       handle you see and the thumb you drag drift apart near the extremes. */
    left: -10px;
    right: -10px;
    top: -8px;
    height: 20px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent; /* kill the grey tap halo on mobile Chrome */
    z-index: 3;
  }
  .price-range-input::-webkit-slider-runnable-track,
  .price-range-input::-moz-range-track {
    background: transparent;
    border: 0;
    height: 4px;
  }
  .price-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent; /* visual handle sits underneath */
    cursor: pointer;
    pointer-events: auto;
    border: 0;
  }
  .price-range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    border: 0;
  }
  .price-range-input:focus-visible + .price-range-handle,
  .price-range-input:focus-visible ~ .price-range-handle {
    /* keyboard focus ring on the visual handle */
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.25);
  }
  .price-range-vals {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink);
    font-weight: 600;
  }

  /* ---------- RESULTS AREA ---------- */
  .results-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .results-count {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--mute);
  }
  .results-count strong {
    color: var(--ink);
    font-weight: 600;
  }

  .active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
  }
  .active-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink);
    background: var(--bg-orange-soft);
    border: 1px solid var(--orange);
    border-radius: 30px;
    padding: 6px 8px 6px 12px;
  }
  .active-filter button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--orange-deep);
    font-size: 14px;
    line-height: 1;
    padding: 0 4px;
  }

  .results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  @media (max-width: 1100px) {
    .results-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 700px) {
    .results-grid { grid-template-columns: 1fr; }
  }

  /* ---------- PAGINATION ---------- */
  .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 56px;
  }
  .pagination button,
  .pagination a {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 40px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--t-fast);
  }
  .pagination button:hover,
  .pagination a:hover {
    border-color: var(--ink);
  }
  .pagination .is-current {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
  }
  .pagination .ellipsis {
    border: none;
    background: none;
    padding: 0 4px;
    color: var(--mute);
  }
