/* CONTAINER */
#main-search-container {
    z-index: 1001;
    position: relative;
    margin: 50px 0;
}

#main-search {
  max-width: 1400px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  padding: 15px;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* TOP: trip selector */
.trip-type {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.trip-type label input {
  display: none;
}

.trip-type label span {
  padding: 6px 14px;
  border-radius: 20px;
  background: #e5e7eb;
  cursor: pointer;
  font-size: 13px;
  transition: 0.2s;
}

.trip-type label input:checked + span {
  background: #6366f1;
  color: white;
}

/* MAIN LINE */
.trip-fields {
  display: flex;
  gap: 3px;
  align-items: flex-start;
}

.multi-stops-form .trip-fields {
    gap: 30px;
}

.route-fields {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
  flex: 1;
}

/* INPUT STYLE */
.editable, input, select {
  border: none;
  outline: none;
  background: #f3f4f6;
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  transition: 0.2s;
}

.editable:focus, input:focus, select:focus {
  background: #e0e7ff;
}

.origin-block {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap; /* empêche le passage à la ligne */
  position: relative;
}

.location-field {
  flex: 1;
}

/* SWITCH BUTTON */
.btn-switch {
  border: none;
  background: #6366f1;
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: 0.2s;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: -18px;
  z-index: 1;
  bottom: 0;
}

.btn-switch svg {
  vertical-align: text-bottom;
}

.btn-switch label {
    display: none;
}

.btn-switch:hover {
  transform: rotate(180deg);
}

.everywhere-block, .direct-only-block {
  margin: 5px;
}

/* DATES BLOCK */
.secondary-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.multi-stops-form .secondary-fields {
  flex: 0 0 40%;
  flex-direction: column;
  gap: 10px;
}

.date-field {
  flex: 1;
  position: relative;
}

/* SMALL TIME SELECT */
.from-hour-block {
	margin: 5px;
}

.from-hour-block select {
	font-size: 12px;
    padding: 1px 3px;
    background: #f5f4f4;
    text-align: center;
    color: #6b7280;
}

.from-hour-block label {
	text-align: center;
}

/* BUDGET */
#budget {
  width: 90px;
}

.multi-stops-form #budget {
    width: 100%;
}

#currency-symbol {
	position: absolute;
    top: 0;
    font-weight: 700;
    right: 0.5rem;
    line-height: 18px;
    padding: 10px 0;
}

/* REMOVE NUMBER INPUT ARROWS */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

/* BOTTOM ROW */
.main-search-form > div:last-child {
    display: flex;
    align-items: center;
    vertical-align: middle;
}

/* CENTER */
#passengers-control {
  margin-left: auto;
  position: relative;
}

/* RIGHT */
.submit-button-container {
  margin-left: auto;
}

/* BUTTON MODERNE */
button[type="submit"], .passengers-button {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}

button[type="submit"]:hover, .passengers-button:hover {
  color: white;
}

button:hover {
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #3f42c5, #4d0bcd);
    transition: 0.1s;
}

/* CHECKBOX MODERNE */
input[type="checkbox"] {
  accent-color: #6366f1;
}

/* LABELS CLEAN */
label {
  font-size: 11px;
  color: #6b7280;
}

#main-search.disabled *, #main-search button:disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.origin-block, .destination-block {
    flex: 1;
}

div.editable, input.datepicker, #budget {
    margin: 0 !important;
    line-height: 18px;
    padding-right: 1rem;
    padding-left: 1rem;
    white-space: nowrap;
    word-wrap: break-word;
    overflow: hidden;
    align-content: center;
}

#main-search.disabled .submit-button-container button, .submit-button-container button:disabled, #main-search.disabled .passengers-button {
    background-color: #dddde5;
    background-image: none;
    color: #b2b2bf;
    box-shadow: none;
    cursor: not-allowed;
}

.passengers-button, .submit-button {
	text-transform: none;
    letter-spacing: normal;
}

.submit-button-container button span {
    vertical-align: middle;
}





.stops-block {
	display:none;
    margin: 10px 0;
    width: 100%;
}

.stop-block, .add-stop-button-container {
    width: 100%;
    padding: 0 40px;
    position: relative;
	margin-top: 10px;
}

.multi-stops-form .stops-block {
	display:block;
}
.stop-frontend {
	height: 40px !important;
    padding-top: 8px !important;
}

.multi-stops-form .route-fields {
	flex-direction: column;
	position: relative;
}

.multi-stops-form .origin-block, .multi-stops-form .destination-block {
	width: 100%;
}

.multi-stops-form .btn-switch, .multi-stops-form .direct-only-block, .multi-stops-form .return-block, .multi-stops-form .DirectOnly {
	display: none;
}

.add-stop-button {
    padding: 2px 12px;
    border-radius: 25px;
}

.add-stop-button:not(:disabled):hover:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
    color: black !important;
    border: 2px solid rgb(142 131 251 / 84%);
}

.add-stop-button:disabled {
	display: none;
}

.multi-stops-form .route-fields:before {
    content: "";
    width: 1px;
    height: calc(100% - 4em);
    margin-top: 2em;
    position: absolute;
    border-left: 2px dashed #d0c0ff;
    left: 8px;
}

.multi-stops-form .stop-frontend:after, .add-stop-button-container button:after {
	content: "";
    width: calc(40px - 8px);
    height: 1px;
    top: 50%;
    position: absolute;
    border-bottom: 2px dashed #d0c0ff;
    left: 8px;
}

.multi-stops-form .route-fields label {
    padding-left: 15px !important;
}

.multi-stops-form .trip-fields {
	margin-bottom: 30px;
}













/* Hide Arrows From Input Number BUDGET on home page */
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

input[type=number] {
    -moz-appearance:textfield; /* Firefox */
}





.outward-return-choice-title {
	text-align: center;
    display: none;
}







#progress-bar {
	display: none;
    position: relative;
}

