/* Галерея */
.gallery {
    max-width: 1200px;
    margin: 20px auto;
    text-align: center;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.carousel-control {
    background: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 24px;
}

.carousel-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel-images {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* n колонок */
    grid-template-rows: repeat(3, 1fr); /* n ряда */
    gap: 15px; /* Расстояние между элементами */
    max-width: 1000px; /* Максимальная ширина галереи */
    margin: 0 auto; /* Центрирование галереи */
}

.carousel-item {
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Создание квадратного контейнера */
    position: relative;
}

.carousel-item a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполнение контейнера с обрезкой */
    border-radius: 5px;
    transition: transform 0.3s;
}

.carousel-image:hover {
    transform: scale(1.05); /* Легкое увеличение при наведении */
}

.step-links a.pagination-button {
    text-decoration: none;
    margin: 0 10px;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
}

.step-links a.pagination-button:hover {
    background: #555;
}

.pagination {
    text-align: center;
    margin-top: 20px;
}

.pagination-button {
    text-decoration: none;
    margin: 0 10px;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
}

.pagination-button:hover {
    background: #555;
}

.cta {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
}

.cta-button {
    text-decoration: none; /* Убирает подчеркивание */
    padding: 10px 20px;
    background-color: #ffffff;
    color: #666;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s, color 0.3s, transform 0.3s; /* добавляем плавный переход для transform */
    box-sizing: border-box;
    border: 2px solid #666; /* серая рамка */
}

.cta-button:hover {
    /*background-color: #d3d3d3;*/
    border: 2px solid #000000; /* серая рамка */
    color: #000000;
    transform: scale(1.2); /* Увеличение на 5% */
}

/* Стили для модального окна */
.lightbox-modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    z-index: 1000; /* Поверх всего */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Избегаем прокрутки */
    background-color: rgba(0, 0, 0, 0.8); /* Полупрозрачный фон */
    justify-content: center;
    align-items: center;
}

/* Изображение внутри модального окна */
.lightbox-content {
    max-width: 80%;
    max-height: 80%;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    object-fit: contain; /* Сохраняем пропорции */
}

/* Кнопка закрытия */
.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
}

/* Навигационные стрелки */
.lightbox-navigation .prev,
.lightbox-navigation .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: #fff;
    font-weight: bold;
    font-size: 40px;
    transition: color 0.3s;
    user-select: none;
}

.lightbox-navigation .prev {
    left: 20px;
}

.lightbox-navigation .next {
    right: 20px;
}

.lightbox-navigation .prev:hover,
.lightbox-navigation .next:hover {
    color: #bbb;
}

/* Нумерация */
.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    padding: 8px 16px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}

/* Размытие фона при открытом модальном окне */
.container.blurred {
    filter: blur(5px);
    transition: filter 0.3s;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .carousel-images {
        grid-template-columns: repeat(4, 1fr); /* Четыре колонки */
    }
}

@media (max-width: 900px) {
    .carousel-images {
        grid-template-columns: repeat(3, 1fr); /* Три колонки */
    }
}

@media (max-width: 600px) {
    .carousel-images {
        grid-template-columns: repeat(2, 1fr); /* Две колонки */
    }

    .carousel-control {
        font-size: 18px; /* Уменьшение размера шрифта для управления каруселью на маленьких экранах */
        padding: 8px 16px;
    }

    .cta-button {
        font-size: 8px; /* Уменьшение размера шрифта для кнопки CTA на маленьких экранах */
    }
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 90%;
        max-height: 70%;
    }

    .close {
        font-size: 30px;
        top: 10px;
        right: 20px;
    }

    .lightbox-navigation .prev,
    .lightbox-navigation .next {
        font-size: 30px;
        padding: 12px;
    }

    .lightbox-caption {
        font-size: 16px;
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 60%;
    }

    .close {
        font-size: 24px;
        top: 5px;
        right: 10px;
    }

    .lightbox-navigation .prev,
    .lightbox-navigation .next {
        font-size: 24px;
        padding: 8px;
    }

    .lightbox-caption {
        font-size: 14px;
        bottom: 15px;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }