html {
    scroll-behavior: smooth;
}

.category-page__title {
    position: relative;
    display: inline-block;

    font-size: 36px;
    font-weight: 700;

    color: #222;

    margin-bottom: 20px;
}

.category-page__title::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: -10px;

    width: 90px;
    height: 3px;

    background: #00743C;

    border-radius: 3px;
}

.category-page__description {
    color: #666;
    line-height: 1.7;
}


/*--------------------------------------------------------------
# Преимущества категории
--------------------------------------------------------------*/

.category-benefits {
    margin-top: 70px;
    padding-top: 50px;

    border-top: 1px solid #ececec;
}

.category-benefits__header {
    margin-bottom: 35px;
}

.category-benefits__title {
    position: relative;
    display: inline-block;

    margin: 0 0 16px;

    font-size: 30px;
    font-weight: 700;
    line-height: 1.3;

    color: #00743C;
}

.category-benefits__title::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: -9px;

    width: 70px;
    height: 3px;

    background: #00743C;

    border-radius: 3px;
}

.category-benefits__subtitle {
    margin: 0;

    color: #777;

    font-size: 16px;
    line-height: 1.6;
}


/*--------------------------------------------------------------
# Список преимуществ
--------------------------------------------------------------*/

.category-benefits__list {
    display: flex;
    flex-direction: column;

    gap: 24px;
}


/*--------------------------------------------------------------
# Карточка преимущества
--------------------------------------------------------------*/

.category-benefit {
    display: grid;

    grid-template-columns:
        320px
        minmax(0, 1fr);

    min-height: 260px;

    overflow: hidden;

    background: #fff;

    border: 1px solid #e8e8e8;
    border-radius: 14px;

    scroll-margin-top: 100px;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.category-benefit:hover {
    transform: translateY(-2px);

    border-color: #dcdcdc;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, .06);
}


/*--------------------------------------------------------------
# Изображение преимущества
--------------------------------------------------------------*/

.category-benefit__image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 260px;

    padding: 24px;

    background: #fafafa;

    border-right: 1px solid #f0f0f0;
}

.category-benefit__image {
    display: block;

    width: 100%;
    height: 100%;

    max-height: 260px;

    object-fit: contain;
}


/*--------------------------------------------------------------
# Содержимое преимущества
--------------------------------------------------------------*/

.category-benefit__body {
    padding: 32px 36px;
}

.category-benefit__title {
    position: relative;
    display: inline-block;

    margin: 0 0 22px;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;

    color: #222;
}

.category-benefit__title::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: -8px;

    width: 50px;
    height: 3px;

    background: #00743C;

    border-radius: 3px;
}

.category-benefit__description {
    color: #666;

    font-size: 16px;
    line-height: 1.75;
}

.category-benefit__description p:last-child {
    margin-bottom: 0;
}


/*--------------------------------------------------------------
# Галерея категории
--------------------------------------------------------------*/

.category-gallery {
    margin-top: 70px;
    padding-top: 50px;

    border-top: 1px solid #ececec;
}

.category-gallery__header {
    margin-bottom: 35px;
}

.category-gallery__title {
    position: relative;
    display: inline-block;

    margin: 0 0 16px;

    font-size: 30px;
    font-weight: 700;
    line-height: 1.3;

    color: #00743C;
}

.category-gallery__title::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: -9px;

    width: 70px;
    height: 3px;

    background: #00743C;

    border-radius: 3px;
}

.category-gallery__subtitle {
    margin: 0;

    color: #777;

    font-size: 16px;
    line-height: 1.6;
}


/*--------------------------------------------------------------
# Сетка галереи
--------------------------------------------------------------*/

.category-gallery__grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}


/*--------------------------------------------------------------
# Элемент галереи
--------------------------------------------------------------*/

.category-gallery__item {
    display: block;

    width: 100%;

    padding: 0;

    overflow: hidden;

    text-align: left;

    background: #fff;

    border: 1px solid #e8e8e8;
    border-radius: 14px;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        transform .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

.category-gallery__item:hover {
    transform: translateY(-3px);

    border-color: #dcdcdc;

    box-shadow:
        0 10px 26px rgba(0, 0, 0, .08);
}

.category-gallery__item:focus-visible {
    outline: none;

    border-color: #00743C;

    box-shadow:
        0 0 0 3px rgba(0, 116, 60, .12);
}


/*--------------------------------------------------------------
# Изображение
--------------------------------------------------------------*/

.category-gallery__image-wrapper {
    position: relative;

    display: block;

    overflow: hidden;

    aspect-ratio: 4 / 3;

    background: #f7f7f7;
}

.category-gallery__image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform .35s ease;
}

