/* ===================================================
   BRA TAXI: ride tracking page (/resa)
   Mobile first. Desktop: status + summary left, map right.
   Uses the tokens from base.css. Yellow stays CTA-only.
   =================================================== */

.trip-page [hidden] { display: none !important; }

.trip-page {
  padding: 28px var(--pad-x) 72px;
  max-width: 1240px;
  margin: 0 auto;
}

/* ---------- Notice (loading, errors, signed out, not found) ---------- */
.trip-notice {
  max-width: 560px;
  margin: 24px auto 8px;
  padding: 36px 28px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--sand);
}
.trip-notice__eyebrow { display: block; font-size: 14.5px; color: var(--label); margin-bottom: 14px; }
.trip-notice__title {
  font-size: clamp(28px, 6vw, 36px);
  line-height: 1.08;
  letter-spacing: -.025em;
}
.trip-notice__text { margin: 14px 0 0; font-size: 17px; line-height: 1.55; color: var(--text-2); }
.trip-notice__text a { text-decoration: underline; text-underline-offset: 3px; }
.trip-notice__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.trip-notice__actions:empty { display: none; }

/* ---------- Layout ---------- */
.trip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "status" "map" "details";
  gap: 24px;
}
.trip__status { grid-area: status; }
.trip__map { grid-area: map; }
.trip__details { grid-area: details; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Live status ---------- */
.trip-live__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--label);
}
.trip-live__title {
  margin-top: 12px;
  font-size: clamp(32px, 8vw, 46px);
  line-height: 1.04;
  letter-spacing: -.03em;
}
.trip-live__lede {
  margin: 12px 0 0;
  max-width: 460px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-2);
}
.trip-live__lede:empty { display: none; }

