.ro-home-categories {
    --ro-hero-ink: #152229;
    --ro-hero-accent: #d4e7e9;
    --ro-hero-gutter: clamp(24px, 5vw, 88px);
    --ro-hero-height: clamp(535px, 72svh, 860px);
    position: relative;
    isolation: isolate;
    width: 100%;
    background: var(--ro-hero-ink);
    color: #fff;
}

.ro-home-categories [hidden] {
    display: none;
}

.ro-home-categories__controls:not([hidden]) + .ro-home-categories__slides {
    display: grid;
}

.ro-home-categories__controls:not([hidden]) + .ro-home-categories__slides > .ro-home-categories__slide {
    grid-area: 1 / 1;
}

/* Inactive slides still size the shared row, so switching slides cannot move the page. */
.ro-home-categories__slide[inert] {
    visibility: hidden;
}

.ro-home-categories__slide {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: end;
    min-height: var(--ro-hero-height);
    overflow: hidden;
    background: #18262c;
}

.ro-home-categories__picture {
    display: contents;
}

.ro-home-categories__photo,
.ro-home-categories__slide::after {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ro-home-categories__photo {
    z-index: -2;
    object-fit: cover;
    border-radius: 0;
}

.ro-home-categories__slide::after {
    z-index: -1;
    content: '';
    background:
        linear-gradient(0deg, rgba(10, 17, 20, .96), rgba(10, 17, 20, .22) 48%, transparent 80%),
        linear-gradient(90deg, rgba(16, 27, 32, .88), rgba(16, 27, 32, .61) 32%, transparent 69%);
}

.ro-home-categories__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 350px);
    align-items: end;
    gap: 28px;
    padding: 40px var(--ro-hero-gutter) 92px;
}

.ro-home-categories__copy {
    max-width: 700px;
}

.ro-home-categories__copy p {
    max-width: 36ch;
    margin: 18px 0 22px;
    color: #f1f5f6;
    font-size: clamp(16px, 1.32vw, 21px);
    line-height: 1.45;
    text-shadow: 0 2px 10px #101a20;
}

.ro-home-categories__copy .ro-home-categories__label {
    margin: 0 0 14px;
    color: #c2dedf;
    font-size: .79rem;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.ro-editorial .ro-home-categories__copy h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(44px, 6vw, 106px);
    font-weight: 800;
    line-height: .97;
    letter-spacing: -.055em;
    text-wrap: balance;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 16px rgb(9 18 21 / 55%);
}

.ro-home-categories a.ro-home-categories__action,
.ro-home-categories a.ro-home-categories__product {
    text-decoration: none;
}

.ro-home-categories a.ro-home-categories__action {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    gap: 23px;
    padding: 9px 16px;
    border-radius: 4px;
    background: var(--ro-hero-accent);
    color: var(--ro-hero-ink);
    font-weight: 800;
}

.ro-home-categories a.ro-home-categories__action:hover {
    background: #fff;
}

.ro-home-categories__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.ro-home-categories a.ro-home-categories__action--outline {
    border: 1px solid var(--ro-hero-accent);
    background: rgb(21 34 41 / 72%);
    color: #fff;
}

.ro-home-categories a.ro-home-categories__action--outline:hover {
    background: var(--ro-hero-accent);
    color: var(--ro-hero-ink);
}

.ro-home-categories__products-heading {
    margin: 0 0 7px;
    color: #e2eef0;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ro-home-categories a.ro-home-categories__more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid #a8c2c8;
    border-radius: 6px;
    background: #152229;
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
}

.ro-home-categories a.ro-home-categories__more:hover {
    background: var(--ro-hero-accent);
    color: var(--ro-hero-ink);
}