.category-gallery__item:hover
.category-gallery__image {
    transform: scale(1.035);
}


/*--------------------------------------------------------------
# Overlay
--------------------------------------------------------------*/

.category-gallery__overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0);

    transition:
        background-color .25s ease;
}

.category-gallery__item:hover
.category-gallery__overlay {
    background: rgba(0, 0, 0, .20);
}

.category-gallery__zoom {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    color: #fff;

    background: rgba(0, 0, 0, .62);

    border: 1px solid rgba(255, 255, 255, .20);
    border-radius: 50%;

    opacity: 0;

    transform: scale(.85);

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.category-gallery__item:hover
.category-gallery__zoom {
    opacity: 1;

    transform: scale(1);
}


/*--------------------------------------------------------------
# Подпись
--------------------------------------------------------------*/

.category-gallery__caption {
    display: block;

    padding: 12px 14px 14px;

    color: #333;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}


/*--------------------------------------------------------------
# Mobile
--------------------------------------------------------------*/

@media (max-width: 768px) {

    .category-benefits {
        margin-top: 50px;
        padding-top: 35px;
    }

    .category-benefits__title {
        font-size: 26px;
    }

    .category-benefits__header {
        margin-bottom: 25px;
    }

    .category-benefits__list {
        gap: 20px;
    }

    .category-benefit {
        grid-template-columns: 1fr;
    }

    .category-benefit__image-wrapper {
        min-height: 200px;

        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .category-benefit__image {
        max-height: 200px;
    }

    .category-benefit__body {
        padding: 24px;
    }

    .category-benefit__title {
        font-size: 20px;
    }

    .category-benefit__description {
        font-size: 15px;
        line-height: 1.7;
    }


    /* Галерея */

    .category-gallery {
        margin-top: 50px;
        padding-top: 35px;
    }

    .category-gallery__title {
        font-size: 26px;
    }

    .category-gallery__header {
        margin-bottom: 25px;
    }

    .category-gallery__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 14px;
    }

    .category-gallery__caption {
        padding: 10px 11px 12px;

        font-size: 13px;
    }

    .category-gallery__zoom {
        width: 40px;
        height: 40px;
    }
}


/*--------------------------------------------------------------
# Small mobile
--------------------------------------------------------------*/

@media (max-width: 480px) {

    .category-page__title {
        font-size: 30px;
    }

    .category-gallery__grid {
        gap: 10px;
    }

    .category-gallery__item {
        border-radius: 11px;
    }

    .category-gallery__image-wrapper {
        aspect-ratio: 1 / 1;
    }

    .category-gallery__caption {
        padding: 9px 10px 11px;

        font-size: 12px;
    }
}


/*--------------------------------------------------------------
# Gallery Lightbox
--------------------------------------------------------------*/

.category-gallery-lightbox {
    position: fixed;

    inset: 0;

    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(0, 0, 0, .88);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity .22s ease,
        visibility .22s ease;
}

.category-gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}


/*--------------------------------------------------------------
# Dialog
--------------------------------------------------------------*/

.category-gallery-lightbox__dialog {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: min(1200px, 100%);
    height: min(90vh, 900px);

    max-height: 90vh;
}


/*--------------------------------------------------------------
# Content
--------------------------------------------------------------*/

.category-gallery-lightbox__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    padding: 20px 70px;
}

.category-gallery-lightbox__image {
    display: block;

    max-width: 100%;
    max-height: calc(90vh - 100px);

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 8px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, .35);

    opacity: 1;

    transform: scale(1);

    transition:
        opacity .12s ease,
        transform .12s ease;
}

.category-gallery-lightbox__image.is-changing {
    opacity: 0;

    transform: scale(.985);
}


/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/

.category-gallery-lightbox__footer {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 18px;

    width: 100%;

    padding-top: 14px;
}

