/* ПОДКЛЮЧЕНИЕ ЦЕРКОВНЫХ ШРИФТОВ ДЛЯ НАСТРОЕК */
@font-face { font-family: 'Ponomar Unicode'; src: url('/wp-content/uploads/fonts/PonomarUnicode.woff2') format('woff2'); }
@font-face { font-family: 'Irmologion'; src: url('/wp-content/uploads/fonts/Irmologion.woff2') format('woff2'); }
@font-face { font-family: 'Blago'; src: url('/wp-content/uploads/fonts/Blago.woff2') format('woff2'); }
@font-face { font-family: 'Triod'; src: url('/wp-content/uploads/fonts/Triod.woff2') format('woff2'); }
@font-face { font-family: 'Tristan'; src: url('/wp-content/uploads/fonts/Tristan.woff2') format('woff2'); }
@font-face { font-family: 'Karmen'; src: url('/wp-content/uploads/fonts/Karmen.woff2') format('woff2'); }
@font-face { font-family: 'Journal'; src: url('/wp-content/uploads/fonts/Journal.woff2') format('woff2'); }
@font-face { font-family: 'Garamond'; src: url('/wp-content/uploads/fonts/Garamond.woff2') format('woff2'); }
@font-face { font-family: 'ComicSans'; src: url('/wp-content/uploads/fonts/ComicSans.woff2') format('woff2'); }

/* Изолированный холст на весь экран */
.m-fullscreen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background-color: #050505;
    overflow: hidden;
    font-family: "Georgia", serif;
    box-sizing: border-box;
}

#monastery-map-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- НЕЗАВИСИМЫЕ КАСТОМНЫЕ ЭЛЕМЕНТЫ УПРАВЛЕНИЯ КАРТОЙ --- */
.g-map-control-container {
    position: absolute;
    z-index: 1000001;
    display: flex;
}
.g-map-control-group {
    display: flex;
    background-color: #fdfbf7;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    border: 1px solid #ebdcb9;
    overflow: hidden;
}
.g-map-control-vertical { 
    flex-direction: column; 
}

