/* ============================================================
   NBC Putevod — страница «Путеводитель» (/putevod/)
   Маршрут по макету land/img/putev.pdf: логотипы в белых кружках
   и «стадионах» с красной обводкой, красная точечная кривая-змейка,
   адреса тёмным 13px, внизу белый полукруг «Центр города».
   ============================================================ */

/* Шрифт заголовков — Despair Display (в теме: land/fonts/) */
@font-face {
    font-family: 'Despair Display';
    src: url('../../land/fonts/despairdisplay-bold.woff2') format('woff2'),
         url('../../land/fonts/despairdisplay-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* На путеводителе общая шапка и футер сайта скрыты; страница скроллится */
body.nbc-putevod-page #site-header,
body.nbc-putevod-page #nbc-header,
body.nbc-putevod-page #site-footer,
body.nbc-putevod-page .nbc-footer,
body.nbc-putevod-page .page-header,
body.nbc-putevod-page h1.entry-title {
    display: none !important;
}

body.nbc-putevod-page {
    background: #EFE4D2 !important;
    /* clip не создаёт скролл-контейнер — прокрутка колесом работает;
       hidden как фолбэк для старых браузеров */
    overflow-x: hidden;
    overflow-x: clip;
}

.pv-page {
    --pv-red: #B83519;
    --pv-red-dark: #8f2812;
    --pv-cream: #EFE4D2;
    --pv-ink: #2b1a12;
    --pv-muted: #8a7360;

    --pv-rowh: 218px;   /* высота ряда маршрута (запас под многострочные адреса) */
    --pv-top: 6px;      /* отступ первого ряда */
    --pv-circle: 132px; /* диаметр кружка */
    --pv-fin-w: 383px;  /* полукруг «Центр города», +10% */
    --pv-fin-h: 191px;

    min-height: 100vh;
    margin: 0 calc(50% - 50vw);
    padding: 0 16px 0;
    box-sizing: border-box;
    text-align: center;
    font-family: 'Montserrat', Arial, sans-serif;
    color: var(--pv-ink);
    background-color: var(--pv-cream);
    background-image:
        radial-gradient(circle, rgba(184, 53, 25, .05) 4px, rgba(184, 53, 25, 0) 4.5px),
        radial-gradient(circle, rgba(184, 53, 25, .05) 4px, rgba(184, 53, 25, 0) 4.5px);
    background-size: 32px 32px;
    background-position: 0 0, 16px 16px;
}

/* ── Шапка ─────────────────────────────────────────────── */

.pv-head {
    padding: 40px 0 6px;
}

.pv-title {
    margin: 0;
    font-family: 'Despair Display', 'Montserrat', Arial, sans-serif !important;
    font-size: clamp(32px, 5.1vw, 48px); /* на 15% меньше */
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    line-height: 1.05;
    color: var(--pv-red);
}

.pv-sub {
    margin: 8px 0 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pv-muted);
}

/* ── Маршрут ───────────────────────────────────────────── */

.pv-route {
    position: relative;
    max-width: 940px; /* шире: боковые дуги змейки снаружи, больше воздуха */
    margin: 10px auto 0;
    /* полукруг прижат к нижней кромке — снизу без зазора */
    height: calc(var(--rows) * var(--pv-rowh) + var(--pv-fin-h));
}

.pv-line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 0;
}

.pv-dot {
    fill: var(--pv-red);
}

/* Элемент маршрута: позиция из --x (%, центр) и --r (номер ряда) */
.pv-item {
    position: absolute;
    left: var(--x);
    top: calc(var(--r) * var(--pv-rowh) + var(--pv-top));
    transform: translateX(-50%) scale(var(--s, 1));
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: max-content;
    padding: 0;
    border: none;
    background: transparent;
    font: inherit;
    color: inherit;
    cursor: pointer;
    /* масштаб появления анимируется через --s, чтобы не конфликтовать с translateX */
    transition: opacity .45s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1);
}

