/* Стилі для банерів */
.banner-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: -20px;
    height: 400px;
}

.banner {
    position: absolute;
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: top left; /* Зміна до лівого верхнього краю */
    opacity: 0;
    transition: opacity 0.8s ease-in-out; /* Плавна зміна видимості */
    z-index: 0;
}

.banner.active {
    opacity: 1;
    z-index: 1; /* Щоб активний банер був на передньому плані */
}

.banner-text {
    position: absolute;
    color: #fff;
    padding: 1rem;
    border-radius: 5px;
    max-width: 45%;
    background-color: rgba(0, 0, 0, 0.5);
    top: 3em;
    left: 5em;
    opacity: 0;
    transform: translateY(20px); /* Початкове положення */
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out; /* Плавність для тексту */
}

.banner.active .banner-text {
    opacity: 1;
    transform: translateY(0); /* Плавне повернення на місце */
}

.banner-text h2 {
    margin: 0;
    font-size: 2.5rem;
    text-align: -webkit-left;
}

.banner-button {
    position: absolute;
    background-color: #fd4d48;
    color: #fff;
    padding: 0.75rem 3rem;
    text-decoration: none;
    border-radius: 60px;
    transition: background-color 0.3s, opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    top: 17em;
    left: 6em;
    box-shadow: 0px 0px 25px red;
    opacity: 0;
    transform: translateY(20px); /* Початкове положення кнопки */
}

.banner.active .banner-button {
    opacity: 1;
    transform: translateY(0); /* Плавне повернення на місце */
}

.banner-button:hover {
    background-color: #6b1514;
}

/* Кнопки навігації */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 0rem;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.5rem;
    z-index: 10;
    width: 50px;
    height: 50px;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

/* Класи для позиціонування тексту */
.text-top-left {
    top: 20px;
    left: 20px;
}

.text-top-right {
    top: 20px;
    right: 20px;
}

.text-bottom-left {
    bottom: 20px;
    left: 20px;
}

.text-bottom-right {
    bottom: 20px;
    right: 20px;
}

.text-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Класи для позиціонування кнопки */
.button-top-left {
    top: 80px;
    left: 20px;
}

.button-top-right {
    top: 80px;
    right: 20px;
}

.button-bottom-left {
    bottom: 20px;
    left: 20px;
}

.button-bottom-right {
    bottom: 20px;
    right: 20px;
}

.button-center {
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Адаптивність для мобільних */
@media (max-width: 768px) {
    .banner {
        height: 300px;
    }

    .banner-text h2 {
        font-size: 1.2rem;
        text-align: center;
    }

    .banner-button {
        padding: 0.3rem 0.5rem;
    }

    .banner-text {
        top: 3em;
        left: 4em;
    }

    .banner-button {
        top: 14em;
        left: 5em;
    }
}


/* Codex technical refinements */
.banner-carousel {
    min-height: 280px;
}

.carousel-prev,
.carousel-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@media (max-width: 768px) {
    .banner-carousel,
    .banner {
        height: 300px;
    }

    .banner-text {
        max-width: calc(100% - 3rem);
        left: 1.5rem;
        right: 1.5rem;
        top: 2rem;
    }

    .banner-button {
        left: 1.5rem;
        top: auto;
        bottom: 2rem;
        padding: 0.6rem 1rem;
        box-shadow: 0 0 12px rgba(154, 25, 21, 0.45);
    }
}


/* Stage 2 banner refinement */
.banner-carousel,
.banner,
.banner-text,
.banner-button,
.carousel-prev,
.carousel-next {
    border-radius: 0 !important;
}

.banner-text {
    border-left: 4px solid var(--pv-red, #9a1915);
    background: rgba(0, 0, 0, 0.64);
}

.banner-button {
    background: var(--pv-red, #9a1915);
    border: 1px solid var(--pv-red, #9a1915);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.banner-button:hover {
    background: var(--pv-red-dark, #6b1514);
    border-color: var(--pv-red-dark, #6b1514);
}

@media (max-width: 430px) {
    .banner-carousel,
    .banner {
        height: 260px;
    }

    .banner-text {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
        padding: 0.8rem;
    }

    .banner-text h2 {
        font-size: 1.05rem;
    }

    .carousel-prev,
    .carousel-next {
        width: 42px;
        height: 42px;
    }
}
