.ltb-ben {
    padding: 88px 0 120px;
    background: #fff;
}

.ltb-page--travel .ltb-ben__heading {
    color: var(--ltb-anthracite);
}

.ltb-ben__sub {
    font-weight: 500;
}

.ltb-ben__tabs-wrap {
    display: flex;
    justify-content: center;
    margin-top: 64px;
}

/* sticky under the menu (--ltb-tabs-top, set in section-benefits.php) while the panels are on screen */
.ltb-ben__tabs-wrap {
    position: sticky;
    top: var(--ltb-tabs-top, 16px);
    z-index: 5;
    transition: top .3s ease-in-out;
}

.ltb-anim .ltb-ben__tabs-wrap[data-ltb-reveal] {
    transition:
        opacity .8s cubic-bezier(.22, .61, .36, 1) var(--ltb-delay, 0ms),
        transform 1s cubic-bezier(.16, 1, .3, 1) var(--ltb-delay, 0ms),
        top .3s ease-in-out;
}

.ltb-ben__tabs-wrap.is-stuck .ltb-ben__tabs {
    box-shadow: 0 6px 24px -6px rgba(17, 17, 17, .22);
}

/* desktop: the full-width band lets clicks through to the content under it */
@media (min-width: 1024px) {
    .ltb-ben__tabs-wrap {
        pointer-events: none;
    }

    .ltb-ben__tabs {
        pointer-events: auto;
    }
}

/* tab states: inactive / hover (dark pill, green label) / active (dark pill) / active dimmed while another tab is hovered */
.ltb-ben__tabs {
    --ltb-tab-ease: cubic-bezier(.33, 1, .68, 1);
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    height: 56px;
    border-radius: 40px;
    background: var(--ltb-regular-beige);
    transition: box-shadow .25s ease;
}

.ltb-ben__tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    display: none;
    width: var(--ltb-pill-w, 0);
    height: 56px;
    border-radius: 40px;
    background: var(--ltb-anthracite);
    transform: translateX(var(--ltb-pill-x, 0));
}

.ltb-ben__tabs.has-pill::before {
    display: block;
}

.ltb-ben__tab {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    margin: 0;
    padding: 0 28px 0 32px;
    border: 0;
    border-radius: 40px;
    background: transparent;
    color: var(--ltb-ash);
    font-family: Nunito, sans-serif;
    cursor: pointer;
    transition:
        padding .45s var(--ltb-tab-ease),
        gap .45s var(--ltb-tab-ease),
        background-color .3s ease,
        color .15s ease;
}

/* the last tab mirrors the padding: its icon keeps 32px to the end of the track */
.ltb-ben__tab:last-child:not(.is-active) {
    padding: 0 32px 0 28px;
}

.ltb-ben__tab:focus-visible {
    outline: 2px solid var(--ltb-green);
    outline-offset: 2px;
}

