/* Основные стили карусели */
.image-carousel {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: 10px;
}

.carousel-slide {
    flex: 0 0 auto;
    position: relative;
    cursor: pointer;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.carousel-slide:hover img {
    transform: scale(1.05);
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-slide:hover .carousel-caption {
    opacity: 1;
}

/* Стрелки навигации */
.carousel-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 10;
}

.carousel-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    transition: all 0.3s ease;
    pointer-events: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.carousel-arrow:hover {
    background: white;
    transform: scale(1.1);
}

.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Индикаторы */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: #999;
}

.carousel-dot.active {
    background: #007cba;
    transform: scale(1.2);
}

/* Модальное окно */
.carousel-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.carousel-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.3s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    width: 100%;
}

.modal-prev,
.modal-next {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    border: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.3s ease;
}

.modal-prev:hover,
.modal-next:hover {
    background: white;
    transform: scale(1.1);
}

.modal-caption {
    margin-top: 10px;
    color: white;
    text-align: center;
    font-size: 16px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .carousel-arrow {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
    }
    
    .modal-prev,
    .modal-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.carousel-modal.active {
    animation: fadeIn 0.3s ease;
}