.category-gallery-lightbox__caption {
    max-width: 700px;

    color: #fff;

    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;

    text-align: center;
}

.category-gallery-lightbox__counter {
    flex: 0 0 auto;

    padding: 5px 9px;

    color: rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .10);

    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 7px;

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;
}


/*--------------------------------------------------------------
# Close
--------------------------------------------------------------*/

.category-gallery-lightbox__close {
    position: absolute;

    top: 0;
    right: 0;

    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    padding: 0;

    color: #fff;
    background: rgba(0, 0, 0, .45);

    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;

    font-size: 18px;

    cursor: pointer;

    transition:
        background-color .15s ease,
        transform .15s ease;
}

.category-gallery-lightbox__close:hover {
    background: rgba(0, 0, 0, .70);

    transform: scale(1.04);
}


/*--------------------------------------------------------------
# Previous / Next
--------------------------------------------------------------*/

.category-gallery-lightbox__prev,
.category-gallery-lightbox__next {
    position: absolute;

    top: 50%;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    padding: 0;

    color: #fff;
    background: rgba(0, 0, 0, .45);

    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;

    font-size: 16px;

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        background-color .15s ease,
        transform .15s ease;
}

.category-gallery-lightbox__prev {
    left: 0;
}

.category-gallery-lightbox__next {
    right: 0;
}

.category-gallery-lightbox__prev:hover,
.category-gallery-lightbox__next:hover {
    background: rgba(0, 0, 0, .70);
}

.category-gallery-lightbox__prev:hover {
    transform:
        translateY(-50%)
        translateX(-2px);
}

.category-gallery-lightbox__next:hover {
    transform:
        translateY(-50%)
        translateX(2px);
}


/*--------------------------------------------------------------
# Keyboard focus
--------------------------------------------------------------*/

.category-gallery-lightbox__close:focus-visible,
.category-gallery-lightbox__prev:focus-visible,
.category-gallery-lightbox__next:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(255, 255, 255, .25);
}


/*--------------------------------------------------------------
# Mobile
--------------------------------------------------------------*/

@media (max-width: 768px) {

    .category-gallery-lightbox {
        padding: 15px;
    }

    .category-gallery-lightbox__dialog {
        width: 100%;
        height: 100%;
        max-height: none;
    }

    .category-gallery-lightbox__content {
        padding: 50px 0 25px;
    }

    .category-gallery-lightbox__image {
        max-width: 100%;
        max-height: calc(100vh - 150px);

        border-radius: 6px;
    }

    .category-gallery-lightbox__close {
        top: 0;
        right: 0;

        width: 42px;
        height: 42px;
    }

    .category-gallery-lightbox__prev,
    .category-gallery-lightbox__next {
        top: auto;
        bottom: 0;

        width: 42px;
        height: 42px;

        transform: none;
    }

    .category-gallery-lightbox__prev {
        left: 0;
    }

    .category-gallery-lightbox__next {
        right: 0;
    }

    .category-gallery-lightbox__prev:hover,
    .category-gallery-lightbox__next:hover {
        transform: none;
    }

    .category-gallery-lightbox__footer {
        flex-direction: column;

        gap: 7px;

        padding-top: 12px;
        padding-left: 50px;
        padding-right: 50px;
    }

    .category-gallery-lightbox__caption {
        max-width: 100%;

        font-size: 14px;

        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;

        overflow: hidden;
    }

    .category-gallery-lightbox__counter {
        font-size: 11px;
    }
}


/*--------------------------------------------------------------
# Small mobile
--------------------------------------------------------------*/

@media (max-width: 480px) {

    .category-gallery-lightbox {
        padding: 10px;
    }

    .category-gallery-lightbox__content {
        padding-top: 48px;
        padding-bottom: 20px;
    }

    .category-gallery-lightbox__image {
        max-height: calc(100vh - 130px);
    }
}


/*--------------------------------------------------------------
# Reduced motion
--------------------------------------------------------------*/

@media (prefers-reduced-motion: reduce) {

    .category-gallery-lightbox,
    .category-gallery-lightbox__image,
    .category-gallery__item,
    .category-gallery__image,
    .category-gallery__overlay,
    .category-gallery__zoom {
        transition: none;
    }
}
