/* T41/T42 — persistent header + hidden drawer, the app's first shared nav
 * chrome. Rendered once from the layout (see _nav_chrome.html.erb) on the
 * four pages that have no header of their own: chat#show, itinerary#show,
 * dashboards#show, trips#index.
 *
 * Overlay-only. The design handoff offered two mobile drawer patterns
 * (overlay vs push-aside) as an open question and asked for one pick before
 * shipping — overlay, since it needs no separate desktop/mobile layout branch.
 *
 * Tokens come from design_tokens.css. The drawer is dark-on-dark like the
 * existing sidebar (--sidebar-bg), but its dim-text opacities are the
 * design's own scale (rgba(247,245,240,*)) rather than --sidebar-muted —
 * kept local here rather than added to design_tokens.css since nothing else
 * uses this exact 4-step opacity scale yet.
 */

.nav-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
@media (min-width: 768px) {
  .nav-header { padding: 0 24px; }
}

.nav-header.nav-header-dark {
  background: var(--sidebar-bg);
  border-bottom-color: rgba(247,245,240,0.10);
  color: #F7F5F0;
}

.nav-header-spacer { height: 56px; }

.nav-trigger {
  flex-shrink: 0;
  width: 44px; height: 44px;
  margin-left: -8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-header-dark .nav-trigger.nav-trigger-open { background: rgba(247,245,240,0.08); }
.nav-header:not(.nav-header-dark) .nav-trigger.nav-trigger-open { background: var(--surface-2); }

.nav-wordmark { display: flex; align-items: baseline; gap: 3px; min-width: 0; text-decoration: none; color: inherit; }
/* Round 4: the wordmark sits about 60% closer to the hamburger than the header's 12px
   gap alone would put it (12px down to about 5px). */
.nav-trigger + .nav-wordmark { margin-left: -7px; }
/* Still used by the sign-in screens (_auth_shell), which keep the brand icon. */
.nav-wordmark-mark {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--green);
  color: #F7F5F0;
  display: flex; align-items: center; justify-content: center;
}
.nav-wordmark--stacked { flex-direction: column; align-items: flex-start; gap: 0; }
.nav-wordmark-line { display: flex; align-items: baseline; gap: 3px; }
/* The flag is the height of the lower-case letters and sits on the baseline. */
.wordmark-flag { width: 7px; height: 8.5px; color: var(--amber); flex-shrink: 0; }
.nav-wordmark-text {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  color: inherit;
  white-space: nowrap;
}
.nav-wordmark-sub {
  font-family: 'Geist Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: rgba(247,245,240,0.38);
  margin-top: 4px;
  white-space: nowrap;
}

.nav-header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* T112 - View Itinerary button, shared by the phone header and the foot of the desktop chat
   sidebar (the sidebar overrides the colours in chat/show.html.erb). Grey while Stevie still
   needs information, green once the itinerary is ready. */
.itin-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 14px; border-radius: 12px; white-space: nowrap;
  font-family: 'Instrument Sans', sans-serif; font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.itin-btn--waiting { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.itin-btn--ready { background: var(--green); color: #fff; border: 1px solid var(--green); }
.itin-btn--ready:hover { background: var(--green-dim); }
.itin-btn.hidden { display: none; }
/* Phones only: from md up the button is in the sidebar, so the header copy goes. */
@media (min-width: 768px) {
  .nav-itinerary-btn { display: none; }
}
/* On a phone the chat header is hamburger, wordmark, View Itinerary. */
@media (max-width: 767px) {
  .nav-header-right--summary .nav-avatar { display: none; }
}

/* The Build step in the menu is a button on the chat page; make it look like the others. */
.nav-flow-button { width: 100%; text-align: left; background: none; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer; font: inherit; }
.nav-flow-itinerary { text-decoration: none; }
/* T112 - itinerary step once ready: amber, with an arrow. */
.nav-flow-item.nav-flow-ready { border-left-color: var(--amber); background: rgba(196,136,26,0.14); }
.nav-flow-ready .nav-flow-marker { color: var(--amber); }
.nav-flow-ready .nav-flow-label { font-weight: 700; color: #F7F5F0; }
.nav-flow-go { flex-shrink: 0; color: var(--amber); }
.nav-flow-lock.hidden, .nav-flow-go.hidden { display: none; }

.nav-stage-indicator {
  display: none;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-header-dark .nav-stage-indicator { color: rgba(247,245,240,0.62); }
@media (min-width: 768px) {
  .nav-stage-indicator { display: block; }
}

.nav-avatar {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 9999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
}
.nav-header-dark .nav-avatar {
  background: rgba(247,245,240,0.12);
  border-color: transparent;
  color: #F7F5F0;
}

/* ── Drawer ── */

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(28,28,26,0);
  transition: background 0.25s ease;
}
.nav-scrim.hidden { display: none; }
.nav-scrim.nav-scrim-visible { background: rgba(28,28,26,0.55); }

.nav-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 61;
  width: 268px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.25s ease-out;
  box-shadow: 8px 0 32px rgba(28,28,26,0.28);
  padding-top: env(safe-area-inset-top, 0px);
}
.nav-drawer.nav-drawer-open { transform: translateX(0); }
@media (min-width: 768px) {
  .nav-drawer { width: 300px; }
}

.nav-drawer-header { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px; }
/* B71 - same size and position as the header's .nav-trigger, so the two X buttons overlap. */
.nav-drawer-header .nav-trigger { color: #F7F5F0; }

.nav-section-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247,245,240,0.38);
  padding: 18px 16px 8px;
}

.nav-divider { height: 1px; background: rgba(247,245,240,0.10); margin: 18px 16px 0; }

.nav-flow-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px 10px 13px;
  border-left: 3px solid transparent;
}
.nav-flow-item.nav-flow-active {
  border-left-color: var(--green-dim);
  background: rgba(45,107,80,0.15);
}
.nav-flow-item.nav-flow-locked { opacity: 0.4; }

