/* ============================================================================
   Evotic — /transport page (Phase Tourisme MG Batch C)
   3 tabs : Lignes taxi-be / Vers autres villes / Hubs+Gares
   + Top sticky Assistance trajet (input + réponse bulle)
   ============================================================================ */

.transport-body {
  padding: 0;
  background: var(--bg);
  min-height: 100dvh;
  background-image:
    radial-gradient(circle at 100% 0%, rgba(255, 102, 0, 0.05), transparent 45%);
  background-attachment: fixed;
}

/* App-header (same as services/manger/dormir) */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
  box-shadow: var(--shadow-header);
}
.app-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
}
.app-header-title { flex: 1; display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.app-header-name {
  font-size: 18px; font-weight: 900;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header-sub {
  font-size: 11px; font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hdr-back {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text);
  text-decoration: none; font-size: 16px; flex-shrink: 0;
  transition: background var(--t-fast), transform var(--t-fast);
}
.hdr-back:active { transform: scale(0.92); }

.transport-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-4) calc(var(--sp-6) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  gap: var(--sp-3);
}

/* ─── Assistant trajet card ─── */
.trp-assist {
  padding: var(--sp-3);
  border: 1px solid rgba(255, 102, 0, 0.25);
  background: linear-gradient(135deg, #FFF8F2 0%, #FFFBF7 100%);
}
.trp-assist-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.trp-assist-form {
  display: flex; gap: 8px;
}
#trp-assist-input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
#trp-assist-input:focus { border-color: var(--primary); }
.trp-assist-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast);
}
.trp-assist-btn:active { transform: scale(0.96); }
.trp-assist-btn:disabled { opacity: 0.6; cursor: wait; }