.ltb-ben__tab-label {
    font-size: 14px;
    font-weight: 900;
    line-height: normal;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ltb-ben__tab-arrow {
    position: relative;
    display: block;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    transition: color .15s ease;
}

.ltb-ben__tab-glyph {
    position: absolute;
    inset: 0;
    display: block;
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity .15s ease;
}

.ltb-ben__tab-glyph--next {
    opacity: 1;
}

.ltb-ben__tab.is-active {
    gap: 16px;
    padding: 0 18px 0 32px;
    color: #fff;
    cursor: default;
}

.ltb-ben__tabs:not(.has-pill) .ltb-ben__tab.is-active {
    background: var(--ltb-anthracite);
}

.ltb-ben__tab.is-active .ltb-ben__tab-arrow {
    color: var(--ltb-green);
}

.ltb-ben__tab.is-active .ltb-ben__tab-glyph--next {
    opacity: 0;
}

.ltb-ben__tab.is-active .ltb-ben__tab-glyph--open {
    opacity: 1;
}

/* a label the sliding pill is coming to changes once the pill is mostly there; one it leaves changes at once */
.ltb-ben__tabs.has-pill .ltb-ben__tab.is-active,
.ltb-ben__tabs.has-pill .ltb-ben__tab.is-active .ltb-ben__tab-arrow,
.ltb-ben__tabs.has-pill .ltb-ben__tab.is-active .ltb-ben__tab-glyph {
    transition-delay: .12s;
}

@media (hover: hover) and (pointer: fine) {
    .ltb-ben__tabs.has-pill .ltb-ben__tab:not(.is-active):hover,
    .ltb-ben__tabs.has-pill .ltb-ben__tab:not(.is-active):hover .ltb-ben__tab-arrow,
    .ltb-ben__tabs.has-pill .ltb-ben__tab:not(.is-active):hover .ltb-ben__tab-glyph {
        transition-delay: .1s;
    }

    .ltb-ben__tabs.has-pill:has(.ltb-ben__tab:not(.is-active):hover) .ltb-ben__tab.is-active,
    .ltb-ben__tabs.has-pill:has(.ltb-ben__tab:not(.is-active):hover) .ltb-ben__tab.is-active .ltb-ben__tab-arrow,
    .ltb-ben__tabs.has-pill:has(.ltb-ben__tab:not(.is-active):hover) .ltb-ben__tab.is-active .ltb-ben__tab-glyph {
        transition-delay: 0s;
    }

    /* with JS the pill slides under the hovered tab; the tab's own background is the no-JS fallback */
    .ltb-ben__tab:not(.is-active):hover {
        gap: 16px;
        padding: 0 18px 0 32px;
        color: var(--ltb-green);
    }

    .ltb-ben__tabs:not(.has-pill) .ltb-ben__tab:not(.is-active):hover {
        background: var(--ltb-anthracite);
    }

    .ltb-ben__tab:not(.is-active):hover .ltb-ben__tab-glyph--next {
        opacity: 0;
    }

    .ltb-ben__tab:not(.is-active):hover .ltb-ben__tab-glyph--hover {
        opacity: 1;
    }

    .ltb-ben__tabs:has(.ltb-ben__tab:not(.is-active):hover) .ltb-ben__tab.is-active {
        background: transparent;
        color: var(--ltb-carbon);
    }

    .ltb-ben__tabs:has(.ltb-ben__tab:not(.is-active):hover) .ltb-ben__tab.is-active .ltb-ben__tab-arrow {
        color: var(--ltb-green-muted);
    }
}

/* one cell for all panels; minmax keeps a wide slider track from stretching it past the screen */
.ltb-ben__panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.ltb-ben__panel {
    display: flex;
    grid-area: 1 / 1;
    align-items: flex-start;
    gap: 72px;
    margin-top: 88px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
}

.ltb-ben__panel.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity .45s ease .1s, visibility 0s;
}

/* the section takes the height of the open tab only; a closing panel fades out over it */
.ltb-ben__panel:not(.is-active) {
    max-height: 0;
}

.ltb-ben__side {
    display: flex;
    flex: 0 0 479px;
    flex-direction: column;
    width: 479px;
}

.ltb-ben__label-icon {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: var(--ltb-soft-grey);
}

.ltb-ben__title {
    margin: 16px 24px 0 0;
    color: #000;
    font-size: 42px;
    font-weight: 800;
    line-height: 48px;
}

.ltb-ben__accent {
    display: block;
    width: 64px;
    height: 4px;
    margin: 32px 0 0;
    border-radius: 2px;
    background: var(--ltb-green);
}

.ltb-ben__tagline {
    max-width: 400px;
    margin: 24px 24px 0 0;
    color: var(--ltb-anthracite);
    font-size: 20px;
    font-weight: 500;
    line-height: 30px;
}

/* the photo fills what the intro leaves of the 634px column */
.ltb-ben__photo {
    width: 479px;
    margin: 24px 0 0;
    overflow: hidden;
    border-radius: 24px;
    aspect-ratio: var(--ltb-photo-ratio, 479 / 368);
}

.ltb-ben__panel--destination .ltb-ben__photo {
    aspect-ratio: 479 / 414;
}

