/* Canonical “Tous les horaires” component shared by line pages and stop-sheet detail. */
.all-times-schedule {
    --all-times-surface: var(--line-shell-surface-strong, var(--pm-bg-card, #ffffff));
    --all-times-soft: var(--line-shell-surface-soft, var(--pm-bg-muted, #f8fafc));
    --all-times-border: var(--line-shell-border, var(--pm-border-light, #e2e8f0));
    --all-times-border-subtle: rgba(226, 232, 240, 0.7);
    --all-times-text: var(--line-shell-text-primary, var(--pm-text-primary, #0f172a));
    --all-times-secondary: var(--line-shell-text-secondary, var(--pm-text-secondary, #64748b));
    --all-times-muted: var(--pm-text-muted, #94a3b8);
    width: 100%;
    min-width: 0;
    margin: 0 0 1rem;
    padding: 20px 18px;
    border: 1px solid var(--all-times-border);
    border-radius: 22px;
    background: var(--all-times-surface);
    color: var(--all-times-text);
    box-shadow: none;
    box-sizing: border-box;
}

.all-times-schedule__header { margin: 0 0 16px; }
.all-times-schedule__title {
    margin: 0 0 4px;
    color: var(--all-times-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.all-times-schedule__subtitle {
    margin: 0;
    color: var(--all-times-secondary);
    font-size: 0.86rem;
    line-height: 1.4;
}

.all-times-schedule__date-selector {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 10px;
    align-items: center;
    width: 100%;
    margin: 0 0 12px;
}
.all-times-schedule__date-nav,
.all-times-schedule__date-button {
    border: 1px solid var(--all-times-border);
    background: var(--all-times-soft);
    color: var(--all-times-secondary);
    box-shadow: none;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
}
.all-times-schedule__date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    padding: 0;
}
.all-times-schedule__date-nav svg { width: 16px; height: 16px; }
.all-times-schedule__date-nav:disabled { opacity: .38; cursor: not-allowed; }
.all-times-schedule__date-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.all-times-schedule__date-button:hover,
.all-times-schedule__date-nav:not(:disabled):hover {
    background: color-mix(in srgb, var(--all-times-soft) 75%, #000);
}
.all-times-schedule__date-label {
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.all-times-schedule__calendar-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--all-times-secondary);
}
.all-times-schedule__date-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.all-times-schedule__hours-carousel {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0 0 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.all-times-schedule__hours-carousel::-webkit-scrollbar { display: none; }
.all-times-schedule__hours {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
}
.all-times-schedule__hour {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 56px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--all-times-border);
    border-radius: 999px;
    background: var(--all-times-soft);
    color: var(--all-times-secondary);
    box-shadow: none;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
}
.all-times-schedule__hour.is-selected {
    background: color-mix(in srgb, var(--line-color, #1e91ff) 13%, var(--all-times-surface));
    border-color: color-mix(in srgb, var(--line-color, #1e91ff) 52%, var(--all-times-border));
    color: var(--all-times-text);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--line-color, #1e91ff) 15%, transparent);
    font-weight: 800;
}
.all-times-schedule__hour.is-past { opacity: .56; }

/* ==========================================================================
   Liste des Départs Tous les Horaires — Style Fiche Horaire Compact (TBM)
   Une seule carte englobante (.all-times-schedule), liste plate de rows
   sans mini-cartes capsules individuelles, séparées par dividers légers.
   ========================================================================== */

.all-times-schedule__rows {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    gap: 0;
}

.all-times-schedule__row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content 44px !important;
    align-items: center;
    gap: 12px;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px;
    margin: 0;
    padding: 10px 4px;
    border: none !important;
    border-bottom: 1px solid var(--all-times-border-subtle) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--all-times-text);
    box-sizing: border-box;
    transition: background-color 0.12s ease;
}

.all-times-schedule__row:last-child {
    border-bottom: none !important;
}

.all-times-schedule__row:hover {
    background: color-mix(in srgb, var(--all-times-soft) 60%, transparent) !important;
}

.all-times-schedule__row.is-past { opacity: .56; }

/* 1. Destination (sans flèche « → ») */
.all-times-schedule__destination-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0 !important;
    max-width: 100%;
    justify-self: start;
    overflow: hidden;
}

.all-times-schedule__destination {
    min-width: 0 !important;
    max-width: 100%;
    overflow: hidden;
    color: var(--all-times-text);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.all-times-schedule__destination-wrap .departure-via {
    display: block;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--all-times-secondary);
    line-height: 1.2;
    margin-top: 1px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 2. Bloc Temps (aligné à droite, déterministe) */
.all-times-schedule__time-main {
    display: flex !important;
    min-width: 88px !important;
    width: max-content !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-self: end !important;
    gap: 2px !important;
    text-align: right !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.all-times-schedule__time-values {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    text-align: right !important;
    line-height: 1.2 !important;
}

.all-times-schedule__time {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    color: var(--all-times-text) !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
    font-variant-numeric: tabular-nums !important;
}

/* Slot RT fixe dédié */
.all-times-schedule__rt-slot {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}

.all-times-schedule__rt-slot:empty {
    visibility: hidden !important;
}

.all-times-schedule__rt-slot img {
    display: block !important;
    width: 18px !important;
    height: 16px !important;
}

.all-times-schedule__time-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    font-size: 0.78rem !important;
    color: var(--all-times-secondary) !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums !important;
    padding-right: 26px !important; /* Calé sous les chiffres de l'heure */
}

.all-times-schedule__scheduled-time {
    color: var(--all-times-muted) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    font-variant-numeric: tabular-nums !important;
    text-decoration: line-through !important;
    text-decoration-thickness: 1.5px !important;
    text-align: right !important;
}

.all-times-schedule__time.is-realtime { color: #0b7496 !important; }
body.dark-theme .all-times-schedule__time.is-realtime,
body[data-theme="dark"] .all-times-schedule__time.is-realtime { color: #7dd3fc !important; }
.all-times-schedule__time.is-cancelled {
    color: #dc2626 !important;
    text-decoration: line-through !important;
}

.all-times-schedule__meta,
.all-times-schedule__note {
    color: var(--all-times-muted);
    font-size: .72rem;
    line-height: 1.25;
    text-align: right;
}

.all-times-schedule__time .pwa-rt-gif-icon,
.all-times-schedule__time .realtime-gif-icon {
    display: inline-block;
    width: 17px;
    height: 15px;
    object-fit: contain;
    vertical-align: middle;
}

.all-times-schedule__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    white-space: nowrap;
}

.all-times-schedule__status--cancelled {
    border: 1px solid rgba(248, 113, 113, .34);
    background: rgba(220, 38, 38, .12);
    color: #b91c1c;
}

/* 3. Action / Chevron (colonne fixe 44px / 40px) */
.all-times-schedule__action {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 100% !important;
    justify-self: end !important;
    flex-shrink: 0 !important;
    box-sizing: border-box;
}

.all-times-schedule .trip-detail-trigger {
    margin: 0 !important;
    justify-self: end !important;
}

.all-times-schedule__empty {
    padding: 12px 0;
    color: var(--all-times-muted);
    font-size: .85rem;
    text-align: center;
}
.all-times-schedule__empty--hours { text-align: left; }
.all-times-schedule__empty--blocked {
    padding: 12px;
    border: 1px solid rgba(220, 38, 38, .34);
    border-radius: 12px;
    background: rgba(220, 38, 38, .08);
    color: #b91c1c;
    font-weight: 700;
}

body:is(.dark-theme, [data-theme="dark"]) .all-times-schedule,
html:is(.dark-theme, [data-theme="dark"]) .all-times-schedule {
    --all-times-surface: #0f172a;
    --all-times-soft: #1e293b;
    --all-times-border: rgba(148, 163, 184, .22);
    --all-times-border-subtle: rgba(148, 163, 184, .12);
    --all-times-text: #e2e8f0;
    --all-times-secondary: #cbd5e1;
    --all-times-muted: #94a3b8;
}
body:is(.dark-theme, [data-theme="dark"]) .all-times-schedule__time.is-realtime,
html:is(.dark-theme, [data-theme="dark"]) .all-times-schedule__time.is-realtime { color: #7dd3fc; }
body:is(.dark-theme, [data-theme="dark"]) .all-times-schedule__status--cancelled,
html:is(.dark-theme, [data-theme="dark"]) .all-times-schedule__status--cancelled {
    color: #fee2e2;
    background: rgba(220, 38, 38, .16);
}

@media (max-width: 420px) {
    .all-times-schedule { padding: 18px 14px; }
    .all-times-schedule__hours-carousel {
        margin-left: -14px;
        margin-right: -14px;
        padding-left: 14px;
        padding-right: 14px;
    }
    .all-times-schedule__row {
        grid-template-columns: minmax(0, 1fr) max-content 40px !important;
        gap: 8px;
        padding: 9px 0;
    }
    .all-times-schedule__action {
        width: 40px !important;
        min-width: 40px !important;
    }
}
