/*
 * Страница планировки (pages/unit.php, D20) — по макету
 * new_pages/Sun_Hills_Layan_D101_With_Documents.html. Всё под .np--unit.
 * Переменные и базовые классы (.np-wrap, .np-btn, .np-eyebrow…) — pages.css.
 */

.np--unit .np-btn {
    white-space: normal;
    text-align: center;
}

.np--unit .un-btn-outline {
    background: #fff;
    border: 1px solid #d2d7dc;
    color: var(--np-ink);
}

.np--unit .un-btn-wa,
.np--unit .un-btn-light {
    background: #eef5fa;
    color: #286c9c;
}

.np--unit .un-btn-grey {
    background: var(--np-soft);
    color: var(--np-ink);
}

.np--unit .np-btn--green:hover {
    background: #5cc026;
}

.np--unit .un-muted {
    margin: 0;
    color: var(--np-muted);
}

.np--unit .un-link {
    display: inline-block;
    color: var(--np-link);
    font-weight: 600;
}

.np--unit .un-link:hover {
    text-decoration: underline;
}

.np--unit .un-link--block {
    display: block;
    width: fit-content;
    margin-top: 22px;
}

.np--unit .un-pill {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 100px;
    background: var(--np-soft);
    color: #34404a;
    font-size: 13px;
}

/* ---------- Первый экран ---------- */
.np--unit .un-top {
    padding-bottom: 50px;
}

.np--unit .np-back {
    margin-bottom: 20px;
}

.np--unit .un-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 26px;
}

.np--unit .un-nav a {
    padding: 9px 13px;
    border-radius: 30px;
    background: var(--np-soft);
    font-size: 13px;
}

.np--unit .un-nav a:hover {
    background: #e6eaed;
}

.np--unit .un-h1 {
    margin: 0 0 14px;
    font-size: clamp(40px, 6vw, 75px);
    font-weight: 650;
    line-height: 1.06;
    letter-spacing: -.045em;
    overflow-wrap: anywhere;
}

.np--unit .un-lead {
    margin: 0 0 32px;
    color: #7e8791;
    font-size: clamp(17px, 2vw, 21px);
}

.np--unit .un-card {
    max-width: 780px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #dce0e4;
    border-radius: 28px;
    background: #fff;
}

.np--unit .un-plan {
    position: relative;
    background: #f5f5f5;
}

.np--unit .un-zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 550px;
    padding: 28px 8%;
    cursor: zoom-in;
}

.np--unit .np-wrap .un-zoom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.np--unit .un-expand {
    position: absolute;
    top: 20px;
    right: 20px;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    color: var(--np-ink);
    font-size: 22px;
    box-shadow: 0 3px 16px rgba(0, 0, 0, .06);
}

.np--unit .un-thumbs {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
    overflow-x: auto;
}

.np--unit .un-thumb {
    flex: 0 0 72px;
    height: 72px;
    padding: 6px;
    border: 1px solid var(--np-line);
    border-radius: 12px;
    background: #fff;
}

.np--unit .un-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.np--unit .un-card-body {
    padding: 34px 38px 38px;
}

.np--unit .un-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    color: #9199a3;
    font-size: 16px;
}

.np--unit .un-card-title {
    margin: 0 0 6px;
    font-size: clamp(24px, 3.4vw, 36px);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}

.np--unit .un-card-area {
    font-size: clamp(42px, 6vw, 62px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.045em;
}

.np--unit .un-price {
    margin: 18px 0 26px;
    padding: 22px 0 20px;
    border-top: 1px solid #e5e8eb;
    border-bottom: 1px solid #e5e8eb;
}

.np--unit .un-price-label {
    margin-bottom: 8px;
    color: #8a929d;
    font-size: 15px;
}

.np--unit .un-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 30px;
    background: #fff2d9;
    color: #a45c09;
    font-size: 13px;
    font-weight: 700;
}

.np--unit .un-price-main {
    color: #101d2a;
    font-size: clamp(30px, 5vw, 43px);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -.03em;
}

.np--unit .un-price-sqm {
    margin-top: 8px;
    color: #8a929d;
    font-size: 17px;
}

.np--unit .un-actions {
    display: grid;
    gap: 12px;
}

