/* 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: 4px; 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: auto minmax(0, 1fr); color: #1a2235; }
.hd-trip-program__stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.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__addbags { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--primary, #1e3c72); font-weight: 600; font-size: 14.5px; text-decoration: underline; }
.hd-trip-program__addbags[hidden] { display: none; }
.hd-trip-program__addbags:disabled { opacity: .6; }
.hd-trip-program__bags { display: flex; flex-direction: column; gap: 8px; }
.hd-trip-program__bag { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1.5px solid #e9ecef; border-radius: 10px; padding: 9px 11px; }
.hd-trip-program__stepper { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.hd-trip-program__stepper button { width: 30px; height: 30px; border: 1.5px solid #dfe5ed; border-radius: 8px; background: #fff; color: #1e3c72; font-size: 16px; line-height: 1; }
.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; height: 0; border-top: 2px solid #d5dbe5; text-align: center; }
.hd-trip-program__card-line em { position: relative; top: 4px; font-style: normal; font-size: 12.5px; font-weight: 600; color: #2f7d4f; }
.hd-trip-program__card-places { display: flex; justify-content: space-between; gap: 12px; color: #667085; font-size: 13px; }
.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__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; }
}
