/* ==========================================================================
   Tours listing (tours.html). Loads after site.css; reuses .oz-card, .oz-pill, .oz-crumbs, the combos rail.
   Mobile first: under 1024px the filter bar is "Filters" + destination chips and the panel opens as a bottom sheet;
   from 1024px the same panel is one row of dropdowns + search. The grid grows 1 → 2 → 3 → 4 columns.
   ========================================================================== */

.tl-page [hidden] { display: none !important; } /* class `display` would otherwise beat the hidden attribute */
html.tl-lock, html.tl-lock body { overflow: hidden; } /* page behind the open sheet stays put */

/* ---- Title ---------------------------------------------------------------- */
.tl-head { padding: 4px 0 var(--s-2); }
.tl-head h1 { font-size: 2rem; line-height: 1.2; text-wrap: balance; }
.tl-intro { max-width: 62ch; margin-top: 10px; color: var(--oz-text-2); }
@media (min-width: 1024px) { .tl-head h1 { font-size: 2.5rem; } }

/* ---- Filter bar: sticks under the header until the end of the list (.tl-shop) ---- */
.tl-filters {
  position: sticky;
  top: var(--bar-h);
  z-index: 40; /* under the header (50) and its menus */
  padding-block: 10px;
  border-bottom: 1px solid transparent;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.tl-filters.is-stuck { border-bottom-color: var(--oz-line); box-shadow: 0 10px 18px -16px rgba(16, 24, 40, .4); }
.tl-filters.has-sheet { z-index: 110; } /* the sheet and its scrim cover the header and the WhatsApp button */
.no-js .tl-filters { display: none; } /* the list itself needs JavaScript in the prototype */
.tl-form { display: flex; align-items: center; gap: 8px; min-width: 0; }

.tl-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--oz-orange); color: #fff; font-size: .75rem; font-weight: 800; }
.tl-link { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--oz-navy); font-size: .875rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.tl-link:hover { color: var(--oz-orange); }

/* "Filters" + destination chips (phones and tablets) */
.tl-fbtn {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--oz-navy);
  border-radius: 999px;
  background: #fff;
  color: var(--oz-navy);
  font-size: .9375rem;
  font-weight: 700;
  transition: background-color .2s ease;
}
.tl-fbtn:hover { background: var(--c-primary-soft); }
.tl-quick { display: flex; flex: 1 1 auto; gap: 8px; min-width: 0; margin-right: calc(var(--gutter) * -1); padding: 2px var(--gutter) 2px 2px; overflow-x: auto; scrollbar-width: none; }
.tl-quick::-webkit-scrollbar { display: none; }
.tl-qchip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--oz-line);
  border-radius: 999px;
  background: #fff;
  font-size: .9375rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.tl-qchip small { font-size: .8125rem; font-weight: 500; color: var(--oz-text-2); }
.tl-qchip:hover { border-color: var(--oz-navy); }
.tl-qchip[aria-pressed="true"] { border-color: var(--oz-navy); background: var(--oz-navy); color: #fff; }
.tl-qchip[aria-pressed="true"] small { color: rgba(255, 255, 255, .82); }
.tl-qchip.is-empty { border-style: dashed; color: #6B7280; }

/* the panel as a bottom sheet */
.tl-panel { display: none; }
.tl-panel.is-open {
  position: fixed;
  inset: auto 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  max-height: min(88dvh, 760px);
  margin-inline: auto;
  border-radius: 16px 16px 0 0;
  background: #fff;
  box-shadow: 0 -12px 40px rgba(16, 24, 40, .25);
  animation: tl-sheet-in .28s cubic-bezier(.2, .8, .2, 1);
}
.tl-scrim { position: fixed; inset: 0; z-index: 1; background: rgba(12, 31, 29, .55); animation: tl-fade .2s ease; }
@keyframes tl-sheet-in { from { opacity: 0; transform: translateY(48px); } }
@keyframes tl-fade { from { opacity: 0; } }
.tl-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 20px; border-bottom: 1px solid var(--oz-line); }
.tl-sheet__head h2 { font-size: 1.125rem; }
.tl-x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--c-text); }
.tl-x:hover { background: var(--oz-gray); }
.tl-panel__body { display: grid; gap: 22px; padding: 18px 20px 24px; overflow-y: auto; overscroll-behavior: contain; }
.tl-sheet__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--oz-line); }
.tl-sheet__foot .oz-pill { flex: 1; max-width: 280px; }