/* barre de fond */
.progress-track {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

/* progression */
.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 0.4s ease;
    background: linear-gradient(
        90deg,
        #6366f1 0%,
        #818cf8 50%,
        #6366f1 100%
    );
    background-size: 200% 100%;
    animation: progress-shimmer 2s infinite linear;
}

@keyframes progress-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* texte */
.progress-text {
    font-size: 12px;
    font-weight: 500;
    color: #4f46e5;
    margin-top: 6px;
    text-align: right;
}























/* Pour afficher le placeholder quand le div editable est vide */
div.editable:empty:before {
    content: attr(data-placeholder);
    cursor: text;
}

.return-block.disabled #return-date-button {
    color: #b2b2bf;
}

.return-block.disabled .from-hour-block {
	opacity: .7;
}

#main-search input[type=checkbox] {
    transform: scale(1.3);
    margin: 0 5px 0 20px;
	vertical-align: middle;
}

#main-search label {
	padding: 0;
    cursor: pointer;
    margin-top: 0;
}





/* Conteneur principal : colonne résultats + sidebar */
#search-results-container {
	display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-top: 30px;
}

/* Colonne principale (h3 + résultats) */
.search-results-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Sidebar à droite */
#search-results-sidebar {
	display: none;
    width: 250px;
    min-width: 250px;
    background: #fff;
    position: relative;
    flex-shrink: 0;
    flex-direction: column;
    gap: 20px;
}

#search-results-sidebar > * {
	border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

/* Responsive mobile */
@media (max-width: 768px) {
    #search-results-container {
        flex-direction: column;
    }

    .search-results-sidebar {
        width: 100%;
        min-width: auto;
        position: static;
    }
}


#search-results-sidebar #map {
	height: unset !important;
    aspect-ratio: 1 / 1;
}

.search-results-main #map {
	margin-bottom: 20px;
}

.result-settled {
    animation: none !important;
}


.trip-details-line-container {
    max-width: 50%;
    flex: 0 1 50%;
    text-align: center;
}

.trip-details-destination {
  display: flex;
  flex: 0 0 25%;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin: auto;
  padding-left: 15px;
}

.trip-details-station-name {
  color: #68697f;
  cursor: help;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.trip-details {
    display: flex;
    flex-flow: row wrap;
    flex: 1 1 75%;
    text-align: center;
    margin-bottom: .5rem;
}

.nb-stops-icon {
	margin-right: 5px;
}

.trip-details-line {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90%;
  height: .125rem;
  margin: .375rem auto;
  border-radius: .375rem;
  background-color: #68697f;
  line-height: 0;
  overflow: visible;
}

.trip-details-stops {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1; /* au-dessus de la ligne mais sous le train */
}

/* icône du train */
.train-icon {
  position: absolute;
  width: 30px;
  height: auto;
  z-index: 3;
    background: white;
}

/* aller → train à droite */
.train-icon--right {
    right: -20px;
}

/* retour → train à gauche */
.train-icon--left {
    left: -20px;
    transform: scaleX(-1);
    transform-origin: center;
}

.trip-details-origin {
  display: flex;
  flex: 0 0 25%;
  min-width: 0;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  margin: auto;
}




.trip-details-separator {
    margin-top: .375rem;
    margin-bottom: .175rem;
    width: 100%;
    height: .0625rem;
    box-shadow: inset 0 1px 0 0 #dddde5;
}

.trip-details-stop-dot {
    position: relative;
    display: inline-block;
    width: .375rem;
    height: .375rem;
    margin: 0 8%;
    border-radius: .375rem;
    background-color: #d1435b;
    background-image: none;
    line-height: 0;
    box-shadow: 0 0 0 .125rem #fff;
    cursor: help;
    zoom: 1;
}

.trip-details-stop-dot::before {
    content: attr(data-stop);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    padding: 10px 8px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 10;
}

.trip-details-stop-dot::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 10;
}

.trip-details-stop-dot:hover::before,
.trip-details-stop-dot:hover::after {
    opacity: 1;
}


.trip-via {
	font-size: 0.8rem;
    margin-left: 0.5rem;
    color: #68697f;
    fill: #68697f;
}



.stops-label {
    font-size: .75rem;
    line-height: 1rem;
    font-weight: 400;
}

.trip-time {
    font-size: 1.3rem;
}

.trip-duration {
    font-size: 0.9rem;
}

.trip-duration-icon {
    vertical-align: middle;
    margin-bottom: 3px;
}


.popup-content {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    color: #111236;
    text-decoration: none;
    box-shadow: 0 1px 3px 0 rgb(37 32 31 / 30%);
    border-radius: .375rem;
    z-index: 0;
}





.trip-container {
	margin: 5px 0;
	animation: append-animate .15s ease-in;
	background: white;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex: none;
    color: #161616;
    text-decoration: none;
    box-shadow: 0 1px 3px 0 rgba(37,32,31,.3);
    cursor: pointer;
    border-radius: 0.75rem;
}

.trip-container:hover {
	box-shadow: 0px 3px 12px 0px rgba(0, 0, 0, 0.5);
}

.trip-prices {
    display: flex;
    padding: 1rem 0;
    justify-content: center;
    align-items: center;
    min-width: 30%;
    border-radius: 0 0.75rem 0.75rem 0;
    box-shadow: inset 0.0625rem 0 0 #c2c9cd;
    flex: 0 0 32%;
}

.trip-price-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    margin: -10px 10px -10px;
    border-radius: 10px;
    padding: 10px 0 20px;
}

.trip-price-column:hover {
    background: #f4f6ff;
}

.trip-price-class {
    font-size: 0.8rem;
    font-weight: 600;
}

.trip-price-from {
    font-size: 0.65rem;
    font-weight: 500;
}

.trip-price-value-wrapper {
    margin-top: 10px;
}

.trip-price-value {
    font-size: 1.3rem;
    font-weight: 600;
}

.trip-price-separator {
    height: stretch;
    width: 1px;
    background-color: #ddd;
}

