/**
 * Interstitial "tutorial" (v1.45.0) — caricamento mostrato al click su "Cerca".
 *
 * Sequenza (--ix-d = 5,5 s, in sincrono con DURATION in interstitial.js):
 *   0–1,95 s  "Cerchiamo su" + 3 fornitori uno alla volta -> "tutti i partner" ✓
 *   2,0 s     "Tra poco si apre {brand}"
 *   2,4 s     passo ① — 2,8 s passo ② — 3,2 s esempio, card, riga cookie
 *   3,6 s     la mano tocca la card -> ✓1
 *   4,2 s     la mano preme il bottone -> ✓2, lucchetto aperto, "Miglior prezzo trovato"
 * Le animazioni girano solo con .ix-run sull'overlay: interstitial.js la toglie e la
 * rimette a ogni ricerca, cosi' la sequenza riparte da zero.
 * Il prezzo non e' MAI leggibile: cifra fittizia sfocata, poi il bollino.
 */

.ix-overlay {
    --ix-d: 5.5s;
    --ix-bg: #EEF5FF; --ix-ink: #0F2340; --ix-muted: #4A5B73; --ix-line: #D5E3F5;
    --ix-blue: #1E5FB8; --ix-blue-soft: #DCE7F5; --ix-orange: #D9480F; --ix-yellow: #FFC93C;
    --ix-green: #1C8A4E; --ix-green-bg: #E3F4EA;
    /* punto della card toccato dalla mano, rispetto al bottone: ricalcolato da interstitial.js */
    --ix-hx: -95px; --ix-hy: -152px;

    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--ix-bg);
    color: var(--ix-ink);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
.ix-overlay.active { display: block; }
.ix-overlay *, .ix-overlay *::before, .ix-overlay *::after { box-sizing: border-box; }

