.portfolioContainer h2 {
    font-size: 28px;
    font-weight: bold;
    color: #1A2A3A;
    line-height: 36px;
    margin: 48px 0;
    padding: 0;
}

.portfolioContainerGallery {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    margin: 48px auto;
}

.galleryPreviewBlock h2 {
    font-size: 48px;
    color: var(--main-blue);
    text-align: center;
    font-weight: bold;

}

.galleryPreviewBlock p {
    font-size: 20px;
    font-weight: 300;
    color: var(--main-blue);
    text-align: center;
}

.galleryPreviewContainer {
    margin: 48px auto;
    text-align: center;
}

.portfolioContainerGalleryItem {
    max-height: 716px !important;
}

.before-image {
    background-size: cover;
    height: 100%;
    width: 100%;
}

.after-image {
    background-size: cover;
    inset: 0;
    position: absolute;
}

.galleryPreviewBlock button {
    width: 148px;
    height: 58px;
    background-color: var(--main-blue);
    border-radius: 25px;
    border: none;
    color: white;
}

.beforeLabel {
    position: absolute;
    bottom: 20px;
    left: 20px;
}

.afterLabel {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

.portfolioContainerGalleryItemNav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    color: var(--main-blue);
    font-size: 16px;
    padding: 0 15px;
    margin: 0 auto;
}

.buttonLine {
    display: flex;
    flex-direction: column;
    width: fit-content;
    justify-content: center;
}

.leftButton {
    margin: 0 32px 0 10px;
}

.rightButton, .rightButtonMobile {
    margin: 0 10px 0 32px;
    transform: rotate(180deg);
}

.leftButton:hover, .rightButton:hover, .leftButtonMobile:hover, .rightButtonMobile:hover {
    cursor: pointer;
}

.mediaContainer {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
}

.hiddenSpace {
    height: 96px;
    width: 100vh;
}

.galleryCircleNav {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin: 48px 0 0 0;
}

.navCircle {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50%;
    background-color: var(--main-blue);
    margin-right: 4px;
}

.navCircle:hover {
    cursor: pointer;
}

.disabledCircle {
    background-color: rgba(26, 42, 58, 0.5);
}

.before-image-hidden, .after-image-hidden {
    display: none;
}

.socialLine {
    margin: 48px 0 0 0;
}

.socialLine p {
    font-size: 16px;
    color: var(--main-blue);
    margin-bottom: 48px;
}

.socialLineIcons {
    width: 104px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin: 0 auto;
}

.mobileButtonLine {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    flex-wrap: nowrap;
    width: fit-content;
    height: fit-content;
}

.mobileGalleryPartCounter {
    display: none;
}

body {
    overflow-x: hidden;
    max-width: 1440px !important;
}

.portfolioContainer h1 {
    font-size: 48px;
    font-weight: bold;
    color: #1A2A3A;
}

.leftButtonMobile, .rightButtonMobile {
    display: none;
}

.portfolioContainer {
    padding: 96px 0;
    text-align: center;
}

.galleryPart {
    margin: 0 auto 96px auto;
    width: fit-content;
}

.gallerySliderBlock {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: fit-content;
}

.galleryPreview {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 96px 0;
    text-align: center;
}

.galleryPreviewBlock {
    width: fit-content;
    margin: 0 auto;
}

.galleryPreview h2 {
    font-size: 48px;
    font-weight: 700;
    color: #1A2A3A;
}

.galleryPreviewSubHeader {
    font-size: 20px;
    font-weight: 400;
    color: #1A2A3A;
}

.beforeAfterHeader {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 95%;
    margin: 0 auto 24px auto;
    padding: 0;
}

.beforeAfterHeader p {
    margin: 0;
    padding: 0;
    color: #1A2A3A;
    font-size: 16px;
    font-weight: 400;
}

.beforeAfterContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
    max-width: 1440px !important;
}

.beforeAfterSlider {
    width: 1034px; /* Ширина слайдера */
    height: 676px; /* Высота слайдера */
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    margin-bottom: 48px;
}

.beforeAfterImageContainer {
    position: relative;
    width: 100%;
    height: 100%;
}

.beforeImage, .afterImage {
    width: 100%;
    height: 100%;
    object-fit: cover; /*  Сохраняет пропорции изображения и заполняет контейнер */
    position: absolute;
    top: 0;
    left: 0;
}

.afterImage {
    clip: rect(0, auto, auto, 0); /*  Изначально скрывает всю правую часть  */
}

.slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%; /* Начальное положение слайдера по центру */
    width: 5px;
    background-color: #ffffff;
    cursor: ew-resize; /*  Меняет курсор при наведении  */
    transform: translateX(-50%); /*  Центрирует вертикальную линию слайдера  */
    z-index: 10;
}

.sliderHandle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 74px;
    height: 40px;
    background-color: white;
    border-radius: 40px;
    transform: translate(-50%, -50%);
    cursor: ew-resize;
}

.sliderHandle::before {
    content: '';
    position: absolute;
    inset: 0 -20px;
}