.pv-js .pv-item {
    --s: .55;
    opacity: 0;
}

.pv-js .pv-item.is-in {
    --s: 1;
    opacity: 1;
}

/* Контейнер лого: белый, красная обводка; размер по классу ниже */
.pv-shape {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 3px solid var(--pv-red);
    box-shadow: 0 8px 22px rgba(43, 26, 18, .14);
    transition: transform .25s ease, box-shadow .25s ease;
}

/* Круглый контейнер: размер и процент лого — per-item переменные
   (--cpct множитель круга, --lp процент лого; дефолт 85%) */
.pv-item:not(.pv-wide) .pv-shape {
    width: calc(var(--pv-circle) * var(--cpct, 1));
    height: calc(var(--pv-circle) * var(--cpct, 1));
    border-radius: 50%;
    box-sizing: border-box;
}

.pv-item:not(.pv-wide) .pv-shape img {
    width: var(--lp, 85%);
    height: var(--lp, 85%);
    object-fit: contain;
    display: block;
    transform: translateY(var(--ln, 0px)); /* микросдвиг лого по вертикали */
}

/* Широкий лого — «стадион» фиксированного размера (3 шт.: Кафе Краснодар,
   Burger Bar, Чик Чак); лого — 85% габарита стадиона, с полями */
.pv-wide .pv-shape {
    width: 202px;
    height: 86px;
    border-radius: 999px;
    box-sizing: border-box;
}

.pv-wide .pv-shape img {
    display: block;
    width: var(--lp, 85%);
    height: var(--lp, 85%);
    object-fit: contain;
    transform: translateY(var(--ln, 0px)); /* микросдвиг лого по вертикали */
}

.pv-item:hover .pv-shape,
.pv-item:focus-visible .pv-shape {
    transform: scale(1.05);
    box-shadow: 0 12px 28px rgba(43, 26, 18, .22);
}

.pv-item:focus-visible {
    outline: none;
}

.pv-item:focus-visible .pv-shape {
    outline: 3px solid var(--pv-red);
    outline-offset: 4px;
}

/* Адрес: тёмный мелкий текст, как в макете; каждый адрес — с новой строки */
.pv-addr {
    margin-top: 9px;
    max-width: 200px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--pv-ink);
}

.pv-addr-line {
    display: block;
}

/* ── Финал: белый полукруг с логотипом «Центр города» ──── */

.pv-final {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) scale(var(--s, 1));
    z-index: 1;
    width: var(--pv-fin-w);
    height: var(--pv-fin-h);
    border-radius: var(--pv-fin-w) var(--pv-fin-w) 0 0;
    background: #fff;
    border: 3px solid var(--pv-red);
    border-bottom: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 30px 0;
    box-shadow: 0 10px 26px rgba(43, 26, 18, .14);
    transition: opacity .45s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1);
}

.pv-final img {
    width: 100%;
    max-height: 64%;
    object-fit: contain;
    display: block;
    margin-top: 20px; /* опущено ещё на 10px */
}

.pv-js .pv-final {
    --s: .55;
    opacity: 0;
}

.pv-js .pv-final.is-in {
    --s: 1;
    opacity: 1;
}

/* Точки линии появляются вместе с кружками */
.pv-js .pv-dot {
    opacity: 0;
}

.pv-js .pv-dot.is-in {
    opacity: 1;
    transition: opacity .35s ease;
}

/* ── Модалка ресторана ─────────────────────────────────── */

.pv-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center; /* по центру окна */
    justify-content: center;
    padding: 4vh 16px;
    background: rgba(43, 26, 18, .65);
    overflow-y: auto;
    font-family: 'Montserrat', Arial, sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.pv-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.pv-modal-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: var(--pv-cream, #EFE4D2);
    border-radius: 20px;
    padding: 30px 26px 26px;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    overflow: hidden;
    transform: translateY(14px) scale(.97);
    transition: transform .25s ease;
}

