.home-slider {
    position: relative;
    isolation: isolate;

    min-width: 0;
    overflow: hidden;

    border-radius: 16px;
    background-color: #e8f6ff;
}

.home-slider__slides {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.home-slider__slide {
    position: relative;
    grid-area: 1 / 1;

    min-width: 0;
    height: 576px;

    color: #000000;
    background-color: #e8f6ff;

    visibility: hidden;
    pointer-events: none;

    opacity: 1;
    transition: none;
}

.home-slider__slide.is-active {
    z-index: 1;

    visibility: visible;
    pointer-events: auto;
}

.home-slider__picture {
    position: absolute;
    top: 28px;
    right: 24px;

    display: block;

    width: calc(100% - 196px);
    height: 520px;
}

.home-slider__picture img {
    display: block;

    width: 100%;
    height: 100%;
    max-width: none;

    object-fit: scale-down;
    object-position: center;
}

.home-slider__slide[data-layout="BACKGROUND"] {
    color: #ffffff;
    background-color: #202020;
}

.home-slider__slide[data-layout="BACKGROUND"]
.home-slider__picture {
    inset: 0;

    width: 100%;
    height: 100%;
}

.home-slider__slide[data-layout="BACKGROUND"]
.home-slider__picture img {
    object-fit: cover;
}

.home-slider__content {
    position: absolute;
    z-index: 1;

    bottom: 80px;
    left: 48px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;

    width: min(354px, calc(100% - 96px));
    margin: 0;
    padding: 0;
}

.home-slider__badge {
    margin: 0;

    color: #ee6a00;

    font-family: "Inter", Arial, sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 36px;
}

.home-slider__title {
    margin: 0;

    color: inherit;

    font-family: "Inter", Arial, sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 38px;

    overflow-wrap: anywhere;
}

.home-slider__description {
    margin: 0;

    color: inherit;

    font-family: "Inter", Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;

    white-space: pre-line;
    overflow-wrap: anywhere;
}

.home-slider__prices {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;

    margin: 0;
    padding: 0;
}

.home-slider__old-price {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;

    margin: 0;

    color: #9e9e9e;

    font-family: "Inter", Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;

    text-decoration-line: line-through;
}

.home-slider__price {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;

    margin: 0;

    color: inherit;

    font-family: "Inter", Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 24px;
}

.home-slider__form {
    display: flex;
    align-items: center;

    margin: 0;
    padding: 0;
}

.home-slider .home-promo__button {
    box-sizing: border-box;
    appearance: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    width: auto;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 8px 16px;

    border: 0;
    border-radius: 20px;

    color: #ffffff;
    background-color: #0093ee;

    font-family: "Inter", Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;

    white-space: nowrap;
    text-decoration: none;

    cursor: pointer;
}

.home-slider .home-promo__button > span:first-child {
    display: block;
    line-height: 24px;
}

.home-slider .home-promo__arrow {
    display: block;
    flex: 0 0 16px;

    width: 16px;
    height: 16px;

    margin: 0;

    background-color: currentColor;

    -webkit-mask-image:
            url("/images/icons/category-arrow-circle-right-108e708090425cc357a8bbe11386d3d1.svg");
    mask-image:
            url("/images/icons/category-arrow-circle-right-108e708090425cc357a8bbe11386d3d1.svg");

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;

    -webkit-mask-position: center;
    mask-position: center;

    -webkit-mask-size: 16px 16px;
    mask-size: 16px 16px;
}

.home-slider .home-promo__button:disabled {
    color: #9e9e9e;
    background-color: #f5f5f5;

    opacity: 1;
    cursor: default;
}

.home-slider__controls {
    position: absolute;
    z-index: 3;

    right: 48px;
    bottom: 48px;

    display: flex;
    align-items: center;
    justify-content: flex-end;
}

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

.home-slider__dots {
    display: flex;
    align-items: center;

    margin: 0;
    padding: 0;
}

.home-slider__dot {
    appearance: none;

    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;

    cursor: pointer;
}

.home-slider__dot::before {
    content: "";

    display: block;

    width: 16px;
    height: 16px;

    border-radius: 50%;
    background-color: #d9d9d9;
}

.home-slider__dot[aria-current="true"]::before {
    background-color: #0093ee;
}

.home-slider__dot:focus-visible,
.home-slider .home-promo__button:focus-visible {
    outline: 2px solid #0093ee;
    outline-offset: 2px;
}

.home-slider__sr-only {
    position: absolute;

    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;

    overflow: hidden;
    clip-path: inset(50%);

    white-space: nowrap;
    border: 0;
}

@media (max-width: 1279px) {
    .home-slider__picture {
        right: 16px;
        width: calc(100% - 48px);
    }

    .home-slider__content {
        left: 24px;
        width: min(354px, calc(100% - 48px));
    }

    .home-slider__controls {
        right: 24px;
    }
}

/*
 * Мобільна композиція:
 * зображення зверху, інформація під ним.
 */

@media (max-width: 767px) {
    .home-slider {
        container-type: inline-size;

        overflow: visible;
        border-radius: 0;
        background-color: #ffffff;
    }

    /*
     * JavaScript задає висоту активного слайда.
     * CSS плавно змінює її при перемиканні.
     *
     * Без JavaScript висоту визначає активний слайд
     * у звичайному потоці документа.
     */
    .home-slider__slides {
        position: relative;

        display: block;

        transition:
                height
                var(--home-slider-height-duration, 0ms)
                ease-out;
    }

    /*
     * Приховані слайди вилучені з потоку,
     * тому довший Ajax не збільшує висоту Tapo або D-Link.
     */
    .home-slider__slide,
    .home-slider__slide[data-layout="BACKGROUND"] {
        position: absolute;
        top: 0;
        left: 0;

        grid-area: auto;

        box-sizing: border-box;

        width: 100%;
        height: auto;
        min-height: 0;

        color: #000000;
        background-color: #ffffff;
    }

    .home-slider__slide.is-active,
    .home-slider__slide.is-active[data-layout="BACKGROUND"] {
        position: relative;
    }

    .home-slider__picture,
    .home-slider__slide[data-layout="BACKGROUND"]
    .home-slider__picture {
        position: relative;
        inset: auto;

        display: block;

        width: 100%;
        height: auto;
        aspect-ratio: 1256 / 576;

        margin: 0;
        overflow: hidden;

        border-radius: 16px;
        background-color: #e8f6ff;
    }

    .home-slider__picture img {
        width: 100%;
        height: 100%;

        object-fit: contain;
        object-position: center;
    }

    .home-slider__slide[data-layout="BACKGROUND"]
    .home-slider__picture {
        background-color: #202020;
    }

    .home-slider__slide[data-layout="BACKGROUND"]
    .home-slider__picture img {
        object-fit: contain;
        object-position: center;
    }

    .home-slider__content,
    .home-slider__slide[data-layout="BACKGROUND"]
    .home-slider__content {
        position: relative;
        inset: auto;

        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 16px;

        width: 100%;
        margin: 24px 0 0;
        padding: 0;

        color: #000000;
    }

    .home-slider__badge,
    .home-slider__title,
    .home-slider__description {
        grid-column: 1 / -1;
    }

    .home-slider__badge {
        font-size: 28px;
        line-height: 36px;
    }

    .home-slider__title {
        font-size: 32px;
        line-height: 38px;

        word-break: normal;
        overflow-wrap: break-word;
    }

    .home-slider__description {
        font-size: 16px;
        line-height: 24px;
    }

    .home-slider__prices {
        grid-column: 1;

        align-self: end;
        min-width: 0;
    }

    .home-slider__form,
    .home-slider__content > a.home-promo__button {
        grid-column: 2;

        align-self: end;
        justify-self: end;
    }

    /*
     * Крапки залишаються всередині зображення.
     * Їхня позиція не залежить від висоти тексту.
     */
    .home-slider__controls {
        top: calc(100cqw * 0.4585987261 - 48px);
        right: 16px;
        bottom: auto;
    }
}

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