.ix-screen {
    min-height: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 22px 22px 24px;
}
.ix-logo { font-size: 24px; font-weight: 800; letter-spacing: -.5px; color: var(--ix-blue); }
.ix-logo b { color: #E8551C; }
.ix-query {
    margin-top: 12px; max-width: 100%;
    background: #fff; border: 1px solid var(--ix-line); border-radius: 999px;
    padding: 8px 16px; display: flex; align-items: center; gap: 10px;
}
.ix-query svg { flex-shrink: 0; }
.ix-query div { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ix-query strong, .ix-query span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-query strong { font-size: 14px; }
.ix-query span { font-size: 12px; color: var(--ix-muted); }

/* ---------- ricerca partner + titolo ---------- */
.ix-head { margin-top: 18px; text-align: center; width: 100%; }
.ix-reel { display: block; height: 1.2em; line-height: 1.2em; overflow: hidden; text-align: start; }
.ix-reel > span { display: flex; flex-direction: column; }
.ix-reel i { font-style: normal; display: block; height: 1.2em; white-space: nowrap; }
.ix-brand { color: var(--ix-orange); }
.ix-opens { display: block; font-size: 22px; font-weight: 800; line-height: 1.25; }
.ix-big { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.ix-searching {
    margin: 0 0 6px; display: flex; justify-content: center; align-items: center; gap: 8px;
    font-size: 16px; color: var(--ix-muted);
}
.ix-searching .ix-reel { font-size: 18px; font-weight: 800; color: var(--ix-ink); }
.ix-spin { width: 18px; height: 18px; flex-shrink: 0; position: relative; }
.ix-spin > * { position: absolute; inset: 0; }
.ix-spin .ix-wheel { animation: ix-rot .9s linear infinite; }
@keyframes ix-rot { to { transform: rotate(360deg); } }

/* ---------- passi ---------- */
.ix-steps { margin-top: 14px; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.ix-step { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 700; }
.ix-num {
    position: relative; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
    background: var(--ix-blue-soft); color: var(--ix-blue);
    display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800;
}
.ix-num .ix-ok {
    position: absolute; inset: 0; border-radius: 50%; background: var(--ix-green);
    display: flex; align-items: center; justify-content: center; opacity: 0;
}
.ix-note { margin: 4px 0 0 44px; font-size: 13px; color: var(--ix-muted); }

/* ---------- card esempio ---------- */
/* allineata a sinistra: il bollino "Offerta sbloccata" sporge sopra la card a destra
   e con le lingue lunghe (de) copriva l'etichetta centrata */
.ix-example {
    align-self: flex-start; margin: 16px 0 8px 4px; font-size: 11px; font-weight: 800; letter-spacing: 1px;
    text-transform: uppercase; color: var(--ix-muted);
}
.ix-card {
    position: relative; width: 100%; background: #fff; border-radius: 16px; cursor: pointer; text-align: start;
    box-shadow: 0 10px 30px rgba(15,35,64,.12), 0 2px 6px rgba(15,35,64,.06);
}
.ix-v-hotel, .ix-v-car, .ix-v-flight { display: none; }
.ix-overlay[data-type=hotel] .ix-v-hotel,
.ix-overlay[data-type=car] .ix-v-car,
.ix-overlay[data-type=flight] .ix-v-flight { display: block; }
.ix-photo { height: 112px; border-radius: 16px 16px 0 0; overflow: hidden; background: #E4ECF5; }
.ix-photo svg { display: block; width: 100%; height: 112px; }
.ix-top { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.ix-row { display: flex; justify-content: space-between; gap: 12px; }
.ix-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ix-title strong { font-size: 16px; }
.ix-title span { font-size: 13px; color: var(--ix-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-score { display: flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 13px; font-weight: 600; align-self: flex-start; }
.ix-score b { background: var(--ix-ink); color: #fff; border-radius: 6px; padding: 3px 7px; }
.ix-specs { display: flex; gap: 16px; font-size: 13px; color: var(--ix-muted); align-items: center; }
.ix-specs > span { display: flex; align-items: center; gap: 5px; }
.ix-legs { padding: 16px 16px 0; display: flex; flex-direction: column; gap: 12px; }
.ix-leg small {
    display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
    color: var(--ix-muted); margin-bottom: 6px;
}
.ix-legrow { display: flex; align-items: center; gap: 10px; }
.ix-air {
    width: 30px; height: 30px; border-radius: 8px; background: #E4ECF5; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.ix-tp { display: flex; flex-direction: column; line-height: 1.15; }
.ix-tp b { font-size: 17px; }
.ix-tp span { font-size: 12px; color: var(--ix-muted); }
.ix-tp.ix-r { text-align: end; }
.ix-mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--ix-muted); }
.ix-mid i { display: block; width: 100%; height: 2px; background: #C9D6E4; border-radius: 2px; position: relative; }
.ix-mid i::after {
    content: ""; position: absolute; right: -1px; top: -3px;
    width: 8px; height: 8px; border-radius: 50%; background: #C9D6E4;
}
.ix-mid .ix-direct { color: var(--ix-green); font-weight: 700; }

.ix-bottomrow {
    margin: 12px 16px 0; padding: 10px 0 14px; border-top: 1px solid #E6EDF5;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.ix-pricebox { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.ix-locks { position: relative; width: 22px; height: 22px; flex-shrink: 0; }
.ix-locks svg { position: absolute; inset: 0; }
.ix-price { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ix-price small { font-size: 12px; color: var(--ix-muted); }
.ix-pslot { height: 30px; display: flex; align-items: center; }
.ix-pfig { font-size: 24px; font-weight: 800; filter: blur(6px); user-select: none; white-space: nowrap; }
.ix-found {
    position: absolute; left: 0; top: 50%; display: flex; align-items: center; gap: 6px;
    background: var(--ix-green-bg); color: #14663A; border-radius: 8px; padding: 6px 10px 6px 8px;
    font-size: 13px; font-weight: 800; line-height: 1.2; max-width: 100%; opacity: 0;
    transform: translateY(-50%); transform-origin: left center;
}
.ix-found svg { flex-shrink: 0; }
.ix-cta-wrap { position: relative; flex-shrink: 0; }
.ix-cta {
    background: var(--ix-orange); color: #fff; border: 0; border-radius: 10px; padding: 0 18px; height: 44px;
    font: inherit; font-size: 15px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.ix-ripple {
    position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; border-radius: 50%;
    background: #fff; pointer-events: none; opacity: 0;
}
.ix-hand { position: absolute; left: calc(50% - 13px); top: calc(50% - 4px); z-index: 4; pointer-events: none; opacity: 0; }
.ix-badge {
    position: absolute; top: -18px; right: -6px; z-index: 3; background: var(--ix-yellow); color: #2A1A00;
    border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 800;
    display: flex; align-items: center; gap: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.18); opacity: 0;
}

.ix-cookie {
    margin: 12px 0 0; display: flex; gap: 8px; align-items: flex-start; width: 100%;
    font-size: 12.5px; color: var(--ix-muted); line-height: 1.4;
}
.ix-cookie svg { flex-shrink: 0; margin-top: 1px; }
.ix-overlay[data-cookie="0"] .ix-cookie { display: none; }

.ix-bottom { margin-top: auto; padding-top: 16px; width: 100%; }
.ix-bar { height: 6px; border-radius: 999px; background: var(--ix-line); overflow: hidden; }
.ix-bar i { display: block; height: 6px; background: var(--ix-blue); border-radius: 999px; width: 0; }
.ix-loading { margin: 8px 0 0; font-size: 12px; color: var(--ix-muted); text-align: center; }

/* Telefoni bassi (es. iPhone SE): stringe le spaziature perche' la card resti nello schermo */
@media (max-height: 700px) {
    .ix-screen { padding-top: 14px; }
    .ix-head { margin-top: 12px; }
    .ix-big { font-size: 30px; }
    .ix-photo, .ix-photo svg { height: 84px; }
    .ix-example { margin: 10px 0 6px; }
}

/* ---------- animazione: % della durata --ix-d (5,5 s) ---------- */
.ix-run .ix-a {
    animation-duration: var(--ix-d);
    animation-timing-function: ease-out;
    animation-fill-mode: both;
    animation-iteration-count: 1;
}
.ix-run .ix-reel-in.ix-a { animation-name: ix-reel; animation-timing-function: cubic-bezier(.5,0,.3,1); }
.ix-run .ix-spinwrap.ix-a { animation-name: ix-spinOut; }
.ix-run .ix-tick.ix-a { animation-name: ix-tickIn; }
.ix-run .ix-titleB.ix-a { animation-name: ix-titleB; }
.ix-run .ix-searching.ix-a { animation-name: ix-dimLine; }
.ix-run .ix-s1in.ix-a { animation-name: ix-s1in; }
.ix-run .ix-s2in.ix-a { animation-name: ix-s2in; }
.ix-run .ix-cardIn.ix-a { animation-name: ix-cardIn; }
.ix-run .ix-cookieIn.ix-a { animation-name: ix-cookieIn; }
.ix-run .ix-c1.ix-a { animation-name: ix-c1; }
.ix-run .ix-c2.ix-a { animation-name: ix-c2; }
.ix-run .ix-card.ix-a { animation-name: ix-cardIn, ix-cardSel; animation-duration: var(--ix-d), var(--ix-d); }
.ix-run .ix-hand.ix-a { animation-name: ix-hand; animation-timing-function: cubic-bezier(.3,.7,.3,1); }
.ix-run .ix-cta.ix-a { animation-name: ix-press; }
.ix-run .ix-ripple.ix-a { animation-name: ix-ripple; }
.ix-run .ix-lock-c.ix-a { animation-name: ix-lockC; }
.ix-run .ix-lock-o.ix-a { animation-name: ix-lockO; }
.ix-run .ix-pfig.ix-a, .ix-run .ix-plabel.ix-a { animation-name: ix-pfig; }
.ix-run .ix-found.ix-a { animation-name: ix-found; animation-timing-function: cubic-bezier(.2,1.5,.4,1); }
.ix-run .ix-badge.ix-a { animation-name: ix-badge; animation-timing-function: cubic-bezier(.2,1.6,.4,1); }
.ix-run .ix-bar i.ix-a { animation-name: ix-bar; animation-timing-function: linear; }

/* fornitori: 3 nomi, ciascuno ~0,5 s fermo + 0,15 s di scorrimento (0–1,95 s) */
@keyframes ix-reel { 0%,9.1% { transform: translateY(0); } 11.8%,20.9% { transform: translateY(-1.2em); } 23.6%,32.7% { transform: translateY(-2.4em); } 35.5%,100% { transform: translateY(-3.6em); } }
@keyframes ix-spinOut { 0%,34.5% { opacity: 1; } 36%,100% { opacity: 0; } }
@keyframes ix-tickIn { 0%,35.5% { opacity: 0; transform: scale(.5); } 38%,100% { opacity: 1; transform: none; } }
/* 2,0 s titolo */
@keyframes ix-titleB { 0%,36.4% { opacity: 0; transform: translateY(8px); } 40%,100% { opacity: 1; transform: none; } }
@keyframes ix-dimLine { 0%,37% { opacity: 1; } 40%,100% { opacity: .6; } }
/* 2,4 s passo 1 — 2,8 s passo 2 — 3,2 s card + riga cookie */
@keyframes ix-s1in { 0%,43.6% { opacity: 0; transform: translateY(10px); } 48.2%,100% { opacity: 1; transform: none; } }
@keyframes ix-s2in { 0%,50.9% { opacity: 0; transform: translateY(10px); } 55.5%,100% { opacity: 1; transform: none; } }
@keyframes ix-cardIn { 0%,58.2% { opacity: 0; transform: translateY(14px); } 62.7%,100% { opacity: 1; transform: none; } }
@keyframes ix-cookieIn { 0%,58.2% { opacity: 0; transform: translateY(8px); } 62.7%,100% { opacity: 1; transform: none; } }
/* 3,6 s la mano tocca la card -> ✓1 */
@keyframes ix-cardSel { 0%,66% { box-shadow: 0 10px 30px rgba(15,35,64,.12), 0 0 0 0 rgba(30,95,184,0); } 67.5%,100% { box-shadow: 0 10px 30px rgba(15,35,64,.12), 0 0 0 3px #1E5FB8; } }
@keyframes ix-c1 { 0%,66.2% { opacity: 0; transform: scale(.5); } 68%,100% { opacity: 1; transform: none; } }
@keyframes ix-hand {
    0%,60% { opacity: 0; transform: translate(-40px,70px) scale(1); }
    61.8% { opacity: 1; }
    65.5% { transform: translate(var(--ix-hx),var(--ix-hy)) scale(1); }
    66.4% { transform: translate(var(--ix-hx),var(--ix-hy)) scale(.86); }
    68% { transform: translate(var(--ix-hx),var(--ix-hy)) scale(1); }
    74.5% { transform: translate(0,0) scale(1); }
    76.4% { transform: translate(0,0) scale(.86); }
    78.2% { transform: translate(0,0) scale(1); }
    90% { opacity: 1; transform: translate(0,0); }
    95%,100% { opacity: 0; transform: translate(14px,24px); }
}
/* 4,2 s preme il bottone -> ✓2 subito, poi sblocco */
@keyframes ix-press { 0%,75.5% { transform: none; filter: none; } 76.4% { transform: scale(.94); filter: brightness(.88); } 78.5%,100% { transform: none; filter: none; } }
@keyframes ix-ripple { 0%,75.8% { opacity: 0; transform: translate(-50%,-50%) scale(.2); } 77% { opacity: .55; } 85%,100% { opacity: 0; transform: translate(-50%,-50%) scale(2.6); } }
@keyframes ix-c2 { 0%,76.2% { opacity: 0; transform: scale(.5); } 78%,100% { opacity: 1; transform: none; } }
@keyframes ix-lockC { 0%,77.5% { opacity: 1; transform: none; } 80%,100% { opacity: 0; transform: rotate(-14deg); } }
@keyframes ix-lockO { 0%,77.5% { opacity: 0; transform: translateY(2px); } 81%,100% { opacity: 1; transform: none; } }
@keyframes ix-pfig { 0%,78% { opacity: 1; transform: none; } 81%,100% { opacity: 0; transform: scale(.85); } }
@keyframes ix-found { 0%,79% { opacity: 0; transform: translateY(-50%) scale(.6); } 82.5% { opacity: 1; transform: translateY(-50%) scale(1.08); } 84.5%,100% { opacity: 1; transform: translateY(-50%) scale(1); } }
@keyframes ix-badge { 0%,81.5% { opacity: 0; transform: scale(.3) rotate(-8deg); } 85% { opacity: 1; transform: scale(1.08) rotate(3deg); } 87%,100% { opacity: 1; transform: scale(1) rotate(3deg); } }
@keyframes ix-bar { 0% { width: 0; } 100% { width: 100%; } }

/* Movimento ridotto: stato finale subito, redirect dopo 3 s (interstitial.js) */
@media (prefers-reduced-motion: reduce) {
    .ix-run .ix-a, .ix-spin .ix-wheel { animation: none !important; }
    .ix-run .ix-reel-in { transform: translateY(-3.6em); }
    .ix-run .ix-spinwrap { opacity: 0; }
    .ix-run .ix-tick, .ix-run .ix-titleB, .ix-run .ix-c1, .ix-run .ix-c2, .ix-run .ix-lock-o, .ix-run .ix-badge { opacity: 1; }
    .ix-run .ix-hand, .ix-run .ix-ripple, .ix-run .ix-lock-c, .ix-run .ix-pfig, .ix-run .ix-plabel { opacity: 0; }
    .ix-run .ix-found { opacity: 1; }
    .ix-run .ix-bar i { width: 100%; }
}
