/* =====================================================
   StoZona — основные стили
   Белый фон, красные акценты, Unbounded для заголовков
   ===================================================== */

/* ---------- Шрифт Unbounded (локально, вариативный) ---------- */
@font-face {
    font-family: 'Unbounded';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/unbounded-cyrillic-ext.woff2') format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Unbounded';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/unbounded-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Unbounded';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/unbounded-vietnamese.woff2') format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Unbounded';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/unbounded-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Unbounded';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/unbounded-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Переменные ---------- */
:root {
    --red:        #e02f2f;
    --red-dark:   #c11f1f;
    --red-light:  #ffe3e3;
    --ink:        #1c1c1e;
    --ink-soft:   #5b5b60;
    --gray:       #8a8a90;
    --line:       #ececee;
    --bg:         #ffffff;
    --bg-soft:    #f7f7f8;
    --white:      #ffffff;
    --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
    --shadow-md:  0 6px 24px rgba(0,0,0,.08);
    --radius:     14px;
    --font-head:  'Unbounded', 'Arial Black', sans-serif;
    --font-body:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- База ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.2;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Шапка ---------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--ink);
    flex-shrink: 0;
}

.logo__word span { color: var(--red); }

.header-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 16px;
    max-width: 560px;
}

.header-search i { color: var(--gray); }

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 14px;
}

.header-search input::placeholder { color: var(--gray); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.btn-catalog, .btn-menu { white-space: nowrap; line-height: 1.2; }
.btn-catalog__text--mobile { display: none; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 14px;
    transition: all .2s;
    text-align: center;
}

.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-dark); color: var(--white); }

.btn-outline {
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-outline:hover { border-color: var(--red); color: var(--red); }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.btn-block { width: 100%; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Герой ---------- */
.hero {
    background:
        radial-gradient(900px 340px at 85% -30%, rgba(224,47,47,.16), transparent 60%),
        radial-gradient(700px 300px at -5% 130%, rgba(224,47,47,.08), transparent 60%),
        var(--white);
    border-bottom: 1px solid var(--line);
    padding: 56px 0 44px;
    overflow: hidden;
}

.hero__grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
    align-items: center;
}

.hero__content { position: relative; z-index: 1; }

.hero__title {
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 800;
    max-width: 780px;
    margin-bottom: 16px;
}

.hero__title em {
    font-style: normal;
    color: var(--red);
}

.hero__subtitle {
    color: var(--ink-soft);
    font-size: 17px;
    max-width: 640px;
    margin-bottom: 28px;
}

.hero__visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 340px;
}

.hero__car {
    width: 100%;
    max-width: 560px;
    filter: drop-shadow(0 36px 44px rgba(224, 47, 47, .28));
    animation: heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50%      { transform: translateY(-14px) rotate(1deg); }
}

.hero__stat {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    animation: heroFloat 6s ease-in-out infinite;
}

.hero__stat--top { top: 6%; left: 2%; animation-delay: .4s; }
.hero__stat--bottom { bottom: 8%; right: 2%; animation-delay: 1s; }

.hero__stat-ico {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--red-light);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}

.hero__stat-num {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1;
    display: block;
    margin-bottom: 2px;
}

.hero__stat-label {
    font-size: 11px;
    color: var(--gray);
    line-height: 1.2;
    display: block;
    max-width: 170px;
}

/* Категории-табы */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--white);
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    transition: all .2s;
}

.cat-tab i { color: var(--red); font-size: 17px; }

.cat-tab:hover { border-color: var(--red); color: var(--red); }

.cat-tab.active {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
}

.cat-tab.active i { color: var(--white); }

.cat-tab .count {
    font-size: 12px;
    background: var(--bg-soft);
    border-radius: 999px;
    padding: 1px 8px;
    color: var(--gray);
}

.cat-tab.active .count { background: rgba(255,255,255,.22); color: var(--white); }

/* ---------- Главная: карта + «Рядом со мной» ---------- */
.home-map {
    padding: 0 20px 40px;
}

.home-map__wrap {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
    max-width: 1280px;
    margin: 0 auto;
}

#home-map {
    width: 100%;
    height: calc(100vh - 64px - 40px);
    min-height: 560px;
    max-height: 860px;
    z-index: 1;
}

