/*
 * Переопределения поверх oldstatic/css/css.css (подключается последним в header.php).
 * 2026-09-13: компактная шапка с фоном, подвал в потоке внизу страницы.
 */

/* ── Шапка: фиксированная полоса с белым фоном ───────────────────────── */
body header {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding: 0 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 1px 12px rgba(0, 0, 0, .08);
}

body header .logo,
body header .logo.black {
    display: block;
    float: none;
}

body header .logo .bg {
    float: none;
    width: 84px;
    height: 32px;
    margin: 0;
}

body header .logo .sep {
    display: none;
}

body header .right,
body header .right.black {
    float: none;
    display: flex;
    align-items: center;
    gap: 28px;
    text-align: right;
}

body header .phone,
body header .right.black .phone {
    float: none;
    display: block;
    width: auto;
    margin: 0;
    color: #1d1d1b;
    font-size: 16px;
    line-height: 1.2;
    text-align: right;
}

body header .phone span {
    color: #666;
    font-size: 11px !important;
}

body header .link,
body header .right.black .link {
    float: none;
    display: block;
    width: auto;
    height: 40px;
    margin: 0;
    padding: 0 22px;
    border: 0;
    background: #f2fb04;
    color: #292929;
    font-size: 14px;
    line-height: 40px;
    text-align: center;
    white-space: nowrap;
}

body header .link:hover,
body header .right.black .link:hover {
    background: #e3ec00;
    color: #000;
}

/* ── Подвал: обычный блок в конце страницы ───────────────────────────── */
body footer {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 0;
    padding: 28px 40px;
    background: #1d1d1b;
    color: #b5b5b5 !important;
    font-size: 13px;
    line-height: 1.5;
}

body footer .cop,
body footer .cop.black {
    color: #b5b5b5;
}

body footer .cop span {
    font-size: 12px;
}

body footer .cop-privacy {
    display: inline-block;
    margin-top: 8px;
    color: #b5b5b5;
}

/* Согласие на обработку ПДн под виджетом бронирования */
#bron .bron-consent {
    max-width: 640px;
    margin: 16px auto 0;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

#bron .bron-consent a {
    color: #555;
}

/* ── Мобильные ───────────────────────────────────────────────────────── */
@media screen and (max-width: 720px) {
    body header {
        height: 56px;
        padding: 0 12px;
    }

    body header .logo .bg {
        width: 66px;
        height: 25px;
    }

    body header .right,
    body header .right.black {
        gap: 10px;
    }

    body header .phone,
    body header .right.black .phone {
        font-size: 13px;
        white-space: nowrap;
    }

    body header .phone br,
    body header .phone span {
        display: none;
    }

    body header .link,
    body header .right.black .link {
        height: 34px;
        padding: 0 10px;
        font-size: 12px;
        line-height: 34px;
    }

    .section.bg1 .wrap {
        padding-top: 90px;
    }

    body footer {
        padding: 20px 16px;
        margin-top: 0;
    }
}

@media screen and (max-width: 360px) {
    body header .phone {
        font-size: 12px;
    }

    body header .link {
        padding: 0 8px;
        font-size: 11px;
    }
}

/* ── Заголовки: h1/h2 вместо div — без браузерных отступов (жирность задаёт site.css) ── */
h1.title_page {
    margin: 0;
}

h2.name_page {
    margin-bottom: 0;
}

/* ── Доступность: видимый фокус с клавиатуры (css.css глобально убирает outline) ── */
a:focus-visible,
[role="button"]:focus-visible,
button:focus-visible {
    outline: 2px solid #f2fb04;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px #1d1d1b;
}

/* ── Стрелки справа: остались только ↑ ↓ ── */
#menu {
    margin-top: -58px;
}

/* Панорамы и виджеты во всю ширину */
iframe {
    width: 100%;
}

/* ── Главная: карточка квартиры — ссылка на её страницу ── */
.section.bg2 .grid a.item {
    display: block;
    color: inherit;
    text-decoration: none;
}