/* groups: always open inside the sheet */
.tl-ddbtn,
.tl-pop__foot { display: none; }
.tl-dd fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.tl-dd legend { margin-bottom: 10px; padding: 0; font-size: 1rem; font-weight: 700; }
.tl-opts { display: flex; flex-wrap: wrap; gap: 8px; } /* tiles as wide as their label: no "Ha Long / Bay" breaks */
.tl-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px 0 12px;
  white-space: nowrap;
  border: 1.5px solid var(--oz-line);
  border-radius: 10px;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.tl-opt:hover { border-color: var(--oz-navy); }
.tl-opt:has(input:checked) { border-color: var(--oz-navy); background: var(--c-primary-soft); font-weight: 700; }
.tl-opt input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--oz-navy); cursor: pointer; }
.tl-opt input:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.tl-opt__t { flex: 1; min-width: 0; }
.tl-opt small { font-size: .8125rem; font-weight: 500; color: var(--oz-text-2); font-variant-numeric: tabular-nums; }
.tl-opt.is-empty { color: #6B7280; }

/* search */
.tl-search__label { display: block; margin-bottom: 10px; font-weight: 700; }
.tl-search__field { position: relative; }
.tl-search__field .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--oz-text-2); pointer-events: none; }
.tl-search input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px 0 44px;
  border: 1.5px solid var(--oz-line);
  border-radius: 999px;
  background: #fff;
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.tl-search input:focus,
.tl-sort select:focus { border-color: var(--oz-navy); outline: none; box-shadow: 0 0 0 3px var(--c-primary-soft); }

