/* ========== КАРУСЕЛЬ ========== */
.karusel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #0a0a0a;
}

.karusel-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-height: 700px;
    min-height: 500px;
    overflow: hidden;
}

.karusel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.karusel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    z-index: 1;
}

.karusel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Элегантная анимация ухода влево */
.karusel-slide.exit-left {
    animation: slideExitLeft 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 3;
}

/* Элегантная анимация прихода справа */
.karusel-slide.enter-right {
    animation: slideEnterRight 0.7s cubic-bezier(0.2, 0.9, 0.4, 1) forwards;
    z-index: 3;
}

@keyframes slideExitLeft {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideEnterRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Плавное появление контента внутри активного слайда */
.karusel-slide.active .karusel-content {
    animation: contentFadeIn 0.6s cubic-bezier(0.2, 0.9, 0.4, 1) 0.2s both;
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Фоновое изображение слайда */
.karusel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
}

/* Затемнение для читаемости текста */
.karusel-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.3) 0%,
        rgba(0,0,0,0.5) 50%,
        rgba(0,0,0,0.7) 100%
    );
    pointer-events: none;
    z-index: 2;
}

/* Контент слайда */
.karusel-content {
    position: absolute;
    bottom: 15%;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    z-index: 3;
    padding: 0 20px;
    opacity: 0;
}

.karusel-title {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    letter-spacing: -0.02em;
}

.karusel-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    margin-bottom: 24px;
    opacity: 0.95;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.karusel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 40px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.karusel-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #0369a1, #0284c7);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.karusel-btn i {
    font-size: 0.9rem;
}

/* Навигационные точки (пагинация) */
.karusel-dots {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 10;
    list-style: none;
}

.karusel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
    border: none;
    padding: 0;
    font-size: 0;
    line-height: 0;
}

.karusel-dot.active {
    width: 28px;
    border-radius: 5px;
    background: white;
}

.karusel-dot:hover {
    background: rgba(255,255,255,0.7);
}

/* Кнопки навигации */
.karusel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
    color: white;
    font-size: 20px;
    opacity: 0.6;
}

.karusel-nav-btn:hover {
    opacity: 1;
    background: rgba(0,0,0,0.6);
    transform: translateY(-50%) scale(1.05);
}

.karusel-prev {
    left: 20px;
}

.karusel-next {
    right: 20px;
}

/* Таймер (прогресс-бар) */
.karusel-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.2);
    z-index: 10;
}

.karusel-timer-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    transition: width linear 0.02s;
}

/* Адаптив */
@media (max-width: 768px) {
    .karusel-container {
        min-height: 400px;
        max-height: 500px;
    }
    
    .karusel-content {
        bottom: 20%;
    }
    
    .karusel-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .karusel-prev {
        left: 12px;
    }
    
    .karusel-next {
        right: 12px;
    }
    
    .karusel-btn {
        padding: 10px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .karusel-container {
        min-height: 350px;
        max-height: 450px;
    }
    
    .karusel-dots {
        bottom: 20px;
        gap: 8px;
    }
    
    .karusel-dot {
        width: 8px;
        height: 8px;
    }
    
    .karusel-dot.active {
        width: 20px;
    }
    
    .karusel-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Семантические улучшения */
.karusel-slide article {
    height: 100%;
    position: relative;
}

.karusel-slide figure {
    height: 100%;
    margin: 0;
}

.karusel-slide figcaption {
    position: absolute;
    bottom: 15%;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 3;
}

/* Skip link для клавиатурной навигации */
.karusel-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0284c7;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 8px 0;
    font-size: 14px;
}

.karusel-skip-link:focus {
    top: 0;
}