/* Основные стили слайдера */
.awesome-photo-gallery {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.apg-slider {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 300px;
    background: #000;
}

.apg-slides {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.apg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    transform: translateX(100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.apg-slide.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
}

.apg-slide.prev {
    transform: translateX(-100%);
}

.apg-slide img {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
}

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

.apg-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px;
    font-size: 16px;
    text-align: center;
}

/* Пустая галерея */
.awesome-gallery-empty {
    background: #f9f9f9;
    border: 2px dashed #ddd;
    padding: 40px 20px;
    text-align: center;
    border-radius: 10px;
}

.awesome-gallery-empty p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Стрелки навигации */
.apg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apg-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.apg-prev {
    left: 20px;
}

.apg-next {
    right: 20px;
}

/* Точки навигации */
.apg-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.apg-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apg-dot:hover,
.apg-dot.active {
    background: white;
    border-color: white;
    transform: scale(1.2);
}

/* Лайтбокс */
.apg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.apg-lightbox.active {
    display: flex;
}

.apg-lightbox-content {
    position: relative;
    width: 80vw;
    height: 80vh;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px;
}

.apg-lightbox-image {
    max-width: 100%;
    max-height: calc(100% - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    animation: scaleIn 0.3s ease;
}

.apg-lightbox-close {
    position: absolute;
    top: -50px;
    right: -50px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.apg-lightbox-prev,
.apg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    font-size: 30px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apg-lightbox-prev:hover,
.apg-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.apg-lightbox-prev {
    left: -80px;
}

.apg-lightbox-next {
    right: -80px;
}

.apg-lightbox-caption {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    font-size: 18px;
    padding: 20px;
}

/* Миниатюры в модальном окне */
.apg-lightbox-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.apg-lightbox-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.apg-lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.apg-lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.apg-lightbox-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.apg-lightbox-thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.apg-lightbox-thumbnail.active {
    border-color: white;
    transform: scale(1.1);
}

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

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .apg-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .apg-prev {
        left: 10px;
    }
    
    .apg-next {
        right: 10px;
    }
    
    .apg-caption {
        font-size: 14px;
        padding: 15px;
    }
    
    .apg-lightbox-content {
        width: 95vw;
        height: 90vh;
        margin: 20px;
    }
    
    .apg-lightbox-prev,
    .apg-lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .apg-lightbox-prev {
        left: 10px;
    }
    
    .apg-lightbox-next {
        right: 10px;
    }
    
    .apg-lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .apg-lightbox-caption {
        bottom: 10px;
        font-size: 16px;
        padding: 10px;
    }
    
    .apg-lightbox-thumbnails {
        bottom: 10px;
        gap: 8px;
        padding: 8px;
    }
    
    .apg-lightbox-thumbnail {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .apg-slider {
        min-height: 250px;
    }
    
    .apg-arrow {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .apg-dots {
        bottom: 10px;
        gap: 8px;
    }
    
    .apg-dot {
        width: 10px;
        height: 10px;
    }
}

/* Поддержка свайпов */
.apg-slider {
    touch-action: pan-y;
    user-select: none;
}

.apg-slide {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.apg-slide.swiping {
    transition: none;
}