/* Мобильная галерея с эффектом пролистывания */

/* Контейнер для галереи изображений */
.image-container {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    aspect-ratio: 320 / 200;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

/* Обертка для всех изображений галереи */
.gallery-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Состояние когда идет активное перетаскивание */
.gallery-wrapper.dragging {
    transition: none;
}

/* Отдельное изображение в галерее */
.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    flex: 0 0 100%;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover эффект для изображений в галерее */
.card:hover .gallery-image {
    transform: scale(1.05);
}

/* Состояние когда идет горизонтальный свайп */
.image-container.swiping-horizontal {
    touch-action: none;
}

.image-container:hover .gallery-image {
    cursor: crosshair;
}

/* Дискретная пагинация без фоновой плашки */
.pagination {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    padding: 0;
    /* Убираем фоновую плашку */
    background: none;
    backdrop-filter: none;
    border-radius: 0;
}

.card:hover .pagination {
    /* Убираем hover эффект для фона */
    background: none;
    backdrop-filter: none;
}

.pagination-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pagination-dot.active {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.pagination-dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
}

.card:hover .pagination-dot {
    background: rgba(255, 255, 255, 0.5);
}

.card:hover .pagination-dot.active {
    background: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Индикатор прогресса свайпа с улучшенными эффектами */
.swipe-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.swipe-indicator.left {
    left: 20px;
}

.swipe-indicator.right {
    right: 20px;
}

.swipe-indicator.show {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.swipe-indicator svg {
    width: 20px;
    height: 20px;
    fill: #333;
    transition: fill 0.4s ease;
}

.card:hover .swipe-indicator {
    background: rgba(93, 61, 181, 0.9);
    box-shadow: 0 6px 16px rgba(93, 61, 181, 0.3);
}

.card:hover .swipe-indicator svg {
    fill: white;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .pagination {
        bottom: 4px;
        gap: 6px;
    }
    
    .pagination-dot {
        width: 5px;
        height: 5px;
    }
    
    .swipe-indicator {
        width: 32px;
        height: 32px;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    }
    
    .swipe-indicator.left {
        left: 15px;
    }
    
    .swipe-indicator.right {
        right: 15px;
    }
    
    .swipe-indicator svg {
        width: 16px;
        height: 16px;
    }
    
    .card:hover .swipe-indicator {
        box-shadow: 0 4px 10px rgba(93, 61, 181, 0.25);
    }
}

/* Плавные переходы при смене изображений */
.gallery-wrapper.transitioning {
    transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Эффект затухания границ для better UX с hover эффектами */
.image-container::before,
.image-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.image-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
}

.image-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
}

.image-container.show-edge-gradients::before,
.image-container.show-edge-gradients::after {
    opacity: 1;
}

.card:hover .image-container::before,
.card:hover .image-container::after {
    background: linear-gradient(to right, rgba(93, 61, 181, 0.15), transparent);
}

.card:hover .image-container::after {
    background: linear-gradient(to left, rgba(93, 61, 181, 0.15), transparent);
}

/* Добавить в конец файла gallery-style.css */

/* Индикатор дополнительных фотографий */
.pagination-more {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 16px;
}

.pagination-more:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card:hover .pagination-more {
    background: rgba(93, 61, 181, 0.9);
    color: white;
    box-shadow: 0 2px 6px rgba(93, 61, 181, 0.4);
}

.card:hover .pagination-more:hover {
    background: rgba(93, 61, 181, 1);
    transform: scale(1.1);
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .pagination-more {
        font-size: 9px;
        padding: 1px 4px;
        min-width: 16px;
        height: 14px;
        margin-left: 3px;
    }
    
    .card:hover .pagination-more {
        box-shadow: 0 1px 4px rgba(93, 61, 181, 0.3);
    }
}