.portfolio-detail {
    padding: 50px 35px 65px;
}

.portfolio-detail__title {
    margin: 0 0 25px;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 700;
    color: #111;
}

.portfolio-detail__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48%;
    gap: 24px;
    align-items: start;
}

.portfolio-detail__content {
    min-height: 355px;
    background: #fff;
}

.portfolio-detail__text {
    min-height: 465px;
    padding: 28px;
    font-size: 16px;
    line-height: 1.5;
    color: #222;
}

.portfolio-detail__text p:first-child {
    margin-top: 0;
}

.portfolio-detail__text p:last-child {
    margin-bottom: 0;
}

/* Правая колонка с фото */
.portfolio-detail__media {
    min-width: 0;
}

/* Основной слайдер */
.portfolio-detail__slider {
    width: 100%;
    margin-bottom: 18px;
    background: #fff;
}

.portfolio-detail__slider .swiper-slide {
    height: auto;
}

.portfolio-detail__main-link {
    display: block;
    width: 100%;
    height: 355px;
    background: #fff;
    text-decoration: none;
}

.portfolio-detail__main-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Миниатюры */
.portfolio-detail__thumbs-wrap {
    position: relative;
    padding: 0 35px;
}

.portfolio-detail__thumbs {
    width: 100%;
}

.portfolio-detail__thumbs .swiper-slide {
    height: auto;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.portfolio-detail__thumbs .swiper-slide:hover,
.portfolio-detail__thumbs .swiper-slide-thumb-active {
    opacity: 1;
}

.portfolio-detail__thumb {
    height: 95px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s ease;
}

.portfolio-detail__thumbs .swiper-slide-thumb-active .portfolio-detail__thumb {
    border-color: #8bef25;
}

.portfolio-detail__thumb img {
    display: block;
/*    width: 100%;*/
    height: 100%;
    object-fit: cover;
}

/* Стрелки миниатюр */
.portfolio-detail__thumbs-prev,
.portfolio-detail__thumbs-next {
    width: 24px;
    height: 24px;
    margin-top: -12px;
    color: #8bef25;
}

.portfolio-detail__thumbs-prev::after,
.portfolio-detail__thumbs-next::after {
    font-size: 18px;
    font-weight: 700;
}

.portfolio-detail__thumbs-prev {
    left: 0;
}

.portfolio-detail__thumbs-next {
    right: 0;
}

.portfolio-detail__thumbs-prev.swiper-button-disabled,
.portfolio-detail__thumbs-next.swiper-button-disabled {
    opacity: 0.25;
}

/* Услуги */
.portfolio-detail__services {
    margin-top: 30px;
}

.portfolio-detail__services-title {
    margin-bottom: 18px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    color: #111;
}

.portfolio-detail__services-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 240px));
    gap: 24px;
}

.portfolio-service-card {
    overflow: hidden;
    border-radius: 8px;
    background: #d9d9d9;
}

.portfolio-service-card__image {
    display: block;
    height: 185px;
    background: #fff;
    text-decoration: none;
}

.portfolio-service-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-service-card__body {
    padding: 14px 14px 12px;
    text-align: center;
}

.portfolio-service-card__title {
    display: block;
    min-height: 38px;
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 700;
    color: #111;
    text-decoration: none;
}

.portfolio-service-card__title:hover {
    text-decoration: underline;
}
.portfolio-service-card__order{
        margin-bottom: 7px !important;
}
.portfolio-service-card__price {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.3;
    color: #333;
}

.portfolio-service-card__order,
.portfolio-service-card__more {
    display: block;
    width: 100%;
    min-height: 22px;
    border-radius: 4px;
    padding: 3px 0;
    font-size: 16px;
    line-height: 22px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
}

.portfolio-service-card__order {
    margin-bottom: 7px;
    background: #8bef25;
    color: #111;
}

.portfolio-service-card__more {
    background: #fff;
    color: #111;
}

.portfolio-service-card__order:hover,
.portfolio-service-card__more:hover {
    opacity: 0.85;
}

/* Кнопка назад */
.portfolio-detail__back {
    margin-top: 55px;
}

.portfolio-detail__back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    padding: 0 20px;
    border: 2px solid #777;
    border-radius: 6px;
    background: #fff;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
    color: #333;
    text-decoration: none;
}

.portfolio-detail__back-link:hover {
    background: #f7f7f7;
}

/* Старые классы — fallback, если где-то остались */
.portfolioimg {
    text-align: center;
    margin-bottom: 25px;
}

.portfoliotext {
    margin-bottom: 25px;
}

.portfolioimg img {
    object-fit: contain;
    width: 100%;
    max-height: 500px;
}

/* Старые классы галереи — чтобы не конфликтовали, если остались в HTML */
.portfolio-detail__main-image,
.portfolio-detail__gallery,
.portfolio-detail__gallery-link {
    display: none;
}

/* Адаптив */
@media (max-width: 900px) {
    .portfolio-detail {
        padding: 35px 20px 45px;
    }

    .portfolio-detail__top {
        grid-template-columns: 1fr;
    }

    .portfolio-detail__content {
        min-height: 0;
    }

    .portfolio-detail__text {
        min-height: 0;
    }

    .portfolio-detail__main-link {
        height: 355px;
    }

    .portfolio-detail__main-link img {
        height: 100%;
    }

    .portfolio-detail__thumb {
        height: 80px;
    }

    .portfolio-detail__services-list {
        grid-template-columns: repeat(2, minmax(0, 180px));
    }
}

@media (max-width: 620px) {
    .portfolio-detail {
        padding: 28px 15px 40px;
    }

    .portfolio-detail__title {
        font-size: 24px;
    }

    .portfolio-detail__text {
        padding: 20px;
        font-size: 15px;
    }

    .portfolio-detail__thumbs-wrap {
        padding: 0 28px;
    }

    .portfolio-detail__thumb {
        height: 72px;
    }

    .portfolio-detail__services-list {
        grid-template-columns: 1fr;
    }

    .portfolio-service-card {
        max-width: 220px;
    }
}

@media (max-width: 420px) {
    .portfolio-detail__thumb {
        height: 64px;
    }

    .portfolio-detail__services-list {
        gap: 18px;
    }
}
.portfolio-service-card {
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
}


.portfolio-service-card__body {
    position: relative;
    z-index: 2;
    margin-top: -18px;
    padding: 22px 14px 12px;
    text-align: center;
    background: #d9d9d9;
    border-radius: 12px 12px 8px 8px;
}
.portfolio-detail__main-link--video {
    position: relative;
    overflow: hidden;
}

.portfolio-detail__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.portfolio-detail__video-play,
.portfolio-detail__thumb-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.58);
}

.portfolio-detail__video-play::before,
.portfolio-detail__thumb-play::before {
    content: "";
    position: absolute;
    left: 23px;
    top: 17px;
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 18px solid #fff;
}

.portfolio-detail__thumb--video {
    position: relative;
    background: #000;
}

.portfolio-detail__thumb-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-detail__thumb-play {
    width: 34px;
    height: 34px;
}

.portfolio-detail__thumb-play::before {
    left: 14px;
    top: 10px;
    border-top-width: 7px;
    border-bottom-width: 7px;
    border-left-width: 11px;
}
.portfolio-detail__video-popup {
    width: 90vw;
    max-width: 1100px;
    background: #000;
    padding: 0 !important;
}

.portfolio-detail__video-popup-file {
    display: block;
    width: 100%;
    max-height: 80vh;
    background: #000;
}