/* ---- From 1024px: one row of dropdowns + search ---------------------------- */
@media (min-width: 1024px) {
  .tl-fbtn,
  .tl-quick,
  .tl-sheet__head,
  .tl-sheet__foot,
  .tl-scrim { display: none !important; }
  .tl-panel { display: block; flex: 1; min-width: 0; }
  .tl-panel__body { display: flex; align-items: center; gap: 8px; padding: 0; overflow: visible; }

  .tl-search { flex: 0 1 300px; order: 9; min-width: 180px; margin-left: auto; }
  .tl-search__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tl-search input { min-height: 44px; }

  .tl-dd { position: relative; flex: none; }
  .tl-ddbtn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    min-height: 44px;
    padding: 0 14px 0 16px;
    border: 1.5px solid var(--oz-line);
    border-radius: 999px;
    background: #fff;
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color .2s ease, background-color .2s ease;
  }
  .tl-ddbtn span { overflow: hidden; text-overflow: ellipsis; }
  .tl-ddbtn .icon { flex: none; transition: transform .2s ease; }
  .tl-ddbtn:hover,
  .tl-ddbtn[aria-expanded="true"] { border-color: var(--oz-navy); }
  .tl-ddbtn[aria-expanded="true"] .icon { transform: rotate(180deg); }
  .tl-ddbtn.is-active { border-color: var(--oz-navy); background: var(--c-primary-soft); color: var(--oz-navy); font-weight: 700; }

  .tl-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 5;
    display: none;
    min-width: 268px;
    padding: 8px 8px 0;
    border: 1px solid var(--oz-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--sh-2);
  }
  .tl-dd.is-open .tl-pop { display: block; animation: tl-pop-in .16s ease; }
  .tl-dd.is-end .tl-pop { right: 0; left: auto; }
  .tl-dd legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* the button names the group */
  .tl-opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tl-opt { min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; }
  .tl-opt:hover { background: var(--oz-gray); }
  .tl-opt:has(input:checked) { background: none; }
  .tl-opt:has(input:checked):hover { background: var(--oz-gray); }
  .tl-pop__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 8px 2px; border-top: 1px solid var(--oz-line); }
}
@keyframes tl-pop-in { from { opacity: 0; transform: translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  .tl-panel.is-open,
  .tl-scrim,
  .tl-dd.is-open .tl-pop { animation: none; }
}

/* ---- Results: count · active filters · sort ------------------------------- */
.tl-results { margin-bottom: var(--s-6); }
.tl-resbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0 var(--s-2); scroll-margin-top: calc(var(--tl-fh, 64px) + 8px); }
.tl-count { margin: 0; font-size: .9375rem; font-weight: 600; color: var(--oz-text-2); }
.tl-sort { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: auto; }
.tl-sort label { flex: none; font-size: .875rem; font-weight: 600; color: var(--oz-text-2); }
.tl-sort select {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px 0 16px;
  border: 1.5px solid var(--oz-line);
  border-radius: 999px;
  background: #fff;
  font-size: 1rem; /* 16px: smaller text makes iPhone zoom in when the select is tapped */
  font-weight: 600;
  transition: border-color .2s ease, box-shadow .2s ease;
}
@media (max-width: 639px) { /* the select says it all on a phone; the label stays for screen readers */
  .tl-sort label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.tl-active { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; gap: 8px; order: 3; }
@media (min-width: 1024px) {
  .tl-active { flex: 1 1 auto; order: 0; }
  .tl-sort { order: 1; }
}
.tl-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--c-primary-soft);
  color: var(--oz-navy);
  font-size: .875rem;
  font-weight: 700;
}
.tl-tag:hover { background: #D2E5E2; }

.tl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin: 0; padding: 0 0 var(--s-2); list-style: none; }
.tl-grid:empty { min-height: 480px; } /* no layout jump while the list loads */
@media (min-width: 640px) { .tl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .tl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.tl-empty { display: grid; justify-items: start; gap: 12px; padding: var(--s-5) 0; }
.tl-empty h2 { font-size: 1.5rem; }
.tl-empty p { max-width: 52ch; color: var(--oz-text-2); }
.tl-empty__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tl-error { max-width: 60ch; padding: 14px 16px; border-radius: 10px; background: #FBEAE6; color: #8A2E12; font-weight: 600; }

/* ===== Destination / tour style pages (WordPress: /destination/hanoi/, /tour-type/jeep-tours/ — inc/landing.php) ===== */
/* the group the page is about is fixed: its controls are not shown (tours.js keeps it ticked) */
.tl[data-fixed="dest"] [data-dd="dest"],
.tl[data-fixed="dest"] .tl-quick,
.tl[data-fixed="type"] [data-dd="type"] { display: none; }
.tl-head .tl-intro + .tl-intro { margin-top: 10px; }

/* questions before you book (taken from the FAQs page) */
.tl-faq__list { max-width: 860px; padding: 12px; border-radius: 16px; background: var(--oz-gray); }
.tl-faq__list details p, .tl-faq__list details li { font-size: .9375rem; }
.tl-faq__list details ul, .tl-faq__list details ol { margin: 0; padding: 0 16px 16px 36px; color: var(--oz-text-2); }
.tl-faq__list details ul { list-style: disc; }
.tl-faq__list details ol { list-style: decimal; }
.tl-faq__all a, .tl-more__all a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--oz-navy); }

/* links to every destination and tour style page (also under the list on /tour/) */
.tl-more__groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
.tl-more__groups h3 { margin-bottom: 12px; font-size: 1rem; }
.tl-more__links { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-more__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--oz-line);
  border-radius: 999px;
  background: #fff;
  color: var(--c-text);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s ease;
}
.tl-more__link small { font-size: .8125rem; font-weight: 500; color: var(--oz-text-2); }
a.tl-more__link:hover { border-color: var(--oz-navy); }
.tl-more__link.is-current { border-color: var(--oz-navy); background: var(--oz-navy); color: #fff; }
.tl-more__link.is-current small { color: rgba(255, 255, 255, .82); }
@media (min-width: 768px) {
  .tl-more__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* the longer intro of a destination / tour style page, under the tours: heading on the left, text on the right from 1024px
   (the text keeps a readable line, ~70 characters, and the two columns use the full width) */
.tl-about__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2) var(--s-5); }
.tl-about__text { max-width: 70ch; }
.tl-about__text p { color: var(--oz-text-2); line-height: 1.7; }
.tl-about__text p + p { margin-top: 12px; }
@media (min-width: 1024px) {
  .tl-about__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: start; }
  .tl-about__grid .oz-head2 { margin-bottom: 0; }
}
/* the one short line under the heading of a destination / style page: a single sentence, so it may run as wide as the heading */
.tl[data-fixed] .tl-head .tl-intro { max-width: 100ch; }