.section.bg2 a.kv-more {
    color: #1d1d1b;
    font-size: 18px;
}

/* ── Внутренние страницы, поиск, 404 (шаблон template-parts/simple) ── */
.page-simple {
    box-sizing: border-box;
    min-height: calc(100vh - 160px);
    max-width: 820px;
    margin: 0 auto;
    padding: 120px 24px 64px;
    color: #1d1d1b;
    font-size: 17px;
    line-height: 1.6;
}

.page-simple h1 {
    margin: 0 0 24px;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 34px;
    font-weight: bold;
    line-height: 1.2;
}

.page-simple h2 {
    margin: 32px 0 12px;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 22px;
    font-weight: bold;
}

.page-simple p,
.page-simple ul,
.page-simple ol {
    margin: 0 0 16px;
}

.page-simple ul,
.page-simple ol {
    padding-left: 24px;
}

.page-simple a {
    color: #1d1d1b;
    text-decoration: underline;
}

.page-simple .page-simple__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 32px;
}

.page-simple .page-simple__actions a {
    display: inline-block;
    padding: 12px 22px;
    background: #f2fb04;
    color: #292929;
    text-decoration: none;
}

.page-simple .page-simple__list {
    list-style: none;
    padding: 0;
}

.page-simple .page-simple__list li {
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
}

@media screen and (max-width: 720px) {
    .page-simple {
        padding: 88px 16px 40px;
        font-size: 16px;
    }

    .page-simple h1 {
        font-size: 26px;
    }
}

/* ── Фоны секций в WebP (JPEG — запасной вариант для старых браузеров) ── */
.section.bg1 {
    background-image: url("/oldstatic/img/bg1.jpg");
    background-image: image-set(url("../img/bg1.webp") type("image/webp"), url("/oldstatic/img/bg1.jpg") type("image/jpeg"));
}

.section.bg3 {
    background-image: url("/oldstatic/img/bg3.jpg");
    background-image: image-set(url("../img/bg3.webp") type("image/webp"), url("/oldstatic/img/bg3.jpg") type("image/jpeg"));
}

.section.bg8 {
    background-image: url("/oldstatic/img/bg8.jpg");
    background-image: image-set(url("../img/bg8.webp") type("image/webp"), url("/oldstatic/img/bg8.jpg") type("image/jpeg"));
}

/* ── Arial Bold шире Helvetica Medium: заголовок карточки первого экрана на ~10% мельче, чтобы остался в 2 строки ── */
.section.bg1 .block .form .ttl1 {
    font-size: 20px;
}

@media screen and (max-width: 1600px) {
    .section.bg1 .block .form .ttl1 {
        font-size: 16px;
    }
}

@media screen and (max-width: 1400px) {
    .section.bg1 .block .form .ttl1 {
        font-size: 13.5px;
    }
}

@media screen and (max-width: 720px) {
    .section.bg1 .block .form .ttl1 {
        font-size: 13px;
    }
}

/* Логотипы клиентов: width/height в HTML резервируют место, ширину задаёт site.css */
.section.bg6 .block_img img {
    height: auto;
}

/* ── Страницы квартир /kvartiry/<slug>/ и каталог /kvartiry/ ── */
.flat-page {
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
    padding: 96px 24px 64px;
    color: #1d1d1b;
    font-size: 17px;
    line-height: 1.6;
}

.flat-page h1 {
    margin: 0 0 24px;
    font-size: 34px;
    line-height: 1.2;
}

.flat-page h2 {
    margin: 48px 0 16px;
    font-size: 26px;
}

.flat-page__address {
    display: block;
    margin-top: 8px;
    font-size: 20px;
    font-weight: normal;
    color: #555;
}

.flat-crumbs {
    margin-bottom: 16px;
    font-size: 14px;
    color: #666;
}

.flat-crumbs a,
.flat-page__more p a {
    color: #1d1d1b;
}

.flat-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
    gap: 8px;
}

.flat-gallery a:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.flat-gallery img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* в сетке 5 фото, остальные — в просмотре fancyBox */
.flat-gallery a:nth-child(n+6) {
    display: none;
}