.g-btn {
    background: none; border: none; color: #4a3e2e; font-family: "Georgia", serif;
    font-size: 14px; font-weight: bold; padding: 10px 16px; cursor: pointer; transition: 0.2s;
    display: flex; align-items: center; justify-content: center; outline: none;
}
.g-btn:hover { background-color: #f4efe2; }
.g-btn.g-active { background-color: #f4efe2; color: #8c6d3e; }
.g-btn-divider { width: 1px; background-color: #ebdcb9; }
.g-btn-divider-h { height: 1px; background-color: #ebdcb9; width: 100%; }
.g-btn-icon { width: 42px; height: 42px; padding: 0; font-size: 18px; }

/* Позиционирование элементов управления */
.g-controls-top-left { 
    top: 40px; 
    left: 40px; 
}

/* Кнопки справа: динамически отъезжают от увеличенного сайдбара (min 45vw или 650px) */
.g-controls-bottom-right { 
    bottom: 40px; 
    right: calc(min(45vw, 650px) + 60px); 
    flex-direction: column; 
    gap: 12px; 
    align-items: flex-end; 
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Логика отъезда кнопок вправо при сворачивании сайдбара */
.sidebar-collapsed .g-controls-bottom-right { 
    right: 40px; 
}

/* --- СИММЕТРИЧНЫЙ ПАРЯЩИЙ САЙДБАР (ДЕСКТОП) --- */
.m-sidebar-panel {
    position: absolute;
    right: 40px; 
    top: 40px;   
    bottom: 40px; /* Равные отступы сверху и снизу */
    width: 45vw; 
    max-width: 650px; /* Сайдбар занимает чуть меньше полэкрана, но не более 650px */
    background-color: #fdfbf7;
    border: 1px solid #ebdcb9;
    border-radius: 16px;
    z-index: 1000002;
    box-shadow: 0 10px 40px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Эффект теплой свечи для темных тем */
.m-sidebar-panel::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    box-shadow: inset 0 0 120px rgba(250, 160, 60, 0.12), inset 0 0 40px rgba(250, 160, 60, 0.08);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 9999999;
    border-radius: 16px;
}
.m-sidebar-panel.glow-active::after {
    opacity: 1;
}

/* ЦВЕТОВЫЕ ТЕМЫ (КЕЛЕЙНЫЕ ОВЕРРАЙДЫ) */
.m-sidebar-panel[data-theme="dark"] { background-color: #121110; border-color: #2a2a2a; }
.m-sidebar-panel[data-theme="dark"] .m-sidebar-header, .m-sidebar-panel[data-theme="dark"] .m-sidebar-footer { background-color: #1a1a1a; border-color: #2a2a2a; }
.m-sidebar-panel[data-theme="dark"] .m-sidebar-header h3, .m-sidebar-panel[data-theme="dark"] .m-details-title, .m-sidebar-panel[data-theme="dark"] .m-card-title, .m-sidebar-panel[data-theme="dark"] .country-header { color: #f5eedc; }
.m-sidebar-panel[data-theme="dark"] .m-search-input, .m-sidebar-panel[data-theme="dark"] .m-settings-select { background-color: #121110; border-color: #444; color: #f5eedc; }
.m-sidebar-panel[data-theme="dark"] .m-card-preview, .m-sidebar-panel[data-theme="dark"] .m-formatted-text { color: #e6dfd5; }
.m-sidebar-panel[data-theme="dark"] .country-body { background-color: #181818; border-color: #2a2a2a; }
.m-sidebar-panel[data-theme="dark"] .country-header { background-color: #121110; }
.m-sidebar-panel[data-theme="dark"] .m-card-item:hover, .m-sidebar-panel[data-theme="dark"] .country-header:hover { background-color: #222222; }
.m-sidebar-panel[data-theme="dark"] .m-toggle-btn, .m-sidebar-panel[data-theme="dark"] .m-back-link, .m-sidebar-panel[data-theme="dark"] .gold-contour-btn, .m-sidebar-panel[data-theme="dark"] .m-fav-btn { color: #d4af6e; border-color: #d4af6e; }
.m-sidebar-panel[data-theme="dark"] .gold-contour-btn, .m-sidebar-panel[data-theme="dark"] .m-fav-btn { background-color: transparent; }
.m-sidebar-panel[data-theme="dark"] .m-toggle-btn:hover, .m-sidebar-panel[data-theme="dark"] .gold-contour-btn:hover, .m-sidebar-panel[data-theme="dark"] .m-fav-btn:hover { background-color: #d4af6e; color: #121110; }
.m-sidebar-panel[data-theme="dark"] .m-toggle-btn.g-active, .m-sidebar-panel[data-theme="dark"] .m-fav-btn.active { background-color: #d4af6e; color: #121110; }
.m-sidebar-panel[data-theme="dark"] .m-action-btn { background-color: #d4af6e; color: #121110 !important; }
.m-sidebar-panel[data-theme="dark"] .m-action-btn:hover { background-color: #c09a5c; }
.m-sidebar-panel[data-theme="dark"] .m-back-divider { background-color: #444; }
.m-sidebar-panel[data-theme="dark"] .m-card-tooltip { background: #121110; color: #e6dfd5; border-color: #d4af6e; }

.m-sidebar-panel[data-theme="gray"] { background-color: #4b4b4d; border-color: #626262; }
.m-sidebar-panel[data-theme="gray"] .m-sidebar-header, .m-sidebar-panel[data-theme="gray"] .m-sidebar-footer { background-color: #3d3d3f; border-color: #626262; }
.m-sidebar-panel[data-theme="gray"] .m-sidebar-header h3, .m-sidebar-panel[data-theme="gray"] .m-details-title, .m-sidebar-panel[data-theme="gray"] .m-card-title, .m-sidebar-panel[data-theme="gray"] .country-header { color: #ffffff; }
.m-sidebar-panel[data-theme="gray"] .m-search-input, .m-sidebar-panel[data-theme="gray"] .m-settings-select { background-color: #4b4b4d; border-color: #777; color: #ffffff; }
.m-sidebar-panel[data-theme="gray"] .m-card-preview, .m-sidebar-panel[data-theme="gray"] .m-formatted-text { color: #e6e6e6; }
.m-sidebar-panel[data-theme="gray"] .country-body { background-color: #424244; border-color: #626262; }
.m-sidebar-panel[data-theme="gray"] .country-header { background-color: #4b4b4d; }
.m-sidebar-panel[data-theme="gray"] .m-card-item:hover, .m-sidebar-panel[data-theme="gray"] .country-header:hover { background-color: #555555; }
.m-sidebar-panel[data-theme="gray"] .m-toggle-btn, .m-sidebar-panel[data-theme="gray"] .m-back-link, .m-sidebar-panel[data-theme="gray"] .gold-contour-btn, .m-sidebar-panel[data-theme="gray"] .m-fav-btn { color: #d4af6e; border-color: #d4af6e; }
.m-sidebar-panel[data-theme="gray"] .gold-contour-btn, .m-sidebar-panel[data-theme="gray"] .m-fav-btn { background-color: transparent; }
.m-sidebar-panel[data-theme="gray"] .m-toggle-btn:hover, .m-sidebar-panel[data-theme="gray"] .gold-contour-btn:hover, .m-sidebar-panel[data-theme="gray"] .m-fav-btn:hover { background-color: #d4af6e; color: #121110; }
.m-sidebar-panel[data-theme="gray"] .m-toggle-btn.g-active, .m-sidebar-panel[data-theme="gray"] .m-fav-btn.active { background-color: #d4af6e; color: #121110; }
.m-sidebar-panel[data-theme="gray"] .m-action-btn { background-color: #d4af6e; color: #121110 !important; }
.m-sidebar-panel[data-theme="gray"] .m-action-btn:hover { background-color: #c09a5c; }
.m-sidebar-panel[data-theme="gray"] .m-back-divider { background-color: #777; }
.m-sidebar-panel[data-theme="gray"] .m-card-tooltip { background: #4b4b4d; color: #e6e6e6; border-color: #d4af6e; }

.m-sidebar-panel[data-theme="white"] { background-color: #ffffff; border-color: #eeeeee; }
.m-sidebar-panel[data-theme="white"] .m-sidebar-header, .m-sidebar-panel[data-theme="white"] .m-sidebar-footer { background-color: #f9f9f9; border-color: #eeeeee; }
.m-sidebar-panel[data-theme="white"] .m-sidebar-header h3, .m-sidebar-panel[data-theme="white"] .m-details-title, .m-sidebar-panel[data-theme="white"] .m-card-title, .m-sidebar-panel[data-theme="white"] .country-header { color: #000000; }
.m-sidebar-panel[data-theme="white"] .m-search-input, .m-sidebar-panel[data-theme="white"] .m-settings-select { background-color: #ffffff; border-color: #cccccc; color: #000; }
.m-sidebar-panel[data-theme="white"] .m-card-preview, .m-sidebar-panel[data-theme="white"] .m-formatted-text { color: #333333; }
.m-sidebar-panel[data-theme="white"] .country-body { background-color: #fafafa; border-color: #eeeeee; }
.m-sidebar-panel[data-theme="white"] .country-header { background-color: #ffffff; }
.m-sidebar-panel[data-theme="white"] .m-card-item:hover, .m-sidebar-panel[data-theme="white"] .country-header:hover { background-color: #f0f0f0; }
.m-sidebar-panel[data-theme="white"] .m-toggle-btn, .m-sidebar-panel[data-theme="white"] .m-back-link, .m-sidebar-panel[data-theme="white"] .gold-contour-btn, .m-sidebar-panel[data-theme="white"] .m-fav-btn { color: #0056b3; border-color: #0056b3; }
.m-sidebar-panel[data-theme="white"] .gold-contour-btn, .m-sidebar-panel[data-theme="white"] .m-fav-btn { background-color: transparent; }
.m-sidebar-panel[data-theme="white"] .m-toggle-btn:hover, .m-sidebar-panel[data-theme="white"] .gold-contour-btn:hover, .m-sidebar-panel[data-theme="white"] .m-fav-btn:hover { background-color: #0056b3; color: #ffffff; }
.m-sidebar-panel[data-theme="white"] .m-toggle-btn.g-active, .m-sidebar-panel[data-theme="white"] .m-fav-btn.active { background-color: #0056b3; color: #ffffff; }
.m-sidebar-panel[data-theme="white"] .m-action-btn { background-color: #0056b3; color: #ffffff !important; }
.m-sidebar-panel[data-theme="white"] .m-action-btn:hover { background-color: #004494; }
.m-sidebar-panel[data-theme="white"] .m-back-divider { background-color: #cccccc; }
.m-sidebar-panel[data-theme="white"] .m-card-tooltip { background: #ffffff; color: #333333; border-color: #0056b3; }

/* Логика сворачивания сайдбара строго ВВЕРХ (ДЕСКТОП) */
.sidebar-collapsed .m-sidebar-panel {
    bottom: calc(100vh - 175px); /* Сжимается вверх, оставляя шапку и кнопки навигации */
}

/* Скрытие контента при сворачивании во избежание наложения текста */
.m-sidebar-content { 
    padding: 0; 
    overflow-y: auto; 
    flex: 1; 
    transition: opacity 0.3s; 
}
.sidebar-collapsed .m-sidebar-content {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.m-sidebar-header {
    padding: 20px;
    background-color: #f4efe2;
    border-bottom: 1px solid #ebdcb9;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.m-sidebar-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.m-sidebar-header h3 {
      margin: 0; color: #4a3e2e; font-size: 18px; font-weight: bold; letter-spacing: 0.5px; text-transform: uppercase;
}
.m-sidebar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.m-toggle-btn {
    background: none; border: 1px solid #8c6d3e; color: #8c6d3e; padding: 6px 10px; border-radius: 6px; 
    font-size: 12px; cursor: pointer; font-weight: bold; transition: all 0.2s; outline: none;
}
.m-toggle-btn:hover { background-color: #8c6d3e; color: #fff; }
.m-toggle-btn.g-active { background-color: #8c6d3e; color: #fff; }

/* Ненавязчивая анимация для кнопки Инфо */
@keyframes gentleJump {
    0%, 85%, 100% { transform: translateY(0); }
    90% { transform: translateY(-4px); }
    95% { transform: translateY(-2px); }
}
.m-info-btn-jump {
    animation: gentleJump 4s infinite ease-in-out;
}

/* Поле поиска */
.m-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ebdcb9;
    border-radius: 8px;
    font-family: "Georgia", serif;
    font-size: 14px;
    color: #4a3e2e;
    background-color: #fdfbf7;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.m-search-input:focus {
    border-color: #8c6d3e;
}

/* Стили для селектов в настройках (решает проблему исчезновения на мобильных и убирает артефакты стрелок) */
.m-settings-select {
    flex: 1;
    min-width: 150px;
    max-width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid #ebdcb9;
    border-radius: 8px;
    font-family: "Georgia", serif;
    font-size: 14px;
    color: #4a3e2e;
    background-color: #fdfbf7;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%238c6d3e" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-overflow: ellipsis;
}
.m-settings-select:focus {
    border-color: #8c6d3e;
}

/* Тумблер (Switch) для настроек */
.m-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
}
.m-toggle-switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.m-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ebdcb9;
    transition: .3s;
    border-radius: 24px;
}
.m-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .m-toggle-slider {
    background-color: #8c6d3e;
}
input:checked + .m-toggle-slider:before {
    transform: translateX(20px);
}

.m-sidebar-footer {
    padding: 15px 20px; background-color: #f4efe2; border-top: 1px solid #ebdcb9; display: flex; gap: 10px;
}
.gold-contour-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; padding: 10px; 
    background-color: #fdfbf7; color: #8c6d3e; font-family: "Georgia", serif; font-size: 13px; 
    font-weight: bold; text-decoration: none; border: 2px solid #8c6d3e; border-radius: 8px; transition: all 0.3s;
}
.gold-contour-btn:hover { background-color: #8c6d3e; color: #ffffff; }

/* --- ВЕРНЫЙ ИЕРАРХИЧЕСКИЙ СПИСОК ИЗ ВЕРСИИ 7.0 --- */
.country-block { border-bottom: 1px solid #ebdcb9; }
.country-header { padding: 14px 20px; background-color: #fdfbf7; color: #4a3e2e; font-size: 16px; font-weight: bold; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background-color 0.2s; }
.country-header:hover { background-color: #f4efe2; }
.c-arrow { font-size: 12px; color: #8c6d3e; transition: transform 0.3s ease; }
.country-block.active .c-arrow { transform: rotate(-180deg); }

.country-body { display: none; background-color: #faf7f0; padding: 8px 0; border-top: 1px dashed #ebdcb9; }
.country-block.active .country-body { display: block; }

.region-title { padding: 8px 20px; font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; color: #8c6d3e; border-bottom: 1px solid rgba(235, 220, 185, 0.5); margin-top: 4px; }

.m-card-item { padding: 12px 24px 12px 45px; cursor: pointer; transition: all 0.2s; position: relative; border-bottom: 1px solid rgba(235, 220, 185, 0.4); display: flex; align-items: center; }

/* Иконка маркера слева от названия в списке */
.m-card-icon { position: absolute; left: 15px; top: 12px; width: 22px; height: 22px; object-fit: contain; }

.m-card-item:hover { background-color: #f4efe2; padding-left: 50px; z-index: 10; }

.m-card-text { display: flex; flex-direction: column; overflow: hidden; width: 100%; }
.m-card-title { color: #4a3e2e; font-size: 14px; font-weight: bold; margin-bottom: 4px; }

/* Вывод одной строчки с троеточием */
.m-card-preview { font-size: 12px; color: #7a684d; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Всплывающая подсказка (Tooltip) с полным описанием */
.m-card-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 20px;
    right: 20px;
    top: 100%;
    margin-top: -10px;
    background-color: #fdfbf7;
    color: #4a3e2e;
    border: 1px solid #8c6d3e;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    font-size: 13px;
    line-height: 1.5;
    z-index: 99999;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    white-space: normal;
}
.m-card-item:hover .m-card-tooltip {
    visibility: visible;
    opacity: 1;
    margin-top: 5px;
}

/* Окно детального просмотра (WYSIWYG) */
.m-details-view { display: none; padding: 25px; }
.m-back-link { background: none; border: none; color: #8c6d3e; cursor: pointer; font-family: "Georgia", serif; font-size: 13px; padding: 0; margin-bottom: 20px; font-weight: bold; display: inline-flex; align-items: center; }
.m-back-link:hover { text-decoration: underline; }
.m-back-divider { width: 1px; height: 14px; background-color: #ebdcb9; }
.m-details-title { color: #4a3e2e; font-size: 24px; margin: 0 0 15px 0; font-weight: normal; border-bottom: 1px solid #ebdcb9; padding-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.m-details-title img { width: 32px; height: 32px; object-fit: contain; }

.m-formatted-text { font-size: 15px; line-height: 1.7; color: #5a4f3f; transition: font-size 0.2s, font-family 0.2s; }
.m-formatted-text p { margin-top: 0; margin-bottom: 14px; text-align: justify; }
.m-formatted-text h2, .m-formatted-text h3 { color: #4a3e2e; font-weight: normal; margin: 20px 0 10px; font-family: "Georgia", serif; }
.m-formatted-text img { max-width: 100%; height: auto; border-radius: 6px; margin: 14px 0; display: block; }

/* КНОПКИ ДЕЙСТВИЙ */
.m-action-group { display: flex; gap: 10px; margin-bottom: 25px; flex-wrap: wrap; }
.m-action-btn { 
    flex: 1; display: flex; align-items: center; justify-content: center; background-color: #8c6d3e; color: #ffffff !important; text-align: center; 
    padding: 12px; border: none; border-radius: 8px; font-family: "Georgia", serif; font-size: 14px; 
    font-weight: bold; cursor: pointer; transition: background-color 0.2s; 
}
.m-action-btn:hover { background-color: #6b5536; }

.m-fav-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    background-color: #fdfbf7; color: #8c6d3e; border: 2px solid #8c6d3e; border-radius: 8px;
    padding: 12px; font-family: "Georgia", serif; font-size: 14px; font-weight: bold; cursor: pointer; transition: all 0.2s;
}
.m-fav-btn:hover { background-color: #f4efe2; }
.m-fav-btn.active { background-color: #27ae60; color: #fff; border-color: #27ae60; }

/* --- ИНФОРМАЦИОННЫЕ КАРТОЧКИ (OVERLAY) И МАРШРУТЫ --- */
.m-info-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(5, 5, 5, 0.7);
    z-index: 1000005;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.m-info-overlay.active {
    opacity: 1;
}
.m-info-card {
    position: relative;
    background-color: #fdfbf7;
    border: 1px solid #ebdcb9;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    text-align: center;
    font-family: "Georgia", serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.m-info-card-wide {
    max-width: 900px;
}
.m-info-image-wrapper {
    width: 100%;
    display: block;
    background-color: #fdfbf7;
    flex-shrink: 0;
    border-bottom: 2px solid #ebdcb9;
}
.m-info-image {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 3168 / 1344;
    object-fit: cover;
}
.m-info-content {
    padding: 35px 40px 40px;
    overflow-y: auto;
}
.m-info-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(253, 251, 247, 0.9);
    border: 1px solid #ebdcb9;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #8c6d3e;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    padding: 0;
}
.m-info-close:hover {
    color: #4a3e2e;
    background: #ffffff;
}
.m-info-title {
    color: #4a3e2e;
    font-size: 26px;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #ebdcb9;
    padding-bottom: 15px;
    font-weight: normal;
}
.m-info-desc {
    color: #5a4f3f;
    font-size: 16px;
    line-height: 1.8;
    text-align: justify;
    margin: 0;
}

/* КНОПКИ МЕНЮ ДЛЯ КАРТОЧКИ ИНФО */
.m-info-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}
.m-info-action-btn {
    background-color: transparent;
    border: 1px solid #8c6d3e;
    color: #4a3e2e;
    font-family: "Georgia", serif;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.m-info-action-btn:hover {
    background-color: #8c6d3e;
    color: #ffffff;
}

/* Стили для выбора навигатора */
.m-route-links-container { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.m-route-link {
    display: flex; align-items: center; justify-content: center; padding: 14px;
    background-color: #fdfbf7; color: #8c6d3e; font-family: "Georgia", serif; font-size: 15px;
    font-weight: bold; text-decoration: none; border: 2px solid #8c6d3e; border-radius: 8px; transition: all 0.3s;
}
.m-route-link:hover { background-color: #8c6d3e; color: #ffffff; }

/* --- ИЗОЛИРОВАННАЯ МОБИЛЬНАЯ АДАПТАЦИЯ (ШТОРКА В СТИЛЕ TELEGRAM) --- */
@media (max-width: 768px) {
    .m-settings-text {
        display: none;
    }
    .m-sidebar-panel::after { border-radius: 20px 20px 0 0 !important; }
    .m-info-content {
        padding: 25px 20px 30px;
    }
    .m-info-actions {
        flex-direction: column;
        gap: 12px;
    }
    .m-info-action-btn {
        width: 100%;
    }

    .m-sidebar-panel {
        /* Развернутое состояние шторки */
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 85vh !important;
        border-radius: 20px 20px 0 0 !important;
        border: none !important;
        border-top: 1px solid #ebdcb9 !important;
        transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1000002 !important;
    }
    .sidebar-collapsed .m-sidebar-panel {
        /* Свернутое состояние шторки (по умолчанию) */
        height: 70px !important; 
        bottom: 0 !important;
    }
    .m-sidebar-header {
        padding: 15px 20px !important;
        border-radius: 20px 20px 0 0 !important;
        cursor: pointer; /* Делаем весь заголовок кликабельным на смартфоне */
        flex-direction: row !important; /* На мобильном поиск можно скрыть в свернутом виде */
    }
    
    /* Скрываем старый класс поиска, но НЕ трогаем селекты настроек */
    .m-search-input { display: none; } 
    .m-sidebar-panel:not(.collapsed) .m-search-input { display: block; margin-top: 15px; } 
    .m-sidebar-panel:not(.collapsed) .m-sidebar-header { flex-direction: column !important; align-items: stretch !important;}

    .m-sidebar-content {
        padding-bottom: 20px !important;
    }
    
    /* Кнопки управления картой смещаем, чтобы шторка их не перекрывала */
    .g-controls-bottom-right { 
        transform: scale(0.85); 
        transform-origin: bottom right; 
        opacity: 0.85; 
        bottom: 85px !important; 
        right: 15px !important; 
    }
    .g-controls-top-left { 
        transform: scale(0.85); 
        transform-origin: top left; 
        opacity: 0.85; 
        top: 15px !important; 
        left: 15px !important; 
    }
    
    /* Скрываем дефолтный переключатель Карта/Спутник от Google */
    .gm-style-mtc, .gm-style-mtc-bbw {
        display: none !important;
    }
}