/* v2: the safe-tab photo frame is narrower than the column */
@media (min-width: 1024px) {
    .ltb-page--shopping-v2 .ltb-ben__panel--safe .ltb-ben__photo {
        width: 440px;
    }

    /* Finance: the pay-simply and stay-in-control photo frames are narrower too */
    .ltb-page--finance .ltb-ben__panel--simply .ltb-ben__photo,
    .ltb-page--finance .ltb-ben__panel--control .ltb-ben__photo {
        width: 440px;
    }
}

.ltb-ben__photo-img {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0;
}

/* margin 0: Swiper's auto side margins would shrink a flex item to its content */
.ltb-ben__slider {
    flex: 1 1 0;
    min-width: 0;
    min-height: 634px;
    margin: 0;
}

/* 2 × 2: each card spans the number, rule, headline, description and label tracks of
   its row, so the descriptions of a row start together under the taller headline and
   the labels sit on the row's bottom line. The 293px spacers set each row's minimum
   height; only the label track takes the slack, and as 0fr it keeps its own size
   (1fr tracks would all grow to the largest one, so a short row would stretch a long one). */
.ltb-ben .ltb-ben__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, auto) minmax(auto, 0fr) 48px repeat(4, auto) minmax(auto, 0fr);
    align-content: start;
    column-gap: 64px;
}

.ltb-ben .ltb-ben__cards::before {
    content: '';
    grid-row: 1 / span 5;
    grid-column: 1;
    height: 293px;
}

.ltb-ben .ltb-ben__cards:has(> :nth-child(3))::after {
    content: '';
    grid-row: 7 / span 5;
    grid-column: 1;
    height: 293px;
}

.ltb-ben__card {
    display: grid;
    grid-row: 1 / span 5;
    grid-template-rows: subgrid;
    align-items: start;
}

.ltb-ben__card:nth-child(odd) {
    grid-column: 1;
}

.ltb-ben__card:nth-child(even) {
    grid-column: 2;
}

.ltb-ben__card:nth-child(n+3) {
    grid-row: 7 / span 5;
}

.ltb-ben__card .ltb-card__label {
    align-self: end;
    justify-self: start;
}

@media (min-width: 1024px) {
    /* the panel is at least 674 tall (634 grid + 40 of air), then 160 to the section end */
    .ltb-ben {
        padding-bottom: 160px;
    }

    .ltb-ben__panel {
        min-height: 674px;
    }

    /* Finance: the panel 104 under the tabs, at least 634 tall, then 120 to the section end */
    .ltb-page--finance .ltb-ben {
        padding-bottom: 120px;
    }

    .ltb-page--finance .ltb-ben__panel {
        min-height: 634px;
        margin-top: 104px;
    }

    /* Finance's benefit cards are 278.5 tall */
    .ltb-page--finance .ltb-ben .ltb-ben__cards::before,
    .ltb-page--finance .ltb-ben .ltb-ben__cards:has(> :nth-child(3))::after {
        height: 278.5px;
    }

    .ltb-ben__card .ltb-card__main,
    .ltb-ben__card .ltb-card__body {
        display: contents;
    }

    .ltb-ben__card .ltb-card__rule {
        margin-top: 2px;
    }

    .ltb-ben__card .ltb-card__title {
        padding-top: 11px;
    }

    /* large panel heads (section.header at the H2 size): 48/56, the accent 24 under it and
       the tagline trimmed across the whole column */
    .ltb-ben--large .ltb-ben__title {
        font-size: 48px;
        line-height: 56px;
    }

    .ltb-ben--large .ltb-ben__accent {
        margin-top: 24px;
    }

    .ltb-ben--large .ltb-ben__tagline {
        max-width: none;
        color: var(--ltb-jet);
    }

    @supports (text-box: trim-both cap alphabetic) {
        .ltb-ben--large .ltb-ben__tagline {
            text-box: trim-both cap alphabetic;
        }
    }
}

@media (max-width: 1279px) {
    .ltb-ben__card .ltb-card__label {
        flex-wrap: wrap;
        max-width: 100%;
        white-space: normal;
        box-sizing: border-box;
    }
}

