/* ============================================================================
   cartellino-travel.css — card e dettaglio travel, direzione A (spec travel 1 §3, bozza bozza-travel.html)
   Hotel = cartolina (francobollo delle stelle, timbro postale con le date), volo = carta d'imbarco con la rotta
   disegnata, crociera = biglietto col nastro, pacchetto = cartolina col francobollo VOLO+HOTEL.
   Solo token: nessun colore scritto qui (TravelUiSourceTests). Caricato da Web (App.razor) e MAUI (index.html)
   dopo cartellino-cards.css. Le misure della zona alta sono quelle di .ct-deal__media, così in un feed misto
   card offerta e card viaggio hanno la stessa altezza.
   ========================================================================== */

/* ── Telaio ─────────────────────────────────────────────────────────────── */
.ct-trip {
  position: relative; display: flex; flex-direction: column; height: 100%; min-width: 0;
  overflow: hidden; color: var(--ink);
}
.ct-trip__hit {
  position: absolute; inset: 0; z-index: 2; width: 100%; padding: 0;
  background: none; border: 0; border-radius: inherit; cursor: pointer;
}
/* L'anello sta DENTRO la card: fuori verrebbe ritagliato da overflow:hidden (revisione del lotto 1-Web) */
.ct-trip__hit:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }

.ct-trip__face {
  position: relative; height: 180px; flex: none; overflow: hidden;
  background: var(--surface-sunk); border-bottom: 2px solid var(--ink);
}
.ct-trip__face > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.ct-trip__ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: var(--ink-muted); }
.ct-trip__face .ct-ribbon { z-index: 3; pointer-events: none; }
/* Controlli veri sopra il bottone-copertura: carosello, preferiti, «apri pagina» (in basso: in alto c'è il francobollo) */
.ct-trip__face .carousel-nav, .ct-trip__face .deal-favorite-btn, .ct-trip__face .card-open-page { z-index: 4; }
.ct-trip__face .deal-favorite-btn { position: absolute; top: auto; bottom: 8px; right: 8px; }
/* Carta d'imbarco: in basso c'è la riga perforata con le date, il cuore sale sopra di lei */
.ct-trip--boardingpass .ct-trip__face .deal-favorite-btn { bottom: 34px; }
.ct-trip--boardingpass .ct-trip__face .card-open-page { bottom: 36px; }
.ct-trip__face .card-open-page {
  position: absolute; top: auto; left: auto; bottom: 10px; right: 52px;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink);
}
.ct-trip:hover .card-open-page, .ct-trip:focus-within .card-open-page { opacity: 1; }
.ct-trip__face:hover .carousel-nav { opacity: 1; }
.ct-trip__sold { z-index: 3; }
.ct-trip.is-sold .ct-trip__face > img { filter: grayscale(1); opacity: 0.55; }