.sliderHandle::after {
    align-items: center;
    background: white url('../images/icons/baArrows.svg') no-repeat center;
    border-radius: 40px;
    content: '';
    display: flex;
    font-size: 16px;
    font-weight: bold;
    justify-content: center;
    min-height: 42px !important;
    min-width: 42px !important;
}

.galleryPreview button {
    width: 148px;
    height: 59px;
    border-radius: 40px;
    background-color: #1a2a3a;
    font-size: 18px;
    color: var(--main-white-text);
    border: none;
}

.leftButtonMobile, .rightButtonMobile {
    width: 25px;
    height: 25px;
}

@media (max-width: 1270px) {
    .beforeAfterSlider {
        width: 863px;
        height: 612px;
    }
}

@media (max-width: 1100px) {
    .leftButton {
        margin-right: 20px;
        max-width: 50px;
    }

    .rightButton {
        margin-left: 20px;
        max-width: 50px;
    }

    .portfolioContainer {
        padding: 48px 10px;
        text-align: center;
    }

    .fullSizeText {
        display: inline-block;
    }

    .mobileSizeText {
        display: none;
    }

    .rightButton, .leftButton {
        display: inline-block;
    }

    .leftButtonMobile, .rightButtonMobile {
        display: none;
    }

    .mobileGalleryPartCounter {
        display: inline-block;
    }
}

@media (max-width: 1030px) {
    .beforeAfterSlider {
        width: 777px;
        height: 550px;
    }
}

@media (max-width: 940px) {
    .beforeAfterSlider {
        width: 680px;
        height: 480px;
    }

    .galleryPreview h2 {
        font-size: 36px;
        font-weight: 700;
    }

    .galleryPreviewBlock {
        margin: 24px auto 0 auto;
    }
}

@media (max-width: 850px) {
    .beforeAfterSlider {
        width: 600px;
        height: 400px;
    }
}

@media (max-width: 770px) {
    .galleryPreview {
        padding: 48px 0;
    }

    .galleryPreview button {
        width: 180px;
        font-size: 14px;
        line-height: 20px;
        font-weight: 600;
    }

    .beforeAfterSlider {
        width: 500px;
        height: 320px;
        padding: 0 !important;
        margin: 0 auto;
    }

    .galleryPreviewBlock {
        margin: 24px auto;
    }

    .galleryPreview h2 {
        font-size: 22px;
        line-height: 30px;
        font-weight: 600;
    }

    .galleryPreviewSubHeader {
        font-size: 12px;
        font-weight: 400;
        line-height: 18px;
    }

    .fullSizeText {
        display: none;
    }

    .sliderHandle {
        width: 66px;
        height: 44px;
    }

    .portfolioContainer h1 {
        font-size: 36px;
    }

    .portfolioContainer {
        padding: 48px 0;
    }
}

@media (max-width: 710px) {
    .fullSizeText {
        display: none;
    }

    .mobileSizeText {
        display: inline-block;
    }

    .mobileButtonLine {
        display: flex !important;
        flex-direction: row;
        justify-content: center;
        flex-wrap: nowrap;
        width: fit-content;
        height: fit-content;
        margin: 20px auto;
    }

    .leftButtonMobile, .rightButtonMobile {
        display: inline-block !important;
        margin: 0;
        padding: 0;
    }

    .mobileGalleryPartCounter {
        margin: 0 10px;
    }

    .leftButtonMobile, .rightButtonMobile {
        max-width: 25px;
        display: inline-block !important;
    }

    .rightButton, .leftButton {
        display: none;
    }

    .galleryCircleNav {
        flex-wrap: wrap;
        margin: 24px 0 0 0;
        row-gap: 5px;
    }
}

@media (max-width: 550px) {
    .beforeAfterHeader {
        margin: 0 auto;
    }

    .portfolioContainer {
        padding: 8px 0 48px 0;
    }

    .portfolioContainer h1 {
        font-size: 22px;
        line-height: 30px;
        max-width: 268px;
        margin: 0 auto;
    }

    .portfolioContainer h2 {
        font-size: 18px;
        line-height: 144%;
        margin: 48px 0 24px 0;
        padding: 0;
    }

    .galleryPreviewBlock p {
        font-size: 12px;
        line-height: 150%;
    }

    .galleryPart {
        margin: 0 auto 48px auto;
    }

    .socialLine {
        max-width: 202px;
        margin: -24px auto 0 auto;
    }

    .socialLine p {
        font-size: 12px;
        line-height: 18px;
        margin-bottom: 24px;
    }
}

@media (max-width: 510px) {
    .beforeAfterSlider {
        width: 460px;
        height: 280px;
    }
}

@media (max-width: 470px) {
    .beforeAfterSlider {
        width: 400px;
        height: 240px;
    }
}

@media (max-width: 420px) {
    .beforeAfterSlider {
        width: 360px;
        height: 211px;
    }
}

@media (max-width: 380px) {
    .beforeAfterSlider {
        width: 330px;
    }
}

@media (max-width: 350px) {
    .beforeAfterSlider {
        width: 300px;
    }
}
