/* ═══════════════════════════════════════════════════
   Tailwind CSS — базовая сборка
   ═══════════════════════════════════════════════════ */

/* Используем Tailwind CDN для прототипа, 
   в production — сборка через postcss + purge */

/* ── CSS переменные ── */
:root {
    --color-primary: #007aff;
    --color-accent: #ff6b00;
    --color-surface: #ffffff;
    --color-bg: #f5f5f7;
    --color-text: #111111;

    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-2xl: 0 25px 50px rgba(0,0,0,0.15);

    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
    --color-surface: #161b22;
    --color-bg: #0d1117;
    --color-text: #e6edf3;
}

/* ── Сброс ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════
   OSM-слои: неактивная кнопка (ниже zoom-порога)
   ═══════════════════════════════════════════════════ */

.osm-layer-disabled {
    opacity: 0.35 !important;
    pointer-events: none !important;
    cursor: not-allowed;
}

.osm-layer-active {
    opacity: 1 !important;
    box-shadow: 0 0 0 2px rgba(0,122,255,0.4);
}

html {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color var(--transition-normal),
                color var(--transition-normal);
    min-height: 100dvh;
}

/* ── Стекломорфизм ── */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background: rgba(22, 27, 34, 0.85);
    border-color: rgba(255, 255, 255, 0.05);
}

/* ── Карта ── */
#map-container {
    width: 100%;
    height: 100dvh;
}

/* ── Bottom Sheet (Apple Maps style) ── */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 80dvh;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    box-shadow: var(--shadow-2xl);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet-open {
    transform: translateY(0) !important;
}

