/* Programmi di viaggio dentro «Viaggio dalla tua città» */
.hd-trip-programs { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.hd-trip-programs[data-found="1"] ~ #hdTripCityEmpty,
.hd-trip-programs[data-only="1"] ~ #hdTripCityEmpty,
.hd-trip-programs[data-only="1"] ~ #hdTripCityLines { display: none !important; }
.hd-trip-program__panel { border: 1.5px solid #e9ecef; border-radius: 12px; padding: 14px 16px; margin: -2px 0 8px; display: flex; flex-direction: column; gap: 12px; }
.hd-trip-program__panel[hidden] { display: none; }
.hd-trip-program__station { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #667085; }
.hd-trip-program__results { display: flex; flex-direction: column; gap: 12px; }
.hd-trip-program__trains { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hd-trip-program__column { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hd-trip-program__title { font-size: 14px; font-weight: 600; }
.hd-trip-program__row { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px; border: 1.5px solid #e9ecef; border-radius: 10px; padding: 9px 11px; font-size: 14px; cursor: pointer; margin: 0; }
.hd-trip-program__row--station { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 16px; border-radius: 14px; color: #1a2235; }
.hd-trip-program__station-name strong { display: block; font-size: 16px; font-weight: 700; }
.hd-trip-program__station-name small { display: block; color: #667085; font-size: 13px; }
.hd-trip-program__stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.hd-trip-program__price { text-align: right; }
.hd-trip-program__logo-box { display: inline-flex; width: 36px; height: 24px; }
.hd-trip-program__logo { width: 36px; height: 24px; object-fit: contain; border-radius: 4px; background: #fff; }
.hd-trip-program__flight { min-width: 0; font-size: 14px; }
.hd-trip-program__flight strong { font-weight: 600; }
.hd-trip-program__flight small { display: block; color: #667085; font-size: 13px; font-variant-numeric: tabular-nums; }
.hd-trip-program__bags { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid #e9ecef; padding-top: 12px; }
.hd-trip-program__bag { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef0f3; }
.hd-trip-program__bag-text strong { display: block; font-size: 15px; font-weight: 500; color: #1a2235; }
.hd-trip-program__bag-text small { display: block; font-size: 13px; font-weight: 600; color: var(--primary, #1e3c72); }
.hd-trip-program__stepper { display: inline-flex; align-items: center; flex: none; border: 1px solid #ced4da; border-radius: 999px; overflow: hidden; }
.hd-trip-program__stepper button { width: 36px; height: 34px; border: 0; background: #f6f8fb; color: #1e3c72; font-size: 18px; line-height: 1; }
.hd-trip-program__stepper button:disabled { color: #bbc; }
.hd-trip-program__stepper b { min-width: 32px; text-align: center; }
/* Il suggerimento delle città vicine: la frase resta una riga sola. */
.hd-trip-city-results .hd-trip-city-result--header { display: block; }
.hd-trip-program__card { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 16px; border-radius: 14px; }
.hd-trip-program__card-top { display: flex; align-items: center; gap: 12px; }
.hd-trip-program__card-top strong { font-size: 21px; font-weight: 700; color: #1a2235; font-variant-numeric: tabular-nums; }
.hd-trip-program__card-line { flex: 1; position: relative; height: 18px; display: flex; align-items: center; justify-content: center; }
.hd-trip-program__card-line::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid #d5dbe5; }
.hd-trip-program__card-line em { position: relative; font-style: normal; font-size: 12px; font-weight: 600; color: #2f7d4f; background: #fff; padding: 0 6px; }
.hd-trip-program__card.is-selected .hd-trip-program__card-line em { background: #fffbf4; }
.hd-trip-program__card-places { display: flex; justify-content: space-between; gap: 12px; color: #667085; font-size: 13px; }
.hd-trip-program__card-places span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-trip-program__card-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e9ecef; }
.hd-trip-program__card-foot .hd-trip-program__carrier { flex: 1; min-width: 0; color: #1a2235; font-size: 14.5px; font-weight: 600; }
.hd-trip-program__logo--wide { width: 52px; }
.hd-trip-program__card .hd-trip-program__logo-box { width: auto; min-width: 36px; }
.hd-trip-program__title--ways { color: var(--primary, #1e3c72); }
.hd-trip-program__row.is-selected { border-color: var(--accent, #f5a623); background: rgba(245, 166, 35, .06); }
.hd-trip-program__row.is-disabled { opacity: .45; cursor: not-allowed; }
.hd-trip-program__bag.is-disabled { opacity: .5; }
.hd-trip-program__carrier { color: #667085; font-size: 13px; }
.hd-trip-program__time, .hd-trip-program__price { font-variant-numeric: tabular-nums; }
.hd-trip-program__notice { background: #fdf4e3; color: #7a5208; border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.hd-trip-program__error { color: #b42318; font-size: 14px; }
.hd-trip-program__wait { color: #667085; font-size: 14px; }
.hd-trip-program__totals { display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.hd-trip-program__line { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.hd-trip-program__line--total { border-top: 1px solid #e9ecef; padding-top: 7px; font-weight: 700; font-size: 16px; }
@media (max-width: 620px) {
    .hd-trip-program__trains { grid-template-columns: 1fr; }
}

/* La finestra alta da subito e mai attaccata ai bordi dello schermo. */
@media (min-width: 768px) {
    .modal.hd-trip-modal { --bs-modal-margin: 40px; }
    .hd-trip-modal .modal-content { min-height: min(620px, 100%); }
}

/* «Viaggio aggiunto» su desktop: una riga sola, quando non ci sono tratte da elencare. */
@media (min-width: 768px) {
    .hd-trip-added:has(> .hd-trip-added__rows:empty) { flex-direction: row; align-items: center; }
    .hd-trip-added:has(> .hd-trip-added__rows:empty) .hd-trip-added__head { flex: 1 1 auto; min-width: 0; padding: 9px 14px; border-bottom: 0; background: transparent; }
    .hd-trip-added:has(> .hd-trip-added__rows:empty) .hd-trip-added__check { width: 28px; height: 28px; flex-basis: 28px; font-size: 15px; }
    .hd-trip-added:has(> .hd-trip-added__rows:empty) .hd-trip-added__title strong { font-size: 14.5px; }
    .hd-trip-added:has(> .hd-trip-added__rows:empty) .hd-trip-added__total strong { font-size: 17px; }
    .hd-trip-added:has(> .hd-trip-added__rows:empty) .hd-trip-added__total small { display: none; }
    .hd-trip-added:has(> .hd-trip-added__rows:empty) .hd-trip-added__actions { flex: none; gap: 12px; padding: 0 14px 0 0; }
    .hd-trip-added:has(> .hd-trip-added__rows:empty) .hd-trip-added__edit { min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; }
    .hd-trip-added:has(> .hd-trip-added__rows:empty) .hd-trip-added__remove { min-height: 34px; padding: 0; font-size: 13.5px; }
}

/* Le schede dei viaggi: icona del mezzo, prezzo in evidenza, pallino a destra (owner 10/11/2026). */
.hd-trip-option.hd-trip-option--program { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; }
.hd-trip-option__mode-icon { width: 48px; height: 48px; border-radius: 12px; background: #eef3fc; display: inline-flex; align-items: center; justify-content: center; }
.hd-trip-option__mode-icon svg, .hd-trip-added__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--primary, #1e3c72); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hd-trip-option--program .hd-trip-option__title { font-size: 15.5px; }
.hd-trip-option--program .hd-trip-option__price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; text-align: right; white-space: nowrap; }
.hd-trip-option__from, .hd-trip-option__unit { font-size: 12.5px; color: #667085; }
.hd-trip-option__amount { font-size: 20px; font-weight: 700; color: var(--primary, #1e3c72); }
.hd-trip-option--program .hd-trip-option__radio-visual { margin: 0; }
.hd-trip-program__line--total { align-items: center; }
.hd-trip-program__total-label { display: flex; flex-direction: column; }
.hd-trip-program__total-label small { font-weight: 400; color: #667085; font-size: 13px; }
.hd-trip-program__total-amount { font-size: 22px; color: var(--primary, #1e3c72); white-space: nowrap; }
.hd-trip-added__icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: #eef3fc; display: inline-flex; align-items: center; justify-content: center; }
.hd-trip-added__rows--summary .hd-trip-added__row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #eef0f3; font-size: 14px; }
.hd-trip-added__rows--summary .hd-trip-added__row:last-child { border-bottom: 0; }
.hd-trip-added__rows--summary .hd-trip-added__row span { color: #667085; }
@media (min-width: 768px) {
    .hd-trip-added__rows--summary { display: none !important; }
    .hd-trip-added:has(> .hd-trip-added__rows--summary) { flex-direction: row; align-items: center; }
    .hd-trip-added:has(> .hd-trip-added__rows--summary) .hd-trip-added__head { flex: 1 1 auto; min-width: 0; padding: 9px 14px; border-bottom: 0; background: transparent; }
    .hd-trip-added:has(> .hd-trip-added__rows--summary) .hd-trip-added__total small { display: none; }
    .hd-trip-added:has(> .hd-trip-added__rows--summary) .hd-trip-added__actions { flex: none; gap: 12px; padding: 0 14px 0 0; }
    .hd-trip-added:has(> .hd-trip-added__rows--summary) .hd-trip-added__edit { min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; }
    .hd-trip-added:has(> .hd-trip-added__rows--summary) .hd-trip-added__remove { min-height: 34px; padding: 0; font-size: 13.5px; }
    .hd-trip-added__head--program .hd-trip-added__icon { width: 34px; height: 34px; flex-basis: 34px; }
}
@media (max-width: 767.98px) {
    .hd-trip-option.hd-trip-option--program { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "icon body radio" "icon price radio"; row-gap: 4px; }
    .hd-trip-option--program .hd-trip-option__mode-icon { grid-area: icon; width: 44px; height: 44px; align-self: start; }
    .hd-trip-option--program .hd-trip-option__body { grid-area: body; }
    .hd-trip-option--program .hd-trip-option__price { grid-area: price; grid-column: auto; flex-direction: row; align-items: baseline; gap: 4px; justify-content: flex-start; justify-self: start; text-align: left; padding-left: 0; }
    .hd-trip-option--program .hd-trip-option__amount { font-size: 18px; }
    .hd-trip-option--program .hd-trip-option__radio-visual { grid-area: radio; }
    .hd-trip-program__card-top strong { font-size: 19px; }
    .hd-trip-program__card-places { font-size: 12.5px; }
    .hd-trip-added__head--program { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
    .hd-trip-added__rows--summary { padding: 4px 16px; }
    .hd-trip-added:has(> .hd-trip-added__rows--summary) .hd-trip-added__actions { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 14px; }
    .hd-trip-added:has(> .hd-trip-added__rows--summary) .hd-trip-added__edit { flex: 0 0 auto; min-height: 40px; padding: 0 20px; }
}

/* «Viaggio aggiunto» di un Programma: i colori della scheda, non il verde della conferma. */
.hd-trip-added__head--program { background: #f4f7fc; border-bottom-color: #e6ecf5; }
.hd-trip-added:has(> .hd-trip-added__head--program) { border-color: #dfe5ed; }
.hd-trip-added__head--program .hd-trip-added__title strong { color: var(--primary, #1e3c72); }
.hd-trip-added__head--program .hd-trip-added__title span { color: #667085; }
