/* Home top of the redesigned sites (templates/website/redesign/home/brands_v2.twig), from the mockup
   «Марки · вариант 2 · слоган». The layout follows the width of the block itself (container query):
   desktop from 1000 px, tablet from 640 px, phone below. --a* colour the first four tiles, --n* the other ones. */

body.rd-home .rd-hb {
    --a: #CC3300;
    --a1: #E8501E;
    --a2: #A52800;
    --a-sh: rgba(204, 51, 0, .8);
    --n: #2E394D;
    --n1: #40506C;
    --n2: #1F2735;
    --n-sh: rgba(24, 32, 48, .8);
    container: rd-hb / inline-size;
    margin: 40px 0 0;
    color: var(--rd-ink);
}

body.rd-germany.rd-home .rd-hb,
body.rd-france.rd-home .rd-hb {
    --a: #033887;
    --a1: #1F5DBF;
    --a2: #022A66;
    --a-sh: rgba(3, 56, 135, .75);
    --n: #0E2150;
    --n1: #1D336A;
    --n2: #071433;
    --n-sh: rgba(7, 20, 51, .8);
}

body.rd-korea.rd-home .rd-hb {
    --a: #0A3D91;
    --a1: #2763C6;
    --a2: #072C6B;
    --a-sh: rgba(10, 61, 145, .75);
    --n: #0D2350;
    --n1: #1C376E;
    --n2: #06132F;
    --n-sh: rgba(6, 19, 47, .8);
}

body.rd-home .rd-hb * {
    box-sizing: border-box;
}

body.rd-home .rd-hb svg {
    flex: none;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---- tiles ---- */

body.rd-home .rd-hb__tl {
    --tc: var(--a);
    position: relative;
    display: block;
    color: #fff;
    text-decoration: none;
    transition: transform .2s;
}

body.rd-home .rd-hb__tl:hover {
    transform: translateY(-3px);
}

body.rd-home .rd-hb__tl--rest {
    --tc: var(--n);
}

body.rd-home .rd-hb__bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    overflow: hidden;
    border-radius: var(--tr);
    box-shadow: 0 22px 34px -22px var(--a-sh);
}

body.rd-home .rd-hb__tl--rest .rd-hb__bg {
    box-shadow: 0 22px 34px -22px var(--n-sh);
}

body.rd-home .rd-hb__bg i {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background: radial-gradient(86% 58% at var(--rx, 50%) var(--ry, 38%), rgba(255, 255, 255, .27), rgba(255, 255, 255, 0) 68%),
        linear-gradient(160deg, var(--a1) 0%, var(--a) 46%, var(--a2) 100%);
}

body.rd-home .rd-hb__tl--rest .rd-hb__bg i {
    background: radial-gradient(86% 58% at var(--rx, 50%) var(--ry, 38%), rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 68%),
        linear-gradient(160deg, var(--n1) 0%, var(--n) 48%, var(--n2) 100%);
}

body.rd-home .rd-hb__bg b {
    position: absolute;
    left: var(--rx, 50%);
    top: var(--ry, 38%);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .12);
    transform: translate(-50%, -50%);
}

body.rd-home .rd-hb__bg b:nth-of-type(1) {
    width: 112%;
}

body.rd-home .rd-hb__bg b:nth-of-type(2) {
    width: 156%;
    border-color: rgba(255, 255, 255, .07);
}

body.rd-home .rd-hb__car {
    position: absolute;
    left: 50%;
    max-width: none;
    height: auto;
    transform: translateX(-50%);
}

body.rd-home .rd-hb__nm {
    position: absolute;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: #fff;
}

body.rd-home .rd-hb__bt {
    position: absolute;
    display: flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    background: #fff;
    color: var(--tc);
    font-weight: 800;
    box-shadow: 0 10px 20px -8px rgba(10, 16, 30, .5);
}

body.rd-home .rd-hb__bt i {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--tc);
    color: #fff;
    font-style: normal;
}

body.rd-home .rd-hb__cap {
    position: absolute;
    display: none;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, .84);
}

body.rd-home .rd-hb__cap svg {
    width: 13px;
    height: 13px;
}

/* ---- desktop ---- */