/* Travel's "UP TO …" labels are longer: below 1440px they wrap inside the card */
@media (max-width: 1439px) {
    .ltb-page--travel .ltb-ben__card .ltb-card__label {
        flex-wrap: wrap;
        max-width: 100%;
        white-space: normal;
        box-sizing: border-box;
    }
}

@media (max-width: 1199px) {
    .ltb-ben__panel {
        gap: 40px;
    }

    .ltb-ben__side {
        flex-basis: 380px;
        width: 380px;
    }

    .ltb-ben__title {
        font-size: 40px;
        line-height: 48px;
    }

    .ltb-ben__photo {
        width: 380px;
    }

    .ltb-ben .ltb-ben__cards {
        column-gap: 40px;
    }
}

@media (max-width: 1023px) {
    .ltb-ben {
        padding: 56px 0 40px;
    }

    .ltb-ben .ltb-container {
        padding: 0;
    }

    .ltb-ben__head {
        padding: 0 20px;
    }

    /* the strip is wider than the screen: it scrolls and keeps the open tab centred */
    .ltb-ben__tabs-wrap {
        justify-content: safe center;
        height: 78px;
        margin-top: 56px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .ltb-ben__tabs-wrap::-webkit-scrollbar {
        display: none;
    }

    .ltb-ben__panel {
        flex-direction: column;
        align-items: stretch;
        /* the design's photo overhangs its 532px column by 13px, so the cards sit 11px under it */
        gap: 11px;
        margin-top: 40px;
    }

    /* 396px column: 22px gutters on a 440 phone, centred on wider screens */
    .ltb-ben__side {
        flex: none;
        width: min(396px, 100% - 44px);
        margin: 0 auto;
    }

    /* the intro is centred over the photo */
    .ltb-ben__intro {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .ltb-ben__intro .ltb-overline {
        justify-content: center;
    }

    .ltb-ben__title {
        margin: 0;
        font-size: 28px;
        line-height: 33px;
        text-box: normal;
    }

    .ltb-ben__accent {
        width: 40px;
        height: 2px;
        margin-top: 16px;
        border-radius: 1px;
    }

    .ltb-ben__tagline {
        margin: 16px 0 0;
        font-size: 18px;
        line-height: 26px;
    }

    /* the Figma frame is 396 × 398: narrower phones scale it down instead of cropping */
    .ltb-ben__photo,
    .ltb-ben__panel--destination .ltb-ben__photo {
        width: auto;
        height: auto;
        margin: 0;
        aspect-ratio: 396 / 398;
    }

    .ltb-ben__photo-img {
        object-position: 50% 50%;
    }

    /* only the airport photo has a mobile crop; the others show their whole render, about as large as it */
    .ltb-ben__panel--before .ltb-ben__photo-img,
    .ltb-ben__panel--destination .ltb-ben__photo-img {
        object-fit: contain;
    }

    /* first card under the centred panel column (43px on a 440 phone), same gutter on the right */
    .ltb-ben__slider {
        flex: none;
        min-height: 0;
        padding: 0 max(43px, 50% - 177px);
        box-sizing: border-box;
    }

    /* slides stretch to the tallest card, so every label sits on one line */
    .ltb-ben .ltb-ben__cards {
        display: flex;
        gap: 0;
    }

    .ltb-ben .ltb-ben__cards::before,
    .ltb-ben .ltb-ben__cards:has(> :nth-child(3))::after {
        content: none;
    }

    .ltb-ben__card {
        display: flex;
        flex-direction: column;
        width: min(320px, 100vw - 86px);
    }

    .ltb-ben__card .ltb-card__main {
        flex: 1 0 auto;
    }

    /* one line on a 320px card as in Figma; narrower cards let the caption wrap */
    .ltb-ben__card .ltb-card__label {
        align-self: flex-start;
        flex-wrap: wrap;
        max-width: 100%;
        white-space: normal;
        box-sizing: border-box;
    }

    .ltb-ben .ltb-nav {
        margin-top: 40px;
    }
}