.ro-home-categories .ro-home-categories__products ul {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ro-home-categories a.ro-home-categories__product {
    display: grid;
    grid-template-columns: 49px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 6px 12px 6px 6px;
    border: 1px solid rgb(221 237 239 / 42%);
    border-radius: 6px;
    background: rgb(21 34 41 / 94%);
    color: #fff;
}

.ro-home-categories a.ro-home-categories__product:hover {
    border-color: var(--ro-hero-accent);
    background: var(--ro-hero-ink);
}

.ro-home-categories__product img {
    display: block;
    width: 49px;
    height: 49px;
    padding: 4px;
    border-radius: 3px;
    background: #fff;
    object-fit: contain;
}

.ro-home-categories__product small {
    display: block;
    margin-top: 3px;
    color: #c2dedf;
    font-size: .76rem;
    line-height: 1.25;
}

.ro-home-categories__product strong {
    display: block;
    font-size: .88rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.ro-home-categories__product-name-mobile {
    display: none;
}

.ro-home-categories__product-arrow {
    color: var(--ro-hero-accent);
    font-size: 1.25rem;
}

.ro-home-categories__controls {
    position: absolute;
    z-index: 1;
    right: var(--ro-hero-gutter);
    bottom: 18px;
    left: var(--ro-hero-gutter);
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ro-home-categories__transport {
    display: flex;
    flex: 0 0 auto;
}

.ro-home-categories__controls button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: white;
    box-shadow: none;
    font: inherit;
    font-size: 1.4rem;
    cursor: pointer;
}

.ro-home-categories__transport button:hover {
    background: rgb(255 255 255 / 14%);
    border-radius: 4px;
}

.ro-home-categories__rotation span {
    width: 10px;
    height: 15px;
    border-inline: 2px solid currentColor;
}

.ro-home-categories__rotation[data-playing="false"] span {
    width: 0;
    height: 0;
    border: 0;
    border-block: 7px solid transparent;
    border-left: 10px solid currentColor;
}

.ro-home-categories .ro-home-categories__choices {
    display: flex;
    gap: 5px;
    width: min(100%, 430px);
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ro-home-categories__choices li {
    flex: 1 1 0;
    min-width: 0;
}

.ro-home-categories__choices button {
    position: relative;
    width: 100%;
}

.ro-home-categories__choices button::before,
.ro-home-categories__choices button span {
    position: absolute;
    inset: 50% 0 auto;
    height: 3px;
    background: rgb(235 246 248 / 45%);
    content: '';
}

.ro-home-categories__choices button span {
    background: #fff;
    transform: scaleX(0);
    transform-origin: left;
}

.ro-home-categories__choices button:hover::before,
.ro-home-categories__choices button[aria-current]::before {
    background: rgb(235 246 248 / 65%);
}

.ro-home-categories__choices button[aria-current] span {
    transform: scaleX(var(--ro-progress, 0));
}

.ro-home-categories :is(a, button):focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.ro-home-visit {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 20px;
    padding: 16px clamp(24px, 5vw, 88px);
    border-bottom: 1px solid #d8e1e2;
    background: #eef3f3;
    color: #20343e;
    font-size: .875rem;
}

.ro-home-visit p {
    margin: 0;
}

.ro-home-visit a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (min-width: 721px) {
    .ro-home-categories__slides {
        isolation: isolate;
        overflow: clip;
    }

    .ro-home-categories__bike-frame {
        position: absolute;
        z-index: -2;
        inset: 0;
        overflow: hidden;
        pointer-events: none;
        background: #0c1012;
    }

    .ro-home-categories__bike-frame[data-bike="grail"] img {
        object-position: var(--ro-canyon-photo-position, center);
    }

    #ro-home-category-canyon-sortiment .ro-home-categories__bike-frame:not([data-bike="grail"]) .ro-home-categories__photo {
        transform: none;
        mask-image: none;
    }

    .ro-home-categories__bike-frame[data-bike="aeroad"] .ro-home-categories__photo {
        object-position: center 24%;
    }

    .ro-home-categories__bike-frame[data-bike="mtb"] {
        container-type: size;
        background: #25313e url("site/images/canyon-spectral-on-aosta-full.webp") center 45% / cover;
    }

    .ro-home-categories__bike-frame[data-bike="mtb"]::before {
        position: absolute;
        inset: 0;
        content: '';
        background: rgb(15 25 33 / 35%);
        backdrop-filter: blur(32px);
    }

    #ro-home-category-canyon-sortiment .ro-home-categories__bike-frame[data-bike="mtb"] .ro-home-categories__photo {
        /* Limit how far cover can crop vertically. Blend the sides on wider banners. */
        --ro-mtb-edge: clamp(0px, calc(100cqw - 195cqh), 100px);
        z-index: 1;
        width: min(100%, 195cqh);
        margin-inline: auto;
        object-position: left 36%;
        mask-image: linear-gradient(90deg, transparent, #000 var(--ro-mtb-edge), #000 calc(100% - var(--ro-mtb-edge)), transparent);
    }

    .ro-home-categories__mtb-caption {
        position: absolute;
        z-index: 0;
        top: clamp(18px, 3.5vw, 48px);
        left: var(--ro-hero-gutter);
        display: grid;
        gap: 2px;
        max-width: calc(100% - 2 * var(--ro-hero-gutter));
        margin: 0;
        padding: 9px 13px;
        border-radius: 4px;
        background: rgb(10 17 20 / 88%);
        color: #fff;
        font-size: .875rem;
        line-height: 1.35;
        pointer-events: none;
    }

    .ro-home-categories__mtb-caption strong {
        font-size: 1rem;
    }

    .ro-home-categories__photo-credit {
        position: absolute;
        top: 14px;
        right: var(--ro-hero-gutter);
        padding: 2px 6px;
        border-radius: 3px;
        background: rgb(10 17 20 / 85%);
        color: #fff;
        font-size: .72rem;
        line-height: 1.5;
    }

    .ro-home-categories__transport .ro-home-categories__bike-rotation {
        width: auto;
        padding-inline: .7rem;
        margin-right: .35rem;
        color: var(--ro-hero-accent);
        font-size: .8125rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .ro-home-categories {
        --ro-hero-height: max(420px, calc(100svh - var(--ro-hero-surroundings, 28svh)));
    }

    #ro-home-category-canyon-sortiment {
        background: #0c1012;
    }
}

/* Keep both wheels above the product cards when the desktop columns are tighter. */
@media (721px <= width <= 1550px) {
    #ro-home-category-canyon-sortiment .ro-home-categories__photo {
        transform: translateY(-10%);
        mask-image: linear-gradient(#000 78%, transparent 100%);
    }
}

@media (721px <= width <= 1100px) {
    #ro-home-category-canyon-sortiment .ro-home-categories__photo {
        transform: translateY(-14%);
    }
}

@media (min-width: 2050px) {
    #ro-home-category-canyon-sortiment .ro-home-categories__photo {
        --ro-canyon-photo-position: center 40%;
    }
}