body.rd-home .rd-hb__top {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

body.rd-home .rd-hb__tl--big {
    --tr: 24px;
    --ry: 62%;
    min-height: 290px;
}

body.rd-home .rd-hb__tl--big .rd-hb__car {
    bottom: 8px;
    width: 90%;
}

body.rd-home .rd-hb__tl--big .rd-hb__nm {
    left: 24px;
    top: 24px;
    font-size: 30px;
}

body.rd-home .rd-hb__tl--big .rd-hb__bt {
    left: 24px;
    top: 70px;
    gap: 8px;
    height: 36px;
    padding: 0 5px 0 15px;
    font-size: 13.5px;
}

body.rd-home .rd-hb__tl--big .rd-hb__bt i {
    width: 26px;
    height: 26px;
}

body.rd-home .rd-hb__tl--big .rd-hb__bt svg {
    width: 13px;
    height: 13px;
}

body.rd-home .rd-hb__side {
    grid-column: 3 / 5;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

body.rd-home .rd-hb__ph {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1002 / 616;
    object-fit: cover;
    border-radius: 24px;
}

body.rd-home .rd-hb__video {
    display: block;
}

body.rd-home .rd-hb__side--photo .rd-hb__ph,
body.rd-home .rd-hb__side--photo .rd-hb__video {
    flex: 1;
    min-height: 0;
    height: 100%;
}

body.rd-home .rd-hb__side--photo .rd-hb__ph {
    aspect-ratio: auto;
}

body.rd-home .rd-hb__sg {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 28px;
    overflow: hidden;
    padding: 24px 32px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(160deg, var(--n1) 0%, var(--n) 50%, var(--n2) 100%);
}

body.rd-home .rd-hb__ring {
    position: absolute;
    right: -60px;
    bottom: -90px;
    width: 260px;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .1);
}

body.rd-home .rd-hb__ring + .rd-hb__ring {
    right: -110px;
    bottom: -140px;
    width: 360px;
    border-color: rgba(255, 255, 255, .06);
}

body.rd-home .rd-hb__sg > :not(.rd-hb__ring) {
    position: relative;
}

body.rd-home .rd-hb__sgx {
    flex: 1;
    min-width: 0;
}

body.rd-home .rd-hb__sgt {
    display: block;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.025em;
    color: #fff;
}

body.rd-home .rd-hb__sgs {
    display: block;
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.45;
    color: #C7CEDC;
}

body.rd-home .rd-hb__sgb {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 7px 0 20px;
    white-space: nowrap;
    border-radius: 999px;
    background: #fff;
    color: var(--a);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 12px 24px -10px rgba(10, 16, 30, .6);
}

body.rd-home .rd-hb__sgb i {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--a);
    color: #fff;
    font-style: normal;
}

body.rd-home .rd-hb__sgb svg {
    width: 15px;
    height: 15px;
}

body.rd-home .rd-hb__rest {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
}

body.rd-home .rd-hb__rest .rd-hb__tl {
    --tr: 22px;
    --ry: 64%;
    flex: 0 0 calc((100% - 72px) / 4);
    height: 262px;
}

body.rd-home .rd-hb__rest .rd-hb__car {
    bottom: 8px;
    width: 82%;
}

body.rd-home .rd-hb__rest .rd-hb__nm {
    left: 22px;
    top: 22px;
    font-size: 26px;
}

body.rd-home .rd-hb__rest .rd-hb__bt {
    left: 22px;
    top: 62px;
    gap: 8px;
    height: 34px;
    padding: 0 5px 0 14px;
    font-size: 13px;
}

body.rd-home .rd-hb__rest .rd-hb__bt i {
    width: 24px;
    height: 24px;
}

body.rd-home .rd-hb__rest .rd-hb__bt svg {
    width: 12px;
    height: 12px;
}

/* Five and more other brands: six small tiles in a row with a caption instead of the button. */
body.rd-home .rd-hb__rest--6 {
    gap: 16px;
}

body.rd-home .rd-hb__rest--6 .rd-hb__tl {
    --tr: 20px;
    --ry: 66%;
    flex: 0 0 calc((100% - 80px) / 6);
    height: 202px;
}

body.rd-home .rd-hb__rest--6 .rd-hb__car {
    bottom: 6px;
    width: 96%;
}

body.rd-home .rd-hb__rest--6 .rd-hb__nm {
    left: 18px;
    top: 16px;
    font-size: 19px;
}

