/* HotelMeta: анимация на время поиска цен (assets/loader.js). Девять вариантов, каждый раз случайный.
   Состояние — классами на .hm-loader: s0…s3 (сервис ответил), e0…e3 (не ответил), all (ответили все), moving (турист идёт). */
.hm-loader { max-height: 0; opacity: 0; overflow: hidden; margin: 0; transition: max-height .5s ease, opacity .4s ease, margin .5s ease; }
.hm-loader.show { max-height: 320px; opacity: 1; margin: 12px 0 16px; }
.hm-loader .ld-stage { position: relative; width: min(100%, 480px); aspect-ratio: 2 / 1; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.hm-loader .ld-stage > svg { display: block; width: 100%; height: 100%; }
.hm-loader svg text { font-family: var(--font); }
/* Подпись над анимацией: вращается, пока ищем, в финале — галочка */
.hm-loader .ld-cap { max-width: 640px; margin: 0 0 8px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.hm-loader .ld-cap b { font-weight: 600; color: var(--ink); }
.hm-loader .ld-cap i { display: inline-block; box-sizing: border-box; width: 15px; height: 15px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: hmSpin .8s linear infinite; }
.hm-loader.all .ld-cap i { animation: none; border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.3l2 2 4-4.6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") 50% 50% / 11px no-repeat; }
@keyframes hmSpin { to { transform: rotate(360deg); } }

/* ---------- 1. Турист с чемоданом идёт по шкале ---------- */
.hm-loader .a1 .rail { stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.hm-loader .a1 .start { fill: var(--accent); }
.hm-loader .a1 .stop circle { fill: #fff; stroke: var(--faint); stroke-width: 2; transition: fill .3s, stroke .3s; }
.hm-loader .a1 .stop.on circle { fill: var(--accent); stroke: var(--accent); }
.hm-loader .a1 .stop.off circle { fill: var(--line); stroke: var(--faint); }
.hm-loader .a1 .lb { font-size: 11px; font-weight: 600; fill: var(--muted); text-anchor: middle; }
.hm-loader .a1 .ct { font-size: 10px; fill: var(--faint); text-anchor: middle; }
.hm-loader .a1 .stop.on .lb { fill: var(--ink); }
.hm-loader .a1 .walker { transform: translateX(var(--x, 0px)); transition: transform 1.3s cubic-bezier(.45, 0, .25, 1); }
.hm-loader .a1 .torso, .hm-loader .a1 .head, .hm-loader .a1 .leg, .hm-loader .a1 .arm, .hm-loader .a1 .wheel { fill: var(--ink); }
.hm-loader .a1 .pack { fill: var(--muted); }
.hm-loader .a1 .case { fill: var(--accent); }
.hm-loader .a1 .armback { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.hm-loader .a1 .handle { stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.hm-loader .a1 .leg, .hm-loader .a1 .arm { transform-box: fill-box; transform-origin: 50% 0; }
.hm-loader.moving .a1 .l1 { animation: hmSwing .42s ease-in-out infinite alternate; }
.hm-loader.moving .a1 .l2, .hm-loader.moving .a1 .arm { animation: hmSwing .42s ease-in-out infinite alternate-reverse; }
.hm-loader.moving .a1 .bob { animation: hmBob .21s ease-in-out infinite alternate; }
.hm-loader .a1 .think { font-size: 18px; font-weight: 700; fill: var(--faint); opacity: 0; transition: opacity .3s; }
.hm-loader:not(.moving):not(.all) .a1 .think { opacity: 1; animation: hmWait 1.2s ease-in-out infinite; }
.hm-loader .a1 .badge { opacity: 0; transform: scale(.3); transform-box: fill-box; transform-origin: 50% 50%; transition: transform .4s cubic-bezier(.2, 1.6, .4, 1), opacity .2s; }
.hm-loader.all .a1 .badge { opacity: 1; transform: none; }
.hm-loader .a1 .badge circle { fill: var(--accent); }
.hm-loader .a1 .badge path { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
@keyframes hmSwing { from { transform: rotate(24deg); } to { transform: rotate(-24deg); } }
@keyframes hmBob { to { transform: translateY(-2px); } }
@keyframes hmWait { 50% { opacity: .3; } }

/* ---------- 3. Оживший логотип ---------- */
.hm-loader .a3 .ln { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.hm-loader .a3 .end { fill: var(--accent); }
.hm-loader .a3 .ring { fill: #fff; stroke: var(--accent); stroke-width: 4; }
.hm-loader .a3 .run { fill: #fff; stroke: var(--accent); stroke-width: 4; animation: hmSlide 1.5s ease-in-out infinite alternate; }
.hm-loader.all .a3 .run { animation: none; transition: transform .6s ease; }
@keyframes hmSlide { to { transform: translateX(300px); } }
.hm-loader .a3 .tk { transition: transform .5s ease; }
.hm-loader .a3 .tki { opacity: 0; transform: scale(.4); transform-box: fill-box; transform-origin: 50% 50%; transition: transform .4s cubic-bezier(.2, 1.6, .4, 1), opacity .25s; }
.hm-loader .a3 .tk.on .tki { opacity: 1; transform: none; }
.hm-loader .a3 .tk line { stroke: var(--ink); stroke-width: 2; }
.hm-loader .a3 .nm { font-size: 11px; font-weight: 600; fill: var(--muted); text-anchor: middle; }
.hm-loader .a3 .pr { font-size: 12px; fill: var(--ink); text-anchor: middle; }
.hm-loader.all .a3 .tk.best .pr, .hm-loader.all .a3 .tk.best .nm { fill: var(--accent); font-weight: 700; }
.hm-loader .a3 .pulse { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.hm-loader.all .a3 .pulse { animation: hmPulse 1.4s ease-out infinite; }
.hm-loader .a3 .fin { font-size: 13px; font-weight: 600; fill: var(--accent); opacity: 0; transition: opacity .4s .3s; }
.hm-loader.all .a3 .fin { opacity: 1; }
@keyframes hmPulse { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(3.2); } }

/* ---------- 4. Лупа над картой города ---------- */
.hm-loader .a4 .land { fill: #eef2ee; }
.hm-loader .a4 .river { fill: none; stroke: #cfe2e8; stroke-width: 16; stroke-linecap: round; }
.hm-loader .a4 .roads path { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; }
.hm-loader .a4 .pin { fill: var(--accent); stroke: #fff; stroke-width: 1.5; transform: scale(0); transform-box: fill-box; transform-origin: 50% 50%; transition: transform .35s cubic-bezier(.2, 1.6, .4, 1); }
.hm-loader .a4 .pin.on { transform: scale(1); }
.hm-loader .a4 .lens { animation: hmLens 9s ease-in-out infinite; }
.hm-loader.all .a4 .lens { animation-play-state: paused; }
.hm-loader .a4 .lens circle { fill: rgba(255, 255, 255, .35); stroke: var(--ink); stroke-width: 5; }
.hm-loader .a4 .lens line { stroke: var(--ink); stroke-width: 7; stroke-linecap: round; }
@keyframes hmLens { 0%, 100% { transform: translate(95px, 70px); } 25% { transform: translate(290px, 55px); } 50% { transform: translate(320px, 140px); } 75% { transform: translate(130px, 140px); } }
.hm-loader .counter { position: absolute; left: 10px; bottom: 8px; margin: 0; padding: 4px 10px; background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); }
.hm-loader .counter b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.hm-loader.all .counter b { color: var(--accent); }

/* ---------- 5. Окна гостиницы загораются ---------- */
.hm-loader .a5 .sky { fill: #1f2a33; }
.hm-loader .a5 .star { fill: #dfe7ee; animation: hmTwinkle 2.4s ease-in-out infinite; }
.hm-loader .a5 .moon { fill: #f3e7b3; }
.hm-loader .a5 .moon-cut { fill: #1f2a33; }
.hm-loader .a5 .bld { fill: #2f3c47; }
.hm-loader .a5 .win { fill: #3e4c58; transition: fill .4s; }
.hm-loader .a5 .win.on { fill: #f6cf72; }
.hm-loader .a5 .door { fill: #46555f; }
.hm-loader .a5 .sign { fill: #2f3c47; stroke: #46555f; stroke-width: 2; transition: fill .5s, stroke .5s; }
.hm-loader .a5 .signt { font-size: 12px; font-weight: 700; letter-spacing: .2em; fill: #5d6b75; text-anchor: middle; transition: fill .5s; }
.hm-loader.all .a5 .sign { fill: var(--accent); stroke: #3fbf8a; }
.hm-loader.all .a5 .signt { fill: #fff; }
.hm-loader .a5 .ground { fill: #18222a; }
@keyframes hmTwinkle { 50% { opacity: .25; } }

/* ---------- 6. Багажная лента ---------- */
.hm-loader .a6 .belt { fill: var(--ink); }
.hm-loader .a6 .belt-top { stroke: #5c6964; stroke-width: 3; stroke-dasharray: 12 10; animation: hmBelt .5s linear infinite; }
.hm-loader .a6 .legs { fill: var(--faint); }
.hm-loader .a6 .bag { animation: hmRide 8s linear infinite; animation-delay: var(--d); }
.hm-loader.all .a6 .bag, .hm-loader.all .a6 .belt-top { animation-play-state: paused; }
.hm-loader .a6 .handle { fill: none; stroke: var(--ink); stroke-width: 3; }
.hm-loader .a6 .tg rect { fill: #fff; stroke: var(--line); stroke-width: 1.5; transition: fill .3s, stroke .3s; }
.hm-loader .a6 .tg text { font-size: 9px; fill: var(--ink); text-anchor: middle; }
.hm-loader .a6 .tg .tn { font-weight: 700; }
.hm-loader.s0 .a6 .b0 .tg rect, .hm-loader.s1 .a6 .b1 .tg rect, .hm-loader.s2 .a6 .b2 .tg rect, .hm-loader.s3 .a6 .b3 .tg rect, .hm-loader.s4 .a6 .b4 .tg rect { fill: var(--accent-l); stroke: var(--accent); }
@keyframes hmBelt { to { stroke-dashoffset: -22; } }
@keyframes hmRide { from { transform: translateX(-80px); } to { transform: translateX(420px); } }

/* ---------- 7. Весы сравнения ---------- */
.hm-loader .a7 .base, .hm-loader .a7 .post, .hm-loader .a7 .beam rect.bar, .hm-loader .a7 .beam .axle { fill: var(--ink); }
.hm-loader .a7 .str { stroke: var(--faint); stroke-width: 1.5; }
.hm-loader .a7 .pan { fill: #cfd6d1; }
.hm-loader .a7 .beam { transform-origin: 200px 61px; animation: hmRock 1.6s ease-in-out infinite alternate; }
.hm-loader.all .a7 .beam { animation: none; transform: rotate(var(--tilt, 0deg)); transition: transform .9s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes hmRock { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.hm-loader .a7 .pti { opacity: 0; transform: translateY(-80px); transition: transform .55s cubic-bezier(.3, 1.4, .5, 1), opacity .2s; }
.hm-loader .a7 .ptag.on .pti { opacity: 1; transform: none; }
.hm-loader .a7 .pti rect { fill: #fff; stroke: var(--line); stroke-width: 1.5; transition: fill .3s; }
.hm-loader .a7 .pti text { font-size: 10px; font-weight: 600; fill: var(--ink); text-anchor: middle; }
.hm-loader.all .a7 .ptag.best rect { fill: var(--accent); stroke: var(--accent); }
.hm-loader.all .a7 .ptag.best text { fill: #fff; }
.hm-loader .a7 .fin { font-size: 13px; font-weight: 600; fill: var(--accent); text-anchor: middle; opacity: 0; transition: opacity .4s .5s; }
.hm-loader.all .a7 .fin { opacity: 1; }

/* ---------- 8. Турист дремлет ---------- */
.hm-loader .a8 .frame { fill: var(--faint); }
.hm-loader .a8 .matt { fill: var(--line); }
.hm-loader .a8 .pillow { fill: #fff; stroke: var(--line); stroke-width: 1.5; }
.hm-loader .a8 .head { fill: var(--ink); }
.hm-loader .a8 .eye { stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.hm-loader .a8 .eye-open { fill: #fff; opacity: 0; }
.hm-loader.all .a8 .eye { opacity: 0; }
.hm-loader.all .a8 .eye-open { opacity: 1; }
.hm-loader .a8 .blanket { fill: var(--accent-l); stroke: var(--accent); stroke-width: 2; transform-box: fill-box; transform-origin: 50% 100%; animation: hmBreathe 2.6s ease-in-out infinite; }
.hm-loader.all .a8 .blanket { animation: none; }
.hm-loader .a8 .z { font-weight: 700; fill: var(--muted); opacity: 0; animation: hmZz 3s ease-out infinite; }
.hm-loader .a8 .z2 { animation-delay: 1s; }
.hm-loader .a8 .z3 { animation-delay: 2s; }
.hm-loader.all .a8 .z { animation: none; opacity: 0; }
.hm-loader .a8 .cloud { fill: #fff; stroke: var(--line); stroke-width: 1.5; }
.hm-loader .a8 .ctext { font-size: 16px; font-weight: 600; fill: var(--muted); text-anchor: middle; }
.hm-loader.all .a8 .ctext { font-size: 13px; fill: var(--accent); }
.hm-loader .a8 .wake { font-size: 13px; font-weight: 600; fill: var(--accent); text-anchor: middle; opacity: 0; transition: opacity .4s .3s; }
.hm-loader.all .a8 .wake { opacity: 1; }
@keyframes hmBreathe { 50% { transform: scaleY(1.08); } }
@keyframes hmZz { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(34px, -52px) scale(1.5); } }

/* ---------- 9. Бумажный самолётик ---------- */
.hm-loader .a9 .route { fill: none; stroke: var(--faint); stroke-width: 2; stroke-dasharray: 4 6; animation: hmDash 1s linear infinite; }
.hm-loader.all .a9 .route { stroke: var(--accent); stroke-dasharray: none; animation: none; }
@keyframes hmDash { to { stroke-dashoffset: -10; } }
.hm-loader .a9 .pt circle { fill: #fff; stroke: var(--faint); stroke-width: 2; transition: fill .3s, stroke .3s; }
.hm-loader.s0 .a9 .pt[data-i="0"] circle, .hm-loader.s1 .a9 .pt[data-i="1"] circle, .hm-loader.s2 .a9 .pt[data-i="2"] circle, .hm-loader.s3 .a9 .pt[data-i="3"] circle, .hm-loader.s4 .a9 .pt[data-i="4"] circle { fill: var(--accent); stroke: var(--accent); }
.hm-loader.e0 .a9 .pt[data-i="0"] circle, .hm-loader.e1 .a9 .pt[data-i="1"] circle, .hm-loader.e2 .a9 .pt[data-i="2"] circle, .hm-loader.e3 .a9 .pt[data-i="3"] circle, .hm-loader.e4 .a9 .pt[data-i="4"] circle { fill: var(--line); }
.hm-loader .a9 .pt text { font-size: 11px; font-weight: 600; fill: var(--muted); text-anchor: middle; }
.hm-loader .a9 .plane path, .hm-loader .a9 .landed path { fill: #fff; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.hm-loader.all .a9 .plane { display: none; }
.hm-loader .a9 .landed { opacity: 0; transition: opacity .3s; }
.hm-loader.all .a9 .landed { opacity: 1; }
.hm-loader .a9 .fin { font-size: 13px; font-weight: 600; fill: var(--accent); opacity: 0; transition: opacity .4s .2s; }
.hm-loader.all .a9 .fin { opacity: 1; }

/* ---------- 10. Печатается кассовый чек ---------- */
.hm-loader .a10 { display: flex; flex-direction: column; align-items: center; height: 100%; padding-top: 10px; background: var(--soft); }
.hm-loader .a10 .printer { position: relative; z-index: 2; width: 270px; max-width: 92%; height: 20px; border-radius: 10px; background: var(--ink); }
.hm-loader .a10 .printer::after { content: ""; position: absolute; left: 18px; right: 18px; top: 8px; height: 4px; border-radius: 2px; background: #000; }
.hm-loader .a10 .paper { position: relative; z-index: 1; width: 230px; max-width: 80%; margin-top: -8px; padding: 14px 14px 10px; background: #fff;
  box-shadow: 0 1px 0 var(--line), 0 6px 14px rgba(28, 36, 32, .08); font: 400 12px/1.6 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--ink);
  animation: hmFeed 1.4s cubic-bezier(.3, 0, .2, 1); }
@keyframes hmFeed { from { transform: translateY(-100%); } to { transform: none; } }
.hm-loader .a10 .rh { text-align: center; font-weight: 700; letter-spacing: .12em; margin-bottom: 6px; }
.hm-loader .a10 .rh small { display: block; font-weight: 400; letter-spacing: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-loader .a10 .rl, .hm-loader .a10 .rt { display: flex; align-items: baseline; white-space: nowrap; }
.hm-loader .a10 i { flex: 1; margin: 0 6px; border-bottom: 1px dotted var(--faint); transform: translateY(-3px); }
.hm-loader .a10 .rl b { font-weight: 400; color: var(--muted); }
.hm-loader .a10 .rl.wait b { animation: hmWait 1s steps(2) infinite; }
.hm-loader .a10 .rl.ok b { color: var(--accent); font-weight: 700; }
.hm-loader .a10 .rt { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--faint); font-weight: 700; }
.hm-loader .a10 .stamp { position: absolute; right: 8px; bottom: 16px; padding: 2px 8px; border: 2.5px solid var(--accent); border-radius: 6px; color: var(--accent);
  font: 700 13px var(--font); letter-spacing: .08em; opacity: 0; transform: rotate(-14deg) scale(2.2); }
.hm-loader.all .a10 .stamp { animation: hmStamp .35s cubic-bezier(.2, 1.6, .4, 1) .3s forwards; }
@keyframes hmStamp { to { opacity: .9; transform: rotate(-14deg) scale(1); } }
.hm-loader .a10 .zz { position: absolute; left: 0; bottom: -6px; width: 100%; height: 6px; }
.hm-loader .a10 .zz polygon { fill: #fff; }

/* На телефоне сцена ниже — чек ужимается, чтобы итог и штамп не обрезались */
@media (max-width: 520px) {
  .hm-loader .a10 { padding-top: 6px; }
  .hm-loader .a10 .paper { padding: 9px 12px 7px; font-size: 10.5px; line-height: 1.4; }
  .hm-loader .a10 .rh { margin-bottom: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-loader, .hm-loader * { animation: none !important; transition: none !important; }
}