/* Панель «Рядом со мной» */
.nearby-panel {
    position: absolute;
    z-index: 500;
    top: 14px;
    left: 14px;
    width: 360px;
    max-width: calc(100% - 28px);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nearby-panel__head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nearby-panel__title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nearby-panel__title i { color: var(--red); }

.nearby-panel__geo {
    font-size: 11px;
    color: var(--gray);
    white-space: nowrap;
}

.nearby-list {
    overflow-y: auto;
    max-height: 380px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nearby-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
    background: var(--white);
}

.nearby-card:hover { border-color: var(--red); }

.nearby-card.active {
    border-color: var(--red);
    background: var(--red-light);
    box-shadow: 0 0 0 1px var(--red);
}

.nearby-card__icon {
    width: 40px; height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--red-light);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nearby-card__body { flex: 1; min-width: 0; }

.nearby-card__name {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nearby-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    font-size: 11px;
    color: var(--gray);
}

.nearby-card__rating { color: var(--red); font-weight: 600; }
.nearby-card__rating i { color: var(--red); }

.nearby-card__status { color: var(--gray); }
.nearby-card__status.is-open { color: #1f8a4c; }

.nearby-card__distance {
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    flex-shrink: 0;
    min-width: 46px;
    text-align: right;
}

.nearby-card__btn {
    width: 30px; height: 30px;
    flex-shrink: 0;
    border: 1px solid var(--line);
    background: var(--white);
    border-radius: 8px;
    color: var(--ink-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all .2s;
}

.nearby-card__btn:hover { border-color: var(--red); color: var(--red); }

.nearby-panel__all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    font-weight: 600;
}

/* Превью организации внизу карты */
.home-preview {
    position: absolute;
    z-index: 500;
    left: 14px;
    right: 14px;
    bottom: 14px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 16px;
    transform: translateY(140%);
    transition: transform .25s ease;
}

.home-preview.open { transform: translateY(0); }

.home-preview__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.home-preview__icon {
    width: 46px; height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--red-light);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.home-preview__titles { flex: 1; min-width: 0; }

.home-preview__titles h3 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.home-preview__cat { font-size: 12px; color: var(--gray); margin-top: 2px; }

.home-preview__close {
    border: none;
    background: none;
    font-size: 22px;
    color: var(--gray);
    line-height: 1;
}

.home-preview__close:hover { color: var(--red); }

.home-preview__info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 12px;
}

.home-preview__rating { display: flex; align-items: center; gap: 6px; }
.home-preview__rating .rating-num { font-family: var(--font-head); font-weight: 700; color: var(--red); }

.home-preview__row { display: flex; gap: 8px; align-items: center; }
.home-preview__row i { color: var(--gray); width: 16px; text-align: center; }

.home-preview__actions { display: flex; gap: 8px; }

/* ---------- Главная: слайдер «Рядом со мной» ---------- */
.nearby-slider { padding: 32px 0 44px; }

.nearby-slider__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.nearby-slider__note { color: var(--gray); font-size: 13px; margin-top: 4px; }

.nearby-slider__controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nearby-slider__nav {
    display: flex;
    gap: 8px;
}

.org-slider {
    position: relative;
}

.org-slider__viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.org-slider__track {
    display: flex;
    gap: 12px;
    --per-view: 3;
    transition: transform .45s ease;
    will-change: transform;
    touch-action: pan-y;
}

.org-slider__track.dragging { transition: none; }

.org-slide {
    flex: 0 0 calc((100% - (var(--per-view) - 1) * 12px) / var(--per-view));
    min-width: 0;
}

.org-slide.hidden { display: none; }

.org-slide__card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, box-shadow .2s;
}

.org-slide__card:hover {
    border-color: var(--red);
    box-shadow: var(--shadow-md);
}

.org-slide__head { display: flex; align-items: flex-start; gap: 12px; }

.org-slide__icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: var(--red-light);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.org-slide__titles { flex: 1; min-width: 0; }

.org-slide__name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 4px;
}

.org-slide__cat {
    font-size: 12px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

.org-slide__badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.slide-distance {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
}

.org-slide__rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 12px;
}

.org-slide__rating .rating-num {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--red);
}

