.how-it-works {
    background-color: #f1eae1;
}

.how-it-works__inner {
    max-width: var(--container-width-wide);
    margin-inline: auto;
    padding-inline: clamp(var(--space-3), 4vw, 3.75rem);
    padding-block: clamp(var(--space-5), 6vw, 3.5rem);
}

.how-it-works__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: clamp(var(--space-4), 4vw, 2.5rem);
}

.how-it-works__heading {
    margin: 0;
    color: var(--color-grey-1);
    font-size: 64px;
}

.how-it-works__nav {
    display: flex;
    flex-shrink: 0;
    gap: var(--space-2);
}

.how-it-works__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius);
    background-color: var(--color-beige-2);
    color: var(--color-text);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.how-it-works__arrow:hover,
.how-it-works__arrow:focus-visible {
    background-color: var(--color-beige-1);
}

.how-it-works__arrow.swiper-button-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.how-it-works__arrow.swiper-button-disabled:hover {
    background-color: var(--color-beige-2);
}

.how-it-works__arrow svg {
    display: block;
    width: 18px;
    height: 18px;
}

/*
 * Swiper's own bundled CSS sets `.swiper { overflow: hidden; }` — needed for
 * clipping off-screen slides horizontally, but it also clips each visible
 * slide's own `box-shadow` flush against the container edge (worst at the
 * ≥900px breakpoint below, where `slidesPerView: 1` leaves zero side buffer
 * at all). Fixing this on the `.swiper` element itself doesn't work cleanly:
 * giving IT padding would also feed into Swiper's own width/slide-size
 * calculations (it measures its own `clientWidth`, which includes padding),
 * throwing off slide positioning. Instead, `.how-it-works__track-clip` (a
 * plain wrapper with no Swiper involvement) does the actual clipping+padding
 * shadow-room trick, while `.how-it-works__track.swiper` is explicitly reset
 * to `overflow: visible` and left otherwise unpadded — Swiper only ever
 * measures ITS OWN box, which now simply IS the already-buffered inner
 * width, no offset options or math needed.
 */
.how-it-works__track-clip {
    overflow: hidden;
    /* No horizontal offsets at mobile widths. slidesPerView is fractional here,
     * so anything that widened this wrapper put a sliced card in the container's
     * gutter; the row now cuts on the gutter line like every other section. The
     * ≥900 rule further down restores the horizontal shadow room, where
     * slidesPerView is 1 and there is no partial card to expose. */
    /* Vertical shadow room belongs here too — clipping happens on this
     * wrapper, not on `.swiper` (which is `overflow: visible` below), so
     * padding on the swiper itself wouldn't have anything left to clip. */
    margin-block: -16px;
    padding-block: 16px;
}

.how-it-works__track.swiper {
    overflow: visible;
}

.how-it-works__card.swiper-slide {
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: clamp(var(--space-4), 4vw, 2.5rem);
    padding: clamp(var(--space-4), 4vw, 2.5rem);
    border-radius: 12px;
    background-color: #F9F3EA;
    border: 1px solid #fae0c0;
    box-shadow: 0px 3px 10px 0px #464a3a3d;
}

.how-it-works__content {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    text-align: left;
}

.how-it-works__text {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.how-it-works__step {
    display: inline-flex;
    align-self: flex-start;
    padding-block: 0.25rem;
    padding-inline: var(--space-3);
    border: 1px solid var(--color-grey-4);
    border-radius: 6px;
    color: var(--color-grey-2);
    font-family: var(--font-family-base);
    font-size: 16px;
}

.how-it-works__card-heading {
    margin: 0;
    color: var(--color-grey-1);
    font-size: 40px;
}

.how-it-works__card-description {
    color: var(--color-grey-1);
    font-family: var(--font-family-base);
    font-size: 18px;
    line-height: 26px;
}

.how-it-works__card-description p {
    margin: 0;
}

.how-it-works__image {
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
}

.how-it-works__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 899px) {
    .how-it-works__inner {
    }

    .how-it-works__header {
        flex-direction: column;
    }

    .how-it-works__heading {
        font-size: 40px;
    }

    .how-it-works__nav {
    }

    .how-it-works__arrow {
    }

    .how-it-works__track.swiper {
    }

    .how-it-works__card.swiper-slide {
        gap:var(--space-6);
        /* Swiper's own bundled CSS sets .swiper-slide { height: 100% } —
           inside .how-it-works__track-wrapper (an auto-height flex
           container, sized by its tallest card), a percentage height like
           that has nothing definite to resolve against. Browsers don't
           treat that the same as an actual `auto` value for align-items:
           stretch purposes, so each card was sizing to its own content
           instead of stretching to match the tallest one — six real cards on
           staging measured 488-537px depending on copy length. Overriding
           back to auto makes the cross-size genuinely auto again, which is
           what the wrapper's default stretch (align-items: normal computes
           to stretch) actually needs to equalize them. */
        height: auto;
    }

    .how-it-works__content {
    }

    .how-it-works__text {
    }

    .how-it-works__step {
    }

    .how-it-works__card-heading {
        font-size: 28px;
    }

    .how-it-works__card-description {
        font-size: 14px;
        line-height: 20px;
    }

    .how-it-works__image {
        /* Pins the image to the bottom of the now equal-height card — with
           cards stretched to match the tallest one, a shorter card's step
           text otherwise left a gap between the text and the image instead
           of the image sitting flush at the card's own bottom edge. */
        margin-top: auto;
    }
}

@media (min-width: 900px) {
    .how-it-works__track-clip {
        margin-inline: -16px;
        padding-inline: 16px;
    }

    .how-it-works__card.swiper-slide {
        flex-direction: row;
        align-items: stretch;
    }

    .how-it-works__content {
        flex: 1 1 45%;
        justify-content: space-between;
    }

    .how-it-works__image {
        flex: 1 1 45%;
    }
}
