/* БАРН-102: десктопная версия карточки проекта. Подключается только на странице id 870. */
@media (min-width: 992px) {
    .project-detail-page--barn-desktop {
        --barn102-page-width: calc(100% - 48px);
    }

    /* Единая ширина: первый экран, крошки, контент, рекомендации */
    .project-detail-page--barn-desktop .breadcrumbs-wrap > .container,
    .project-detail-page--barn-desktop .project-page__header > .container,
    .project-detail-page--barn-desktop .project-page__about > .container,
    .project-detail-page--barn-desktop .project-recommendations > .container {
        width: var(--barn102-page-width);
        max-width: none;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .project-detail-page--barn-desktop .barn102-project-details {
        max-width: none;
    }

    .project-detail-page--barn-desktop .project-page__about {
        padding-bottom: 32px !important;
    }

    .project-detail-page--barn-desktop .barn102-project-details {
        margin-bottom: 0 !important;
    }

    .project-detail-page--barn-desktop .project-recommendations.d-lg-block {
        padding-top: 24px;
    }

    /* Первый экран: крупнее мелкий текст */
    .project-detail-page--barn-desktop .barn102-title-size {
        margin-left: 6px;
        color: rgba(255, 255, 255, .6);
        font-size: .52em;
        font-weight: 650;
        letter-spacing: -.01em;
        text-transform: none;
        white-space: nowrap;
    }

    .project-detail-page--barn-desktop .dc102-price-option__note,
    .project-detail-page--barn-desktop .dc102-price-option__toggle,
    .project-detail-page--barn-desktop .barn102-pricing-note,
    .project-detail-page--barn-desktop .project-quick-trust--dc102 strong,
    .project-detail-page--barn-desktop .project-quick-trust--dc102 span {
        font-size: 13px;
    }

    .project-detail-page--barn-desktop .dc102-price-option__toggle b {
        color: rgba(255, 255, 255, .55);
        font-weight: 600;
    }

    .project-detail-page--barn-desktop .barn102-manager-link__copy small {
        font-size: 12px;
    }

    .project-detail-page--barn-desktop .barn102-manager-link__copy strong {
        font-size: 13px;
    }

    .project-detail-page--barn-desktop .project-gallery-custom--adapt,
    .project-detail-page--barn-desktop .project-gallery-deadline {
        font-size: 13px;
    }

    .project-detail-page--barn-desktop .barn102-section-eyebrow {
        font-size: 12px;
    }

    .project-detail-page--barn-desktop .barn102-order-steps li > small,
    .project-detail-page--barn-desktop .barn102-room-grid span {
        font-size: 14px;
    }

    /* Цены в двух карточках на одном уровне */
    .project-detail-page--barn-desktop .dc102-pricing__options {
        align-items: stretch;
    }

    .project-detail-page--barn-desktop .dc102-price-option {
        display: flex;
        flex-direction: column;
    }

    .project-detail-page--barn-desktop .dc102-price-option summary {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .project-detail-page--barn-desktop .dc102-price-option__main {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .project-detail-page--barn-desktop .dc102-price-option__note {
        margin-bottom: auto;
    }

    .project-detail-page--barn-desktop .dc102-price-option__price {
        padding-top: 8px;
    }

    /* Планировка в галерее: убираем плашки и даём увеличение */
    .project-detail-page--barn-desktop .project-gallery-custom--adapt,
    .project-detail-page--barn-desktop .project-gallery-deadline {
        transition: opacity .2s ease, visibility .2s ease;
    }

    .project-detail-page--barn-desktop .project-gallery-shell.is-plan-active .project-gallery-custom--adapt,
    .project-detail-page--barn-desktop .project-gallery-shell.is-plan-active .project-gallery-deadline {
        opacity: 0;
        visibility: hidden;
    }

    .project-detail-page--barn-desktop .f-carousel__slide--plan {
        position: relative;
        cursor: zoom-in;
    }

    .project-detail-page--barn-desktop .f-carousel__slide--plan::after {
        position: absolute;
        top: 16px;
        left: 16px;
        padding: 8px 12px;
        content: "Нажмите, чтобы увеличить";
        border-radius: 999px;
        background: rgba(36, 33, 31, .78);
        color: #fff;
        font-size: 13px;
        font-weight: 650;
        pointer-events: none;
    }

    /* О проекте */
    .project-detail-page--barn-desktop .barn102-overview {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .project-detail-page--barn-desktop .barn102-overview__intro {
        max-width: 860px;
    }

    .project-detail-page--barn-desktop .project-page__about .barn102-overview__intro > p {
        max-width: 820px;
        margin: 18px 0 0;
        color: #3f3934;
        font-size: 18px !important;
        line-height: 1.65;
    }

    .project-detail-page--barn-desktop .project-page__about .barn102-overview__intro > p + p {
        margin-top: 10px;
        color: #6a625b;
        font-size: 16px !important;
    }

    .project-detail-page--barn-desktop .barn102-overview .barn102-room-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        margin-top: 0;
    }

    .project-detail-page--barn-desktop .barn102-overview .barn102-room-grid > div {
        padding: 20px 22px;
    }

    .project-detail-page--barn-desktop .barn102-overview .barn102-room-grid strong {
        font-size: 26px;
    }

    .project-detail-page--barn-desktop .barn102-overview .barn102-room-grid span {
        color: #6a625b;
        font-size: 15px;
    }

    .project-detail-page--barn-desktop .barn102-overview .barn102-detail-grid {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
        margin-top: 0;
    }

    .project-detail-page--barn-desktop .barn102-overview .barn102-detail-grid > section {
        padding: 26px 28px;
        border: 1px solid rgba(45, 41, 38, .1);
        background: #fff;
        box-shadow: 0 8px 24px rgba(45, 41, 38, .04);
    }

    .project-detail-page--barn-desktop .barn102-overview .barn102-detail-grid__wide {
        grid-column: auto;
    }

    .project-detail-page--barn-desktop .project-page__about .barn102-overview .barn102-detail-grid h3 {
        margin-bottom: 12px;
        color: #2d2926;
        font-size: 20px !important;
        line-height: 1.3;
    }

    .project-detail-page--barn-desktop .project-page__about .barn102-overview .barn102-detail-grid p {
        color: #4a443f;
        font-size: 16px !important;
        line-height: 1.65;
    }

    /* Доверие */
    .barn102-trust {
        margin-top: 54px;
        padding-top: 48px;
        border-top: 1px solid rgba(45, 41, 38, .12);
    }

    .project-detail-page--barn-desktop .project-page__about .barn102-trust h2 {
        margin: 0;
        color: #2d2926;
        font-size: clamp(28px, 2.8vw, 42px) !important;
        font-weight: 720;
        line-height: 1.14;
        letter-spacing: -.035em;
    }

    .barn102-trust {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "heading ratings"
            "facts facts"
            "reviews reviews";
        gap: 24px 32px;
        align-items: end;
    }

    .barn102-trust__heading {
        grid-area: heading;
    }

    .barn102-trust__ratings {
        display: flex;
        grid-area: ratings;
        gap: 10px;
    }

    .barn102-trust__ratings a {
        display: grid;
        gap: 2px;
        min-width: 156px;
        padding: 12px 16px;
        border: 1px solid rgba(45, 41, 38, .1);
        border-radius: 12px;
        background: #fff;
        color: #2d2926;
        text-decoration: none;
        transition: border-color .18s ease;
    }

    .barn102-trust__ratings a:hover,
    .barn102-trust__ratings a:focus-visible {
        border-color: rgba(217, 95, 11, .5);
    }

    .barn102-trust__ratings strong {
        font-size: 24px;
        font-weight: 800;
        line-height: 1.1;
    }

    .barn102-trust__ratings strong span {
        color: #f5a623;
    }

    .barn102-trust__ratings a > span {
        color: #777069;
        font-size: 13px;
    }

    .barn102-trust__facts {
        display: grid;
        grid-area: facts;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .barn102-trust__facts li {
        display: grid;
        align-content: start;
        gap: 6px;
        padding: 20px;
        border-radius: 14px;
        background: #ebe6df;
    }

    .barn102-trust__facts strong {
        color: #2d2926;
        font-size: 18px;
        font-weight: 750;
    }

    .barn102-trust__facts span {
        color: #625b55;
        font-size: 14px;
        line-height: 1.5;
    }

    .barn102-trust__facts a {
        color: #a6420d;
    }

    .barn102-trust__reviews {
        display: grid;
        grid-area: reviews;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .barn102-trust__reviews figure {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 16px;
        margin: 0;
        padding: 22px 24px;
        border: 1px solid rgba(45, 41, 38, .1);
        border-radius: 14px;
        background: #fff;
    }

    .barn102-trust__reviews blockquote {
        position: relative;
        margin: 0;
        padding-top: 26px;
        color: #4a443f;
        font-size: 15px;
        line-height: 1.6;
    }

    .barn102-trust__reviews blockquote::before {
        position: absolute;
        top: -8px;
        left: 0;
        content: "“";
        color: #f47b20;
        font-size: 48px;
        font-weight: 800;
        line-height: 1;
    }

    .barn102-trust__reviews figcaption {
        display: grid;
        gap: 2px;
        padding-top: 14px;
        border-top: 1px solid rgba(45, 41, 38, .08);
    }

    .barn102-trust__reviews figcaption strong {
        color: #2d2926;
        font-size: 15px;
    }

    .barn102-trust__reviews figcaption span {
        color: #777069;
        font-size: 13px;
    }

    /* Окно «Что входит в стоимость» */
    body.project-detail-page--barn-desktop.modal-open .cfcity_first {
        visibility: hidden;
    }

    .project-detail-page--barn-desktop .barn102-config .modal-dialog {
        max-width: min(1040px, calc(100vw - 48px));
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .project-detail-page--barn-desktop .barn102-config .modal-content {
        position: relative;
        display: grid;
        grid-template-columns: 350px minmax(0, 1fr);
        height: min(780px, calc(100vh - 48px));
        border: 0;
        border-radius: 24px;
        background: #f7f4f0;
        color: #2d2926;
        overflow: hidden;
    }

    .barn102-config__close {
        position: absolute;
        top: 18px;
        right: 18px;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: rgba(45, 41, 38, .07);
        color: #2d2926;
        transition: background-color .18s ease;
    }

    .barn102-config__close:hover {
        background: rgba(45, 41, 38, .13);
    }

    .barn102-config__close svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    .barn102-config__aside {
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 44px 0 40px 44px;
    }

    .barn102-config__title {
        color: #242424;
        font-size: 31px;
        font-weight: 800;
        line-height: 1.12;
    }

    .barn102-config__lead {
        margin: 14px 0 0;
        color: #716960;
        font-size: 14px;
        line-height: 1.55;
    }

    .barn102-config__tabs {
        display: grid;
        gap: 10px;
        margin-top: 26px;
    }

    .barn102-config__tabs button {
        display: grid;
        gap: 3px;
        padding: 15px 18px;
        border: 1px solid rgba(45, 41, 38, .1);
        border-radius: 16px;
        background: rgba(255, 255, 255, .45);
        color: #2d2926;
        text-align: left;
        transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
    }

    .barn102-config__tabs button:not(.is-active):hover {
        background: #fff;
    }

    .barn102-config__tabs button.is-active {
        border-color: #ff5900;
        background: #fff;
        box-shadow: 0 0 0 1px #ff5900, 0 10px 24px rgba(45, 41, 38, .06);
    }

    .barn102-config__tabs strong {
        font-size: 15px;
        font-weight: 750;
    }

    .barn102-config__tabs span {
        color: #716960;
        font-size: 13px;
        line-height: 1.4;
    }

    .barn102-config__tabs b {
        margin-top: 5px;
        font-size: 20px;
        font-weight: 800;
    }

    .barn102-config__calculate {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        min-height: 52px;
        margin-top: auto;
        padding: 12px 18px;
        border: 0;
        border-radius: 13px;
        background: #ff5900;
        color: #fff;
        font-size: 14px;
        font-weight: 750;
        white-space: nowrap;
        box-shadow: 0 10px 22px rgba(255, 89, 0, .22);
        transition: background-color .18s ease;
    }

    .barn102-config__calculate:hover {
        background: #ec5200;
    }

    .barn102-config__calculate svg {
        width: 17px;
        height: 17px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .barn102-config__tabs button:focus-visible,
    .barn102-config__close:focus-visible,
    .barn102-config__calculate:focus-visible {
        outline: 2px solid #ff9a5c;
        outline-offset: 2px;
    }

    .barn102-config__body {
        min-height: 0;
        padding: 44px 44px 40px 32px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .barn102-config__panel {
        display: grid;
        gap: 14px;
        padding-right: 18px;
    }

    .barn102-config__panel[hidden] {
        display: none;
    }

    .barn102-config-group {
        padding: 20px 22px;
        border-radius: 16px;
        background: #fff;
    }

    .barn102-config-group__title {
        margin-bottom: 14px;
        color: #242424;
        font-size: 16px;
        font-weight: 800;
    }

    .barn102-config-group ul {
        display: grid;
        gap: 14px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .barn102-config-group li {
        position: relative;
        display: grid;
        gap: 3px;
        padding-left: 26px;
    }

    .barn102-config-group li::before {
        content: "";
        position: absolute;
        top: 3px;
        left: 4px;
        width: 6px;
        height: 11px;
        border-right: 2px solid #ff5900;
        border-bottom: 2px solid #ff5900;
        transform: rotate(45deg);
    }

    .barn102-config-group li strong {
        color: #2d2926;
        font-size: 15px;
        font-weight: 750;
        line-height: 1.35;
    }

    .barn102-config-group li strong em {
        display: inline-block;
        margin-left: 8px;
        padding: 2px 8px;
        border-radius: 999px;
        background: #f3eee8;
        color: #7a7068;
        font-size: 12px;
        font-style: normal;
        font-weight: 650;
        vertical-align: 1px;
    }

    .barn102-config-group li span {
        color: #716960;
        font-size: 14px;
        line-height: 1.55;
    }

    .barn102-config-group--compare {
        padding: 8px 22px;
    }

    .barn102-config-compare {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
        line-height: 1.5;
    }

    .barn102-config-compare th,
    .barn102-config-compare td {
        padding: 13px 10px;
        border-bottom: 1px solid rgba(45, 41, 38, .08);
        text-align: left;
        vertical-align: top;
    }

    .barn102-config-compare th:first-child {
        width: 30%;
        padding-left: 0;
    }

    .barn102-config-compare thead th {
        color: #716960;
        font-size: 13px;
        font-weight: 650;
    }

    .barn102-config-compare thead th b {
        display: block;
        margin-top: 2px;
        color: #242424;
        font-size: 18px;
        font-weight: 800;
    }

    .barn102-config-compare tbody th {
        color: #2d2926;
        font-size: 15px;
        font-weight: 750;
    }

    .barn102-config-compare td {
        width: 35%;
        color: #4f4843;
    }

    .barn102-config-compare__same td {
        color: #716960;
    }

    .barn102-config-compare__none {
        color: #b8afa7;
    }

    .barn102-config-compare tfoot th,
    .barn102-config-compare tfoot td {
        border-bottom: 0;
        color: #716960;
    }

    .barn102-config-compare tfoot th {
        color: #2d2926;
        font-size: 15px;
        font-weight: 750;
    }

    .barn102-config-compare tfoot b {
        margin-right: 6px;
        color: #242424;
        font-size: 18px;
        font-weight: 800;
    }

    /* Выбор комплектации в форме доставки */
    .barn102-delivery-config {
        margin: 0 0 14px;
        padding: 0;
        border: 0;
    }

    .barn102-delivery-config legend {
        float: none;
        width: auto;
        margin-bottom: 7px;
        color: #2e2a27;
        font-size: 13px;
        font-weight: 700;
    }

    .barn102-delivery-config__options {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .barn102-delivery-config label {
        position: relative;
        margin: 0;
        cursor: pointer;
    }

    .barn102-delivery-config input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .barn102-delivery-config label > span {
        display: grid;
        gap: 2px;
        height: 100%;
        padding: 10px 12px;
        border: 1px solid #e4dcd4;
        border-radius: 10px;
        background: #fff;
        color: #2d2926;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.3;
        transition: border-color .18s ease, background-color .18s ease;
    }

    .barn102-delivery-config label > span small {
        color: #8a827b;
        font-size: 13px;
        font-weight: 600;
    }

    .barn102-delivery-config label:hover > span {
        border-color: rgba(240, 91, 18, .5);
    }

    .barn102-delivery-config input:checked + span {
        border-color: #f05b12;
        background: #fff4ec;
        box-shadow: inset 0 0 0 1px #f05b12;
    }

    .barn102-delivery-config input:focus-visible + span {
        outline: 2px solid #f05b12;
        outline-offset: 2px;
    }

    /* Похожие проекты */
    .project-detail-page--barn-desktop .project-recommendations.d-lg-block .project-recommendation-card {
        flex: 0 0 280px;
        width: 280px;
    }

    .project-detail-page--barn-desktop .project-recommendations.d-lg-block .project-recommendations__track {
        gap: 14px;
    }

    /* Кнопка «наверх» */
    .project-detail-page--barn-desktop #btn-back-to-top {
        right: 24px;
        bottom: 88px;
        left: auto;
        width: 48px;
        min-width: 48px;
        height: 48px;
        padding: 0;
        border-radius: 12px;
        box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    }
}

@media (min-width: 1200px) {
    .project-detail-page--barn-desktop {
        --barn102-page-width: min(calc(100% - 96px), 1600px);
    }

    .project-detail-page--barn-desktop .barn102-overview {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        gap: 32px 48px;
    }

    /* Высота первого экрана по содержимому, чтобы ничего не обрезалось */
    .project-detail-page--barn-desktop .project-page__header .row.barn102-hero-grid {
        --barn102-hero-height: clamp(600px, 40vw, 720px);
        align-items: stretch;
    }

    .project-detail-page--barn-desktop .barn102-hero-grid > [class*="col-"] {
        height: auto;
        min-height: var(--barn102-hero-height);
    }

    .project-detail-page--barn-desktop .barn102-hero-grid > .product-detail-info {
        display: flex;
        flex-direction: column;
    }

    .project-detail-page--barn-desktop .product-detail-info > div {
        height: auto;
        flex: 1 1 auto;
    }

    .project-detail-page--barn-desktop .barn102-hero-grid > .col-lg-7 {
        position: relative;
    }

    .project-detail-page--barn-desktop .barn102-hero-grid > .col-lg-7 > .project-page__gallery {
        position: absolute;
        inset: 0;
    }
}

/* Широкий дом: фото шире, колонка с ценами компактнее */
@media (min-width: 1200px) {
    .project-detail-page--barn-desktop .project-page__header .row.barn102-hero-grid.barn-hero--wide {
        grid-template-columns: minmax(0, 1.7fr) minmax(420px, 1fr);
    }

    .project-detail-page--barn-desktop .barn-hero--wide #product-page__gallery .f-carousel__slide:first-child > img,
    .project-detail-page--barn-desktop .barn-hero--wide #product-page__gallery .f-carousel__slide:first-child > picture > img {
        object-fit: cover !important;
        object-position: var(--barn-hero-focus, 50% 50%) !important;
    }

    .project-detail-page--barn-desktop .barn-hero--wide .product-detail-info > div {
        padding: clamp(20px, 1.5vw, 28px);
    }

    .project-detail-page--barn-desktop .barn-hero--wide .project-page__title {
        font-size: clamp(30px, 2.1vw, 38px);
    }

    .project-detail-page--barn-desktop .barn-hero--wide .barn102-primary-facts {
        font-size: 17px;
    }

    .project-detail-page--barn-desktop .barn-hero--wide .dc102-price-option__price {
        font-size: clamp(24px, 1.8vw, 30px) !important;
    }

    .project-detail-page--barn-desktop .barn-hero--wide .barn102-pricing-actions .dc102-pricing__cta {
        gap: 8px;
        padding-right: 14px;
        padding-left: 14px;
        font-size: 14px;
        white-space: nowrap;
    }

    .project-detail-page--barn-desktop .barn-hero--wide .dc102-included-costs ul {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 6px !important;
    }

    .project-detail-page--barn-desktop .barn-hero--wide .dc102-included-costs li {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        min-height: 0 !important;
        padding: 8px 12px !important;
    }

    .project-detail-page--barn-desktop .barn-hero--wide .dc102-included-costs li .barn102-included-icon {
        flex: 0 0 auto;
        margin: 0 !important;
    }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .project-detail-page--barn-desktop .barn-hero--wide .barn102-pricing-actions {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .project-detail-page--barn-desktop .barn-hero--wide .dc102-price-option summary {
        padding-right: 14px !important;
        padding-left: 14px !important;
    }

    .project-detail-page--barn-desktop .barn-hero--wide .dc102-price-option__toggle {
        gap: 4px;
        font-size: 12px;
    }
}

/* Планировки и фото в галерее: целиком, по данным проекта */
@media (min-width: 992px) {
    .project-detail-page--barn-desktop #product-page__gallery .barn-slide--plan {
        background: var(--barn-plan-bg, #fff);
    }

    .project-detail-page--barn-desktop #product-page__gallery .barn-slide--plan > picture > img {
        box-sizing: border-box;
        padding: 58px 24px 62px;
        object-fit: contain !important;
        object-position: center;
        background: var(--barn-plan-bg, #fff);
    }

    .project-detail-page--barn-desktop #product-page__gallery .barn-slide--photo {
        cursor: default;
    }

    .project-detail-page--barn-desktop #product-page__gallery .barn-slide--photo::after {
        content: none;
    }

    .project-detail-page--barn-desktop #product-page__gallery .barn-slide--photo > picture > img {
        object-fit: contain !important;
        object-position: center;
        background: transparent;
    }
}

@media (min-width: 1200px) {
    .project-detail-page--barn-desktop .barn-hero--wide #product-page__gallery .barn-slide--photo > picture > img {
        object-fit: cover !important;
        object-position: 50% 60%;
    }
}
