/* ============================================================
   Wunderlust — build-your-own-trip
   Selection mode on the Places grid, the floating collect bar, and
   the builder sheet body. Its own file so cards.css / trips.css /
   sheet.css stay under the 200-line guideline.
   ============================================================ */

/* --- Select toggle in the filter bar ---------------------- */
#selectBtn { box-sizing: border-box; min-height: 38px; }
#selectBtn[hidden] { display: none; }
#selectBtn[aria-pressed="true"] {
  background: var(--accent-fill); color: var(--on-accent); border-color: transparent;
}
#selectBtn[aria-pressed="true"] .ms { color: inherit; }

/* --- Selection mode on the place cards -------------------- */
/* The tick sits where the heart does; the heart steps aside so the
   whole card reads as one big checkbox while collecting. */
.card-check { display: none; }
.grid.selecting .fav { display: none; }
.grid.selecting .card { cursor: pointer; }
.grid.selecting .card .card-foot,
.grid.selecting .card .sponsor-tag { pointer-events: none; }
.grid.selecting .card-check {
  display: grid; place-items: center;
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: var(--r-pill);
  border: 2px solid var(--line); background: var(--surface); color: transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.grid.selecting .card-check .ms { font-size: 18px; }
.grid.selecting .card[data-sel="1"] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow-1);
}
.grid.selecting .card[data-sel="1"] .card-check {
  background: var(--accent-fill); border-color: transparent; color: var(--on-accent);
}

/* --- Floating collect bar --------------------------------- */
.select-bar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 45;
  bottom: calc(var(--gap-4) + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-3);
  max-width: calc(100vw - 32px);
  padding: var(--gap-3) var(--gap-4);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  box-shadow: var(--shadow-2);
}
.select-bar[hidden] { display: none; }
.sb-n { font: 600 var(--fs-body) var(--font-ui); font-variant-numeric: tabular-nums; }
.sb-hint { font-size: var(--fs-sm); color: var(--text-3); }
.select-bar .btn { padding: 8px 16px; font-size: var(--fs-sm); }
@media (max-width: 560px) {
  .sb-hint { display: none; }
  .select-bar { width: calc(100vw - 24px); justify-content: space-between; }
}

/* --- "Build your own trip" tile, leading the Trips tab ---- */
.trip-make {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--gap-3);
  padding: var(--gap-4); text-align: left; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: var(--r-lg);
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.trip-make:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.trip-make .ms {
  flex: 0 0 auto; width: 44px; height: 44px; font-size: 24px;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--accent-fill); color: var(--on-accent);
}
.trip-make span { display: flex; flex-direction: column; }
.trip-make b { font: 600 var(--fs-h3) var(--font-display); }
.trip-make small { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-3); }

/* The "Yours" badge leads a user trip's foot; the Edit affordance
   reuses the heart's corner slot. */
.trip-mine { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; }
.trip-edit .ms { font-size: 19px; }

/* --- Builder sheet body ----------------------------------- */
.tb-form { display: flex; flex-direction: column; gap: var(--gap-3); margin-top: var(--gap-4); }
.tb-field { display: flex; flex-direction: column; gap: 6px; }
.tb-field > span { font: 600 var(--fs-sm) var(--font-ui); color: var(--text); }
.tb-field > span small { font-weight: 400; color: var(--text-3); }
.tb-input {
  width: 100%; box-sizing: border-box;
  padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font: var(--fs-body) var(--font-ui); resize: vertical;
}
.tb-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-fill); }
.tb-glyphs { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-glyph {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.tb-glyph .ms { font-size: 20px; }
.tb-glyph:hover { border-color: var(--accent); color: var(--text); }
.tb-glyph.on {
  background: linear-gradient(150deg, var(--accent), var(--accent-press));
  color: var(--on-accent); border-color: transparent;
}

.tb-stops-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap-3); margin-top: var(--gap-5);
}
.tb-stops-head h3 { font: 600 var(--fs-h3) var(--font-display); }
.tb-stops { margin: var(--gap-3) 0 0; padding: 0; list-style: none; display: grid; gap: var(--gap-2); }
.tb-stop {
  display: flex; align-items: center; gap: var(--gap-3);
  padding: var(--gap-2); border: 1px solid var(--line); border-radius: var(--r-md);
}
.tb-stop-body { flex: 1 1 auto; min-width: 0; }
.tb-stop-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.tb-stop-acts .icon-btn { width: 32px; height: 32px; }
.tb-stop-acts .icon-btn[disabled] { opacity: .35; cursor: not-allowed; }

.tb-preview {
  display: flex; flex-wrap: wrap; gap: var(--gap-4);
  margin-top: var(--gap-4); padding: var(--gap-3);
  border-radius: var(--r-md); background: var(--surface-2);
  font-size: var(--fs-sm); color: var(--text-2);
}
.tb-preview span { display: inline-flex; align-items: center; gap: 6px; }
.tb-preview .ms { font-size: 17px; color: var(--text-3); }
.tb-free { color: var(--meadow-deep); font-weight: 600; }
.tb-free .ms { color: inherit; }
.tb-prev-empty { color: var(--text-3); }
.tb-msg { margin: var(--gap-2) 0 0; min-height: 1em; font-size: var(--fs-sm); color: var(--accent); }