.np--unit .un-actions .np-btn {
    width: 100%;
    min-height: 56px;
    font-size: 16px;
}

/* ---------- Секции ---------- */
.np--unit .un-section {
    padding: 60px 0;
    border-top: 1px solid var(--np-line);
}

.np--unit .un-h2 {
    margin: 0 0 24px;
    font-size: clamp(28px, 4vw, 43px);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.np--unit .un-h3 {
    margin: 0 0 10px;
    font-size: 22px;
    letter-spacing: -.02em;
    font-weight: 650;
}

.np--unit .un-lead-muted {
    max-width: 730px;
    margin: -8px 0 24px;
    color: #7e8791;
    font-size: 18px;
}

.np--unit .un-text {
    max-width: 880px;
    margin: 0 0 14px;
    color: #6f7984;
    font-size: 18px;
    line-height: 1.6;
}

.np--unit .un-text--dark {
    color: #34404a;
}

/* Характеристики */
.np--unit .un-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 0;
}

.np--unit .un-stat {
    padding: 24px;
    border-radius: 22px;
    background: var(--np-soft);
}

.np--unit .un-stat dt {
    color: var(--np-muted);
}

.np--unit .un-stat dd {
    margin: 8px 0 0;
    font-size: 28px;
    font-weight: 650;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* План оплаты */
.np--unit .un-payments {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 45px;
}

.np--unit .un-payrows {
    margin-top: 14px;
}

.np--unit .un-payrow {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid var(--np-line);
}

.np--unit .un-payrow span {
    min-width: 0;
}

.np--unit .un-payrow small {
    display: block;
    color: var(--np-muted);
    font-size: 13px;
}

.np--unit .un-payrow b {
    flex: none;
    text-align: right;
    white-space: nowrap;
}

.np--unit .un-timeline {
    display: flex;
    gap: 5px;
    margin-top: 25px;
}

.np--unit .un-step {
    flex: 1 1 0;
    min-width: 0;
    color: var(--np-muted);
    font-size: 12px;
    text-align: center;
}

.np--unit .un-step::before {
    content: "";
    display: block;
    height: 6px;
    margin-bottom: 12px;
    border-radius: 5px;
    background: #d7dbe0;
}

.np--unit .un-step:first-child::before {
    background: var(--np-green);
}

.np--unit .un-step strong {
    display: block;
    color: var(--np-ink);
    font-size: 16px;
}

.np--unit .un-step span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.np--unit .un-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    margin-top: 26px;
}

/* Расходы */
.np--unit .un-fees {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.np--unit .un-fee {
    padding: 22px;
    border: 1px solid var(--np-line);
    border-radius: 20px;
}

.np--unit .un-fee b {
    display: block;
    margin-top: 10px;
    font-size: 21px;
    line-height: 1.3;
    font-weight: 700;
}

.np--unit .un-fee small {
    display: block;
    margin-top: 4px;
    color: var(--np-muted);
    font-size: 13px;
}

/* Другие юниты */
.np--unit .un-others {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.np--unit .un-other {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 23px;
    border: 1px solid var(--np-line);
    border-radius: 24px;
}

/* План типа в карточке «Другие юниты» — как основной план: целиком, без обрезки */
.np--unit .un-other-plan {
    width: 100%;
    height: 190px;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 18px;
    background: #f5f5f5;
}

.np--unit .np-wrap .un-other-plan img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.np--unit .un-other-title {
    margin: 15px 0 4px;
    font-size: 23px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.np--unit .un-other-title a:hover {
    color: var(--np-navy);
}

.np--unit .un-other-price {
    margin: 12px 0 18px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.03em;
}

/* Кнопки карточки: «Подробнее» (контурная, ссылка) + «Уточнить наличие» (зелёная = WhatsApp) */
.np--unit .un-other-btns {
    display: grid;
    gap: 10px;
    width: 100%;
    margin-top: auto;
}

.np--unit .un-other-btn {
    width: 100%;
}

/* Карусели (комплекс, район) */
.np--unit .un-carousel {
    position: relative;
    overflow: hidden;
    margin: 6px 0 22px;
    border-radius: 26px;
    background: var(--np-soft);
}

.np--unit .un-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.np--unit .un-track::-webkit-scrollbar {
    display: none;
}

.np--unit .un-slide {
    position: relative;
    flex: 0 0 100%;
    margin: 0;
    scroll-snap-align: start;
}

.np--unit .un-slide img {
    width: 100%;
    height: 430px;
    object-fit: cover;
}

.np--unit .un-slide figcaption {
    position: absolute;
    left: 18px;
    top: 18px;
    padding: 8px 14px;
    border-radius: 30px;
    background: rgba(11, 27, 41, .78);
    color: #fff;
    font-size: 14px;
}

.np--unit .un-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    z-index: 2;
    display: flex;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 99px;
    background: rgba(11, 27, 41, .3);
    transform: translateX(-50%);
}

.np--unit .un-dots[hidden] {
    display: none;
}

.np--unit .un-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, .58);
    transition: width .22s ease, background .22s ease;
}

