.kb-slider {
    position: relative;
    width: 100%;
    height: min(56.25vw, 900px);
    min-height: 520px;
    overflow: hidden;
    background: #111;
    color: #fff;
}

.kb-slides,
.kb-slide,
.kb-slide picture,
.kb-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.kb-slide {
    opacity: 0;
    visibility: hidden;
    z-index: 1;
    cursor: default;
    will-change: opacity, transform;
}

.kb-animation-fade .kb-slide {
    transition:
        opacity var(--kb-transition, 650ms) ease,
        visibility 0s linear var(--kb-transition, 650ms);
}

.kb-animation-fade .kb-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    transition:
        opacity var(--kb-transition, 650ms) ease,
        visibility 0s;
}

.kb-animation-slide-left .kb-slide.is-active,
.kb-animation-slide-right .kb-slide.is-active,
.kb-slide.is-entering,
.kb-slide.is-leaving {
    opacity: 1;
    visibility: visible;
}

.kb-slide[data-url]:not([data-url=""]) {
    cursor: pointer;
}

.kb-slide img {
    object-fit: cover;
}

.kb-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, .30) 0%,
            rgba(0, 0, 0, .05) 38%,
            rgba(0, 0, 0, .64) 100%
        );
}

.kb-content {
    position: relative;
    z-index: 3;
    height: 100%;
    max-width: 1200px;
    margin: auto;
    padding:
        clamp(20px, 3vw, 46px)
        clamp(24px, 5vw, 70px)
        clamp(50px, 5vw, 80px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.kb-top h1,
.kb-top h2 {
    font-size: clamp(38px, 4vw, 68px);
    line-height: 1.05;
    margin: 0 0 12px;
    color: #fff;
    text-shadow: 0 2px 12px #0008;
}

.kb-subtitle {
    font-size: clamp(20px, 2vw, 31px);
    margin: 0;
    text-shadow: 0 2px 8px #0009;
}

.kb-bottom {
    max-width: 920px;
    margin: 0 auto;
}

.kb-body {
    font-size: clamp(17px, 1.35vw, 23px);
    line-height: 1.5;
    margin: 0 0 22px;
    text-shadow: 0 2px 8px #000;
}

.kb-button {
    display: inline-flex;
    min-width: 180px;
    justify-content: center;
    padding: 15px 25px;
    border-radius: 30px;
    background: #252525e8;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.kb-arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #fff9;
    font-size: 60px;
    line-height: 1;
    cursor: pointer;
    padding: 18px;
}

.kb-arrow:hover {
    color: #fff;
}

.kb-prev {
    left: 3vw;
}

.kb-next {
    right: 3vw;
}

.kb-indicators {
    position: absolute;
    z-index: 5;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
}

.kb-indicators button {
    width: 30px;
    height: 4px;
    border: 0;
    background: #ffffff70;
    padding: 0;
    cursor: pointer;
}

.kb-indicators button.is-active {
    background: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .kb-slide {
        transition-duration: 1ms !important;
    }
}

/* Podgląd animacji w panelu */
.animation-preview-card {
    padding: 18px;
    border: 1px solid #ddd5cd;
    border-radius: 10px;
    background: #faf8f5;
}

.animation-preview-window {
    position: relative;
    height: 120px;
    margin: 12px 0;
    overflow: hidden;
    border-radius: 8px;
    background: #d8d0c7;
}

.preview-slide {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 42px;
    font-weight: 800;
    color: #fff;
}

.preview-a {
    background: #86705d;
}

.preview-b {
    opacity: 0;
    background: #38332e;
}

.preview-fade.is-playing .preview-a {
    animation: kb-preview-fade-out .65s ease forwards;
}

.preview-fade.is-playing .preview-b {
    animation: kb-preview-fade-in .65s ease forwards;
}

.preview-slide-left.is-playing .preview-a {
    animation: kb-preview-left-out .65s ease forwards;
}

.preview-slide-left.is-playing .preview-b {
    opacity: 1;
    transform: translateX(100%);
    animation: kb-preview-left-in .65s ease forwards;
}

.preview-slide-right.is-playing .preview-a {
    animation: kb-preview-right-out .65s ease forwards;
}

.preview-slide-right.is-playing .preview-b {
    opacity: 1;
    transform: translateX(-100%);
    animation: kb-preview-right-in .65s ease forwards;
}

@keyframes kb-preview-fade-out {
    to { opacity: 0; }
}

@keyframes kb-preview-fade-in {
    to { opacity: 1; }
}

@keyframes kb-preview-left-out {
    to { transform: translateX(-100%); }
}

@keyframes kb-preview-left-in {
    to { transform: translateX(0); }
}

@keyframes kb-preview-right-out {
    to { transform: translateX(100%); }
}

@keyframes kb-preview-right-in {
    to { transform: translateX(0); }
}

@media (max-width: 700px) {
    .kb-slider {
        height: calc(100svh - 70px);
        min-height: 650px;
        max-height: 960px;
    }

    .kb-content {
        padding: 20px 36px 80px;
    }

    .kb-top h1,
    .kb-top h2 {
        font-size: clamp(34px, 10vw, 50px);
    }

    .kb-subtitle {
        font-size: clamp(19px, 5.5vw, 27px);
    }

    .kb-bottom {
        width: 100%;
    }

    .kb-body {
        font-size: clamp(16px, 4.3vw, 20px);
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .kb-arrow {
        font-size: 50px;
        padding: 8px;
    }

    .kb-prev {
        left: 4px;
    }

    .kb-next {
        right: 4px;
    }

    .kb-button {
        padding: 14px 22px;
    }

    .kb-overlay {
        background:
            linear-gradient(
                to bottom,
                rgba(0, 0, 0, .30),
                rgba(0, 0, 0, .15) 34%,
                rgba(0, 0, 0, .72) 82%,
                rgba(0, 0, 0, .82)
            );
    }
}


/* =========================================================
   MOBILE: tytuł i podtytuł u góry, opis i przycisk na dole
   ========================================================= */
@media (max-width: 700px) {
    .kb-slider .kb-content {
        position: relative !important;
        display: block !important;
        height: 100% !important;
        min-height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .kb-slider .kb-top {
        position: absolute !important;
        z-index: 4 !important;
        top: 22px !important;
        left: 34px !important;
        right: 34px !important;
        bottom: auto !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        text-align: center !important;
    }

    .kb-slider .kb-top h1,
    .kb-slider .kb-top h2 {
        display: block !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        margin: 0 0 7px !important;
        padding: 0 !important;
        font-size: clamp(28px, 8vw, 42px) !important;
        line-height: 1.05 !important;
        font-weight: 800 !important;
        color: #fff !important;
        opacity: 1 !important;
        visibility: visible !important;
        text-align: center !important;
        text-shadow: 0 2px 10px rgba(0, 0, 0, .95) !important;
    }

    .kb-slider .kb-top .kb-subtitle {
        display: block !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: clamp(17px, 4.8vw, 24px) !important;
        line-height: 1.2 !important;
        font-weight: 600 !important;
        color: #fff !important;
        opacity: 1 !important;
        visibility: visible !important;
        text-align: center !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, .95) !important;
    }

    .kb-slider .kb-bottom {
        position: absolute !important;
        z-index: 4 !important;
        left: 30px !important;
        right: 30px !important;
        bottom: 72px !important;
        top: auto !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center !important;
    }

    .kb-slider .kb-bottom .kb-body {
        display: block !important;
        width: auto !important;
        margin: 0 0 14px !important;
        padding: 0 !important;
        font-size: clamp(15px, 4vw, 19px) !important;
        line-height: 1.32 !important;
        color: #fff !important;
        opacity: 1 !important;
        visibility: visible !important;
        text-align: center !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, .98) !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: initial !important;
        overflow: visible !important;
    }

    .kb-slider .kb-bottom .kb-button {
        display: inline-flex !important;
        position: static !important;
        margin: 0 !important;
    }

    .kb-slider .kb-indicators {
        display: flex !important;
        position: absolute !important;
        z-index: 20 !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        gap: 8px !important;
        width: auto !important;
        height: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .kb-slider .kb-indicators button {
        display: block !important;
        width: 32px !important;
        height: 4px !important;
        min-width: 32px !important;
        min-height: 4px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 2px !important;
        background: rgba(255,255,255,.48) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .kb-slider .kb-indicators button.is-active {
        background: #fff !important;
    }

    .kb-slider .kb-overlay {
        background:
            linear-gradient(
                to bottom,
                rgba(0, 0, 0, .62) 0%,
                rgba(0, 0, 0, .20) 24%,
                rgba(0, 0, 0, .06) 48%,
                rgba(0, 0, 0, .40) 72%,
                rgba(0, 0, 0, .82) 100%
            ) !important;
    }
}