/* Status dot: ink pulse while searching, solid while live, hollow when over */
.trip-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  flex: 0 0 auto;
}
.trip-dot.is-done { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.trip-dot.is-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ink);
  animation: trip-pulse 1.6s ease-out infinite;
}
@keyframes trip-pulse {
  0% { transform: scale(1); opacity: .45; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* ---------- Stepper ---------- */
.trip-steps {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.trip-steps__item { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.trip-steps__bar {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--hairline);
  overflow: hidden;
  position: relative;
}
.trip-steps__label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trip-steps__item.is-done .trip-steps__bar { background: var(--ink); }
.trip-steps__item.is-done .trip-steps__label { color: var(--text-2); }
.trip-steps__item.is-current .trip-steps__label { color: var(--ink); font-weight: 600; }
.trip-steps__item.is-current .trip-steps__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: left;
  animation: trip-fill 2.4s ease-in-out infinite;
}
.trip-steps.is-finished .trip-steps__item.is-current .trip-steps__bar::after { animation: none; }
.trip-steps.is-finished .trip-steps__item.is-current .trip-steps__bar { background: var(--ink); }
@keyframes trip-fill {
  0% { transform: scaleX(0); opacity: 1; }
  70% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* ---------- Map ---------- */
.trip-map {
  height: 280px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--sand);
  border: 1px solid var(--hairline);
}

/* ---------- Driver ---------- */
.trip-driver {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--dark-text);
}
.trip-driver__title { margin: 0; font-family: var(--font-head); font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.trip-driver__car { margin: 4px 0 0; font-size: 15px; color: var(--dark-muted); }
.trip-driver__car:empty { display: none; }
.trip-driver .btn--outline {
  color: var(--dark-text);
  border-color: var(--dark-hairline);
  font-size: 15.5px;
  padding: 13px 18px;
}
.trip-driver .btn--outline svg { flex: 0 0 18px; }
.trip-driver .btn--outline:hover { border-color: var(--dark-text); color: #fff; }

/* ---------- Summary card / receipt ---------- */
.trip-card {
  padding: 22px 20px 20px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: #fff;
}
.trip-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.trip-card__title { font-size: 15px; font-family: var(--font-body); font-weight: 600; color: var(--label); letter-spacing: 0; }
.trip-card__date { font-size: 14.5px; color: var(--text-2); }

.trip-route { list-style: none; margin: 18px 0 0; padding: 0; position: relative; }
.trip-route::before {
  /* the line between the two stops */
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 34px;
  border-left: 1.5px dashed var(--border-soft);
}
.trip-route__stop { position: relative; padding-left: 28px; display: flex; flex-direction: column; gap: 2px; }
.trip-route__stop + .trip-route__stop { margin-top: 16px; }
.trip-route__stop::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
}
.trip-route__stop--from::before { border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; }
.trip-route__stop--to::before { background: var(--ink); border-radius: 2px; }
.trip-route__label { font-size: 13px; color: var(--muted); line-height: 1.3; }
.trip-route__addr { font-size: 16px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }

.trip-card__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}
.trip-card__facts dt { font-size: 13px; color: var(--muted); }
.trip-card__facts dd { margin: 2px 0 0; font-size: 16px; font-weight: 500; }
.trip-card__price { font-family: var(--font-head); font-size: 22px !important; font-weight: 600 !important; letter-spacing: -.02em; }
.trip-card__pay { margin: 14px 0 0; font-size: 14.5px; color: var(--text-2); }

/* ---------- Cancel ---------- */
.trip-cancel { display: flex; flex-direction: column; gap: 12px; }
.trip-cancel__open {
  align-self: flex-start;
  padding: 10px 2px;
  border: 0;
  background: none;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--border-soft);
  cursor: pointer;
}
.trip-cancel__open:hover { color: var(--ink); text-decoration-color: var(--ink); }
.trip-cancel__confirm {
  padding: 20px;
  border-radius: 16px;
  background: var(--sand);
  border: 1px solid var(--hairline-sand);
}
.trip-cancel__q { margin: 0; font-family: var(--font-head); font-size: 19px; font-weight: 600; letter-spacing: -.015em; outline: none; }
.trip-cancel__note { margin: 4px 0 16px; font-size: 15px; color: var(--text-2); }
.trip-cancel__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.trip-cancel__buttons .btn { flex: 1 1 140px; font-size: 15.5px; padding: 13px 18px; }
.trip-cancel__buttons .btn:disabled { opacity: .55; cursor: progress; }
.trip-cancel__free,
.trip-cancel__phone { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.trip-cancel__phone a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.trip-cancel__msg { margin: 0; font-size: 15px; color: var(--text-2); }
.trip-cancel__msg.is-error { color: #A3261B; }

/* ---------- Book again ---------- */
.trip-again { display: flex; flex-wrap: wrap; gap: 12px; }
.trip-again .btn { flex: 1 1 180px; }

/* ---------- App band ---------- */
.trip-app {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline);
}
.trip-app__title { font-size: 22px; letter-spacing: -.02em; }
.trip-app__text { margin: 6px 0 0; font-size: 15.5px; color: var(--text-2); max-width: 460px; }

/* Focus rings for every control on the page */
.trip-page a:focus-visible,
.trip-page button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- Desktop: two columns ---------- */
@media (min-width: 960px) {
  .trip-page { padding-top: 48px; }
  .trip.has-map {
    grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "status map" "details map";
    column-gap: 48px;
    row-gap: 28px;
  }
  .trip:not(.has-map) { max-width: 600px; margin: 0 auto; }
  .trip__map { align-self: start; position: sticky; top: 96px; }
  .trip-map { height: min(640px, calc(100vh - 140px)); min-height: 440px; }
  .trip-driver { flex-direction: row; align-items: center; justify-content: space-between; }
  .trip-app { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .trip-dot.is-pulse::after,
  .trip-steps__item.is-current .trip-steps__bar::after { animation: none; }
  .trip-steps__item.is-current .trip-steps__bar { background: var(--ink); }
}