.trip-details-container {
    padding: 1rem;
    flex: 2 1 auto;
    border-radius: 0.75rem 0 0 0.75rem;
    display: flex;
    height: 100%;
    flex-direction: column;
}



/* ===========================
   AUTOCOMPLETE — PREDICTIONS
   =========================== */

/* WRAPPER : gère l'arrondi, l'ombre, la bordure, et le masquage */
.autocomplete-wrapper {
    display: none;
    width: 380px;
    max-width: 90vw;
    z-index: 3;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    position: absolute;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(17, 17, 17, 0.12), 0 2px 8px rgba(17, 17, 17, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: autocomplete-pop 0.15s ease-out;
}

.autocomplete-wrapper.active {
    display: block;
}

@keyframes autocomplete-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* LISTE : c'est elle qui scrolle, sans aucun border-radius */
.autocomplete-result {
    max-height: 340px;
    overflow-y: auto;
    cursor: pointer;
    list-style-type: none;
    padding: 6px;
    margin: 0;
}

/* Scrollbar custom (Chrome / Edge / Safari) */
.autocomplete-result::-webkit-scrollbar {
    width: 6px;
}
.autocomplete-result::-webkit-scrollbar-thumb {
    background: #d8d8f0;
    border-radius: 10px;
}
.autocomplete-result::-webkit-scrollbar-track {
    background: transparent;
}

/* ITEM */
li.prediction {
    position: relative;
    padding: 8px 10px 8px 55px;
    border-radius: 10px;
    line-height: 1.3;
    transition: background 0.15s ease, transform 0.15s ease;
}

li.prediction:not(:last-child) {
    margin-bottom: 2px;
}

li.prediction:hover,
li.prediction.active-highlight {
    background-color: #eef0fe;
    transform: translateX(2px);
}

/* Pastille icône */
li.prediction:before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: 17px 17px;
    background-repeat: no-repeat;
    background-position: center;
}

li.prediction.meta:before {
    background-color: #ede9fe;
    background-image: var(--background-url-city-icon);
}

li.prediction.classic:before {
    background-color: #e0e7ff;
    background-image: var(--background-url-station-icon);
}

