/* ── BROWSE HERO ── */
.browse-hero { background: #18181B; padding: 14px 20px 14px; position: relative; overflow: visible; }
.browse-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 50%, rgba(79,70,229,0.25) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(55,48,163,0.18) 0%, transparent 55%); pointer-events: none; }
.hero-label { font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.5); margin-bottom: 2px; }
.hero-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: 10px; letter-spacing: -0.2px; position: relative; z-index: 1; }
.use-loc-btn { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); color: rgba(255,255,255,0.8); font-size: 12px; font-weight: 500; cursor: pointer; font-family: var(--font-body); padding: 5px 10px; border-radius: var(--r-sm); transition: background 0.15s; position: relative; z-index: 1; }
.use-loc-btn:hover { background: rgba(255,255,255,0.13); }
.use-loc-btn:active { transform: scale(0.96); }
.use-loc-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); justify-content: center; flex-shrink: 0; }

/* ── FILTER BAR ── */
.filter-bar { flex-shrink: 0; background: var(--surface); }

/* ── RESULTS AREA (list + map share this) ── */
#browse-results { flex: 1; position: relative; overflow: hidden; }
#browse-scroll-body { position: absolute; inset: 0; overflow-y: auto; padding-bottom: calc(var(--bottom) + var(--safe-bottom) + 32px); scroll-padding-bottom: 80px; }
#browse-scroll-body::-webkit-scrollbar { width: 3px; }
#browse-scroll-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
#map-container { position: absolute; inset: 0; display: none; }
.search-wrap { display: flex; gap: 8px; position: relative; z-index: 2; }
.search-input { flex: 1; height: 38px; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.1); color: #fff; font-family: var(--font-body); font-size: 13px; padding: 0 12px; outline: none; }
.search-input::placeholder { color: rgba(255,255,255,0.38); }
.search-input:focus { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.15); }
.search-btn { height: 38px; padding: 0 14px; background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.22); border-radius: var(--r-sm); font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.12s; }
.search-btn:hover { background: rgba(255,255,255,0.22); }
.search-btn:active { transform: scale(0.96); }

/* ── FILTER ROW ── */
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; flex-shrink: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.filter-chip { flex-shrink: 0; height: 26px; padding: 0 10px; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--ink-muted); font-family: var(--font-body); font-size: 12px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; transition: all 0.12s; }
.filter-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-chip:active { transform: scale(0.96); }
.filter-extra { display: none; }
.filter-extra.open { display: flex; flex-wrap: wrap; }
.more-filters-btn { flex-shrink: 0; height: 26px; padding: 0 10px; border-radius: 4px; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--ink-mid); font-family: var(--font-body); font-size: 12px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; transition: all 0.12s; margin-left: auto; }
.more-filters-btn:hover { background: var(--bg); }
.more-filters-btn.open { border-color: var(--accent); color: var(--accent); border-style: solid; }

/* ── VIEW TOGGLE ── */
.view-toggle { display: flex; gap: 6px; padding: 8px 14px; flex-shrink: 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.view-btn { flex: 1; height: 32px; border-radius: 8px; border: 1.5px solid var(--border-strong); background: transparent; color: var(--ink-muted); font-family: var(--font-body); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 5px; }
.view-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }


/* ── ROUTES LIST ── */
.routes-list { padding: 14px 20px; display: flex; flex-direction: column; gap: 9px; }