.trp-assist-out {
  margin-top: 10px;
}
.trp-assist-loading {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.trp-assist-resp {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.trp-assist-resp-head {
  font-size: 11px; font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.trp-assist-resp-head i { margin-right: 4px; }
.trp-assist-resp-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.trp-assist-line {
  display: inline-block;
  padding: 1px 7px;
  margin: 0 2px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}
.trp-md-h {
  margin: 10px 0 4px;
  font-size: 14px; font-weight: 900;
  color: var(--primary);
}
.trp-md-h:first-child { margin-top: 0; }
.trp-md-ul {
  margin: 4px 0 8px;
  padding-left: 18px;
}
.trp-md-ul li {
  margin-bottom: 4px;
  line-height: 1.4;
}
.trp-assist-resp-body b { font-weight: 800; }
.trp-assist-resp-body i { font-style: italic; }
.trp-assist-err {
  padding: 10px 12px;
  background: #FFF8E1;
  border: 1px solid #F9A825;
  border-radius: 12px;
  font-size: 13px;
  color: #6C4400;
  line-height: 1.4;
}
.trp-assist-err i { margin-right: 6px; }
.trp-assist-err a { color: var(--primary); font-weight: 700; }

/* ─── Tabs principaux — segmented control polished ─── */
.trp-tabs-main {
  display: flex;
  gap: 4px;
  background: #F1F2F6;
  padding: 4px;
  border-radius: 14px;
  border: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}
.trp-tab-main {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #6B7280;
  font-family: inherit; font-weight: 700; font-size: 13px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
  letter-spacing: 0.01em;
}
.trp-tab-main i { font-size: 12px; opacity: 0.8; }
.trp-tab-main:hover { color: #1C1C2E; }
.trp-tab-main.active {
  background: linear-gradient(135deg, #FF6600 0%, #FF8533 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 102, 0, 0.28), 0 1px 2px rgba(255, 102, 0, 0.16);
}
.trp-tab-main.active i { opacity: 1; }
.trp-tab-main:active { transform: scale(0.97); }

/* Search */
.trp-search { padding: var(--sp-3); }
.search-row { display: flex; align-items: center; gap: var(--sp-2); }
.search-input-wrap { position: relative; flex: 1; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
#trp-search-input {
  width: 100%; padding: 12px 12px 12px 40px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--input-bg, var(--card-bg));
  color: var(--text);
  font-size: 15px; outline: none;
  transition: border var(--t-fast);
}
#trp-search-input:focus { border-color: var(--primary); }

/* ─── Pills secondaires (tarif) — outline style discret ─── */
.trp-pills {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.trp-pills::-webkit-scrollbar { display: none; }
.trp-pill {
  flex: 0 0 auto;
  display: inline-flex; align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid #E2E4EA;
  background: #FFFFFF;
  color: #6B7280;
  font-family: inherit; font-weight: 700; font-size: 12px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  user-select: none;
}
.trp-pill:hover { border-color: #C7C9D0; color: #1C1C2E; }
.trp-pill.active {
  background: rgba(255, 102, 0, 0.08);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(255, 102, 0, 0.15);
}
.trp-pill:active { transform: scale(0.95); }

.trp-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 2px 0;
}

/* ─── Cards ─── */
.trp-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 10px;
}
.trp-card {
  display: flex; align-items: stretch; gap: 12px;
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.trp-card:active { transform: scale(0.99); box-shadow: var(--shadow-sm); }

/* Ligne badge */
.line-badge {
  flex: 0 0 56px;
  height: 56px;
  align-self: center;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900;
  letter-spacing: 0.02em;
}
.line-badge-lg {
  flex: 0 0 64px;
  height: 64px;
  font-size: 24px;
}

.line-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.line-route {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 800; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.line-route i { color: var(--text-muted); font-size: 11px; }
.line-op { font-size: 11px; color: var(--text-muted); font-weight: 700; }
.line-op i { margin-right: 4px; }
.line-via { font-size: 11px; color: var(--text-muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-tarif {
  font-size: 12px; font-weight: 800;
  color: var(--primary);
  margin-top: 2px;
}

.trp-call {
  align-self: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.trp-call:active { transform: scale(0.92); }

/* Trip cards (intercités) */
.trip-ic, .trip-ic-lg {
  flex: 0 0 56px;
  height: 56px;
  align-self: center;
  background: #E0F2F1;
  color: #00897B;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.trip-ic-lg { flex: 0 0 64px; height: 64px; font-size: 26px; }
.trip-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.trip-dest {
  font-size: 16px; font-weight: 900;
  color: var(--text);
}
.trip-meta {
  display: flex; gap: 12px;
  font-size: 12px; color: var(--text-muted);
}
.trip-tarif { color: var(--primary); font-weight: 700; }
.trip-tarif i, .trip-duree i, .trip-gare i { margin-right: 4px; }
.trip-gare { font-size: 11px; color: var(--text-muted); }
.trip-coops { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* Hub cards */
.hub-ic, .hub-ic-lg {
  flex: 0 0 56px;
  height: 56px;
  align-self: center;
  background: #FFF3E0;
  color: var(--primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.hub-ic-lg { flex: 0 0 64px; height: 64px; font-size: 26px; }
.hub-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hub-nom { font-size: 15px; font-weight: 900; color: var(--text); }
.hub-role { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; }
.hub-desc { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.hub-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); }
.hub-dist { color: var(--primary); font-weight: 700; }
.hub-lignes {
  background: var(--skeleton);
  padding: 1px 8px;
  border-radius: 8px;
  font-weight: 700;
}

/* Empty + err */
.empty-state { text-align: center; padding: var(--sp-5); }
.empty-icon { font-size: 32px; color: var(--text-muted); opacity: 0.5; margin-bottom: var(--sp-2); }
.err { color: #C62828; font-size: 13px; margin: 4px 2px; }

.trp-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--sp-3);
  text-align: center;
  line-height: 1.4;
}
.trp-disclaimer i { margin-right: 4px; }
.trp-disclaimer a { color: var(--primary); text-decoration: none; font-weight: 700; }

/* ─── Sheet ─── */
.trp-sheet {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.trp-sheet.open { pointer-events: auto; opacity: 1; }
.trp-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.trp-sheet-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.25s ease;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.25);
}
.trp-sheet.open .trp-sheet-card { transform: translateY(0); }
.trp-sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 12px; }

.trp-sheet-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  background: var(--skeleton);
}
.trp-sheet-title h3 { margin: 0; font-size: 17px; font-weight: 900; color: var(--text); }
.trp-sheet-title p {
  margin: 2px 0 0;
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
}

.trp-sheet-info p {
  margin: 6px 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.trp-sheet-info i { width: 18px; color: var(--primary); margin-right: 6px; }
.trp-note {
  margin: 10px 0;
  padding: 8px 12px;
  background: #FFF8E1;
  color: #6C4400;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.trp-note i { color: #F57F17 !important; }

.trp-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 8px 0 12px;
}
.trp-chip {
  display: inline-flex; align-items: center;
  padding: 5px 10px;
  border-radius: 12px;
  background: var(--skeleton);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.line-chip {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--t-fast);
}
.line-chip:active { transform: scale(0.94); }

.trp-sheet-map {
  width: 100%; height: 200px;
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
  background: var(--skeleton);
}

/* Stops list */
.line-stops { margin-top: 6px; }
.line-stops h4 {
  margin: 12px 0 6px;
  font-size: 12px; font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.line-stops h4 i { margin-right: 6px; color: var(--primary); }
.stops-list {
  list-style: none;
  margin: 0; padding: 0;
  border-left: 2px dashed var(--primary);
  margin-left: 8px;
}
.stops-list li {
  position: relative;
  padding: 4px 0 4px 16px;
  font-size: 13px;
  color: var(--text);
}
.stops-list li::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.stops-list li.start::before { background: #43A047; }
.stops-list li.end::before   { background: #C62828; }
.stops-list li.start, .stops-list li.end { font-weight: 800; }

/* Sheet actions */
.trp-sheet-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 14px;
}
.trp-sheet-action {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--skeleton);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform var(--t-fast);
}
.trp-sheet-action:active { transform: scale(0.98); }
.trp-sheet-action.primary {
  background: var(--primary);
  color: #fff;
}

.hub-sheet-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 6px 0 12px;
  line-height: 1.4;
}
.hub-sheet-h4 {
  margin: 14px 0 8px;
  font-size: 13px; font-weight: 800;
  color: var(--text);
}
.hub-sheet-h4 i { color: var(--primary); margin-right: 6px; }

.hint { font-size: 12px; color: var(--text-muted); }