.org-slide__meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 13px;
    color: var(--ink-soft);
}

.org-slide__row { display: flex; gap: 8px; align-items: center; }

.org-slide__row i {
    color: var(--gray);
    width: 17px;
    text-align: center;
    font-size: 14px;
}

.org-slide__actions {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    gap: 10px;
}

.org-slide__actions .btn { flex: 1; justify-content: center; }

.org-slider__arrow {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}

.org-slider__arrow:hover { border-color: var(--red); color: var(--red); }

.org-slider__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.org-slider__dots .dot {
    width: 8px; height: 8px;
    border-radius: 999px;
    border: none;
    background: var(--line);
    cursor: pointer;
    padding: 0;
    transition: all .25s;
}

.org-slider__dots .dot.active { width: 22px; background: var(--red); }

/* ---------- Каталог: список + закреплённая карта ---------- */
.catalog-page { padding: 24px 0 60px; }

.catalog-page__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.catalog-page__title { font-size: 22px; font-weight: 700; }

.catalog-page__result { font-size: 13px; color: var(--gray); margin-top: 4px; }

.catalog-page__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.catalog-page__chips .cat-tab { padding: 8px 14px; font-size: 13px; }

.sort-select {
    border: 1px solid var(--line);
    background: var(--bg-soft);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--ink);
    outline: none;
}

.catalog-page__layout {
    display: grid;
    grid-template-columns: minmax(380px, 460px) 1fr;
    gap: 24px;
    align-items: start;
}

.catalog-page__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Карта закрепляется при прокрутке */
.catalog-page__map {
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px - 20px);
    min-height: 480px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
}

#catalog-map { width: 100%; height: 100%; z-index: 1; border-radius: inherit; }

.map-modal-close { display: none; }

.org-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: all .2s;
    background: var(--white);
    position: relative;
}

.org-card:hover {
    border-color: var(--red);
    box-shadow: var(--shadow-sm);
}

.org-card.active {
    border-color: var(--red);
    background: var(--red-light);
    box-shadow: 0 0 0 1px var(--red);
}

.org-card__top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.org-card__icon {
    width: 42px; height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--red-light);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.org-card__name {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.org-card__cat {
    font-size: 12px;
    color: var(--gray);
}

.org-card__badges {
    margin-left: auto;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
}

.badge-red { background: var(--red); color: #fff; }
.badge-soft { background: var(--bg-soft); color: var(--ink-soft); }
.badge-green { background: #e4f5e9; color: #1f8a4c; }
.badge-orange { background: #fff0e0; color: #c2731a; }

.org-card__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.org-card__rating .rating-num {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--red);
}

.rating-stars { color: var(--red); font-size: 13px; letter-spacing: 1px; }

.org-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--ink-soft);
}

.org-card__meta i {
    color: var(--gray);
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.org-card__meta-row { display: flex; gap: 8px; align-items: center; }

.org-card__footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    display: flex;
    gap: 8px;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray);
}

.empty-state i { font-size: 44px; color: var(--line); display: block; margin-bottom: 12px; }
.empty-state p { font-family: var(--font-head); font-size: 14px; color: var(--ink-soft); }

/* Панель карты */
.map-toast {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 600;
    max-width: calc(100% - 28px);
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    opacity: 1;
    transition: opacity .3s ease, transform .3s ease;
    text-align: center;
}

.map-toast--error { background: var(--red); }
.map-toast--hide { opacity: 0; transform: translate(-50%, -6px); }

/* Кнопка «Моё местоположение» */
.locate-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    right: auto;
    z-index: 500;
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all .2s;
}

.locate-btn:hover { color: var(--red); border-color: var(--red); }
.locate-btn:active { transform: scale(.92); }

/* Точка местоположения пользователя */
.user-dot {
    width: 18px; height: 18px;
    background: #2f7ee0;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(47, 126, 224, .5);
    animation: pulse 2s infinite;
}

/* Точка пользователя в навигаторе */
.nav-dot {
    width: 22px; height: 22px;
    background: #2f7ee0;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(47, 126, 224, .5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(47, 126, 224, .5); }
    70%  { box-shadow: 0 0 0 12px rgba(47, 126, 224, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 126, 224, 0); }
}

