/* RelaxMassageVIP — светлый «маркетплейс», мобайл-фёрст (редизайн 2026-07-16) */

:root {
    --bg: #F2F4F7;
    --surface: #FFFFFF;
    --surface-alt: #F7F9FB;
    --hover: #F2F6FD;
    --line: #DCE2EA;
    --line-soft: #EAEEF3;
    --border-input: #C9D2DD;
    --ink: #1B2430;
    --text: #3C4654;
    --soft: #5A6675;
    --muted: #6B7684;
    --navy: #16335F;
    --navy-soft: #9FB4D4;
    --blue: #2058C0;
    --blue-hover: #1A49A2;
    --chip-bg: #EDF2FA;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'IBM Plex Sans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: var(--blue); }
img { max-width: 100%; display: block; }

.mono { font-family: 'IBM Plex Mono', monospace; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* --- Топбар --- */
.topbar { background: var(--navy); color: #FFFFFF; position: sticky; top: 0; z-index: 40; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 54px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #FFFFFF; font-weight: 700; font-size: 15px; }
.logo-mark {
    background: #FFFFFF; color: var(--navy);
    font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600;
    padding: 4px 7px; border-radius: 5px;
}
.top-note { font-size: 12px; color: var(--navy-soft); display: none; }

/* --- Главная: интро --- */
.intro { background: var(--surface); border-bottom: 1px solid var(--line); }
.intro-in { padding: 22px 0 20px; }
.intro h1 { font-size: 21px; margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.intro p { color: var(--soft); font-size: 14px; line-height: 1.55; margin: 10px 0 0; max-width: 640px; }
.stats { display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat b { font-size: 20px; font-weight: 700; color: var(--blue); }
.stat span { font-size: 12px; color: var(--muted); }

/* --- Секции --- */
.sec { padding: 20px 0 40px; }
.sec-t, .card-t {
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: var(--muted); margin: 0 0 10px;
}

/* --- Города --- */
.citybox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.citygrid { display: grid; grid-template-columns: 1fr; }
.cityrow {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px; text-decoration: none;
    border-bottom: 1px solid var(--line-soft);
    transition: background .15s;
}
.cityrow:hover { background: var(--hover); }
.cityrow .n { color: var(--blue); font-size: 14.5px; font-weight: 500; }
.cityrow .c { color: var(--muted); font-size: 12.5px; }

/* --- Хлебные крошки и заголовки --- */
.crumbs { padding: 14px 0 0; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.head { padding: 8px 0 4px; }
.head h1 { font-size: 21px; font-weight: 700; margin: 0; letter-spacing: -.01em; line-height: 1.3; }
.head .lead { color: var(--soft); font-size: 13.5px; line-height: 1.55; margin: 8px 0 0; max-width: 680px; }
.salons-link { margin: 10px 0 0; font-size: 14px; }
.salons-link a { font-weight: 600; }

/* SEO-текст: сворачиваем на мобильном (текст остаётся в DOM) */
.seo-toggle { position: absolute; opacity: 0; pointer-events: none; }
.seo-more { display: none; margin-top: 4px; color: var(--blue); font-size: 13px; font-weight: 500; cursor: pointer; }
.seo-more::after { content: 'Развернуть ↓'; }
.seo-toggle:checked ~ .seo-more::after { content: 'Свернуть ↑'; }

/* --- Чипсы услуг/районов (горизонтальный скролл) --- */
.service-chips { margin-top: 12px; }
.neighbor-links {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.service-chips {
    display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
    padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.service-chips::-webkit-scrollbar { display: none; }
.neighbor-links a, .service-chips a {
    flex-shrink: 0; background: var(--chip-bg); color: var(--blue); text-decoration: none;
    padding: 8px 14px; font-size: 13.5px; border-radius: 8px; white-space: nowrap;
    transition: background .15s;
}
.neighbor-links a:hover, .service-chips a:hover { background: var(--hover); }

/* --- Тулбар фильтров (горизонтальный скролл пилюль) --- */
.toolbar {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 0 4px; margin-bottom: 8px;
}
.filters {
    display: flex; gap: 10px; flex: 1; min-width: 0;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.f { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.f label { font-size: 12px; color: var(--muted); }
.f select {
    background: var(--surface); border: 1px solid var(--border-input); border-radius: 19px;
    color: var(--ink); font-family: inherit; font-size: 13px; padding: 8px 12px; cursor: pointer;
    white-space: nowrap;
}
.f input[type="search"] {
    background: var(--surface); border: 1px solid var(--border-input);
    color: var(--ink); padding: 8px 12px; font-size: 14px;
    font-family: inherit; border-radius: 19px; min-width: 120px;
}
.f input[type="search"]::placeholder { color: var(--muted); }
.count { font-size: 12.5px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

/* --- Карточная сетка анкет (бывшая таблица) --- */
.tbl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.thead, .salon-head { display: none; }
.row {
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    overflow: hidden; text-decoration: none; display: flex; flex-direction: column;
    transition: box-shadow .15s, border-color .15s;
}
.row:hover { box-shadow: 0 6px 18px rgba(22, 51, 95, .1); border-color: var(--border-input); }
.row.no-contact { opacity: .72; }

.avatar {
    position: relative; aspect-ratio: 4 / 5; width: 100%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #C7CDD8, #9AA6B5); color: #fff;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .no-photo { color: rgba(255,255,255,.85); font-size: 22px; }
.av-count {
    position: absolute; left: 8px; bottom: 8px;
    background: rgba(27, 36, 48, .62); color: #fff; font-size: 10.5px;
    border-radius: 9px; padding: 2px 8px; line-height: 1.4;
}

/* Тело карточки: цена (жирная), имя+возраст, район */
.cbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.cprice { font-size: 15px; font-weight: 700; color: var(--ink); }
.cname { font-size: 13.5px; color: var(--text); }
.cgeo { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-badge {
    position: absolute; top: 8px; left: 8px; background: var(--navy); color: #fff;
    font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 9px;
}

/* --- Показать ещё --- */
.more-wrap, .pagination { display: flex; justify-content: center; padding: 18px 0 40px; }
.more, .page-link {
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 1px solid var(--border-input); border-radius: 10px;
    color: var(--blue); font-family: inherit; font-size: 14px; font-weight: 600;
    padding: 0 32px; height: 48px; width: 100%; max-width: 420px;
    cursor: pointer; transition: background .15s; text-decoration: none;
}
.more:hover, .page-link:hover { background: var(--hover); }

/* --- Пагинация каталога --- */
.pagenav { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; padding: 18px 0 40px; }
.pagenav .pg {
    display: flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 10px;
    background: var(--surface); border: 1px solid var(--border-input); border-radius: 8px;
    color: var(--blue); font-size: 14px; font-weight: 600; text-decoration: none;
    transition: background .15s;
}
.pagenav a.pg:hover { background: var(--hover); }
.pagenav .pg-cur { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.pagenav .pg-gap { background: none; border: none; padding: 0; min-width: 20px; color: var(--muted); }

/* --- Страница анкеты --- */
.layout { display: block; padding-bottom: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 12px; }
.panel .card-t { padding: 14px 16px 0; margin: 0; font-size: 12px; color: var(--muted); }

.photos { padding: 14px; }
.main-ph { aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: #E4E9F0; max-height: 60vh; }
.main-ph img { width: 100%; height: 100%; object-fit: cover; }
.thumbs {
    display: flex; gap: 8px; margin-top: 10px; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumbs .thumb {
    flex-shrink: 0; width: 62px; height: 62px; border-radius: 8px; object-fit: cover;
    cursor: pointer; border: 2px solid transparent;
}
.thumbs .thumb.on { border-color: var(--blue); }

.desc { padding: 16px; border-top: 1px solid var(--line-soft); }
.desc h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.desc p { color: var(--text); font-size: 14.5px; line-height: 1.7; margin: 0 0 12px; }

.side { display: block; }
.info { width: 100%; border-collapse: collapse; margin: 6px 0; }
.info td { padding: 10px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); }
.info tr:last-child td { border-bottom: none; }
.info td:first-child { color: var(--muted); width: 42%; }
.info td:last-child { color: var(--ink); font-weight: 500; text-align: right; }

.phone-wrap { padding: 14px 16px 16px; }
.phone {
    display: block; background: var(--blue); color: #FFFFFF; text-align: center;
    text-decoration: none; font-size: 16px; font-weight: 600;
    border-radius: 10px; padding: 14px; transition: background .15s;
}
.phone:hover { background: var(--blue-hover); }
.phone-note { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.srv { list-style: none; margin: 0; padding: 10px 16px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.srv li {
    background: var(--chip-bg); color: var(--blue);
    font-size: 12.5px; font-weight: 500; padding: 6px 12px; border-radius: 8px;
}

.back { padding: 18px 0 96px; }
.back a { color: var(--blue); text-decoration: none; font-size: 14px; font-weight: 500; }
.back a:hover { text-decoration: underline; }

/* --- Похожие анкеты (мини-строки) --- */
.related-panel { margin-top: 16px; }
.related-rows { padding: 6px 0; }
.related-rows .rel-row {
    display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
    padding: 9px 16px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--text);
}
.related-rows .rel-row:last-child { border-bottom: none; }
.related-rows .rel-row:hover { background: var(--hover); }
.related-rows .avatar { width: 52px; height: 52px; aspect-ratio: auto; border-radius: 8px; flex-shrink: 0; }
.related-rows .avatar img { width: 100%; height: 100%; object-fit: cover; }
.related-rows .name { color: var(--blue); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-rows .cell { font-size: 13px; color: var(--text); white-space: nowrap; }
.related-rows .rel-price { color: var(--ink); font-weight: 700; text-align: right; }

/* --- FAQ --- */
.faq { margin: 32px 0 0; max-width: 760px; }
.faq h2 { font-size: 18px; color: var(--ink); margin: 0 0 12px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; padding: 0 16px; }
.faq-item summary {
    cursor: pointer; padding: 14px 24px 14px 0; font-size: 15px;
    font-weight: 500; color: var(--ink); list-style: none; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "▾"; position: absolute; right: 0; top: 14px; color: var(--blue); transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-item p { color: var(--text); line-height: 1.6; margin: 0 0 14px; }

/* --- Соседние города --- */
.neighbors { margin: 32px 0 8px; }
.neighbors h2 { font-size: 17px; color: var(--ink); margin: 0 0 12px; }

/* --- Подвал --- */
.ftr { border-top: 1px solid var(--line); background: var(--surface); margin-top: 24px; }
.ftr-in {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px 14px; padding: 18px 0; color: var(--muted); font-size: 12px;
}
.badge18 { background: var(--ink); color: #FFFFFF; padding: 3px 8px; font-size: 11px; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; }

/* --- 18+ оверлей --- */
#age-overlay {
    position: fixed; inset: 0; background: rgba(27, 36, 48, .55);
    display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
html.age-ok #age-overlay { display: none; }
.age-modal {
    max-width: 420px; width: 100%; background: var(--surface);
    border: 1px solid var(--border-input); border-radius: 14px;
    padding: 32px 26px 26px; box-shadow: 0 12px 40px rgba(22, 51, 95, .12);
}
.age-badge {
    display: inline-block; background: var(--navy); color: #FFFFFF;
    font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500;
    padding: 6px 11px; border-radius: 6px; margin-bottom: 18px;
}
.age-modal h2 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.age-modal p { color: var(--soft); font-size: 14.5px; line-height: 1.6; margin: 0 0 8px; }
.age-modal .age-q { font-weight: 600; color: var(--ink); margin-top: 16px; }
.age-buttons { display: flex; gap: 12px; margin-top: 22px; }
.age-buttons button {
    flex: 1; background: var(--blue); color: #FFFFFF; border: none; border-radius: 10px;
    padding: 14px; font-size: 14.5px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: background .15s;
}
.age-buttons button:hover { background: var(--blue-hover); }
.age-buttons .btn-exit {
    flex: 1; background: var(--surface); color: var(--soft);
    border: 1px solid var(--border-input); border-radius: 10px; padding: 14px;
    font-size: 14.5px; font-weight: 500; text-decoration: none; text-align: center;
    display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.age-buttons .btn-exit:hover { background: var(--bg); }
.age-fine { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* --- Sticky «Позвонить» на мобиле --- */
.sticky-call { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; }
.sticky-call {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(242, 244, 247, .92); border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
.sticky-call .call {
    display: block; text-align: center; background: var(--blue);
    color: #fff; text-decoration: none; padding: 15px;
    font-weight: 600; border-radius: 10px;
}
body:has(.sticky-call) { padding-bottom: 78px; }

/* --- Производительность больших списков --- */
.table-row { content-visibility: auto; contain-intrinsic-size: auto 260px; }

/* --- 404 --- */
.err-page {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 24px; background: var(--bg); color: var(--ink);
}
.err-code { font-size: 80px; color: var(--navy); line-height: 1; font-weight: 700; }
.err-page h1 { font-size: 24px; margin: 16px 0 8px; }
.err-page p { color: var(--soft); margin: 0 0 24px; }
.err-btn { background: var(--blue); color: #fff; text-decoration: none; padding: 12px 26px; border-radius: 10px; font-weight: 500; transition: background .15s; }
.err-btn:hover { background: var(--blue-hover); }

/* --- Салоны: карточка адреса под фото --- */
.salon-row .cgeo { white-space: normal; }
/* Рейтинг строкой в листинге салонов (звёзды те же, что на странице салона) */
.crating { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.crating .stars-inline { font-size: 12px; }
.crating b { color: var(--ink); font-weight: 600; }

/* ============ Планшет ============ */
@media (min-width: 600px) {
    .wrap { padding: 0 24px; }
    .citygrid { grid-template-columns: repeat(2, 1fr); }
    .cityrow { border-right: 1px solid var(--line-soft); }
    .tbl { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .intro h1 { font-size: 25px; }
    .head h1 { font-size: 24px; }
}

/* ============ Десктоп ============ */
@media (min-width: 900px) {
    .wrap { padding: 0 24px; }
    .topbar-in { height: 58px; }
    .logo { font-size: 16px; }
    .top-note { display: block; }
    .intro-in { padding: 40px 0 36px; }
    .intro h1 { font-size: 27px; }
    .intro p { font-size: 15px; }
    .stats { gap: 36px; margin-top: 24px; }
    .stat b { font-size: 22px; }
    .sec { padding: 36px 0 56px; }
    .sec-t, .card-t { font-size: 13px; }
    .citygrid { grid-template-columns: repeat(3, 1fr); }
    .head { padding: 10px 0 8px; }
    .head h1 { font-size: 26px; }
    .head .lead { font-size: 14px; }
    .seo-more { display: none !important; }
    .seo-text { display: block !important; -webkit-line-clamp: unset !important; }
    .tbl { grid-template-columns: repeat(4, 1fr); gap: 16px; }

    /* Двухколоночный layout анкеты */
    .layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; padding-bottom: 56px; }
    .panel { margin-top: 0; }
    .layout > .panel { margin-bottom: 0; }
    .side { display: flex; flex-direction: column; gap: 14px; }
    .side .panel { margin-top: 0; }
    .main-ph { max-height: none; }
    .related-rows .rel-row { grid-template-columns: 52px 1fr 60px 110px 1fr; }
    .sticky-call { display: none; }
    body:has(.sticky-call) { padding-bottom: 0; }
    .back { padding: 0 0 56px; }
    .toolbar { flex-wrap: wrap; }
    .filters { flex-wrap: wrap; overflow: visible; }
}

/* Сворачивание SEO-текста только на мобильном/планшете */
@media (max-width: 899px) {
    .seo-text {
        display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    }
    .seo-toggle:checked ~ .seo-text { -webkit-line-clamp: unset; overflow: visible; }
    .seo-more { display: inline-block; }
    .related-rows .cell.hide-m { display: none; }
}

/* --- Рейтинг и отзывы (task #10) — каталожный стиль --- */
.stars-inline, .stars {
    --pct: calc(var(--rating) / 5 * 100%);
    display: inline-block; line-height: 1; letter-spacing: 1px; vertical-align: middle;
}
.stars-inline::before, .stars::before {
    content: "\2605\2605\2605\2605\2605";
    background: linear-gradient(90deg, #F5A623 var(--pct), var(--line) var(--pct));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.rating-src { color: var(--muted); font-size: 11px; }
.reviews { margin-top: 24px; }
.reviews h2 { font-size: 18px; margin: 0 0 12px; }
.reviews .reviews-meta { color: var(--muted); font-size: 13px; font-weight: 400; }
.review-list { list-style: none; padding: 0; margin: 0; }
.review { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 10px 0; background: #FFFFFF; }
.review-text { margin: 0 0 6px; color: var(--text); line-height: 1.5; font-size: 14px; }
.review-author { margin: 0; color: var(--muted); font-size: 12px; }

/* План продвижения: свежесть, живой текст города, перелинковка анкеты */
.fresh-note { font-size: .8rem; color: var(--muted); margin: .3rem 0 .8rem; }
.city-text p { margin: .5em 0; color: var(--ink); }
.city-text { font-size: .95rem; line-height: 1.6; max-width: 60rem; }
.see-also { display: flex; flex-wrap: wrap; gap: .35rem; }
.see-also a { font-size: .82rem; padding: .25rem .6rem; background: var(--chip-bg); border: 1px solid var(--line); border-radius: 6px; color: var(--navy); text-decoration: none; }
.see-also a:hover { border-color: var(--blue); color: var(--blue); }

/* --- Хаб программ города (/{city}/uslugi/): таблица сравнения --- */
.chip-all { font-weight: 600; }
.hubtbl {
    margin-top: 16px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.hubhead, .hubrow {
    display: grid; grid-template-columns: 1fr 90px 90px;
    gap: 10px; align-items: center; padding: 12px 14px;
}
.hubhead {
    background: var(--surface-alt); color: var(--muted);
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--line);
}
.hubhead span:not(:first-child), .hubrow .hc, .hubrow .hp { text-align: right; }
.hubrow {
    text-decoration: none; border-bottom: 1px solid var(--line-soft);
    transition: background .15s;
}
.hubrow:last-child { border-bottom: 0; }
.hubrow:hover { background: var(--hover); }
.hubrow .hn { color: var(--blue); font-size: 14.5px; font-weight: 500; }
.hubrow .hc { color: var(--text); font-size: 13.5px; }
.hubrow .hp { color: var(--muted); font-size: 13.5px; white-space: nowrap; }

/* Блок «Справочник» на главной */
.guidegrid { display: grid; grid-template-columns: 1fr; }
.guiderow {
    display: block; padding: 13px 16px; text-decoration: none;
    border-bottom: 1px solid var(--line-soft); transition: background .15s;
}
.guiderow:last-child { border-bottom: 0; }
.guiderow:hover { background: var(--hover); }
.guiderow .n { display: block; color: var(--blue); font-size: 14.5px; font-weight: 500; }
.guiderow .d { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 3px; }

@media (min-width: 700px) {
    .guidegrid { grid-template-columns: repeat(2, 1fr); }
}