/* Texte : nom puis pays, empilés */
li.prediction .name {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    color: #1f2333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

li.prediction .country {
    display: block;
    margin-top: 1px;
    font-style: normal;
    font-size: 0.76rem;
    color: #9594b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* État "aucun résultat" */
li.prediction.not-found {
    padding-left: 10px;
    color: #9594b8;
    font-size: 0.85rem;
    cursor: default;
}
li.prediction.not-found:hover {
    background-color: transparent;
    transform: none;
}
li.prediction.not-found:before {
    display: none;
}
/* État "aucune gare trouvée" */
li.prediction.not-found {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 14px;
    cursor: default;
}

li.prediction.not-found:hover {
    background-color: transparent;
    transform: none;
}

li.prediction.not-found:before {
    display: none;
}

.not-found-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f4f4fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.not-found-text {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4b4a63;
}

.not-found-sub {
    display: block;
    margin-top: 2px;
    font-weight: 400;
    font-size: 0.78rem;
    color: #9594b8;
}




#main-search .alert, #main-search .error {
	left: 50%;
    transform: translateX(-50%);
}


/*pour que les results de autocomplete ne descende pas plus bas que le footer sinon ils sont masqués*/
section.content-area {
  min-height: 1000px;
}







/* Offers choices */
.offers-choices, .seat-toggle {
    justify-content: center;
    display: flex;
    margin-bottom: 15px;
}

.offers-type, .seat-type-toggle-group {
	flex-flow: wrap;
    display: flex;
    justify-content: center;
    width: 100%;
}

.offers-choices input, .seat-toggle input {
    position: absolute;
    opacity: 0;
}
.offers-choices label, .seat-toggle label {
	box-shadow: 0 2px 10px rgba(0,0,0,.1);
    display: flex;
    align-self: center;
    flex-direction: column;
  cursor: pointer;
  padding: 0.7rem 1.8rem;
  position: relative;
  border: solid 1px #b4b4b4;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.15s ease-out, color 0.25s ease-out, background-color 0.15s ease-out, box-shadow 0.15s ease-out;
  margin: 0;
}
.offers-choices label:first-of-type {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}
.offers-choices label:last-of-type {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}
.offers-choices input:hover + label, .seat-toggle input:hover + label {
  border-color: #c4c4c4;
  background-color: #dbeeff;
}
.offers-choices input:checked + label, .seat-toggle input:checked + label {
  background-color: #4b9dea;
  color: #fff;
  box-shadow: 0 0 10px rgba(102, 179, 251, 0.5);
  border-color: #4b9dea;
}

.seat-toggle label {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
}
.seat-toggle .seat-type-option:first-of-type label {
  border-top-left-radius: 35px;
  border-bottom-left-radius: 35px;
}
.seat-toggle .seat-type-option:last-of-type label {
  border-top-right-radius: 35px;
  border-bottom-right-radius: 35px;
}
/* Hover */
.seat-toggle input:hover + label {
  border-color: #c7b5f7;
  background-color: #ede2ff;
}

/* Checked */
.seat-toggle input:checked + label {
  background-color: #9b6ef3;
  color: #fff;
  box-shadow: 0 0 10px rgba(155, 110, 243, 0.5);
  border-color: #9b6ef3;
}

.offer-tab-panels {
    margin-top: 40px;
}

.offers-wrapper:not(.first-class) .first-seat-toggle,
.offers-wrapper:not(.first-class) .offers-first {
    display: none;
}

.offers-wrapper.first-class .second-seat-toggle,
.offers-wrapper.first-class .offers-second {
    display: none;
}




@keyframes append-animate {
	from {
		transform: translateX(-10%);
		opacity: 0;
	}
	to {
		transform: translateX(0%);
		opacity: 1;
	}
}





.trip-timeline {
	border-radius: 8px;
    padding: 20px 0;
    width: 310px;
    height: fit-content;
    margin-top: 40px;
    font-family: "Open Sans", sans-serif;
    background: #bea2e7;
    /* Old browsers */  background: -moz-linear-gradient(top, #bea2e7 0%, #86b7e7 100%);
    /* FF3.6-15 */  background: -webkit-linear-gradient(top, #bea2e7 0%, #86b7e7 100%);
    /* Chrome10-25,Safari5.1-6 */  background: linear-gradient(to bottom, #bea2e7 0%, #86b7e7 100%);
    /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#bea2e7", endColorstr="#86b7e7",GradientType=0 );  /* IE6-9 */
}

.trip-timeline ul {
	height: 100%;
	margin: 0;
    list-style: none;
    position: relative;
    padding: 1px 80px;
    color: #fff;
    font-size: 13px;
}

.trip-timeline ul:before {
	content: "";
    width: 1px;
    height: calc(100% - 4em);
    margin-top: 2em;
    position: absolute;
    border-left: 2px dashed #fff;
    left: 55px;
}
.trip-timeline ul li {
	position: relative;
    width: 200px;
}
.trip-timeline ul li:not(:first-child) {
	margin-top: 60px;
}
.trip-timeline ul li:last-child {
	margin-bottom: 1em;
}
.trip-timeline ul li:last-child {
	margin-bottom: 1em;
}
.trip-timeline ul li div {
	text-align: left;
}
.trip-timeline ul li > div.station {
	font-size: 14px;
    font-weight: bold;
    margin: 15px 0 15px 0;
}
.trip-timeline ul li > div.infos {
	background-color: rgba(255, 255, 255, 0.2);
    padding: 14px;
    border-radius: 6px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.08);
}
.trip-timeline ul li > span.number {
	font-size: 15px;
    width: 2px;
    height: calc(100% - 15px);
	background: #fff;
    left: -25px;
    top: 5px;
    position: absolute;
}
.trip-timeline ul li > span.number:before, .trip-timeline ul li > span.number:after {
	content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    position: absolute;
    background: #86b7e7;
    left: -5px;
    top: 0;
}
.trip-timeline ul li span.number:after {
	top: calc(100% - 6px);
}
.trip-timeline div .title, .trip-timeline div .type {
	font-weight: 600;
    font-size: 12px;
}
.trip-timeline div .info {
	font-weight: 300;
}
.trip-timeline span.number {
	height: 100%;
}
.trip-timeline span.number span {
	position: absolute;
    font-size: 11px;
    left: -40px;
    font-weight: bold;
    text-align: right;
}
.trip-timeline span.number span:first-child {
	top: -3px;
}
.trip-timeline span.number span:last-child {
	top: calc(100% - 10px);
}
    
    
    
    
.offers-tabs {
	position: relative;
    flex:auto; text-align: center;
    width: 100%;
}

.offers-tabs > label, .toggle {
	height:2.2rem;
    border-radius:100px;
}

.offers-tabs > label {
	width:350px;
    background-color:rgba(0,0,0,.1);
    position:relative;
    margin:0 auto 1.2rem;
    cursor:pointer;
}

.offers-tabs .toggle {
	position:absolute;
    width:50%;
    background-color:#fff;
    box-shadow:0 2px 10px rgba(0,0,0,.3);
    transition:transform .3s cubic-bezier(0.25,0.46,0.45,0.94) !important;
}



.names {
	height: 100%;
    font-size:90%;
    font-weight:bolder;
    width:65%;
    margin-left:17.5%;
    position:absolute;
    display:flex;
    justify-content:space-between;
    user-select:none;
}

.names p { margin: auto 0; font-weight: 600;}

.first { opacity:.5; }

.class-switch { display:none; }

.class-switch:checked + .offers-tabs .toggle { transform:translateX(100%); } 

.class-switch:checked + .offers-tabs .first { opacity:1; }

.class-switch:checked + .offers-tabs .second { opacity:.5; }

.offers-first {display:none;}

.class-switch:checked + .offers-tabs .offers-first {display:flex;}

.class-switch:checked + .offers-tabs .offers-second {display:none;}

.offer-tab-panel {display:none;text-align: left;position:relative;margin-top: 50px;width: 100%;}

.offer-tab-panel h4 {
	font-style: italic;
    margin-bottom: 15px;
}

.offer-tab-panel > div {
    margin-bottom: 40px;
}



.seat-reservation-choice .btn2 {
    width: 50%;
    font-weight: 400;
    font-size: 15px;
    border: 2px solid #1a1a1a;
    padding: 10px 20px;
    position: relative;
    text-align: center;
    transition: background 600ms ease, color 600ms ease !important;
}

.seat-reservation-choice label:first-of-type {
	border-right:0;
}

.seat-reservation-choice input[type=radio] + label {
	text-transform: none;
    cursor: pointer;
    min-width: 60px;
}
.seat-reservation-choice input[type=radio] + label:hover {
	background: none;color: #1a1a1a;
}
.seat-reservation-choice input[type=radio]:checked + label:after {
	background: #1a1a1a;
    content: "";
    height: 100%;
    position: absolute;
    top: 0;
    transition: left 200ms cubic-bezier(0.77, 0, 0.175, 1);
    width: 100%;
    z-index: -1;
}
.seat-reservation-choice input[type=radio]:checked + label {
	cursor: default;
    color: #fff;
    transition: color 200ms;
}
.seat-reservation-choice input[type=radio]:checked + label:after {
	left: 0;
}
.seat-reservation-choice input[type=radio] {
	position:absolute;
    top: 7px;
    left: 7px;
}
.seat-reservation-choice input[type=radio]:last-of-type {
    left: calc(50% + 7px);
}

.seat-reservation-choice .ribbon {
    width: auto;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    position: absolute;
    right: 5px;
    top: 40px;
    text-align: center;
    border-radius: 25px;
    transform: rotate(15deg);
    background-color: #e5950b;
    color: white;
}

.seat-reservation-choice .ribbon.individual-price::after {
	content: "\f110";
    font: normal 15px / 1 dashicons;
    vertical-align: text-top;
}









.reservation {
	width: 100%;
}


.seat-reservation-table {
	width: 96%;
    margin-top: 10px;
    margin-left: 2%;
    border-collapse: separate;
    border-spacing: 0 2px;
}

.seat-reservation-table tbody tr, .seat-reservation-table tbody tr:hover {
	background-color: #cdffc0;
}

.seat-reservation-table tr.optional, .seat-reservation-table tr.optional:hover {
	background-color: #f1f1f1;
}
.seat-reservation-table tr.not-reserved, .seat-reservation-table tr.not-reserved:hover {
	background-color: #fde7cb;
}
.seat-reservation-table tr.reserved, .seat-reservation-table tr.reserved:hover {
	background-color: #cdffc0;
}

.seat-reservation-table tr td:first-of-type {
	padding-left: 10px;
	min-width: 120px;
  border-radius: 3px 0 0 3px;
  width: 70%;
}

.seat-reservation-table tr td:not(:first-of-type) {
    text-align: center;
	min-width: 120px;
}

.seat-reservation-table td:last-child {
  border-radius: 0 3px 3px 0;
  width: 20%;
}

.seat-reservation-table td, .wp-block-table table tbody td {
    border: none;
    white-space: nowrap;
}



input.condition-checkbox {
  display: none;
}

label.condition-label {
    cursor: pointer;
    width: 100%;
    padding: 5px 10px;
    margin-bottom: 0;
    margin-top: 5px;
    border-radius: 3px;
    background: #fbe4af;
}

label.condition-label span {
    color: #000;
    font-weight: 600;
}

.condition-content {
  display: grid; 
  grid-template-rows: 0fr;
  transition: 250ms grid-template-rows ease !important;
  overflow: hidden;
  width: 95%;
    margin: auto;
    background: #e4eaf3;
    padding: 0 20px;
    border-radius: 0 0 3px 3px;
}

.condition-content > div {
    overflow: hidden;
}

.condition-content span {
	display: block;
    margin: 5px 0;
	font-size: 15px;
}

input.condition-checkbox:checked + .condition-content {
  grid-template-rows: 1fr;
  padding: 5px 20px 10px;
}

.condition-label .passengers-number {
    font-style: italic;
    color: #8b8b8b;
    font-size: 14px;
    margin-left: 10px;
}
.condition-label .passengers-number:before {
	content: "\f110";
    font: normal 17px / 1 dashicons;
    vertical-align: text-top;
}

.condition-label .price {
    float: right;
}

label.condition-label:hover {
    background: #a38f57;
}

label.condition-label:hover span {
    color: #FFF;
}

.condition-group ul { margin: 0; padding-left: 1.2em; }
.condition-group p { margin: 0; padding-left: 1.2em; } /* même retrait, sans puce */




.group-offers-station-link:hover {
    background-color: #454356;
}

.group-offers-station-link:hover div {
    color: white;
}

.group-offers-station-link {
    padding: 10px;
    font-size: 20px;
    font-weight: 600;
    background-color: #e6e4ff;
    color: #000000 !important;
    border-radius: 7px;
    margin-top: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.group-offers-station-link .station-name-distance {
	display: flex;
    flex-direction: column;
    margin: auto;
}

.group-offers-station-link .station-distance {
	font-size: 12px;
    font-weight: 400;
    align-self: center;
    line-height: .4;
}
.group-offers-station-link .station-duration, .group-offers-station-link .station-transfers {
	display: flex;
    padding: 0;
    align-items: center;
    box-shadow: inset 0.0625rem 0 0 #c2c9cd;
    flex: 0 0 20%;
    margin: 0;
    flex-direction: column;
}
.group-offers-station-link .station-duration span:first-of-type, .group-offers-station-link .station-transfers span:first-of-type {
	display: block;
    font-size: 0.8rem;
    font-weight: 600;
}
.group-offers-station-link .station-duration span:last-of-type, .group-offers-station-link .station-transfers span:last-of-type {
	text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
}
.group-offers-station-link .station-price {
	display: flex;
    padding: 0;
    align-items: center;
    box-shadow: inset 0.0625rem 0 0 #c2c9cd;
    flex: 0 0 20%;
    margin: 0;
    flex-direction: column;
}
.group-offers-station-link .station-price span:first-of-type {
	display: block;
    font-size: 0.8rem;
    font-weight: 600;
}
.group-offers-station-link .station-price span:last-of-type {
	text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
}

.results-page header {
    display: none;
}




.offers-wrapper {
    display: flex;
    margin-bottom: 20px;
}
.offer-flexibility, .offer-seat {
    font-size: 12px;
    font-style: italic;
    letter-spacing: -0.2px;
    display: block;
}
.offer-footer {
    display: flex;
    flex-direction: column;
    align-items: end;
}
.total-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;

    padding: 8px 25px;
    border-radius: 14px 14px 0 0;

    background: var(--surface-1, #f4f4f6);
    border: 0.5px solid rgba(99, 102, 241, 0.25);
    color: inherit;
    width: fit-content;
    margin: auto;
}

.total-block > span:first-child {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6366f1;
    opacity: 0.8;
}

.total-block .total {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #4f46e5;
}

.total-block .total strong {
    font-weight: inherit;
}


.price-divider {
    height: 100%;
    width: 0.0625rem;
    box-shadow: inset 0 0 0 1px #dddde5;
}

.price-block {
    align-items: center;
    flex: 1;
    margin-top: -25px;
    display: flex;
    flex-direction: column;
}

.price-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
}

.price-label {
    display: block;
    line-height: 0.6;
    font-size: 0.65rem;
    font-weight: 500;
}

.price-amount {
    margin-top: 10px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
}






.remove-stop-button {
	border: 0;
    outline: none;
    background-color: transparent;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 0;
    width: 40px;
    padding: 0;
    text-align: center;
}

.remove-stop-button svg {
	transition: fill-opacity .2s ease-in-out;
    fill: #f18989;
}

.remove-stop-button:focus svg,.remove-stop-button:hover svg {
	fill-opacity:.5
}

.remove-stop-button:disabled svg {
	fill-opacity:.4
}

.remove-stop-button:hover {
	transform: none;
    box-shadow: none;
    background: none;
}    
    
.MulticityControls_MulticityControls__add-leg-icon__NTM5M {
	fill:#0770e3
}









/* POPUP CONTAINER */
#popup-passengers {
    opacity: 0;
    transform: translateX(-100%) scale(0.95);
    visibility: hidden;
    transition: all 0.25s ease;
    
    position: absolute;
    top: -60px;
    width: auto;
    max-height: 280px;
    overflow: hidden;

    padding: 10px;
    border-radius: 10px;

    background: rgba(255,255,255);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);

    border: 1px solid rgba(0,0,0,0.1);
    z-index: 10;
    
    overflow: visible;
}

/* OPEN STATE */
#passengers-control.clicked #popup-passengers,
#passengers-control.hover #popup-passengers,
#popup-passengers:hover {
    opacity: 1;
    transform: translateX(calc(-100% + 10px)) scale(1);
    visibility: visible;
}