/* ── ROUTE CARD ── */
.route-card { background: var(--surface); border-radius: var(--r); border: 1px solid var(--border); padding: 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; animation: fadeUp 0.22s ease both; }
.route-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.route-card:active { transform: scale(0.99); box-shadow: var(--shadow-sm); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.driver-info { display: flex; align-items: center; gap: 9px; }
.driver-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-body); font-size: 12px; font-weight: 600; color: #fff; flex-shrink: 0; }
.driver-name { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.driver-meta { font-size: 11px; color: var(--ink-muted); display: flex; align-items: center; gap: 5px; }
.rating { display: flex; align-items: center; gap: 2px; color: var(--amber); }
.seats-badge { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.seats-num { font-size: 18px; font-weight: 700; color: var(--accent); line-height: 1; }
.seats-label { font-size: 10px; color: var(--ink-faint); font-weight: 500; }
.route-path { display: flex; flex-direction: column; margin-bottom: 11px; position: relative; padding-left: 20px; }
.route-path::before { content: ''; position: absolute; left: 6px; top: 7px; bottom: 7px; width: 1px; background: var(--border-strong); }
.route-stop { display: flex; align-items: center; gap: 8px; padding: 4px 0; position: relative; }
.stop-dot { position: absolute; left: -17px; width: 7px; height: 7px; border-radius: 50%; border: 2px solid var(--surface); flex-shrink: 0; }
.stop-dot.from { background: var(--accent); }
.stop-dot.to { background: var(--green); }
.stop-name { font-size: 13px; font-weight: 500; color: var(--ink); flex: 1; }
.stop-time { font-size: 11px; color: var(--ink-muted); }
.card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 10px; }
.tag-row { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { height: 19px; padding: 0 7px; border-radius: 3px; font-size: 10px; font-weight: 600; display: flex; align-items: center; background: var(--bg); color: var(--ink-muted); letter-spacing: 0.1px; }
.tag.green { background: var(--green-light); color: var(--green); }
.tag.amber { background: var(--amber-light); color: var(--amber); }
.tag.blue { background: var(--accent-light); color: var(--accent); }
.request-btn { height: 28px; padding: 0 13px; background: var(--accent); color: #fff; border: none; border-radius: var(--r-sm); font-family: var(--font-body); font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.12s; flex-shrink: 0; letter-spacing: 0.1px; }
.request-btn:hover { background: var(--accent-dark); }
.request-btn:active { transform: scale(0.94); }
.request-btn.joined { background: var(--green-light); color: var(--green); cursor: default; }
.request-btn.mine { background: var(--bg); color: var(--ink-faint); border: 1px solid var(--border); cursor: default; font-size: 11px; }

/* ── LOCATION PICKER ── */
.loc-wrap { position: relative; width: 100%; }
.loc-input {
  width: 100%; height: 40px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 0 32px 0 12px;
  font-family: var(--font-body); font-size: 14px; color: var(--ink);
  outline: none; transition: border-color 0.2s; cursor: text;
}
.loc-input:focus { border-color: var(--accent-mid); box-shadow: 0 0 0 3px rgba(79,70,229,0.08); }
.loc-input.has-value { background: var(--accent-light); border-color: rgba(79,70,229,0.3); color: var(--accent); font-weight: 500; }
.loc-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink-muted); color: #fff;
  font-size: 10px; display: none; align-items: center; justify-content: center;
  cursor: pointer; border: none; line-height: 1;
}
.loc-clear.show { display: flex; }
.loc-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  max-height: 210px; overflow-y: auto;
  z-index: 500; display: none;
}
.loc-dropdown.open { display: block; }
.loc-dropdown::-webkit-scrollbar { width: 3px; }
.loc-dropdown::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.loc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; cursor: pointer;
  transition: background 0.1s; border-bottom: 1px solid var(--border);
}
.loc-item:last-child { border-bottom: none; }
.loc-item:hover, .loc-item.focused { background: var(--accent-light); }
.loc-item-icon { font-size: 13px; flex-shrink: 0; }
.loc-item-main { flex: 1; min-width: 0; }
.loc-item-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.loc-item-name mark { background: none; color: var(--accent); font-weight: 600; }
.loc-item-state { font-size: 11px; color: var(--ink-muted); }
.loc-no-results { padding: 14px 13px; font-size: 13px; color: var(--ink-muted); text-align: center; }

/* Browse search — dark hero variant */
.browse-loc-wrap { position: relative; flex: 1; }
.browse-loc-clear { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,0.2); border: none; color: rgba(255,255,255,0.85); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; transition: background 0.12s; }
.browse-loc-clear:hover { background: rgba(255,255,255,0.3); }
.browse-loc-input {
  width: 100%; height: 40px; border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: #fff; font-family: var(--font-body); font-size: 14px;
  padding: 0 36px 0 13px; outline: none; transition: border-color 0.2s;
}
.browse-loc-input::placeholder { color: rgba(255,255,255,0.35); }
.browse-loc-input:focus { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.10); }
/* Browse dropdown uses fixed positioning to escape the dark hero */
.browse-loc-dropdown {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  max-height: 240px; overflow-y: auto;
  z-index: 999; display: none;
}
.browse-loc-dropdown.open { display: block; }
.browse-loc-dropdown::-webkit-scrollbar { width: 3px; }

/* ── ROUTE REQUEST CARDS ── */
.route-card.request-card { border-left: 3px solid var(--amber, #D97706); }
.request-tag { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.offer-tag { background: var(--green-light, #F0FDF4); color: var(--green, #15803D); border: 1px solid #BBF7D0; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.respond-btn { height: 34px; padding: 0 14px; background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: all 0.15s; }
.respond-btn:hover { background: #FDE68A; }
