/* The trip configurator shares one dialog across hotel page variants. */
[data-hd-trip-open]:focus-visible {
    outline: 3px solid var(--primary, #1e3c72);
    outline-offset: 6px;
    border-radius: 8px;
}
.hd-trip-modal .modal-content {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(21, 42, 79, .2);
}
.hd-trip-modal__header {
    align-items: flex-start;
    gap: 16px;
    padding: 24px 28px 20px;
    border-color: #e9edf2;
}
.hd-trip-modal__header > div { flex: 1; min-width: 0; }
.hd-trip-modal__eyebrow {
    margin-bottom: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}
.hd-trip-modal .modal-title {
    color: var(--primary, #1e3c72);
    font-size: 24px;
    font-weight: 700;
}
.hd-trip-modal__intro {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 14px;
}
.hd-trip-modal .btn-close {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px;
}
.hd-trip-modal .modal-body {
    padding: 20px 28px;
    overscroll-behavior: contain;
}
.hd-trip-modal .hd-trip-card__inner {
    margin: 0;
    padding: 0;
    border: 0;
}
.hd-trip-modal .hd-trip-tabs,
.hd-trip-modal .hd-trip-tabs-dropdown { display: none !important; }
.hd-trip-modal .hd-trip-actions {
    position: sticky;
    bottom: -20px;
    z-index: 4;
    margin-bottom: -20px;
    padding: 16px 0;
    background: #fff;
    border-top: 1px solid #e9edf2;
}
.hd-trip-scroll-lock {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}
.hd-trip-dialog-open #hdStickyMobileCta,
.hd-trip-dialog-open .sticky-price-bar {
    visibility: hidden !important;
    pointer-events: none !important;
}
@media (max-width: 767.98px) {
    .hd-trip-modal .modal-content { border-radius: 0; }
    .hd-trip-modal__header { padding: 18px 16px 14px; }
    .hd-trip-modal .modal-title { font-size: 21px; }
    .hd-trip-modal__intro { font-size: 13px; }
    .hd-trip-modal .modal-body {
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    }
    .hd-trip-modal .hd-trip-actions {
        bottom: calc(-16px - env(safe-area-inset-bottom));
        margin-bottom: calc(-16px - env(safe-area-inset-bottom));
        padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
        gap: 8px;
    }
    .hd-trip-modal .hd-trip-action { min-height: 44px; }
    .hd-trip-modal .hd-trip-card__inner .hd-trip-panel { min-width: 0; }
}

/* The page shows one entry card per transport section. */
#hdAggiungiViaggio.is-trip-added {
    background: #fff;
    border-color: #e9ecef;
}
.hd-trip-card__header--sections .hd-trip-card__icon-wrap { display: none; }
#hdAggiungiViaggio .hd-trip-card__header--sections .hd-trip-card__title { color: #1a2235; }
#hdAggiungiViaggio .hd-trip-card__header--sections .hd-trip-card__title::before { content: none; }
#hdAggiungiViaggio .hd-trip-card__header--sections .hd-trip-card__subtitle {
    color: #6b7280;
    font-weight: 400;
}
.hd-trip-card__header--sections {
    cursor: default;
    flex-wrap: wrap;
    align-items: center;
}
.hd-trip-card__header--sections > div:nth-child(2) { min-width: 170px; }
.hd-trip-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.hd-trip-choice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 18px;
    color: var(--primary, #1e3c72);
    background: #fff;
    border: 1px solid #dfe5ed;
    border-radius: 14px;
    text-align: left;
    transition: border-color .15s, box-shadow .15s;
}
.hd-trip-choice:hover {
    border-color: var(--accent, #f5a623);
    box-shadow: 0 4px 16px rgba(30, 60, 114, .08);
}
.hd-trip-choice__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 4px;
    color: var(--primary, #1e3c72);
    background: #f0f4fa;
    border-radius: 11px;
    font-size: 21px;
}
.hd-trip-choice__title { font-size: 15px; font-weight: 700; line-height: 1.35; }
.hd-trip-choice__description { color: #64748b; font-size: 12px; line-height: 1.5; }
.hd-trip-choice__action { margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 700; }
.hd-trip-choice.is-added { border-color: #198754; background: #f3fbf6; }
.hd-trip-choice.is-added .hd-trip-choice__action { color: #157347; }
.hd-trip-choice.is-pending { border-color: var(--accent, #f5a623); background: #fffaf0; }
.hd-trip-summary-link {
    padding: 8px 12px;
    color: var(--primary, #1e3c72);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
}
@media (max-width: 767.98px) {
    .hd-trip-choices { grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 12px; }
    .hd-trip-choice {
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        min-height: 46px;
        padding: 8px 10px;
        border-radius: 10px;
    }
    .hd-trip-choice__icon {
        width: 28px;
        height: 28px;
        margin: 0;
        border-radius: 8px;
        font-size: 17px;
    }
    .hd-trip-choice__title { font-size: 13px; line-height: 1.3; }
    .hd-trip-choice__description { display: none; }
    .hd-trip-choice__action {
        max-width: 90px;
        margin: 0;
        padding: 0;
        font-size: 12px;
        line-height: 1.3;
        text-align: right;
    }
}

/* Voli a passi (atlas_flights.js, opts.steps): la barra del picker aderisce
   al fondo del dialog come .hd-trip-actions; mentre si scelgono le tratte
   «Conferma trasporto» e la nota di pagamento aspettano il riepilogo, e il
   banner «incluso» diventa una riga del picker. */
@media (max-width: 767.98px) {
    .hd-trip-modal .hd-trip-panel[data-panel="flight"] .hd-trip-panel__included { display: none; }
    .hd-trip-modal .af-picker--steps .af-stepnav:not([hidden]) {
        bottom: calc(-16px - env(safe-area-inset-bottom));
        margin-bottom: calc(-16px - env(safe-area-inset-bottom));
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    .hd-trip-modal:has(.hd-trip-panel[data-panel="flight"]:not([style*="none"]) .af-picker--steps:not([data-step="summary"])) :is(.hd-trip-actions, .hd-trip-footer, #hdAtlasNote) { display: none !important; }
}

/* Testata compatta su mobile: il titolo della sezione basta, la frase
   introduttiva spingeva la scelta sotto la piega. */
@media (max-width: 767.98px) {
    .hd-trip-modal__intro { display: none; }
    .hd-trip-modal .hd-trip-city-result { min-height: 52px; }
}

/* Treni e FlixBus: andata e ritorno come due tratte a tutta larghezza sotto
   l'intestazione della card (hdTripLineLegsHtml in hotel-trip-modal.js). */
.hd-trip-option:has(.hd-trip-legs) { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 12px; align-items: start; }
.hd-trip-option:has(.hd-trip-legs) .hd-trip-option__body { display: contents; }
.hd-trip-option:has(.hd-trip-legs) .hd-trip-option__radio-visual { grid-row: 1; grid-column: 1; align-self: center; }
.hd-trip-option:has(.hd-trip-legs) .hd-trip-option__title { grid-row: 1; grid-column: 2; align-self: center; }
.hd-trip-option:has(.hd-trip-legs) .hd-trip-option__price { grid-row: 1; grid-column: 3; padding-left: 0; text-align: right; }
.hd-trip-option:has(.hd-trip-legs) .hd-trip-option__price-big { display: block; }
.hd-trip-option:has(.hd-trip-legs) .hd-trip-option__price-unit { display: block; margin-left: 0; }
.hd-trip-option:has(.hd-trip-legs) .hd-trip-option__meta { grid-column: 1 / -1; }
.hd-trip-legs { grid-row: 2; grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid #e9edf2; }
.hd-trip-leg { display: flex; flex-direction: column; gap: 4px; }
.hd-trip-leg__tag { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--primary, #1e3c72); }
.hd-trip-leg__row { display: flex; align-items: center; gap: 10px; }
.hd-trip-leg__end { display: flex; flex-direction: column; min-width: 0; }
.hd-trip-leg__end b { font-size: 19px; font-weight: 700; color: #14213d; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hd-trip-leg__end small { font-size: 12px; color: #5b6475; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.hd-trip-leg__end--arr { align-items: flex-end; text-align: right; }
.hd-trip-leg__mid { flex: 1; min-width: 24px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hd-trip-leg__mid small { font-size: 11px; color: #5b6475; }
.hd-trip-leg__mid i { display: block; width: 100%; height: 2px; border-radius: 1px; background: #c9d1de; }

/* Viaggio confermato: un solo banner al posto delle card «Aggiungi». */
.hd-trip-added { margin-top: 16px; padding: 16px; border: 1px solid #bfe3cd; border-radius: 16px; background: #f3fbf6; display: flex; flex-direction: column; gap: 12px; }
.hd-trip-added[hidden] { display: none; }
.hd-trip-added__head { display: flex; align-items: center; gap: 10px; }
.hd-trip-added__check { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: #1f7a4d; color: #fff; display: grid; place-items: center; font-size: 20px; }
.hd-trip-added__title { display: flex; flex-direction: column; min-width: 0; }
.hd-trip-added__title strong { font-size: 17px; color: #14532d; }
.hd-trip-added__title span { font-size: 13px; color: #3d5a47; }
.hd-trip-added__rows { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: #fff; }
.hd-trip-added__rows:empty { display: none; }
.hd-trip-added__rows .hd-trip-legs { padding-top: 0; border-top: 0; }
.hd-trip-added__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.hd-trip-added__row span { color: #5b6475; }
.hd-trip-added__row strong { color: #14213d; font-variant-numeric: tabular-nums; text-align: right; }
.hd-trip-added__row--total { padding-top: 8px; border-top: 1px solid #eef1f5; }
.hd-trip-added__actions { display: flex; gap: 8px; align-items: center; }
.hd-trip-added__edit { flex: 1; min-height: 46px; border: 1px solid var(--primary, #1e3c72); border-radius: 12px; background: #fff; color: var(--primary, #1e3c72); font-size: 15px; font-weight: 700; }
.hd-trip-added__edit:hover { background: #f0f4fa; }
.hd-trip-added__remove { min-height: 46px; padding: 0 14px; border: 0; background: none; color: #5b6475; font-size: 14px; font-weight: 600; text-decoration: underline; }
@media (min-width: 768px) {
    .hd-trip-added__actions { justify-content: flex-start; }
    .hd-trip-added__edit { flex: 0 0 auto; padding: 0 28px; }
}
@media (min-width: 768px) {
    .hd-trip-legs, .hd-trip-added__rows { max-width: 560px; }
}