.nav-flow-marker {
  flex-shrink: 0;
  width: 26px;
  display: flex;
  justify-content: center;
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  color: rgba(247,245,240,0.62);
}
.nav-flow-active .nav-flow-marker { color: #F7F5F0; }

.nav-flow-body { flex: 1; min-width: 0; }
.nav-flow-label {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: rgba(247,245,240,0.82);
}
.nav-flow-active .nav-flow-label { font-weight: 700; color: #F7F5F0; }
.nav-flow-sub {
  display: block;
  font-size: 11.5px;
  color: rgba(247,245,240,0.62);
  margin-top: 1px;
}
.nav-flow-lock { flex-shrink: 0; color: rgba(247,245,240,0.62); }

.nav-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 16px;
  color: rgba(247,245,240,0.82);
  text-decoration: none;
}
.nav-drawer-link .nav-flow-marker { color: rgba(247,245,240,0.62); width: auto; }
.nav-drawer-link-body { flex: 1; min-width: 0; }
.nav-drawer-link-label {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.nav-drawer-link-sub { display: block; font-size: 11.5px; color: rgba(247,245,240,0.62); margin-top: 1px; }

.nav-drawer-spacer { flex: 1; }

/* T102 - currency switch, used in the dark drawer and the light landing menu. */
.currency-switch { display: flex; gap: 6px; padding: 0 16px; }
.currency-switch-form { flex: 1; display: flex; }
.currency-switch-btn {
  flex: 1; min-height: 44px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-family: 'Instrument Sans', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.currency-switch-btn--active { background: var(--green); border-color: var(--green); color: #fff; }
.currency-switch--dark .currency-switch-btn {
  background: rgba(247,245,240,0.06); border-color: rgba(247,245,240,0.16); color: rgba(247,245,240,0.82);
}
.currency-switch--dark .currency-switch-btn--active { background: var(--green-dim); border-color: var(--green-dim); color: #fff; }
.currency-switch-note { padding: 8px 16px 0; font-size: 12px; color: var(--muted); }
.currency-switch-note--dark { color: rgba(247,245,240,0.62); }

/* S94 - the currency choice in the chat header: desktop only, no "Prices show in" note. */
.nav-header-currency { display: none; }
.currency-switch--compact { padding: 0; }
.currency-switch--compact .currency-switch-btn { min-height: 34px; padding: 0 10px; white-space: nowrap; font-size: 12.5px; }
@media (min-width: 768px) {
  .nav-header-currency { display: block; }
}

.nav-drawer-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(247,245,240,0.10);
  text-decoration: none;
}
.nav-drawer-footer-avatar {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 9999px;
  background: rgba(247,245,240,0.12);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: #F7F5F0;
}
.nav-drawer-footer-body { flex: 1; min-width: 0; }
.nav-drawer-footer-name { font-size: 13px; color: rgba(247,245,240,0.86); font-weight: 500; }
.nav-drawer-footer-status {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: rgba(247,245,240,0.62);
}
.nav-drawer-footer-chevron { flex-shrink: 0; color: rgba(247,245,240,0.62); }