.ct-trip__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 10px; flex: 1; min-width: 0; }
.ct-trip__kicker {
  font: 500 10px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em;
}
.ct-trip__title {
  margin: 0; font: 800 15px/1.3 var(--font-sans); color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em;
}
.ct-trip__where {
  font-size: 13px; color: var(--ink-soft); min-height: 1.3em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ct-trip__facts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.ct-trip__facts li { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.ct-trip__facts li > i { flex: none; color: var(--ink-muted); }
.ct-trip__facts li.is-ok > i { color: var(--save); }

/* ── Prezzo: tre righe riservate in fondo, alla stessa quota in tutte le card della fila ── */
.ct-trip__save { margin-top: auto; min-height: 20px; padding-top: 8px; }
.ct-trip__save .ct-pct { font-size: 11px; }
.ct-trip__price {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: nowrap;
  padding-top: 4px; min-width: 0;
}
.ct-trip__price .ct-price-tag { flex: none; }
.ct-trip__unit { min-height: 18px; font: 500 12px var(--font-mono); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-trip__prov {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px;
  margin: 8px -12px -10px; padding: 6px 12px; border-top: 1.5px dashed var(--rule);
  font: 500 11px var(--font-mono); color: var(--ink-muted);
}
/* Il bottone si restringe con i puntini invece di uscire dalla card stretta (home a 5 colonne, tablet) */
.ct-trip__cta {
  position: relative; z-index: 4; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  display: inline-block; text-align: center; vertical-align: middle; line-height: 20px;
  min-height: 36px; padding: 6px 12px; white-space: nowrap; cursor: pointer;
  background: var(--brand); color: var(--on-brand); border: 2px solid var(--ink); border-radius: 10px;
  box-shadow: var(--shadow-hard-sm); font: 800 13px var(--font-sans);
}
.ct-trip__cta:hover { background: var(--brand-hover); }
.ct-trip__cta:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ct-trip__cta--ghost { background: var(--surface); color: var(--ink); }
.ct-trip__cta--ghost:hover { background: var(--surface-sunk); }
.ct-trip__cta[disabled] {
  background: var(--surface-sunk); color: var(--ink-muted); border-style: dashed; box-shadow: none; cursor: not-allowed;
}
.ct-trip__cta.is-busy { opacity: 0.6; }

/* ── Cartolina: francobollo e timbro postale ── */
.ct-trip__stampbox {
  position: absolute; right: 10px; top: 10px; z-index: 3; pointer-events: none;
  background: var(--surface); color: var(--ink); padding: 5px 8px; text-align: center;
  font: 900 13px/1.1 var(--font-sans); transform: rotate(3deg);
  border: 3px dotted var(--ink); outline: 3px solid var(--surface); box-shadow: var(--shadow-hard-sm);
}
.ct-trip__stampbox > span { display: block; font: 500 10px var(--font-mono); color: var(--ink-muted); }
.ct-trip__postmark {
  position: absolute; left: 10px; bottom: 8px; z-index: 3; pointer-events: none;
  width: 86px; height: 86px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface);
  display: grid; place-content: center; text-align: center; gap: 1px;
  font: 500 10px/1.15 var(--font-mono); color: var(--ink); transform: rotate(-8deg); box-shadow: var(--shadow-hard-sm);
}
.ct-trip__postmark > b { font: 900 14px var(--font-sans); }

/* ── Carta d'imbarco ── */
.ct-trip--boardingpass .ct-trip__face { display: grid; grid-template-rows: auto 1fr auto; background: var(--tag); }
.ct-trip__passbar {
  display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px; min-width: 0;
  background: var(--ink); color: var(--surface); font: 700 12px var(--font-sans);
}
.ct-trip__passbar > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-trip__route {
  position: relative; min-height: 0; overflow: hidden;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 6px 6px;
}
.ct-trip__route > svg { display: block; width: 100%; height: 100%; }
.ct-trip__route .route-arc { fill: none; stroke: var(--tag-ink); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 7 6; }
.ct-trip__route .route-arc--back { stroke-width: 2; stroke-dasharray: 3 6; opacity: 0.7; }
.ct-trip__route .route-plane { fill: var(--tag-ink); }
.ct-trip__route .route-plane--back { fill: var(--brand); stroke: var(--tag-ink); stroke-width: 1.2; }
.ct-trip__route .route-sun { fill: var(--brand); stroke: var(--tag-ink); stroke-width: 2; }
.ct-trip__route .route-cloud { fill: var(--surface); stroke: var(--tag-ink); stroke-width: 2; }
.ct-trip__route .route-city { fill: var(--surface); stroke: var(--tag-ink); stroke-width: 3; }
.ct-trip__route .route-city--end { fill: var(--tag-ink); stroke: none; }
.ct-trip__route .route-iata { font: 900 22px var(--font-sans); fill: var(--tag-ink); }
.ct-trip__route .route-leg { font: 500 9px var(--font-mono); fill: var(--tag-ink); }
.ct-trip__routeph { display: grid; place-items: center; font-size: 40px; color: var(--tag-ink); }
.ct-trip__perf {
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 5px 12px;
  border-top: 2px dashed var(--tag-ink); color: var(--tag-ink); font: 500 11px var(--font-mono);
}

/* ── Biglietto della crociera ── */
.ct-trip__ribbon {
  position: absolute; left: 0; bottom: 12px; z-index: 3; pointer-events: none; max-width: 80%;
  background: var(--accent-travel); color: var(--on-accent-travel);
  border: 2px solid var(--ink); border-left: 0; border-radius: 0 8px 8px 0;
  padding: 4px 10px 4px 12px; font: 800 12px var(--font-sans);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Telefono: zona alta più bassa, card sempre verticale, bottone raggiungibile col dito ── */
@media (max-width: 640px) {
  .ct-trip__face { height: 160px; }
  .ct-trip__cta { min-height: 44px; min-width: 44px; }
  .ct-trip__postmark { width: 76px; height: 76px; }
}

/* ── Dettaglio a tutta larghezza (TravelDetailLayout): uguale in pagina e in modale ── */
.ct-trip-detail {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; color: var(--ink);
}
.ct-trip-detail__main { display: grid; gap: 16px; min-width: 0; }
.ct-trip-detail__hero {
  height: 280px; border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-hard);
}
.ct-trip-detail.ct-trip--boardingpass .ct-trip-detail__hero { display: grid; grid-template-rows: auto 1fr auto; background: var(--tag); }
.ct-trip-detail__head { display: grid; gap: 4px; }
.ct-trip-detail__title { margin: 0; font: 900 26px/1.2 var(--font-sans); letter-spacing: -0.01em; }
.ct-trip-detail__card {
  background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-hard-sm);
  padding: 14px 16px;
}
.ct-trip-detail__card > h3 { margin: 0 0 8px; font: 800 16px var(--font-sans); }
.ct-trip-detail__rows { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.ct-trip-detail__rows dt { color: var(--ink-muted); font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; align-self: center; }
.ct-trip-detail__rows dd { margin: 0; white-space: pre-line; }
.ct-trip-detail__legs { display: grid; gap: 10px; }
.ct-trip-detail__leg { border: 1.5px solid var(--ink); border-radius: 10px; padding: 8px 12px; background: var(--surface-sunk); }
.ct-trip-detail__leglabel { font: 500 11px var(--font-mono); color: var(--ink-muted); }
.ct-trip-detail__iata { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.ct-trip-detail__iata b { font: 900 24px var(--font-sans); letter-spacing: -0.02em; }
.ct-trip-detail__iata small { color: var(--ink-muted); font-size: 12px; }
.ct-trip-detail__legmeta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.ct-trip-detail__legmeta .is-ok { color: var(--save); font-weight: 700; }
.ct-trip-detail__stops { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 3px; font-size: 14px; }
.ct-trip-detail__promos { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 3px; font-size: 14px; }
.ct-trip-detail__side { position: sticky; top: 16px; }
.ct-trip-detail__pricebox { display: grid; gap: 10px; justify-items: start; padding: 16px; }
.ct-trip-detail__typical { font: 500 12px var(--font-mono); color: var(--ink-muted); }
.ct-trip-detail__buttons { display: grid; gap: 8px; width: 100%; }
.ct-trip-detail__buttons .ct-trip__cta { width: 100%; min-height: 44px; font-size: 15px; }
.ct-trip-detail__note { margin: 0; font-size: 12px; color: var(--ink-muted); }
.ct-trip-detail__prov { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; font: 500 11px var(--font-mono); color: var(--ink-muted); }
.ct-trip-detail__open { font-size: 13px; color: var(--brand-text); }

@media (max-width: 900px) {
  .ct-trip-detail { grid-template-columns: 1fr; }
  .ct-trip-detail__hero { height: 220px; }
  /* Telefono: prezzo e bottone restano a portata di pollice */
  .ct-trip-detail__side {
    position: sticky; top: auto; bottom: 0; z-index: 5;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ct-trip-detail__pricebox { box-shadow: var(--shadow-hard); }
  /* Nella pagina c'è la barra delle schede fissa in basso: il prezzo resta sopra di lei */
  .detail-page .ct-trip-detail__side { bottom: calc(var(--ct-tabs-h) + var(--safe-area-bottom, 0px)); }
}

/* Pagina /travel/{id}: più larga delle altre pagine di dettaglio, per le due colonne */
.detail-page--wide { max-width: 1200px; }

/* ── Banco dei filtri travel (spec travel 1 §3.8, bozza bozza-travel.html righe 152-205) ─────────────────── */
/* Righe a due colonne (etichetta · controlli), su telefono l'etichetta va sopra. Righe e valori vengono dalla policy
   (TravelLockedGroupModel); qui solo la forma, coi token. */
.ct-bench { display: flex; flex-direction: column; min-width: 0; }
.ct-brow {
  display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 10px 0; border-bottom: 1.5px dashed var(--rule);
}
.ct-bench > .ct-brow:last-child, .ct-lockgroup__rows > .ct-brow:last-child { border-bottom: 0; }
.ct-brow__label { font-weight: 800; font-size: 14px; padding-top: 6px; color: var(--ink); }
.ct-brow__label small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-muted); }
.ct-brow__body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (max-width: 639.98px) { .ct-brow { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

.ct-bchips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.ct-bchips:empty { display: none; }
.ct-bsub {
  padding: 10px 12px; background: var(--surface-sunk); border: 1.5px solid var(--rule); border-radius: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.ct-bsub__hint { margin: 0; font-size: 12px; color: var(--ink-muted); }
.ct-bnights, .ct-bdates { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ct-bnights label, .ct-bdates label, .ct-bnum { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.ct-bnights .ct-input { width: 72px; }
.ct-borigin { width: 180px; text-transform: uppercase; font-family: var(--font-mono); }
.ct-bseg { align-self: flex-start; }

/* Sette giorni L…D */
.ct-bdays { display: inline-grid; grid-template-columns: repeat(7, 40px); gap: 4px; }
.ct-bdays .ct-chip { justify-content: center; padding: 5px 0; border-radius: 8px; }

/* Striscia dei 12 mesi dal mese corrente: primo e ultimo toccati (bordo), in mezzo più chiari; segno dell'anno a gennaio */
.ct-bmonths {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); max-width: 640px;
  border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--surface);
}
.ct-bmonths button {
  position: relative; border: 0; border-right: 1.5px solid var(--rule); background: var(--surface); color: var(--ink);
  padding: 12px 0 6px; font-weight: 700; font-size: 13px; cursor: pointer; min-height: 40px;
}
.ct-bmonths button:last-child { border-right: 0; }
.ct-bmonths button.is-in { background: color-mix(in srgb, var(--tag) 40%, var(--surface)); color: var(--tag-ink); }
.ct-bmonths button.is-edge { background: var(--tag); color: var(--tag-ink); box-shadow: inset 0 -3px 0 var(--ink); }
.ct-bmonths button:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.ct-bmonths__year {
  position: absolute; top: 1px; left: 0; right: 0; text-align: center;
  font: 500 9px var(--font-mono); letter-spacing: 0.06em; color: var(--ink-muted);
}
@media (max-width: 639.98px) {
  .ct-bmonths { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ct-bmonths button { min-height: 44px; }
  .ct-bmonths button:nth-child(6) { border-right: 0; }
  .ct-bmonths button:nth-child(-n+6) { border-bottom: 1.5px solid var(--rule); }
}

/* ── Blocco anonimo: UNA fascia e le righe riservate in grigio LEGGIBILE (spec travel 1 §3.8) ────────────────── */
/* Niente opacità né filtri: testo --ink-muted su --surface-sunk e bordi tratteggiati --rule, così il testo resta
   sopra 4,5:1 anche nel grigio. La fascia è il cartellino (--tag) con bordo d'inchiostro. */
.ct-lockgroup { display: flex; flex-direction: column; min-width: 0; padding: 4px 0; border-bottom: 1.5px dashed var(--rule); }
.ct-lockbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 8px 0 6px; padding: 8px 12px;
  background: var(--tag); color: var(--tag-ink); border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow-hard-sm);
}
.ct-lockbar__text { flex: 1 1 280px; font-size: 14px; }
.ct-lockbar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ct-lockbar__login { color: var(--tag-ink); font-size: 13px; font-weight: 700; text-decoration: underline; }
.ct-lockgroup__rows { display: flex; flex-direction: column; background: var(--surface-sunk); border-radius: 10px; padding: 0 10px; }
.ct-lockgroup__rows .ct-brow__label { color: var(--ink-muted); }
.ct-lockgroup__rows .ct-bmonths { border: 2px dashed var(--rule); }
.ct-lockgroup__rows .ct-bmonths button { background: var(--surface-sunk); color: var(--ink-muted); cursor: not-allowed; }
.ct-lockgroup__rows .ct-bmonths button.is-in,
.ct-lockgroup__rows .ct-bmonths button.is-edge { background: var(--surface); color: var(--ink-soft); box-shadow: inset 0 -3px 0 var(--ink-muted); }
.ct-lockgroup__rows .ct-bsub { background: var(--surface); border-style: dashed; }

/* Un controllo riservato, dentro il gruppo o da solo in una riga aperta: si vede (anche il valore scelto) ma non risponde */
.ct-chip[aria-disabled="true"], .ct-input[aria-disabled="true"], .ct-bmonths button[aria-disabled="true"] {
  cursor: not-allowed;
}
.ct-chip[aria-disabled="true"] { background: var(--surface-sunk); color: var(--ink-muted); border: 1.5px dashed var(--rule); box-shadow: none; }
.ct-chip[aria-disabled="true"].is-on,
html[data-theme="dark"] .ct-chip[aria-disabled="true"].is-on:not(.ct-chip--danger) {
  background: var(--surface); color: var(--ink-soft); border: 1.5px solid var(--ink-muted); font-weight: 700;
}
.ct-input[aria-disabled="true"] { background: var(--surface-sunk); color: var(--ink-muted); border-style: dashed; border-color: var(--rule); }

/* Avviso del link con filtri riservati: il testo e la registrazione gratuita */
.ct-notice--locked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