.pv-modal.is-open .pv-modal-box {
    transform: none;
}

.pv-modal-box::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 200px;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(184, 53, 25, .12) 4px, rgba(184, 53, 25, 0) 4.5px),
        radial-gradient(circle, rgba(184, 53, 25, .12) 4px, rgba(184, 53, 25, 0) 4.5px);
    background-size: 32px 32px;
    background-position: 0 0, 16px 16px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 100%);
}

.pv-modal-box > * {
    position: relative;
    z-index: 1;
}

.pv-modal-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    margin: 0 -6px 0 0;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--pv-red, #B83519) transparent;
}

.pv-modal-scroll::-webkit-scrollbar {
    width: 6px;
}

.pv-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.pv-modal-scroll::-webkit-scrollbar-thumb {
    background: var(--pv-red, #B83519);
    border-radius: 3px;
}

.pv-modal-close {
    position: absolute;
    top: 12px;
    left: 12px; /* крестик слева */
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 3px;
    border: none;
    border-radius: 50%;
    background: var(--pv-red, #B83519);
    color: #f7f0e4;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease;
}

.pv-modal-close:hover {
    background: var(--pv-red-dark, #8f2812);
    transform: scale(1.07);
}

.pv-modal-logo {
    margin-bottom: 14px;
}

.pv-modal-logo img {
    height: 82px; /* крупнее */
    width: auto;
    max-width: 78%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Название ресторана в модалке не показываем — лого говорит само за себя */
.pv-modal-title {
    display: none;
}

.pv-modal-title {
    margin: 0 0 14px;
    padding: 0 44px;
    box-sizing: border-box;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.25;
    color: var(--pv-red, #B83519);
}

.pv-modal-dishes {
    list-style: none;
    margin: 0 0 6px;
    padding: 0;
    text-align: left;
}

.pv-modal-dishes li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 2px;
    border-bottom: 1px dashed rgba(184, 53, 25, .3);
    font-size: 14px;
    line-height: 1.45;
}

.pv-modal-dishes li:last-child {
    border-bottom: none;
}

.pv-dish-name {
    color: var(--pv-ink, #2b1a12);
}

.pv-dish-price {
    flex: 0 0 auto;
    font-weight: 800;
    color: var(--pv-red, #B83519);
    white-space: nowrap;
}

.pv-modal-photo {
    margin-top: 12px;
}

.pv-modal-photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}

.pv-modal-photo.is-hidden {
    display: none;
}

/* ── Адаптив ───────────────────────────────────────────── */

@media (max-width: 720px) {
    .pv-page {
        --pv-rowh: 200px;
        --pv-circle: 128px; /* крупные круги: между парой в ряду помещаются точки */
        --pv-fin-w: 275px;
        --pv-fin-h: 137px;
        padding: 0 10px 0;
    }

    .pv-head {
        padding-top: 28px;
    }

    /* стадион — один на строку; проценты лого (--lp) сохраняются */
    .pv-wide .pv-shape {
        width: 200px;
        height: 80px;
    }

    .pv-addr {
        font-size: 12px;
        max-width: 150px;
        margin-top: 7px;
    }

    .pv-final img {
        max-height: 60%;
    }

    .pv-modal-box {
        padding: 26px 18px 22px;
    }

    .pv-modal-dishes li {
        font-size: 13px;
    }
}

/* ── «Уменьшить движение»: без очереди и зума ──────────── */

@media (prefers-reduced-motion: reduce) {
    .pv-js .pv-item,
    .pv-js .pv-final,
    .pv-js .pv-item.is-in,
    .pv-js .pv-final.is-in {
        --s: 1;
        opacity: 1;
        transition: none;
    }

    .pv-js .pv-dot,
    .pv-js .pv-dot.is-in {
        opacity: 1;
        transition: none;
    }

    .pv-shape,
    .pv-modal,
    .pv-modal-box {
        transition: none;
    }
}
