/* Tryppy journey loader - shared by tryppy.in and Tryppy Events (keep both copies identical).
   Markup:
   <div class="ty-loader" role="status" aria-live="polite">
     <div class="ty-loader-stage" aria-hidden="true">
       <svg viewBox="0 0 220 84"><path class="ty-lr-base" d="M14 70C60 4 160 4 206 70"/><path class="ty-lr-trail" pathLength="100" d="M14 70C60 4 160 4 206 70"/>
         <circle class="ty-lr-dot" cx="14" cy="70" r="5"/><circle class="ty-lr-ring" cx="206" cy="70" r="5"/><circle class="ty-lr-dot ty-lr-end" cx="206" cy="70" r="5"/></svg>
       <span class="ty-loader-pin"><svg viewBox="0 0 24 30"><path d="M12 29S2 19.6 2 12a10 10 0 0 1 20 0c0 7.6-10 17-10 17z"/><circle cx="12" cy="12" r="4"/></svg></span>
     </div>
     <div class="ty-loader-msgs"><span>Finding the best prices…</span><span>…</span><span>…</span></div>
   </div>
   Add "ty-loader--overlay" for a full-screen version (payments, bookings). */
.ty-loader {
  --tyl-brand: var(--brand, var(--ty-brand, #1c30e4));
  --tyl-pin: #f4b608;
  --tyl-track: color-mix(in srgb, var(--tyl-brand) 22%, transparent);
  --tyl-text: var(--text, var(--ty-text, #1f2533));
  --tyl-muted: var(--muted, var(--ty-muted, #6b7280));
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 40px 16px;
  text-align: center;
}
.ty-loader-stage { position: relative; width: 220px; height: 84px; }
.ty-loader-stage > svg { position: absolute; inset: 0; width: 220px; height: 84px; overflow: visible; }
.ty-lr-base, .ty-lr-trail { fill: none; stroke-linecap: round; }
.ty-lr-base { stroke: var(--tyl-track); stroke-width: 2.5; stroke-dasharray: 2 7; }
.ty-lr-trail {
  stroke: var(--tyl-brand);
  stroke-width: 3;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
  animation: tyl-trail 2.4s cubic-bezier(.45, .05, .35, 1) infinite;
}
.ty-lr-dot { fill: #fff; stroke: var(--tyl-brand); stroke-width: 3; }
.ty-lr-end { stroke: var(--tyl-track); animation: tyl-end 2.4s ease infinite; }
.ty-lr-ring { fill: none; stroke: var(--tyl-brand); stroke-width: 2; transform-box: fill-box; transform-origin: center; opacity: 0;
  animation: tyl-ring 2.4s ease-out infinite; }
.ty-loader-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 28px;
  offset-path: path("M14 70C60 4 160 4 206 70");
  offset-rotate: 0deg;
  offset-anchor: 50% 100%;
  animation: tyl-fly 2.4s cubic-bezier(.45, .05, .35, 1) infinite;
  filter: drop-shadow(0 4px 6px rgba(20, 24, 60, .25));
}
.ty-loader-pin svg { display: block; width: 100%; height: 100%; }
.ty-loader-pin path { fill: var(--tyl-pin); }
.ty-loader-pin circle { fill: #fff; }
@keyframes tyl-fly {
  0% { offset-distance: 0%; opacity: 0; transform: scale(.6); }
  8% { opacity: 1; transform: scale(1); }
  70% { offset-distance: 100%; transform: scale(1); }
  76% { offset-distance: 100%; transform: scale(1.18, .82); }
  84% { offset-distance: 100%; transform: scale(1); opacity: 1; }
  100% { offset-distance: 100%; transform: scale(1); opacity: 0; }
}
@keyframes tyl-trail {
  0% { stroke-dashoffset: 100; opacity: 1; }
  70% { stroke-dashoffset: 0; opacity: 1; }
  88% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes tyl-end { 0%, 68% { stroke: var(--tyl-track); } 72%, 92% { stroke: var(--tyl-brand); } 100% { stroke: var(--tyl-track); } }
@keyframes tyl-ring { 0%, 70% { opacity: 0; transform: scale(1); } 72% { opacity: .8; } 100% { opacity: 0; transform: scale(3.2); } }
/* browsers without CSS motion paths: the pin hops along the line instead */
@supports not (offset-path: path("M0 0")) {
  .ty-loader-pin { top: 6px; animation: tyl-hop 2.4s ease-in-out infinite; }
  @keyframes tyl-hop { 0% { transform: translateX(3px); opacity: 0; } 10% { opacity: 1; } 70% { transform: translateX(195px); } 100% { transform: translateX(195px); opacity: 0; } }
}

/* rotating messages: three lines take turns */
.ty-loader-msgs { position: relative; height: 24px; width: min(100%, 340px); }
.ty-loader-msgs span {
  position: absolute;
  inset: 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--tyl-text);
  opacity: 0;
  animation: tyl-msg 7.2s ease infinite;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ty-loader-msgs span:nth-child(2) { animation-delay: 2.4s; }
.ty-loader-msgs span:nth-child(3) { animation-delay: 4.8s; }
.ty-loader-msgs span:only-child { animation: none; opacity: 1; }
@keyframes tyl-msg { 0% { opacity: 0; transform: translateY(8px); } 6%, 30% { opacity: 1; transform: none; } 36%, 100% { opacity: 0; transform: translateY(-8px); } }
.ty-loader small { color: var(--tyl-muted); font-size: 13px; max-width: 300px; }

/* full-screen version */
.ty-loader--overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-content: center;
  background: color-mix(in srgb, var(--surface, #fff) 88%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: tyl-fade .25s ease both;
}
@keyframes tyl-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ty-lr-trail { animation: none; stroke-dashoffset: 50; }
  .ty-loader-pin { animation: none; offset-distance: 50%; }
  .ty-lr-ring, .ty-lr-end { animation: none; }
  .ty-loader-msgs span { animation: none; }
  .ty-loader-msgs span:first-child { opacity: 1; }
}