.np--unit .un-dot.is-active {
    width: 25px;
    background: #fff;
}

.np--unit .un-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 20px;
}

.np--unit .un-more summary {
    display: inline-block;
    margin: 4px 0 14px;
    padding: 12px 20px;
    border-radius: 99px;
    background: var(--np-soft);
    font-weight: 650;
    cursor: pointer;
    list-style: none;
}

.np--unit .un-more summary::-webkit-details-marker {
    display: none;
}

.np--unit .un-more[open] summary {
    display: none;
}

/* Удобства */
.np--unit .un-amenities {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 30px;
    row-gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.np--unit .un-amenity {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    color: #62686e;
    font-size: 17px;
    line-height: 1.45;
}

.np--unit .un-amenity[hidden] {
    display: none;
}

.np--unit .un-symbol {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f2f3;
    color: #666c71;
}

.np--unit .un-symbol svg {
    width: 22px;
    height: 22px;
}

.np--unit [data-un-amenities-toggle] {
    width: 100%;
    max-width: 460px;
    margin-top: 22px;
}

.np--unit [data-un-amenities-toggle][hidden] {
    display: none;
}

/* Свободные юниты планировки (D20): таблица, на телефоне — карточки */
.np--unit .un-units {
    margin-top: 6px;
}

.np--unit .un-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.np--unit .un-table th,
.np--unit .un-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--np-line);
    text-align: left;
    vertical-align: middle;
}