/* Скелетон */
.skeleton {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #30363d 25%, #3a434c 50%, #30363d 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Скрыть скроллбар у фильтров */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Гео-кнопка на карте */
.geo-btn {
    position: absolute;
    bottom: 24px;
    right: 12px;
    z-index: 30;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
    color: #007aff;
}
.geo-btn:active { transform: scale(0.9); }
.dark .geo-btn { background: rgba(30,35,42,0.92); color: #5ea8ff; }

/* Стеклянный попап */
.glass-panel {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.06);
}
.dark .glass-panel {
    background: rgba(22,27,34,0.92);
    border-color: rgba(255,255,255,0.06);
}

/* Анимация панели фильтров */
.animate-slide-up {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 8px auto;
}

/* ── Кнопки ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    font-size: 14px;
    min-height: 44px;
}

.btn:active {
    transform: scale(0.92);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-accent {
    background: var(--color-accent);
    color: white;
}

/* ═══════════════════════════════════════════════════
   Lightbox (галерея fullscreen)
   ═══════════════════════════════════════════════════ */

.lightbox-overlay {
    position: fixed; inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-backdrop-filter: blur(12px);
}
.lightbox-overlay.active {
    opacity: 1; visibility: visible;
}
.lightbox-img {
    max-width: 90vw; max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}
.lightbox-close {
    position: absolute; top: 16px; right: 16px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #ef4444;
    color: white; font-size: 22px; font-weight: 700; line-height: 44px; text-align: center;
    border: none; cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.lightbox-close:hover { background: #dc2626; transform: scale(1.1); }
.lightbox-prev, .lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: white; font-size: 36px; line-height: 52px; text-align: center;
    border: none; cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-caption {
    position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
    color: white; font-size: 14px;
    background: rgba(0,0,0,0.5);
    padding: 6px 16px; border-radius: 20px;
    max-width: 80vw; text-align: center;
}
.lightbox-counter {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,0.7); font-size: 13px;
}

@media (max-width: 640px) {
    .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 28px; line-height: 40px; }
    .lightbox-prev { left: 6px; }
    .lightbox-next { right: 6px; }
    .lightbox-img { max-width: 96vw; max-height: 80vh; }
}

/* ═══════════════════════════════════════════════════
   Map Loader — стеклянная карточка + SVG кольцо
   ═══════════════════════════════════════════════════ */

.maploader {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 45;
    width: 180px;
    padding: 30px 20px 20px;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 28px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.maploader.hidden { display: none; }
.maploader.fadeout { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }

.dark .maploader {
    background: rgba(22,27,34,0.82);
    box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
}

/* SVG кольцо + процент */
.maploader-ring-wrap {
    position: relative;
    width: 100px; height: 100px;
    display: grid;
    place-items: center;
}
.maploader-ring {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}
.maploader-track {
    stroke: rgba(0,0,0,0.06);
}
.dark .maploader-track {
    stroke: rgba(255,255,255,0.08);
}
.maploader-fill {
    stroke: #007aff;
    transition: stroke-dashoffset 0.35s ease;
}

/* Процент */
.maploader-pct {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
    line-height: 1;
}
.dark .maploader-pct { color: #e6edf3; }

/* Название */
.maploader-name {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-align: center;
    min-height: 16px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.dark .maploader-name { color: #8b949e; }

/* ═══════════════════════════════════════════════════
   Zoom индикатор — левый нижний угол
   ═══════════════════════════════════════════════════ */

.zoom-indicator {
    position: fixed;
    top: 50%; left: 14px;
    transform: translateY(-50%);
    z-index: 30;
    padding: 5px 12px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #222;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    pointer-events: none;
}
.zoom-indicator.hidden { display: none; }

.dark .zoom-indicator {
    color: #d0d8e0;
    background: rgba(22,27,34,0.82);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════════════════
   Глобальный поиск — выпадающий список (v8.0)
   ═══════════════════════════════════════════════════ */

#search-results {
    animation: searchSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top center;
}

#search-results.hidden {
    display: none;
}

@keyframes searchSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Заголовок группы ── */
.search-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8e8e93;
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2;
}

.dark .search-group-header {
    color: #8b949e;
    background: rgba(31,36,45,0.95);
}

.search-group-header:first-child {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.search-group-icon {
    font-size: 14px;
    line-height: 1;
}

.search-group-label {
    flex: 1;
}

.search-group-count {
    font-size: 10px;
    font-weight: 600;
    color: #aeaeb2;
    background: rgba(0,0,0,0.06);
    padding: 2px 8px;
    border-radius: 10px;
}

.dark .search-group-count {
    color: #8b949e;
    background: rgba(255,255,255,0.08);
}

.search-group-more {
    font-size: 10px;
    font-weight: 600;
    color: #007aff;
    text-decoration: none;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

.search-group-more:hover {
    background: rgba(0,122,255,0.08);
}

/* ── Кнопка «Ещё N» под группой ── */
.search-group-more-link {
    display: block;
    text-align: center;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #007aff;
    text-decoration: none;
    transition: background 0.12s;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.dark .search-group-more-link {
    border-bottom-color: rgba(255,255,255,0.04);
}

.search-group-more-link:hover {
    background: rgba(0,122,255,0.06);
}

.dark .search-group-more-link:hover {
    background: rgba(0,122,255,0.1);
}

/* ── Элемент поиска ── */
.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    color: inherit;
    transition: background 0.12s ease;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.dark .search-item {
    border-bottom-color: rgba(255,255,255,0.04);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover,
.search-item-active {
    background: rgba(0,122,255,0.06);
}

.dark .search-item:hover,
.dark .search-item-active {
    background: rgba(0,122,255,0.1);
}

.search-item-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    line-height: 1;
}

.search-item-content {
    min-width: 0;
    flex: 1;
}

.search-item-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-sub {
    display: block;
    font-size: 12px;
    color: #8e8e93;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.dark .search-item-sub {
    color: #8b949e;
}

.search-item-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255,107,0,0.12);
    color: #ff6b00;
    flex-shrink: 0;
}

.dark .search-item-badge {
    background: rgba(255,107,0,0.18);
}

/* ── Футер ── */
.search-footer-link {
    display: block;
    text-align: center;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #007aff;
    text-decoration: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    transition: background 0.15s;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.search-footer-link:hover {
    background: rgba(0,122,255,0.05);
}

.dark .search-footer-link {
    border-top-color: rgba(255,255,255,0.06);
}

/* ── Пустое состояние ── */
.search-empty {
    padding: 32px 16px;
    text-align: center;
}

.search-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.search-empty-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.search-empty-sub {
    font-size: 13px;
    color: #8e8e93;
}

.dark .search-empty-sub {
    color: #8b949e;
}

/* ── Скелетон ── */
.search-skeleton-group {
    padding: 8px 16px;
}

.search-skeleton-header {
    height: 12px;
    width: 80px;
    background: linear-gradient(90deg, #e5e5ea 25%, #f0f0f5 50%, #e5e5ea 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 10px;
}

.dark .search-skeleton-header {
    background: linear-gradient(90deg, #21262d 25%, #30363d 50%, #21262d 75%);
    background-size: 200% 100%;
}

.search-skeleton-row {
    height: 16px;
    background: linear-gradient(90deg, #e5e5ea 25%, #f0f0f5 50%, #e5e5ea 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 8px;
}

.search-skeleton-row.short {
    width: 60%;
}

.dark .search-skeleton-row {
    background: linear-gradient(90deg, #21262d 25%, #30363d 50%, #21262d 75%);
    background-size: 200% 100%;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Страница /poisk ── */
.search-result-card {
    cursor: pointer;
}

.search-result-card:active {
    transform: scale(0.985);
}

.search-tab {
    user-select: none;
    white-space: nowrap;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Transport page /transport ---- */
.route-card { position: relative; background: rgba(255,255,255,0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(0,0,0,0.06); border-radius: 16px; padding: 14px 16px; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.dark .route-card { background: rgba(22,27,34,0.9); border-color: rgba(255,255,255,0.06); box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
.route-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); transform: translateY(-1px); }
.dark .route-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.route-card:active { transform: scale(0.99); }
.stop-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #007aff; box-shadow: 0 0 0 3px rgba(0,122,255,0.18); }
.dark .stop-dot { box-shadow: 0 0 0 3px rgba(0,122,255,0.3); }
.route-line { width: 2px; flex-shrink: 0; min-height: 14px; background: linear-gradient(to bottom, rgba(0,122,255,0.3), rgba(0,122,255,0.05)); }

/* ═══════════════════════════════════════════════════
   OSM-слои и попапы
   ═══════════════════════════════════════════════════ */

/* ── Кнопки OSM-слоёв ── */
#osm-layer-transport,
#osm-layer-buildings,
#osm-layer-nature,
#osm-layer-infra {
    transition: opacity 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

#osm-layer-buildings[data-zoom-disabled] {
    cursor: not-allowed;
    filter: grayscale(1);
}

/* ── OSM-попап ── */
.osm-popup {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    max-width: 300px;
    font-size: 13px;
}

.dark .osm-popup {
    background: rgba(22,27,34,0.95);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
}

.osm-popup-card {
    line-height: 1.4;
}

/* Стрелка попапа */
.osm-popup-arrow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.95);
    border-right: 1px solid rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.dark .osm-popup-arrow {
    background: rgba(22,27,34,0.95);
    border-color: rgba(255,255,255,0.08);
}

/* ── Анимация появления слоёв ── */
.osm-layer-fade-in {
    animation: osmFadeIn 0.35s ease-out;
}

@keyframes osmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Кольцо активации слоя ── */
.osm-layer-active {
    box-shadow: 0 0 0 2px rgba(0,122,255,0.25), 0 4px 24px rgba(0,0,0,0.06);
}

.dark .osm-layer-active {
    box-shadow: 0 0 0 2px rgba(0,122,255,0.4), 0 4px 24px rgba(0,0,0,0.2);
}

/* ═══════════════════════════════════════════════════
   Auth Modal
   ═══════════════════════════════════════════════════ */

#auth-modal.animate-slide-up {
    animation: authSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes authSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#auth-modal:not(.hidden) .relative {
    animation: authSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#auth-modal-bg {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Адаптивный радиус */
@media (min-width: 640px) {
    #auth-modal .relative {
        border-radius: 24px;
    }
}
@media (max-width: 639px) {
    #auth-modal .relative {
        border-radius: 24px 24px 0 0;
    }
}

/* ═══════════════════════════════════════════════
   OSM-слои — Zoom-пороги
   ═══════════════════════════════════════════════ */

.osm-layer-active {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.35);
}

.osm-layer-below {
    position: relative;
    cursor: not-allowed;
}

.osm-layer-below::after {
    content: '';
    font-size: 10px;
    position: absolute;
    top: -6px;
    right: -6px;
    background: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.dark .osm-layer-below::after {
    background: #1e2130;
}

/* ═══════════════════════════════════════════════
   Кеш-дашборд (админка)
   ═══════════════════════════════════════════════ */

.cache-stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cache-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.dark .cache-stat-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}


/* ═══════════════════════════════════════════════════
   Поиск адресов — бейджи и дополнительные стили v9.0
   ═══════════════════════════════════════════════════ */

/* Бейдж населённого пункта в строке поиска */
.address-settlement-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(99,99,102,0.08);
    color: #636366;
    flex-shrink: 0;
    margin-left: auto;
}

.dark .address-settlement-badge {
    background: rgba(235,235,240,0.1);
    color: #aeaeb2;
}

/* Подсветка совпадений в результатах поиска */
.address-highlight {
    background: rgba(0,122,255,0.15);
    color: #007aff;
    border-radius: 2px;
    padding: 0 1px;
    font-weight: 600;
}

.dark .address-highlight {
    background: rgba(0,122,255,0.25);
    color: #5ea8ff;
}

/* Бейдж типа здания */
.address-type-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(0,122,255,0.08);
    color: #007aff;
    flex-shrink: 0;
}

.dark .address-type-badge {
    background: rgba(0,122,255,0.15);
    color: #5ea8ff;
}

/* Адаптивный отступ для карточек адресов на /poisk */
.search-group[data-group="address"] .search-result-card:hover h4 {
    color: #636366;
}

.dark .search-group[data-group="address"] .search-result-card:hover h4 {
    color: #aeaeb2;
}

/* ═══════════════════════════════════════════════════
   Кнопка «Показать ещё» — sticky снизу секции
   ═══════════════════════════════════════════════════ */

.load-more-sticky-wrapper {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    padding-top: 12px;
    margin-top: 4px;
}

.load-more-btn {
    cursor: pointer;
    user-select: none;
}

/* ═══════════════════════════════════════════════════
   Пульсирующее кольцо «На карте» (focusOnMarker)
   ═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   Единый градиентный фон страниц (ЛК, /poisk, ...)
   ═══════════════════════════════════════════════════ */

.page-bg {
    background:
        radial-gradient(ellipse 80% 60% at 50% 30%, rgba(0,122,255,0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 70%, rgba(255,107,0,0.03) 0%, transparent 50%),
        radial-gradient(circle at 20% 50%, rgba(0,122,255,0.02) 0%, transparent 40%),
        #f5f5f7;
    transition: background 0.5s ease;
}

.dark .page-bg {
    background:
        radial-gradient(ellipse 80% 60% at 50% 30%, rgba(0,122,255,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 70%, rgba(255,107,0,0.05) 0%, transparent 50%),
        radial-gradient(circle at 20% 50%, rgba(0,122,255,0.04) 0%, transparent 40%),
        #0d1117;
}

/* Декоративная сетка точек */
.page-bg::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.4;
}

.dark .page-bg::before {
    background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    opacity: 0.3;
}

/* Все иконки — мягкий светло-синий */
.ph-duotone,
.ph,
.ph-fill {
    color: oklch(65% 0.12 250 / 72%) !important;
}
/* Иконки внутри белого текста (кнопки закрытия и т.д.) — белые */
.text-white .ph-duotone,
.text-white .ph,
.text-white .ph-fill,
.bg-red-500 .ph-duotone,
.bg-red-500 .ph,
.bg-red-500 .ph-fill,
.bg-primary .ph-duotone,
.bg-primary .ph,
.bg-primary .ph-fill {
    color: white !important;
}

/* Размеры иконок */
.ph-xs { font-size: 0.75rem; }
.ph-sm { font-size: 0.875rem; }
.ph-md { font-size: 1.25rem; }
.ph-lg { font-size: 1.5rem; }
.ph-xl { font-size: 2rem; }

/* Звёзды рейтинга — filled/empty */
.ph-duotone.ph-star.star-on { color: oklch(79.5% 0.185 90) !important; }
.ph-duotone.ph-star.star-off { color: oklch(80% 0.01 250 / 35%) !important; }

/* Звёзды в селекторе рейтинга (card.js) — наследуют цвет от кнопки */
.star-btn .ph-duotone.ph-star { color: inherit !important; }
/* FIX 2026-09-15: Parallax content card — добавлено вручную т.к. Tailwind JIT не подхватывает */
.hero-parallax-bg {
    position: relative;
    overflow: hidden;
    background-color: rgb(243 244 246);
    width: 100%;
}
.dark .hero-parallax-bg {
    background-color: rgb(31 41 55);
}
.hero-parallax-bg > picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.hero-parallax-bg > picture > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    will-change: transform;
}
.hero-parallax-bg > .absolute {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.4), transparent);
    z-index: 1;
}
.hero-content-card {
    position: relative;
    z-index: 20;
    will-change: transform;
}
.hero-content-card > article {
    position: relative;
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.parallax-img {
    will-change: transform;
    transition: transform 0.1s linear;
}
@media (prefers-reduced-motion: reduce) {
    .parallax-img {
        transform: none !important;
    }
    .hero-content-card {
        transform: none !important;
    }
}