/* Панель маршрута */
.route-panel {
    position: absolute;
    z-index: 500;
    right: 14px;
    bottom: 14px;
    left: auto;
    width: 300px;
    max-width: calc(100% - 28px);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 12px;
    transform: translateY(130%);
    transition: transform .25s ease;
}

.route-panel.open { transform: translateY(0); }

.route-backdrop { display: none; }

/* Выбор сервиса построения маршрута */
.navi-pick {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 16, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 16px;
}
.navi-pick.open { display: flex; }
.navi-pick__box {
    width: 100%;
    max-width: 340px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 14px;
}
.navi-pick__list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.navi-pick__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.navi-pick__item:hover { border-color: var(--red); color: var(--red); }
.navi-pick__item:hover .navi-pick__icon { border-color: var(--red); }
.navi-pick__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 17px;
    transition: all .2s;
    overflow: hidden;
}
.navi-pick__icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.route-panel__title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.route-panel__close {
    border: none;
    background: none;
    font-size: 18px;
    color: var(--gray);
    line-height: 1;
}

.route-panel__close:hover { color: var(--red); }

.route-panel__hint {
    display: none;
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--ink);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
}

.route-points { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }

.route-point {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 12px;
}

.route-point__dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.route-point__dot.from { background: #2f7ee0; }
.route-point__dot.to { background: var(--red); }

.route-point__text { flex: 1; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.route-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.route-actions .btn { flex: 1; justify-content: center; }

.route-result {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border-radius: 10px;
    font-size: 13px;
    display: none;
}

.route-result.show { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.route-result .metric { font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.route-result .metric small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11px; color: var(--gray); }

.route-result .route-message { color: var(--red); }

.route-go { margin-top: 10px; }

/* Полноэкранный навигатор */
.navigator {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: var(--ink);
    display: none;
}

.navigator.active { display: block; }

#navigator-map {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.navigator__bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(28,28,30,.92), rgba(28,28,30,0));
    color: #fff;
}

.navigator__info {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-head);
}

.navigator__dist { font-size: 24px; font-weight: 800; color: #fff; }
.navigator__eta { font-size: 14px; color: rgba(255,255,255,.75); }

#nav-exit { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
#nav-exit:hover { border-color: var(--red); color: var(--red); }

.navigator__hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    background: rgba(28,28,30,.85);
    color: rgba(255,255,255,.85);
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    white-space: nowrap;
}

.navigator__hint i { color: var(--red); }

/* Попап на карте */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 4px;
}

.leaflet-popup-content { margin: 12px 14px; }

.map-popup { min-width: 210px; }

.map-popup h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.map-popup .cat { font-size: 11px; color: var(--gray); margin-bottom: 6px; }
.map-popup .addr { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.map-popup .popup-route-btn { width: 100%; margin-top: 6px; justify-content: center; }

/* Пользовательские маркеры */
.org-marker {    width: 34px; height: 34px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--red);
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.org-marker i { transform: rotate(45deg); font-size: 15px; }
.org-marker.featured { background: var(--red-dark); }
.org-marker.active-marker { width: 42px; height: 42px; }

.start-marker {
    width: 30px; height: 30px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: #2f7ee0;
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,.25);
}

/* ---------- Секция «Как это работает» ---------- */
.howto { padding: 40px 20px 56px; }

.section-title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    margin-bottom: 8px;
}

.section-sub { color: var(--ink-soft); margin-bottom: 28px; }

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.step {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}

.step__num {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 800;
    color: var(--red);
    margin-bottom: 12px;
    opacity: .9;
}

.step h3 { font-size: 16px; margin-bottom: 8px; }
.step p { font-size: 13px; color: var(--ink-soft); }

/* ---------- Подвал ---------- */
.site-footer {
    background: var(--ink);
    color: rgba(255,255,255,.75);
    padding: 36px 0;
    margin-top: 20px;
}