.np--unit .un-table thead th {
    padding-top: 0;
    color: var(--np-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.np--unit .un-table tbody th {
    font-weight: 700;
    white-space: nowrap;
}

.np--unit .un-table .un-cell-price {
    font-weight: 700;
    white-space: nowrap;
}

.np--unit .un-table .un-cell-btn {
    width: 1%;
    text-align: right;
}

.np--unit .un-row {
    scroll-margin-top: 110px;
}

.np--unit .un-row:target,
.np--unit .un-row.is-target {
    background: #eef8e8;
}

.np--unit .un-anchor {
    display: block;
    position: relative;
    top: -110px;
    visibility: hidden;
}

.np--unit .un-row[data-un-extra].is-collapsed {
    display: none;
}

.np--unit .un-row-btn {
    min-height: 40px;
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.np--unit .un-units-more {
    margin-top: 18px;
}

.np--unit .un-units-more[hidden] {
    display: none;
}

.np--unit .un-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.np--unit .un-pay-basis {
    margin: 12px 0 4px;
    font-size: 14px;
}

/* Локация */
.np--unit .un-map {
    overflow: hidden;
    height: 360px;
    border-radius: 24px;
    background: #e3ece8;
}

.np--unit .un-map iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.np--unit .un-places-title {
    margin-top: 28px;
}

.np--unit .un-places {
    margin: 0;
    padding: 0;
    list-style: none;
}

.np--unit .un-place {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 15px 0;
    border-top: 1px solid #dfe2e5;
}

.np--unit .un-place span {
    min-width: 0;
}

.np--unit .un-place small {
    display: block;
    color: var(--np-muted);
    font-size: 13px;
}

.np--unit .un-place b {
    flex: none;
    white-space: nowrap;
}

/* Документы (только список: файлы не раздаём, D7) */
.np--unit .un-docs-title {
    margin-top: 26px;
}

.np--unit .un-docs {
    margin: 0;
    padding: 0;
    list-style: none;
}

.np--unit .un-doc {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #edf0f2;
    color: #34404b;
}

.np--unit .un-doc-info {
    flex: 1;
    min-width: 0;
}

.np--unit .un-doc-name {
    display: block;
    overflow-wrap: anywhere;
}

.np--unit .un-doc-size {
    display: block;
    margin-top: 3px;
    color: #9ba4af;
    font-size: 13px;
}

/* «Запросить» — вторичная светло-серая кнопка (как у документов обзора и характеристик) */
.np--unit .un-doc-btn {
    flex: none;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--np-soft);
    color: #2b699a;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease;
}

.np--unit .un-doc-btn:hover {
    background: #e6e9ec;
}

/* Заявка */
.np--unit .un-request .np-form {
    margin: 0 auto;
}

/* Просмотр плана */
.np--unit .un-dialog {
    width: min(920px, 95vw);
    max-width: none;
    max-height: 92vh;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 15px 100px rgba(0, 0, 0, .3);
}

.np--unit .un-dialog::backdrop {
    background: rgba(7, 17, 28, .8);
}

.np--unit .un-dialog-inner {
    padding: 18px 20px 24px;
}

.np--unit .un-dialog-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.np--unit .un-dialog-close {
    flex: none;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--np-soft);
}

.np--unit .un-dialog img {
    width: auto;
    max-width: 100%;
    max-height: 76vh;
    margin: 0 auto;
    object-fit: contain;
}

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
    .np--unit .un-payments,
    .np--unit .un-others {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .np--unit .un-others {
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .np--unit .un-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-right: -22px;
        padding-right: 22px;
        scrollbar-width: none;
    }

    .np--unit .un-nav a {
        flex: none;
    }

    .np--unit .un-card {
        border-radius: 24px;
    }

    .np--unit .un-zoom {
        height: 360px;
        padding: 20px 6%;
    }

    .np--unit .un-expand {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .np--unit .un-card-body {
        padding: 24px 22px 26px;
    }

    .np--unit .un-card-meta {
        font-size: 13px;
    }

    .np--unit .un-actions .np-btn {
        min-height: 52px;
        font-size: 15px;
    }

    .np--unit .un-section {
        padding: 44px 0;
    }

    .np--unit .un-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .np--unit .un-stat {
        padding: 16px;
        border-radius: 18px;
    }

    .np--unit .un-stat dd {
        font-size: 21px;
    }

    .np--unit .un-payrow {
        font-size: 14px;
    }

    .np--unit .un-payrow b {
        white-space: normal;
    }

    .np--unit .un-fees {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .np--unit .un-fee {
        padding: 16px;
    }

    .np--unit .un-fee b {
        font-size: 17px;
    }

    .np--unit .un-slide img {
        height: 290px;
    }

    .np--unit .un-amenities {
        grid-template-columns: minmax(0, 1fr);
    }

    .np--unit .un-amenity {
        font-size: 16px;
    }

    .np--unit .un-text,
    .np--unit .un-lead-muted {
        font-size: 16px;
    }

    .np--unit .un-map {
        height: 280px;
    }

    .np--unit .un-doc {
        gap: 12px;
    }

    .np--unit .un-doc-btn {
        padding: 9px 15px;
        font-size: 13px;
    }

    /* Таблица юнитов → карточки */
    .np--unit .un-table thead {
        display: none;
    }

    .np--unit .un-table,
    .np--unit .un-table tbody {
        display: block;
    }

    .np--unit .un-table tr.un-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 12px;
        align-items: center;
        padding: 14px 0;
        border-bottom: 1px solid var(--np-line);
    }

    .np--unit .un-table tr.un-row[data-un-extra].is-collapsed {
        display: none;
    }

    .np--unit .un-table .un-row > th,
    .np--unit .un-table .un-row > td {
        display: block;
        padding: 0;
        border: 0;
        font-size: 15px;
    }

    .np--unit .un-table .un-row > td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--np-muted);
        font-weight: 400;
    }

    .np--unit .un-table .un-row > th {
        font-size: 17px;
    }

    .np--unit .un-table .un-cell-btn {
        grid-column: 2;
        grid-row: 1 / span 3;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .np--unit .un-track {
        scroll-behavior: auto;
    }

    .np--unit .un-dot {
        transition: none;
    }
}