/* ARROW */
#popup-passengers:before {
	background-color: white;
    border: 0;
    border-right: 1px solid rgba(0,0,0,0.12);
    border-bottom: 1px solid rgba(0,0,0,0.12);
    content: "";
    height: 20px;
    position: absolute;
    top: 75px;
    transform: rotate(-45deg);
    width: 20px;
    z-index: 0;
    right: -10px;
    display: block !important;
}

/* SCROLL AREA */
.passengers-block {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 5px;
    position: relative;
}

/* SCROLLBAR CLEAN */
.passengers-block::-webkit-scrollbar {
    width: 6px;
}
.passengers-block::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 10px;
}

/* PASSENGER CARD */
.passenger {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    box-shadow: 0 4px 7px rgba(99, 102, 241, 0.25);
    transition: 0.1s;
}


/* HEADER */
.passenger > div:first-child {
    display: flex;
    gap: 25px;
    align-items: center;
    justify-content: space-between;
}

/* TITLE */
.passenger p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* SELECT */
.passenger select {
    border-radius: 15px;
    padding: 4px 8px;
    font-size: 13px;
    background: #f3f4f6;
    color: #111;
    border: none;
}

/* REMOVE BUTTON */
.remove-card-container {
	margin-left: 15px;
}

.remove-passenger-button, .remove-card-button {
	border: 0;
    outline: none;
    background-color: transparent;
    cursor: pointer;
    position: relative;
    padding: 0;
    text-align: center;
}

