/**
 * Dates et prix d'une fiche circuit.
 *
 * Les mois en cartes qui défilent, puis les départs du mois : un tableau dont
 * chaque ligne est une carte blanche. Sous 860 px, chaque départ devient une
 * carte à part entière.
 */

/* --- Mois ------------------------------------------------------------------ */

.tc-trip-months {
  position: relative;
  margin-bottom: 26px;
}

.tc-trip-months__track {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 4px 2px 6px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.tc-trip-months__track::-webkit-scrollbar {
  display: none;
}

.tc-trip-months__track li {
  flex: none;
  scroll-snap-align: start;
}

.tc-trip-months__item {
  display: grid;
  align-content: space-between;
  gap: 1px;
  min-width: 158px;
  height: 100%;
  padding: 14px 18px 12px;
  border: 1px solid var(--tc-border);
  border-radius: 14px;
  background: var(--tc-surface);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tc-trip-months__item:hover {
  border-color: var(--tc-ink-soft);
}

.tc-trip-months__name {
  margin-bottom: 8px;
  font-size: var(--tc-fs-sm);
  font-weight: 700;
  color: var(--tc-ink);
}

.tc-trip-months__name::first-letter {
  text-transform: uppercase;
}

.tc-trip-months__from {
  font-size: var(--tc-fs-2xs);
  color: var(--tc-ink-soft);
}

.tc-trip-months__item strong {
  font-family: var(--tc-serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--tc-accent);
}

/* Le mois choisi reste clair : liseré or sable et ombre légère. */
.tc-trip-months__item.is-active {
  border-color: var(--tc-primary);
  box-shadow: 0 0 0 1.5px var(--tc-primary), 0 6px 16px rgba(0, 0, 0, .08);
}

.tc-trip-months__item.is-active .tc-trip-months__name {
  color: var(--tc-primary-strong);
}

.tc-trip-months__arrow {
  position: absolute;
  top: 50%;
  left: -18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--tc-border);
  border-radius: 50%;
  background: var(--tc-surface);
  color: var(--tc-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  transform: translateY(-50%);
  cursor: pointer;
}

.tc-trip-months__arrow--next {
  left: auto;
  right: -18px;
}

.tc-trip-months__arrow--next svg {
  transform: scaleX(-1);
}

.tc-trip-months__arrow:disabled {
  opacity: .35;
  cursor: default;
}

/* --- Départs --------------------------------------------------------------- */

.tc-trip-dates__panel[hidden] {
  display: none;
}

.tc-trip-dates__panel + .tc-trip-dates__panel {
  margin-top: 24px;
}

.tc-trip-fares {
  width: 100%;
  margin-top: -10px;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.tc-trip-fares th {
  padding: 6px 16px 2px;
  font-size: var(--tc-fs-2xs);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: left;
  vertical-align: bottom;
  color: var(--tc-ink-soft);
}

.tc-trip-fares th:last-child {
  position: relative;
  text-align: right;
}

.tc-trip-fares td {
  padding: 16px;
  border-block: 1px solid var(--tc-border);
  background: var(--tc-surface);
  vertical-align: middle;
  font-size: 15px;
  transition: border-color 160ms ease;
}

.tc-trip-fares td:first-child {
  border-left: 1px solid var(--tc-border);
  border-radius: 14px 0 0 14px;
}

.tc-trip-fares td:last-child {
  border-right: 1px solid var(--tc-border);
  border-radius: 0 14px 14px 0;
  text-align: right;
}

.tc-trip-fares tbody tr:hover td {
  border-color: var(--tc-primary);
}

.tc-trip-fares__dates { width: 30%; }
.tc-trip-fares__prices { width: 30%; }
.tc-trip-fares__state { width: 18%; }

.tc-trip-fares__period {
  display: block;
  font-size: var(--tc-fs-md);
  font-weight: 700;
  color: var(--tc-ink);
}

.tc-trip-fares__detail {
  display: block;
  margin-top: 3px;
  font-size: var(--tc-fs-xs);
  color: var(--tc-ink-soft);
}

/* Le prix, empilé : l'adulte en grand, puis chaque autre tranche avec ses âges. */
.tc-trip-fares__price {
  display: block;
  font-size: var(--tc-fs-xs);
  line-height: 1.5;
  white-space: nowrap;
  color: var(--tc-ink-soft);
  font-variant-numeric: tabular-nums;
}

.tc-trip-fares__price--main {
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 600;
  color: var(--tc-ink);
}

.tc-trip-fares__price--main strong {
  margin-left: 4px;
  font-family: var(--tc-serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--tc-accent);
}

.tc-trip-fares__tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: var(--tc-radius-pill);
  background: var(--tc-action);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tc-on-action);
}

/* L'état en pilule. */
.tc-trip-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--tc-radius-pill);
  background: var(--tc-surface-soft);
  font-size: var(--tc-fs-xs);
  font-weight: 600;
  white-space: nowrap;
  color: var(--tc-ink-soft);
}

.tc-trip-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
}

.tc-trip-state--garanti {
  background: var(--tc-positive-soft);
  color: var(--tc-positive);
}

.tc-trip-state--garanti::before {
  background: var(--tc-success);
  opacity: 1;
}

.tc-trip-state--dernieres {
  background: var(--tc-warning-soft);
  color: var(--tc-warning);
}

.tc-trip-state--complet {
  background: var(--tc-muted-soft);
  color: var(--tc-ink-soft);
}

/* --- Réactif --------------------------------------------------------------- */

@media (max-width: 860px) {
  /* Une carte par départ : les dates, le prix empilé, puis l'état et le
     bouton côte à côte. L'en-tête du tableau se retire. */
  .tc-trip-fares thead {
    display: none;
  }

  .tc-trip-fares,
  .tc-trip-fares tbody {
    display: block;
  }

  .tc-trip-fares {
    margin-top: 0;
    border-spacing: 0;
  }

  .tc-trip-fares tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid var(--tc-border);
    border-radius: 14px;
    background: var(--tc-surface);
  }

  .tc-trip-fares td,
  .tc-trip-fares td:first-child,
  .tc-trip-fares td:last-child {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    text-align: left;
  }

  .tc-trip-fares__dates,
  .tc-trip-fares__prices {
    grid-column: 1 / -1;
  }

  .tc-trip-fares__price {
    white-space: normal;
  }

  .tc-trip-fares td.tc-trip-fares__action {
    text-align: right;
  }
}

@media (max-width: 560px) {
  .tc-trip-months__arrow {
    display: none;
  }
}

@media (max-width: 400px) {
  /* Trop étroit pour l'état et le bouton côte à côte. */
  .tc-trip-fares tbody tr {
    grid-template-columns: minmax(0, 1fr);
  }

  .tc-trip-fares td.tc-trip-fares__action {
    text-align: left;
  }

  .tc-trip-fares__action .tc-trip-button {
    width: 100%;
  }
}
