/* Layout: calendar — fixed departures inside the tour's "Dates & prices" tab.
   Month carousel (one month at a time) + calendar leaf rows. Container queries: it adapts to its box. */
.tdx {
    --_ink: var(--idx-title, #111418);
    --_text: var(--idx-text, #4B5563);
    --_muted: var(--idx-muted, #5A6878);
    --_line: var(--idx-border, #DCE4EC);
    --_soft: var(--idx-soft, #F3F7FB);
    --_dark: var(--idx-dark, #0B2A4A);
    --_blue: var(--idx-secondary, #02549A);
    --_blue-soft: var(--idx-secondary-soft, #E1EAF3);
    --_ok: var(--idx-success, #2F8F5B);
    --_btn: var(--turidesk-primary, var(--idx-secondary, #02549A));
    --_ease: cubic-bezier(.25, 1, .5, 1);
    --_chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
    container: tdx / inline-size;
    color: var(--_text);
    font-family: var(--idx-font-body, system-ui), system-ui, sans-serif;
    font-size: var(--idx-fs-3, .9375rem);
}
.tdx *, .tdx *::before, .tdx *::after { box-sizing: border-box; }
.tdx .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tdx__empty { margin: 0; padding: 16px; border: 1px solid var(--_line); border-radius: 6px; background: var(--_soft); }

/* How many and from how much */
.tdx-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin: 0 0 18px; }
.tdx-top p { margin: 0; color: var(--_text); font-size: var(--idx-fs-3, .9375rem); }
.tdx-top strong { color: var(--_ink); font-weight: 800; }
.tdx-top__count strong { font-size: var(--idx-fs-6, 1.25rem); font-variant-numeric: tabular-nums; }

/* Month carousel */
.tdx-car {
    --per: 5; --cgap: 10px;
    display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 6px;
    padding: 6px; border: 1px solid var(--_line); border-radius: 16px; background: #fff;
    box-shadow: 0 2px 8px rgba(11, 42, 74, .06);
}
.tdx-car__nav {
    display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0;
    border: 0; border-radius: 50%; background: var(--_soft); color: var(--_ink); cursor: pointer;
    transition: background-color .2s var(--_ease), color .2s var(--_ease), opacity .2s var(--_ease);
}
.tdx-car__nav::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--_chev) center / contain no-repeat; mask: var(--_chev) center / contain no-repeat; }
.tdx-car__nav--prev::before { transform: scaleX(-1); }
.tdx-car__nav:disabled { cursor: default; opacity: .35; }
.tdx-car__nav:focus-visible { outline: 2px solid var(--_blue); outline-offset: 2px; }
.tdx-car.is-fit .tdx-car__nav { visibility: hidden; }
.tdx-car__view { position: relative; display: flex; gap: var(--cgap); min-width: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.tdx-car__view::-webkit-scrollbar { display: none; }
.tdx-car__m {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 4px;
    flex: 0 0 calc((100% - (var(--per) - 1) * var(--cgap)) / var(--per)); min-width: 0; min-height: 64px; margin: 0; padding: 8px 4px;
    border: 0; border-radius: 12px; background: none; color: var(--_ink); cursor: pointer; scroll-snap-align: start;
    font-family: inherit; text-align: center;
    transition: background-color .2s var(--_ease), color .2s var(--_ease);
}
.tdx-car__m + .tdx-car__m::before { content: ""; position: absolute; left: calc(var(--cgap) / -2 - .5px); top: 22%; bottom: 22%; width: 1px; background: var(--_line); }
.tdx-car__m[aria-selected="true"]::before, .tdx-car__m[aria-selected="true"] + .tdx-car__m::before { opacity: 0; }
.tdx-car__name { font-size: var(--idx-fs-6, 1.25rem); font-weight: 800; line-height: 1; white-space: nowrap; }
.tdx-car__name small { color: var(--_blue); font-size: var(--idx-fs-0, .75rem); font-weight: 700; vertical-align: top; }
.tdx-car__n { color: var(--_muted); font-size: var(--idx-fs-1, .8125rem); font-weight: 500; white-space: nowrap; }
.tdx-car__short { display: none; }
.tdx-car__m[aria-selected="true"] { background: var(--_dark); color: #fff; }
.tdx-car__m[aria-selected="true"] .tdx-car__n { color: rgba(255, 255, 255, .75); }
.tdx-car__m[aria-selected="true"] .tdx-car__name small { color: var(--idx-accent-light, #8FD8F2); }
.tdx-car__m:focus-visible { outline: 2px solid var(--_blue); outline-offset: -2px; }
.tdx-car__dots { display: flex; justify-content: center; gap: 4px; margin: 6px 0 12px; }
.tdx-car__dots button { width: 20px; height: 20px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.tdx-car__dots button::before { content: ""; display: block; width: 8px; height: 8px; margin: auto; border-radius: 50%; background: var(--_line); transition: background-color .2s var(--_ease), transform .2s var(--_ease); }
.tdx-car__dots button.is-on::before { background: var(--_dark); transform: scale(1.15); }
@media (hover: hover) {
    .tdx-car__nav:not(:disabled):hover { background: var(--_dark); color: #fff; }
    .tdx-car__m:not([aria-selected="true"]):hover { background: var(--_soft); }
}

/* Rows: calendar leaf + route + spots + price + Book */
.tdx-list { list-style: none; margin: 0; padding: 0; }
.tdx-dep { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 16px; align-items: start; margin: 0; padding: 16px 0; border-bottom: 1px solid var(--_line); }
.tdx-dep::before { content: none; }
.tdx-leaf { display: grid; overflow: hidden; text-align: center; border: 1px solid var(--_line); border-radius: 8px; background: #fff; transition: border-color .2s var(--_ease); }
.tdx-leaf__m { padding: 3px 0; background: var(--_dark); color: #fff; font-size: var(--idx-fs-0, .75rem); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tdx-leaf__d { padding-top: 5px; color: var(--_ink); font-size: var(--idx-fs-9, 1.75rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tdx-leaf__w { padding: 2px 0 6px; color: var(--_muted); font-size: var(--idx-fs-0, .75rem); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
@media (hover: hover) { .tdx-dep:hover .tdx-leaf { border-color: var(--_dark); } }
.tdx-dep__opts { display: grid; min-width: 0; }
.tdx-opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "trip trip" "price book"; align-items: center; gap: 12px 16px; min-width: 0; }
.tdx-opt + .tdx-opt { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--_line); }
.tdx-opt__trip { grid-area: trip; display: grid; justify-items: start; gap: 8px; min-width: 0; }
.tdx-opt__route { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; color: var(--_ink); font-size: var(--idx-fs-4, 1rem); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tdx-opt__line { position: relative; display: flex; justify-content: center; flex: 1 1 auto; min-width: 56px; max-width: 180px; }
.tdx-opt__line::before { content: ""; position: absolute; inset: 50% 4px auto; border-top: 1px dashed color-mix(in srgb, var(--_blue) 55%, #fff); }
.tdx-opt__line::after { content: ""; position: absolute; top: calc(50% - 3px); right: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--_blue); }
.tdx-opt__line b { position: relative; padding: 2px 8px; border-radius: 999px; background: var(--_blue-soft); color: var(--_blue); font-size: var(--idx-fs-0, .75rem); font-weight: 700; }
.tdx-opt__spots { display: inline-flex; align-items: center; gap: 8px; color: var(--_ok); font-size: var(--idx-fs-1, .8125rem); font-weight: 700; }
.tdx-opt__spots--low { color: #9A5B00; }
.tdx-opt__spots--out { color: var(--_muted); }
.tdx-meter { display: inline-flex; gap: 2px; }
.tdx-meter i { width: 4px; height: 12px; border-radius: 1px; background: currentColor; }
.tdx-meter i.is-on { background: var(--_line); }
.tdx-opt__price { grid-area: price; color: var(--_ink); font-size: var(--idx-fs-6, 1.25rem); font-weight: 800; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tdx-opt__price del { color: var(--_muted); font-size: var(--idx-fs-1, .8125rem); font-weight: 500; }
.tdx-opt__price small { display: block; margin-top: 2px; color: var(--_muted); font-size: var(--idx-fs-0, .75rem); font-weight: 500; }
.tdx-opt .tdx-book { grid-area: book; justify-self: end; }
.tdx-book {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-width: 104px; min-height: 44px; padding: 10px 16px; margin: 0;
    border: 0; border-radius: 8px; background: var(--_btn); color: #fff;
    font-family: inherit; font-size: var(--idx-fs-2, .875rem); font-weight: 700; line-height: 1.2;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background-color .2s var(--_ease);
}
a.tdx-book::after { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--_chev) center / contain no-repeat; mask: var(--_chev) center / contain no-repeat; transition: transform .25s var(--_ease); }
.tdx-book:hover, .tdx-book:focus { color: #fff; }
.tdx-book:focus-visible { outline: 2px solid var(--_ink); outline-offset: 2px; }
.tdx-book:disabled { cursor: not-allowed; background: var(--_soft); color: var(--_muted); }
@media (hover: hover) {
    a.tdx-book:hover { background: var(--_dark); }
    a.tdx-book:hover::after { transform: translateX(3px); }
}

/* Rows come in when the month changes (content is visible without the animation) */
@keyframes tdx-in { from { opacity: 0; transform: translateY(8px); } }
.tdx-panel:not([hidden]) .tdx-dep { animation: tdx-in .45s var(--_ease) backwards; animation-delay: calc(var(--i, 0) * 30ms); }

/* Link to the departures page */
.tdx-all {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 20px; padding: 12px 12px 12px 16px;
    border: 1px solid var(--_line); border-radius: 10px;
    color: var(--_ink); font-size: var(--idx-fs-3, .9375rem); font-weight: 700; text-decoration: none;
    transition: border-color .2s var(--_ease);
}
.tdx-all__arrow { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--_blue-soft); color: var(--_blue); transition: transform .25s var(--_ease), background-color .2s var(--_ease), color .2s var(--_ease); }
.tdx-all__arrow::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--_chev) center / contain no-repeat; mask: var(--_chev) center / contain no-repeat; }
.tdx-all:hover, .tdx-all:focus { color: var(--_ink); }
.tdx-all:focus-visible { outline: 2px solid var(--_blue); outline-offset: 2px; }
@media (hover: hover) {
    .tdx-all:hover { border-color: var(--_dark); }
    .tdx-all:hover .tdx-all__arrow { transform: translateX(3px); background: var(--_blue); color: #fff; }
}

/* Narrow box (phones): 3 months per page, short count, rows in two lines */
@container tdx (max-width: 599px) {
    .tdx-car { --per: 3; --cgap: 8px; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 4px; padding: 4px; }
    .tdx-car__nav { width: 36px; height: 36px; }
    .tdx-car__long { display: none; }
    .tdx-car__short { display: inline; }
    .tdx-car__n { font-size: var(--idx-fs-0, .75rem); }
    .tdx-car__name small { display: block; margin-top: 2px; text-align: center; }
}
@container tdx (min-width: 600px) {
    .tdx-dep { grid-template-columns: 64px minmax(0, 1fr); gap: 20px; }
    .tdx-opt { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "trip price book"; gap: 20px; }
    .tdx-opt__price { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
    .tdx *, .tdx *::before, .tdx *::after { transition: none !important; }
    .tdx-panel:not([hidden]) .tdx-dep { animation: none; }
}