@media (max-width: 720px) {
    .ro-home-categories__mtb-caption {
        display: none;
    }

    .ro-home-categories {
        --ro-hero-height: 0px;
        --ro-hero-gutter: clamp(18px, 5vw, 32px);
    }

    .ro-home-categories__slide[inert] {
        display: none;
    }

    .ro-home-categories__slide::after {
        background: linear-gradient(0deg, #10191e 5%, rgb(16 25 30 / 90%) 27%, rgb(16 25 30 / 19%) 76%, transparent);
    }

    .ro-home-categories__content {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-top: clamp(120px, 16svh, 174px);
        padding-bottom: 24px;
    }

    :is(#ro-home-category-canyon-sortiment, #ro-home-category-workshop, #ro-home-category-vinter, #ro-home-category-sykkelklaer) {
        align-content: start;
        background: var(--ro-hero-ink);
    }

    :is(#ro-home-category-canyon-sortiment, #ro-home-category-workshop, #ro-home-category-vinter, #ro-home-category-sykkelklaer)::after {
        content: none;
    }

    :is(#ro-home-category-canyon-sortiment, #ro-home-category-workshop, #ro-home-category-vinter, #ro-home-category-sykkelklaer) .ro-home-categories__photo {
        position: relative;
        inset: auto;
        z-index: auto;
        height: auto;
    }

    :is(#ro-home-category-canyon-sortiment, #ro-home-category-workshop, #ro-home-category-vinter, #ro-home-category-sykkelklaer) .ro-home-categories__content {
        padding-top: 20px;
    }

    #ro-home-category-vinter .ro-home-categories__photo {
        aspect-ratio: 16 / 10;
    }

    #ro-home-category-sykkelklaer .ro-home-categories__photo {
        aspect-ratio: 4 / 3;
    }

    #ro-home-category-workshop .ro-home-categories__photo {
        aspect-ratio: 16 / 9;
    }

    #ro-home-category-canyon-sortiment .ro-home-categories__photo {
        aspect-ratio: 4006 / 5008;
    }

    #ro-home-category-canyon-sortiment .ro-home-categories__content {
        position: relative;
        margin-top: -42vw;
        padding-top: 0;
        background: linear-gradient(180deg, rgb(21 34 41 / 85%), var(--ro-hero-ink) 130px);
    }

    #ro-home-category-canyon-sortiment .ro-home-categories__copy {
        position: relative;
        margin-top: -16px;
    }

    #ro-home-category-canyon-sortiment .ro-home-categories__content::before {
        position: absolute;
        inset: -24px 0 auto;
        height: 24px;
        background: linear-gradient(transparent, rgb(21 34 41 / 85%));
        pointer-events: none;
        content: '';
    }

    .ro-editorial .ro-home-categories__copy h2 {
        font-size: clamp(39px, 9.5vw, 65px);
        text-wrap: initial;
    }

    .ro-home-categories__copy p {
        margin: 12px 0 14px;
    }

    .ro-home-categories__copy .ro-home-categories__label {
        margin-bottom: 9px;
    }

    .ro-home-categories a.ro-home-categories__action--repeats-range {
        display: none;
    }

    .ro-home-categories__products {
        max-width: 380px;
    }

    .ro-home-categories a.ro-home-categories__product {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        gap: 8px;
        padding-block: 4px;
    }

    .ro-home-categories__product strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ro-home-categories__product-name-full {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .ro-home-categories__product-name-mobile {
        display: inline;
    }

    .ro-home-categories__product img {
        width: 40px;
        height: 40px;
    }

    .ro-home-categories__controls {
        top: 5px;
        bottom: auto;
        background: transparent;
    }

    .ro-home-categories__controls::before {
        position: absolute;
        z-index: -1;
        inset: -5px calc(-1 * var(--ro-hero-gutter)) -14px;
        background: linear-gradient(rgb(8 16 20 / 62%), rgb(8 16 20 / 34%) 64%, transparent);
        pointer-events: none;
        content: '';
    }

    .ro-home-categories__controls .ro-home-categories__choices button::before {
        background: rgb(255 255 255 / 55%);
    }

    .ro-home-categories__controls .ro-home-categories__choices button[aria-current]::before {
        background: rgb(255 255 255 / 72%);
    }

    .ro-home-categories__transport button {
        width: 40px;
        text-shadow: 0 1px 5px #10191e;
    }
}
