/* Фотогалерея Coverflow на странице подкатегории (tpl/blocks/category_gallery.tpl, javascript/gallery.js).
   Масштаб слайдов задаёт Swiper (coverflowEffect.scale): центральное фото на ~18% крупнее соседних, крайние — меньше. */

.cg {
    margin: 40px 0;
    padding: 30px 0 24px;
    background: #f7f7f7;
    border-radius: 10px;
    text-align: center;
}

.cg__title {
    margin: 0 20px 10px;
    color: #333;
    font: 26px/1.25 'Open Sans Bold', sans-serif;
    text-transform: none;
}

.cg__text {
    max-width: 760px;
    margin: 0 auto 20px;
    padding: 0 20px;
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

.cg__stage {
    position: relative;
}

.cg__swiper {
    overflow: hidden;
    padding: 24px 0;
}

/* общие правила сайта для .swiper-slide (main.css) дают белый фон и растягивают слайд по высоте */
.cg .swiper-wrapper {
    align-items: center;
}

.cg .swiper-slide.cg__slide {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
    background: none;
}

.cg__link {
    display: block;
    width: 100%;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.cg__slide.swiper-slide-active .cg__link {
    cursor: zoom-in;
}

/* фото целиком, без обрезки и искажений; селектор сильнее общего правила сайта
   .swiper-slide img { width: auto; height: 100%; object-fit: cover } из main.css */
.cg .cg__slide .cg__img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    transition: transform .3s ease;
}

/* наведение на центральное фото — +4%, место под это оставлено отступом между слайдами */
@media (hover: hover) {
    .cg .cg__slide.swiper-slide-active .cg__link:hover .cg__img {
        transform: scale(1.04);
    }
}

/* стрелки: зелёный кружок со стрелкой внутри; стоят под каруселью по бокам от счётчика —
   вся ширина колонки отдана фото */
.cg__arrow {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid #99c45a;
    border-radius: 50%;
    background: #fff;
    color: #99c45a;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.cg__arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.cg__arrow--prev::before {
    transform: translate(-35%, -50%) rotate(-135deg);
}

.cg__arrow--next::before {
    transform: translate(-65%, -50%) rotate(45deg);
}

.cg__arrow:hover,
.cg__arrow:focus-visible {
    background: #99c45a;
    color: #fff;
}

.cg__arrow:focus-visible,
.cg__link:focus-visible {
    outline: 2px solid #99c45a;
    outline-offset: 3px;
}

.cg__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 4px;
}

.cg__counter {
    min-width: 64px;
    color: #555;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
    .cg {
        margin: 30px -15px;
        border-radius: 0;
    }

    .cg__title {
        font-size: 21px;
    }
}