.remove-passenger-button svg, .remove-card-button svg {
	transition: fill-opacity .2s ease-in-out;
    fill: #f18989;
}

.remove-passenger-button:focus, .remove-passenger-button:hover svg, .remove-card-button:focus, .remove-card-button:hover svg {
	fill-opacity:.5
}

.remove-passenger-button:disabled svg {
	fill-opacity:.4
}

.remove-passenger-button:hover, .remove-card-button:hover {
	transform: none;
    box-shadow: none;
    background: none;
}

/* ADD CARD BUTTON */
.add-passenger-card-button {
    align-self: center;
    border: none;
    border-radius: 20px;

    padding: 6px 14px;
    font-size: 12px;

    background: rgba(255,255,255,0.2);
    color: white;

    cursor: pointer;
    transition: 0.2s;
}

.add-passenger-card-button:hover {
    color: white;
    background: rgba(255,255,255,0.35);
}

/* CARD BLOCK */
.passenger-card {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 5px 10px;

    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    color: #111;

    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
    align-items: center;
}

/* CARD SELECT */
.passenger-card select {
    border-radius: 15px;
    padding: 5px;
    font-size: 13px;
}

/* INPUT CARD NUMBER */
.card-number {
    border-radius: 8px;
    padding: 5px;
    font-size: 13px;
    border: 1px solid #ddd;
    grid-column: 1 / -1;
}

/* REMOVE CARD BUTTON */
.remove-card-button {
    opacity: 0.5;
    transition: 0.2s;
}

.remove-card-button:hover {
    opacity: 1;
}

/* ADD PASSENGER BUTTON */
.add-passenger-button {
    margin-top: 10px;

    background: linear-gradient(135deg, #8385ff, #6661b3);
    color: white;

    border: none;
    border-radius: 14px;

    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
    transition: 0.2s;
}

.add-passenger-button:hover {
    color: white;
}




/* Filters */
.sidebar-section {
    margin-bottom: 20px;
}

.filter-label {
	display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #8d8d8f;
}

.filter-label:before, .filter-label:after {
    content: '';
    flex: 1;
    height: 1px;
    background: #c7c7c7;
}

.price-range-slider, #duration-filter {
    position: relative;
    height: 60px; /* espace pour les bulles */
    margin-top: 10px;
    transition: opacity 0.3s ease;
}

.price-range-slider.disabled, #duration-filter.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Bulles */
.price-bubble {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    background: #0062e3;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1.2;
    z-index: 5;
    cursor: pointer;
}

/* Petite flèche sous la bulle */
.price-bubble::after {
    content: "";
    position: absolute;
    left: calc(50% + var(--arrow-offset, 0px));
    top: 100%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #0062e3;
}

/* Barre de fond */
.price-range-track, .price-range-fill, .duration-track, .duration-fill {
    position: absolute;
    top: 42px;
    height: 4px;
    border-radius: 999px;
}

.price-range-track, .duration-track {
    left: 0;
    right: 0;
    background: #d1d5db;
}

/* Partie sélectionnée */
.price-range-fill, .duration-fill {
    background: #0062e3;
}

/* Inputs superposés */
.price-range-slider input[type="range"], #duration-filter input[type="range"] {
    position: absolute;
    top: 30px;
    left: 0;
    width: 100%;
    height: 24px;
    margin: 0;
    padding: 0;
    background: none;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
}

/* Poignées */
.price-range-slider input[type="range"]::-webkit-slider-thumb, #duration-filter input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0062e3;
    border: 2px solid #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.price-range-slider input[type="range"]::-moz-range-thumb, #duration-filter input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0062e3;
    border: 2px solid #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}



:root {
    --slider-thumb-size: 18px;
}

/* ===========================
   TRANSFERS FILTER
   =========================== */

.transfers-slider-container {
    position: relative;
    padding-top: 30px;
}

/* Slider */

#max-transfers {
    width: 100%;
    margin: 0;
	padding: 0;

    appearance: none;
    -webkit-appearance: none;

    height: 4px;
    border-radius: 999px;

	background: linear-gradient(to right, #0062e3 0%, #0062e3 100%, #d1d5db 100%, #d1d5db 100%);
}

/* Thumb */

#max-transfers::-webkit-slider-thumb {
    -webkit-appearance: none;

    width: var(--slider-thumb-size);
    height: var(--slider-thumb-size);

    border-radius: 50%;
    background: #0062e3;
    border: 2px solid #fff;

    cursor: pointer;

    margin-top: calc(
        (4px - var(--slider-thumb-size)) / 2
    );

    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

#max-transfers::-moz-range-thumb {
    width: var(--slider-thumb-size);
    height: var(--slider-thumb-size);

    border-radius: 50%;
    background: #0062e3;
    border: 2px solid #fff;

    cursor: pointer;

    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* ===========================
   BUBBLE
   =========================== */

#transfers-bubble {
    position: absolute;
    top: 0;

    transform: translateX(-50%);
	left: calc(100% - (var(--slider-thumb-size) / 2));
    
    background: #0062e3;
    color: #fff;

    font-size: 12px;
    font-weight: 600;

    padding: 2px 8px;

    border-radius: 6px;

    white-space: nowrap;

    cursor: pointer;
    z-index: 5;
}

#transfers-bubble::after {
    content: "";

    position: absolute;

    left: 50%;
    top: 100%;

    transform: translateX(-50%);

    width: 0;
    height: 0;

    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #0062e3;
}

/* ===========================
   LABELS
   =========================== */

.transfers-labels {
    position: relative;

    height: 20px;

    margin-top: 10px;

    /* même zone utile que le slider */
    padding-left: calc(var(--slider-thumb-size) / 2);
    padding-right: calc(var(--slider-thumb-size) / 2);

    user-select: none;
}

.transfers-labels span {
    position: absolute;

    transform: translateX(-50%);

    font-size: 12px;
    font-weight: 500;

    color: #6b7280;

    white-space: nowrap;
}

/* Positions exactes des 5 paliers */

.transfers-labels span:nth-child(1) {
    left: calc(var(--slider-thumb-size) / 2);
}

.transfers-labels span:nth-child(2) {
    left: 25%;
}

.transfers-labels span:nth-child(3) {
    left: 50%;
}

.transfers-labels span:nth-child(4) {
    left: 75%;
}

.transfers-labels span:nth-child(5) {
    left: calc(100% - (var(--slider-thumb-size) / 2));
}











#sort-container {
    display: none;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

#sort-container > span {
	font-size: 13px;
}

.sort-bar {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 0.5px solid var(--color-border-tertiary, rgba(0,0,0,0.1));
    position: relative;
    width: fit-content;
}

.sort-bar.visible {
    display: flex;
}

.sort-btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    border-radius: 999px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s;
    user-select: none;
	text-transform: none;
    font-size: 12px;
    padding: 3px 7px;
}

.sort-btn:hover:not(.active) {
    background: #f3f4f6;
    color: #111 !important;
    transform: none;
    box-shadow: none;
}

.sort-btn.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
					 
}

.sort-btn.active:hover {
    transform: none;
    box-shadow: none;
}

.sort-btn .sort-icon {
    font-size: 11px;
    opacity: .8;
}

.sort-btn .sort-direction {
    font-size: 10px;
    width: 10px;
    text-align: center;
    opacity: .3;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-block;
}

.sort-btn:hover:not(.active) .sort-direction {
    opacity: .55;
}

.sort-btn.active .sort-direction {
    opacity: .9;
				
}

.sort-btn[data-dir="desc"] .sort-direction {
    transform: rotate(180deg);
						  
}







/* Mobile */
@media (max-width: 768px) {
  .trip-fields {
    flex-direction: column;
  }
  
  .route-fields {
    flex-direction: column;
    width: 100%;
  }

  .origin-block {
    flex-wrap: wrap;
  }

  .origin-block, .destination-block, .date-field, .date-field .DateInput_DateInput--docked__MWRjN, #budget-block, #budget {
    width: 100%;
  }
  
  .btn-switch {
    transform: rotate(90deg);
    top: 100%;
    right: 0;
  }

    .btn-switch:hover {
        transform: rotate(270deg);
    }
}

/* Tablette */
@media (max-width: 1024px) { }

/* Desktop */
@media (min-width: 1025px) { }

/* Grand écran */
@media (min-width: 1440px) { }








/* ================================
   LAYOUT DESKTOP (défaut)
   ================================ */

#search-results-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Bouton caché sur desktop */
#filters-toggle-btn {
    display: none;
}

/* filters-block toujours visible sur desktop */
#filters-block {
	overflow: visible;
    display: block;
}

#sort-and-filters-container {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ================================
   LAYOUT MOBILE
   ================================ */