.site-footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.site-footer .logo { color: #fff; }

.site-footer small { font-size: 12px; color: rgba(255,255,255,.45); }

.footer-links { display: flex; gap: 18px; }
.footer-links a { color: rgba(255,255,255,.75); font-size: 13px; }
.footer-links a:hover { color: #fff; }

/* ---------- Адаптивность ---------- */
@media (max-width: 1024px) {
    .hero__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .hero__visual { order: -1; min-height: 0; }
    .hero__car { max-width: 340px; }
    .hero__stat--top { top: 4%; left: 4%; }
    .hero__stat--bottom { bottom: 4%; right: 4%; }
    .catalog-page__layout {
        grid-template-columns: 1fr;
    }
    .catalog-page__map {
        position: static;
        height: 480px;
        min-height: 0;
    }
    .nearby-panel { width: 320px; }
    .nearby-list { max-height: 300px; }
}

@media (max-width: 768px) {
    .site-header__inner { gap: 12px; }
    .header-search { display: none; }
    .btn-catalog { width: auto; height: 40px; padding: 0 14px; border-radius: 10px; }
    .btn-catalog i { display: none; }
    .btn-catalog__text--desktop { display: none; }
    .btn-catalog__text--mobile { display: inline; }
    .btn-menu { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
    .btn-menu .btn-menu__text { display: none; }
    .btn-menu i { font-size: 18px; }
    .steps { grid-template-columns: 1fr; }
    .hero { padding: 32px 0 36px; }
    .hero__car { max-width: 260px; }
    .hero__stat { padding: 8px 12px; border-radius: 12px; gap: 8px; }
    .hero__stat-ico { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
    .hero__stat-num { font-size: 16px; }
    .hero__stat-label { font-size: 10px; max-width: 90px; }
    .howto { padding: 28px 20px 44px; }
    .howto .step { padding: 20px; }

    .home-map { padding: 0 12px 32px; }
    #home-map { height: 62vh; min-height: 480px; }

    .nearby-panel {
        top: 10px;
        left: 10px;
        width: 300px;
    }
    .nearby-list { max-height: 240px; }

    .nearby-slider { padding: 28px 0 32px; }
    .nearby-slider__head { align-items: flex-start; }
    .org-slider__track { --per-view: 2; }
    .org-slide__actions { flex-direction: column; }

    .catalog-page__head { align-items: flex-start; }
    .catalog-page__map {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        max-height: none;
        border: none;
        border-radius: 0;
        overflow: hidden;
        z-index: 1400;
        display: none;
    }
    .catalog-page__map.open { display: block; }
    .map-modal-close {
        display: flex;
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 1200;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 10px;
        background: var(--white);
        box-shadow: var(--shadow-md);
        font-size: 22px;
        line-height: 1;
        color: var(--ink);
    }
    .route-panel {
        position: fixed;
        left: 50%;
        top: 50%;
        right: auto;
        bottom: auto;
        width: calc(100% - 32px);
        max-width: 420px;
        transform: translate(-50%, -50%);
        transition: none;
        display: none;
        z-index: 1500;
        box-shadow: var(--shadow-lg);
    }
    .route-panel.open { display: block; transform: translate(-50%, -50%); }
    .route-panel.is-minimized {
        display: block;
        top: auto;
        bottom: 14px;
        left: 14px;
        right: 14px;
        transform: none;
        transition: none;
        padding: 10px 12px;
        width: auto;
        max-width: none;
    }
    .route-panel.is-minimized .route-points,
    .route-panel.is-minimized .route-actions,
    .route-panel.is-minimized .route-result,
    .route-panel.is-minimized .route-go {
        display: none;
    }
    .route-panel.is-minimized .route-panel__hint { display: flex; align-items: center; gap: 8px; }
    .route-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1499;
        background: rgba(10, 12, 16, .55);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        display: none;
    }
    .route-panel.open + .route-backdrop { display: block; }
    .route-panel.is-minimized + .route-backdrop { display: none; }
}

@media (max-width: 480px) {
    .org-slider__track { --per-view: 1; }

    .hero__visual { display: none; }

    .nearby-panel {
        position: static;
        width: auto;
        max-width: none;
        margin: 10px;
        box-shadow: none;
    }
    .nearby-list { max-height: 260px; }
    .nearby-card__distance { display: none; }
    .home-preview__actions .btn { flex: 1; justify-content: center; }
    .cat-tab { flex: 0 0 auto; justify-content: center; padding: 8px 14px; font-size: 13px; gap: 6px; }
}