.flat-gallery a[data-more] {
    position: relative;
}

.flat-gallery a[data-more]::after {
    content: attr(data-more);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 22px;
    font-weight: bold;
}

.flat-page__body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    margin-top: 32px;
    align-items: start;
}

.flat-page__text p {
    margin: 0 0 6px;
}

.flat-archive > p {
    margin: 0 0 12px;
}

.flat-page__book {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.flat-page__book div.newbtn {
    margin: 8px 0;
}

.flat-page__book a {
    color: #1d1d1b;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
}

.flat-page__book small {
    color: #666;
}

.flat-page__price {
    font-size: 24px;
    font-weight: bold;
}

.flat-page__pano iframe {
    width: 100%;
    height: 480px;
    border: 0;
}

.flat-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 24px;
}

.flat-card {
    display: block;
    color: #1d1d1b;
    text-decoration: none;
}

.flat-card img {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
}

.flat-card span {
    display: block;
    margin-top: 12px;
    font-size: 18px;
    line-height: 1.4;
    text-align: center;
}

.flat-archive__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    margin-top: 40px;
}

.flat-archive__actions div.newbtn {
    margin: 0;
}

.flat-archive__actions a {
    color: #1d1d1b;
    font-size: 20px;
    font-weight: bold;
}

@media screen and (max-width: 900px) {
    .flat-page__body {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .flat-page__book {
        position: static;
    }

    .flat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .flat-page {
        padding: 80px 16px 40px;
        font-size: 16px;
    }

    .flat-page h1 {
        font-size: 26px;
    }

    .flat-gallery {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 120px;
    }

    .flat-page__pano iframe {
        height: 320px;
    }

    .flat-cards {
        grid-template-columns: 1fr;
    }
}

/* Подборки квартир: ссылки-«чипсы» */
.flat-sets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
}

.flat-sets a {
    padding: 6px 14px;
    border: 1px solid #d5d5d5;
    border-radius: 999px;
    color: #1d1d1b;
    font-size: 15px;
    text-decoration: none;
}

.flat-sets a:hover,
.flat-sets a[aria-current="page"] {
    border-color: #1d1d1b;
    background: #f2fb04;
}

/* fullPage (от 700px) после загрузки ставит каждой секции высоту окна; та же высота сразу —
   без скачка вёрстки, пока скрипты с defer ещё не выполнились (CLS 0,96 → 0) */
@media screen and (min-width: 700px) {
    #fullpage > .section:not(.fp-auto-height) {
        height: 100vh;
    }
}

/* Главная: все квартиры одной секцией (fp-auto-height — высота по содержимому, без пустых экранов) */
.section.bg2.flats-section {
    padding: 40px 0 56px;
}

/* fullPage 2 ставит секции (и обёртке .fp-tableCell) высоту окна даже с fp-auto-height */
#fullpage > .section.flats-section,
#fullpage > .section.flats-section > .fp-tableCell {
    height: auto !important;
}

.section.bg2.flats-section .grid {
    row-gap: 40px;
    padding-top: 0;
}

/* .wrap в site.css — absolute и по центру экрана; здесь — в потоке, чтобы секция росла по содержимому */
.section.bg2.flats-section .wrap {
    position: relative;
    top: auto;
    bottom: auto;
    height: auto;
    margin: 0 auto;
}

/* вертикальная подпись «Выбор квартиры» — поверх, не сдвигает сетку */
.section.bg2.flats-section .name_page {
    position: absolute;
    top: 0;
    left: 0;
    float: none;
    margin-top: 260px;
}

@media screen and (max-width: 720px) {
    .section.bg2.flats-section {
        padding: 24px 0 40px;
    }

    .section.bg2.flats-section .grid {
        row-gap: 28px;
    }

    .section.bg2.flats-section .grid .item {
        margin-bottom: 0;
    }

    .section.bg2.flats-section .grid.first {
        padding-top: 0;
    }

    .section.bg2.flats-section a.kv-more {
        display: flex;
    }
}