body.rd-home .rd-hb__rest--6 .rd-hb__bt {
    display: none;
}

body.rd-home .rd-hb__rest--6 .rd-hb__cap {
    display: flex;
    left: 18px;
    top: 44px;
}

/* ---- tablet: big tiles in two columns, the photo and the slogan below them, the other brands three in a row ---- */

@container rd-hb (max-width: 999px) {
    body.rd-home .rd-hb__top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    body.rd-home .rd-hb__side {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    body.rd-home .rd-hb__side--photo .rd-hb__ph {
        aspect-ratio: 1002 / 616;
    }

    body.rd-home .rd-hb__tl--big {
        min-height: 250px;
    }

    body.rd-home .rd-hb__rest,
    body.rd-home .rd-hb__rest--6 {
        gap: 16px;
        margin-top: 16px;
    }

    body.rd-home .rd-hb__rest .rd-hb__tl,
    body.rd-home .rd-hb__rest--6 .rd-hb__tl {
        flex: 0 0 calc((100% - 32px) / 3);
        height: 220px;
    }
}

@supports not (container-type: inline-size) {
    @media (max-width: 1047px) {
        body.rd-home .rd-hb__top {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 16px;
        }

        body.rd-home .rd-hb__side {
            grid-column: 1 / -1;
            grid-row: auto;
        }

        body.rd-home .rd-hb__side--photo .rd-hb__ph {
            aspect-ratio: 1002 / 616;
        }

        body.rd-home .rd-hb__tl--big {
            min-height: 250px;
        }

        body.rd-home .rd-hb__rest,
        body.rd-home .rd-hb__rest--6 {
            gap: 16px;
            margin-top: 16px;
        }

        body.rd-home .rd-hb__rest .rd-hb__tl,
        body.rd-home .rd-hb__rest--6 .rd-hb__tl {
            flex: 0 0 calc((100% - 32px) / 3);
            height: 220px;
        }
    }
}

/* Tablet only: tiles are wide but not tall here, so the car takes its size from the tile height and stays below the
   name and the button. */
@container rd-hb (min-width: 640px) and (max-width: 999px) {
    body.rd-home .rd-hb__tl--big {
        min-height: 290px;
    }

    body.rd-home .rd-hb__tl--big .rd-hb__car {
        width: auto;
        height: 60%;
    }

    body.rd-home .rd-hb__rest .rd-hb__tl {
        height: 240px;
    }

    body.rd-home .rd-hb__rest .rd-hb__car {
        width: auto;
        height: 52%;
    }
}

@supports not (container-type: inline-size) {
    @media (min-width: 688px) and (max-width: 1047px) {
        body.rd-home .rd-hb__tl--big {
            min-height: 290px;
        }

        body.rd-home .rd-hb__tl--big .rd-hb__car {
            width: auto;
            height: 60%;
        }

        body.rd-home .rd-hb__rest .rd-hb__tl {
            height: 240px;
        }

        body.rd-home .rd-hb__rest .rd-hb__car {
            width: auto;
            height: 52%;
        }
    }
}

/* ---- phone: the mockup «телефон · слоган» ---- */

@container rd-hb (max-width: 639px) {
    body.rd-home .rd-hb {
        margin-top: 28px;
    }

    body.rd-home .rd-hb__top {
        gap: 12px;
    }

    body.rd-home .rd-hb__tl--big {
        --tr: 20px;
        min-height: 0;
        height: 222px;
    }

    body.rd-home .rd-hb__tl--big .rd-hb__car {
        bottom: 6px;
        width: 94%;
    }

    body.rd-home .rd-hb__tl--big .rd-hb__nm {
        left: 16px;
        top: 16px;
        font-size: 21px;
    }

    body.rd-home .rd-hb__tl--big .rd-hb__bt {
        left: 16px;
        top: 48px;
        gap: 6px;
        height: 30px;
        padding: 0 4px 0 12px;
        font-size: 12px;
    }

    body.rd-home .rd-hb__tl--big .rd-hb__bt i {
        width: 22px;
        height: 22px;
    }

    body.rd-home .rd-hb__tl--big .rd-hb__bt svg {
        width: 11px;
        height: 11px;
    }

    body.rd-home .rd-hb__side {
        gap: 14px;
        margin-top: 8px;
    }

    body.rd-home .rd-hb__ph {
        border-radius: 18px;
    }

    body.rd-home .rd-hb__sg {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 22px 20px;
        border-radius: 18px;
    }

    body.rd-home .rd-hb__sgt {
        font-size: 24px;
    }

    body.rd-home .rd-hb__sgs {
        margin-top: 8px;
        font-size: 14.5px;
    }

    body.rd-home .rd-hb__sgb {
        justify-content: space-between;
        height: 48px;
        padding: 0 8px 0 20px;
    }

    body.rd-home .rd-hb__rest,
    body.rd-home .rd-hb__rest--6 {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-top: 20px;
    }

    body.rd-home .rd-hb__rest .rd-hb__tl,
    body.rd-home .rd-hb__rest--6 .rd-hb__tl {
        --tr: 18px;
        --ry: 66%;
        height: 176px;
    }

    body.rd-home .rd-hb__rest .rd-hb__car {
        bottom: 5px;
        width: 98%;
    }

    body.rd-home .rd-hb__rest .rd-hb__nm {
        left: 14px;
        top: 14px;
        font-size: 17px;
    }

    body.rd-home .rd-hb__rest .rd-hb__bt {
        display: none;
    }

    body.rd-home .rd-hb__rest .rd-hb__cap {
        display: flex;
        left: 14px;
        top: 38px;
        font-size: 12px;
    }
}

@supports not (container-type: inline-size) {
    @media (max-width: 687px) {
        body.rd-home .rd-hb {
            margin-top: 28px;
        }

        body.rd-home .rd-hb__top {
            gap: 12px;
        }

        body.rd-home .rd-hb__tl--big {
            --tr: 20px;
            min-height: 0;
            height: 222px;
        }

        body.rd-home .rd-hb__tl--big .rd-hb__car {
            bottom: 6px;
            width: 94%;
        }

        body.rd-home .rd-hb__tl--big .rd-hb__nm {
            left: 16px;
            top: 16px;
            font-size: 21px;
        }

        body.rd-home .rd-hb__tl--big .rd-hb__bt {
            left: 16px;
            top: 48px;
            gap: 6px;
            height: 30px;
            padding: 0 4px 0 12px;
            font-size: 12px;
        }

        body.rd-home .rd-hb__tl--big .rd-hb__bt i {
            width: 22px;
            height: 22px;
        }

        body.rd-home .rd-hb__tl--big .rd-hb__bt svg {
            width: 11px;
            height: 11px;
        }

        body.rd-home .rd-hb__side {
            gap: 14px;
            margin-top: 8px;
        }

        body.rd-home .rd-hb__ph {
            border-radius: 18px;
        }

        body.rd-home .rd-hb__sg {
            flex-direction: column;
            align-items: stretch;
            gap: 16px;
            padding: 22px 20px;
            border-radius: 18px;
        }

        body.rd-home .rd-hb__sgt {
            font-size: 24px;
        }

        body.rd-home .rd-hb__sgs {
            margin-top: 8px;
            font-size: 14.5px;
        }

        body.rd-home .rd-hb__sgb {
            justify-content: space-between;
            height: 48px;
            padding: 0 8px 0 20px;
        }

        body.rd-home .rd-hb__rest,
        body.rd-home .rd-hb__rest--6 {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
            margin-top: 20px;
        }

        body.rd-home .rd-hb__rest .rd-hb__tl,
        body.rd-home .rd-hb__rest--6 .rd-hb__tl {
            --tr: 18px;
            --ry: 66%;
            height: 176px;
        }

        body.rd-home .rd-hb__rest .rd-hb__car {
            bottom: 5px;
            width: 98%;
        }

        body.rd-home .rd-hb__rest .rd-hb__nm {
            left: 14px;
            top: 14px;
            font-size: 17px;
        }

        body.rd-home .rd-hb__rest .rd-hb__bt {
            display: none;
        }

        body.rd-home .rd-hb__rest .rd-hb__cap {
            display: flex;
            left: 14px;
            top: 38px;
            font-size: 12px;
        }
    }
}

@container rd-hb (max-width: 359px) {
    body.rd-home .rd-hb__tl--big .rd-hb__nm {
        font-size: 19px;
    }

    body.rd-home .rd-hb__tl--big .rd-hb__bt {
        gap: 4px;
        height: 28px;
        padding: 0 4px 0 9px;
        font-size: 11px;
    }

    body.rd-home .rd-hb__tl--big .rd-hb__bt i {
        width: 20px;
        height: 20px;
    }

    body.rd-home .rd-hb__sg {
        padding: 20px 16px;
    }

    body.rd-home .rd-hb__sgt {
        font-size: 22px;
    }
}

@supports not (container-type: inline-size) {
    @media (max-width: 391px) {
        body.rd-home .rd-hb__tl--big .rd-hb__nm {
            font-size: 19px;
        }

        body.rd-home .rd-hb__tl--big .rd-hb__bt {
            gap: 4px;
            height: 28px;
            padding: 0 4px 0 9px;
            font-size: 11px;
        }

        body.rd-home .rd-hb__tl--big .rd-hb__bt i {
            width: 20px;
            height: 20px;
        }

        body.rd-home .rd-hb__sg {
            padding: 20px 16px;
        }

        body.rd-home .rd-hb__sgt {
            font-size: 22px;
        }
    }
}

@container rd-hb (max-width: 319px) {
    body.rd-home .rd-hb__tl--big .rd-hb__bt {
        padding: 0 3px 0 8px;
        font-size: 10px;
    }

    body.rd-home .rd-hb__tl--big .rd-hb__bt i {
        width: 18px;
        height: 18px;
    }

    body.rd-home .rd-hb__sgt {
        font-size: 20px;
    }

    body.rd-home .rd-hb__sgb {
        font-size: 14px;
    }

    body.rd-home .rd-hb__rest .rd-hb__nm {
        left: 12px;
        top: 13px;
        font-size: 15px;
    }

    body.rd-home .rd-hb__rest .rd-hb__cap {
        left: 12px;
        font-size: 11px;
    }
}

@supports not (container-type: inline-size) {
    @media (max-width: 351px) {
        body.rd-home .rd-hb__tl--big .rd-hb__bt {
            padding: 0 3px 0 8px;
            font-size: 10px;
        }

        body.rd-home .rd-hb__tl--big .rd-hb__bt i {
            width: 18px;
            height: 18px;
        }

        body.rd-home .rd-hb__sgt {
            font-size: 20px;
        }

        body.rd-home .rd-hb__sgb {
            font-size: 14px;
        }

        body.rd-home .rd-hb__rest .rd-hb__nm {
            left: 12px;
            top: 13px;
            font-size: 15px;
        }

        body.rd-home .rd-hb__rest .rd-hb__cap {
            left: 12px;
            font-size: 11px;
        }
    }
}

/* ---- two or three brands: a wide tile takes both left columns, its car stands on the right ---- */

body.rd-home .rd-hb__tl--wide {
    --rx: 68%;
    grid-column: span 2;
}

body.rd-home .rd-hb__tl--wide .rd-hb__car {
    left: auto;
    right: 4%;
    width: min(62%, 370px);
    height: auto;
    transform: none;
}

/* Two brands on a phone: two ordinary tiles side by side. */
@container rd-hb (max-width: 639px) {
    body.rd-home .rd-hb__tl--pair {
        --rx: 50%;
        grid-column: auto;
    }

    body.rd-home .rd-hb__tl--pair .rd-hb__car {
        left: 50%;
        right: auto;
        width: 94%;
        transform: translateX(-50%);
    }
}

@supports not (container-type: inline-size) {
    @media (max-width: 687px) {
        body.rd-home .rd-hb__tl--pair {
            --rx: 50%;
            grid-column: auto;
        }

        body.rd-home .rd-hb__tl--pair .rd-hb__car {
            left: 50%;
            right: auto;
            width: 94%;
            transform: translateX(-50%);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    body.rd-home .rd-hb__tl {
        transition: none;
    }
}

/* Browsers without aspect-ratio (Safari < 15, Chrome < 88): the same proportions from a padding. */
@supports not (aspect-ratio: 1) {
    body.rd-home .rd-hb__bg b:nth-of-type(1) {
        padding-top: 112%;
    }

    body.rd-home .rd-hb__bg b:nth-of-type(2) {
        padding-top: 156%;
    }

    body.rd-home .rd-hb__ring {
        height: 260px;
    }

    body.rd-home .rd-hb__ring + .rd-hb__ring {
        height: 360px;
    }
}