@media (max-width: 1024px) {

    #search-results-container {
        flex-direction: column;
    	gap: 0;
    }
    
    #sort-container > span {
    	display: none;
    }

    #search-results-sidebar {
        width: 100%;
    }

    /* Bouton visible sur mobile */
    body:not(.home) #filters-toggle-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        width: fit-content;
        background: rgba(255,255,255,0.85);
        backdrop-filter: blur(12px);
        border: 1px solid rgba(0,0,0,0.1);
        border-radius: 999px;
        padding: 6px 14px;
        font-size: 13px;
        font-weight: 500;
        color: #374151;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,0.07);
        transition: none;
    }

    body:not(.home) #filters-toggle-btn:hover {
        transform: none;
    }
    
    body:not(.home) #filters-toggle-btn:not(.open):hover {
    	background: rgb(243, 244, 246);
        color: #374151;
    }

	body:not(.home) #filters-toggle-btn.open {
        background: linear-gradient(135deg, rgb(99, 102, 241), rgb(79, 70, 229));
        color: white;
    }
    
    #filters-toggle-btn .chevron {
        transition: transform 0.3s ease;
        margin-left: 4px;
    }

    #filters-toggle-btn.open .chevron {
        transform: rotate(180deg);
    }

    /* filters-block : fermé par défaut sur mobile */
    #filters-block {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        padding: 0 20px;
        background: rgba(255,255,255,0.95);
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.09);
        margin-top: 4px;
        margin-bottom: 10px;
        width: 100%;

        /* fermeture : rapide */
        transition: max-height 0.25s ease-in,
                    opacity 0.2s ease-in,
                    padding 0.25s ease;
    }
    
    #filters-block h4 {
        display: none;
    }

    /* #filters-block : ouvert */
    #filters-block.open {
    	overflow: visible;
        max-height: 1000px;
        opacity: 1;
        padding: 20px;

        /* ouverture : plus douce */
        transition: max-height 0.4s ease-out,
                    opacity 0.3s ease-out,
                    padding 0.3s ease;
    }
}







/* ================================================
   CORRECTIFS MOBILE — trip-container & formulaire
   ================================================ */

@media (max-width: 600px) {

  /* --- Carte de résultat : passe en colonne --- */
  .trip-container {
    flex-direction: column;
  }

  /* --- Zone prix : pleine largeur, barre à gauche → bordure en haut --- */
  .trip-prices {
    flex: unset;
    min-width: unset;
    width: 100%;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: inset 0 0.0625rem 0 #c2c9cd; /* trait en haut */
    padding: 0.75rem 0;
  }

  /* Colonne prix : remonte l'effet négatif margin-top qui décale les prix */
  .trip-price-column {
    margin: -5px 10px;
  }
  
  .trip-price-value-wrapper {
    margin-top: 0;
  }

  /* --- Zone détails : coins haut arrondis seulement --- */
  .trip-details-container {
    border-radius: 0.75rem 0.75rem 0 0;
    height: auto;
  }

  /* --- Heure : légèrement plus petite --- */
  .trip-time {
    font-size: 1.1rem;
  }

  /* --- Nom de gare : autorise le retour à la ligne plutôt que d'écraser --- */
  .trip-details-station-name {
    white-space: normal;
    font-size: 0.7rem;
    line-height: 1.2;
  }

  /* --- Via : évite le débordement --- */
  .trip-via {
    font-size: 0.72rem;
    word-break: break-word;
  }

}




/* ================================================
   POPUP DE RÉSERVATION (.popup-content) — MOBILE
   ================================================ */

@media (max-width: 600px) {

  /* --- Overlay : plein écran, scrollable --- */
  .popup-overlay.active {
    padding: 0;
    align-items: flex-end; /* effet "bottom sheet" */
  }

  /* --- Carte popup : occupe tout l'écran, coins arrondis seulement en haut --- */
  .popup-content {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: 92vh;
    max-height: 92vh;
    margin: 0;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: popup-slide-up 0.25s ease-out;
  }

  @keyframes popup-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* --- Petite poignée visuelle en haut (style "drag handle") --- */
  .popup-content:before {
    content: "";
    position: sticky;
    top: 0;
    display: block;
    width: 40px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 4px;
    background: #d8d8e2;
    z-index: 3;
  }

  .popup-content form.reservation {
    padding: 0 16px 24px;
  }

  /* --- En-tête : date + ligne de train --- */
  .popup-content form.reservation > div:first-child {
    margin-bottom: 12px !important;
  }

  .popup-content form.reservation > div:first-child > div {
    flex-direction: column !important;
    align-items: center;
    gap: 8px;
  }

  .popup-content .calendar {
    transform: scale(0.85);
  }

  .popup-content .trip-details {
    width: 100%;
  }

  /* --- Timeline : passe en pleine largeur, padding réduit --- */
  .popup-content > form > div[style*="display:flex"]:has(.trip-timeline) {
    display: block !important;
  }

  .trip-timeline {
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
    box-sizing: border-box;
    padding: 16px 0;
  }

  .trip-timeline ul {
    padding: 1px 56px 1px 70px;
  }

  .trip-timeline ul:before {
    left: 45px;
  }

  .trip-timeline ul li {
    width: 100%;
  }

  .trip-timeline ul li:not(:first-child) {
    margin-top: 44px;
  }

  .trip-timeline span.number span {
    left: -32px;
    font-size: 10px;
  }

  /* --- Bloc des offres : pleine largeur, sans marge négative --- */
  .popup-content .offers-block {
    margin-left: 0 !important;
    width: 100% !important;
    margin-top: 20px;
    box-sizing: border-box;
  }

  .offers-tabs > label {
    width: 100%;
    max-width: 320px;
  }

  /* --- Footer (total + bouton réserver) : reste visible en bas --- */
  .offer-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 24px -16px -24px;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  }

  .offer-footer .SubmitButtonContainer button {
    width: 100%;
    min-width: 0;
  }

  /* --- Tableau de réservation des sièges : scroll horizontal propre --- */
  .seat-reservation-table {
    display: block;
    width: 100%;
    margin: 10px 0 0;
    overflow-x: auto;
    white-space: nowrap;
  }
}