body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.sidebar {
    position: relative;
    z-index: 1000;
    height: 100vh;
    overflow-y: auto;
}

#sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 100%;
    z-index: 1000;
    background: #f8f9fa;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Скрытие сайдбара на десктопе */
#sidebar.collapsed {
    transform: translateX(-100%);
}

/* Скрытие сайдбара на мобильных — через отсутствие .active */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.active {
        transform: translateX(0);
    }
}
@media (max-width: 767px) {
    #sidebar {
        width: 80%;
    }
}
/* Кнопка скрытия сайдбара */
#toggle-sidebar-btn {
    z-index: 1100;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 5px 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* 💻 Десктоп — кнопка фиксируется относительно сайдбара */
@media (min-width: 992px) {
    #toggle-sidebar-btn {
        position: absolute;
        top: 80px;
        left: 400px; /* ширина сайдбара */
    }

    #sidebar.collapsed + #toggle-sidebar-btn {
        left: 0;
    }
}

/* 📱 Мобильные — кнопка фиксирована по краю */
@media (max-width: 991.98px) {
    #toggle-sidebar-btn {
        position: fixed;
        top: 80px;
        left: 0;
        transform: translateX(0);
    }

    /* Сайдбар открыт: кнопка у правого края сайдбара */
    #sidebar.active + #toggle-sidebar-btn {
        left: 80%; /* ширина сайдбара */
        transform: translateX(0);
    }

    /* Сайдбар скрыт: кнопка у левого края */
    #sidebar:not(.active) + #toggle-sidebar-btn {
        left: 0;
        transform: translateX(0);
    }
}

/* Стили для кнопки переключения режима */
#toggle-view-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 14px;
}

#toggle-view-mode-btn i {
    font-size: 14px;
}

/* карта */
#map {
    width: 100%;
    height: 100vh;
    min-height: 600px;
}

.list-group-item {
    cursor: pointer;
    padding: 12px 15px;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

.place-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    flex-direction: column;
}

.place-title {
    font-weight: 600;
    font-size: 16px;
    margin-right: 10px;
    flex-grow: 1;
}

.place-rating {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.place-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #555;
}

.place-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.place-meta-item i {
    font-size: 14px;
    color: #666;
}

.place-address {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.place-address i {
    margin-top: 2px;
}

/* Адаптивность сайдбара */
@media (max-width: 991.98px) {
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1060;
    }

    #sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 400px;
        height: 100%;
        background: #f8f9fa;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    #sidebar.active {
        transform: translateX(0);
    }

    /*#map {
        height: calc(100vh - 120px);
    }*/
}

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1045;
}

#overlay.active {
    display: block;
}

.floating-location-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.floating-location-btn:hover {
    background-color: #0b5ed7;
}


.custom-marker {
    background: none;
    border: none;
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Базовый стиль маркера */
.marker-icon {
    width: 20px;
    height: 20px;
    background: #0d6efd; /* Синий цвет по умолчанию */
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.marker-icon::after {
    content: '';
    width: 14px;
    height: 14px;
    margin: 3px;
    background: white;
    position: absolute;
    border-radius: 50%;
}

/* Стиль активного маркера */
.active-marker .marker-icon {
    background: #dc3545 !important;
    transform: rotate(-45deg) scale(1.2);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.7);
}

/* Убираем фильтры которые могли искажать цвет */
.custom-marker {
    background: none;
    border: none;
    filter: none !important;
}

/* закруглённая иконка */
.leaflet-marker-icon[src*="user-marker.png"] {
    border-radius: 50%;
    border: 2px solid #007bff;
}

.leaflet-bottom.leaflet-right {display: none !important;}

/* Позиционируем кнопки масштабирования выше кнопки местоположения */
.leaflet-control-zoom {
    position: fixed !important;
    bottom: 90px;
    right: 24px;
    z-index: 1000;
}

/* Делаем видимыми на всех устройствах */
.leaflet-control-zoom.leaflet-bar {
    display: flex !important;
    flex-direction: column;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Модалка */
.modal-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content-custom {
    background: white;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.d-none {
    display: none !important;
}

/* карточка места */
.place-panel {
    position: absolute;
    top: 0;
    left: 400px; /* ширина сайдбара */
    width: 400px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    overflow-y: auto;
    z-index: 1200;
    transition: transform 0.3s ease;
}

.place-panel.d-none {
    transform: translateX(100%);
}

.place-panel-close {
    position: absolute;
    top: 0;
    right: 10px;
    border: none;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 991px) {
    .place-panel {
        left: 0;
        width: 100%;
    }
}

#place-panel h4 {
    word-wrap: break-word;
    white-space: normal;
    margin-bottom: 15px;
    line-height: 1.3;
}

#place-panel-body {
    margin-top: 30px;
}

/* фотогалерея  */
.photo-gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.photo-gallery img {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-gallery img:hover {
    transform: scale(1.05);
}

/* Карусель фотографий */
.place-carousel {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 15px;
    border-radius: 8px 8px 0 0;
}

.place-carousel-inner {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.place-carousel-item {
    min-width: 100%;
    height: 100%;
}

.place-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Навигация карусели */
.carousel-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    background: rgba(0,0,0,0.2);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.place-carousel:hover .carousel-nav {
    opacity: 1;
}

.carousel-prev {
    left: 0;
    border-radius: 8px 0 0 0;
}

.carousel-next {
    right: 0;
    border-radius: 0 8px 0 0;
}

/* Индикаторы и счетчик фото */
.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 10;
}

.carousel-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
}

.carousel-indicator.active {
    background: white;
}

.photo-counter {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 40px;
    text-align: right;
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    cursor: pointer;
    z-index: 10;
}

/* Адаптивность карусели */
@media (max-width: 768px) {
    .place-carousel {
        height: 160px;
    }
}

#open-full-gallery {cursor: pointer;}

a.reviews_counter {color: #878787; text-decoration: none;}
a.reviews_counter:hover {color: #0d6efd;}

/* Лайтбокс */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    overflow: hidden;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    margin: auto;
    position: relative;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: fixed;
   top: 50%;
   transform: translateY(-50%);
    color: white;
    font-size: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-nav:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.photo-card {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.photo-card:hover img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay i {
    color: white;
    font-size: 24px;
}
#lightbox-prev {
    left: -60px;
}

#lightbox-next {
    right: -60px;
}


/* табы в карточке */
.place-tabs {
    margin-top: 15px;
}
/*.nav-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}
.nav-link {
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    color: #666;
}
.nav-link.active {
    color: #0d6efd;
    font-weight: bold;
}
.nav-link.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0d6efd;
}*/
/* Контейнер для табов с прокруткой */
.nav-tabs-wrapper {
    display: block !important;
    position: relative;
    /*padding: 0 30px;*/
    overflow: hidden;
}

/* Основные стили для табов */
.nav-tabs {
    display: flex;
    gap: 8px;
    padding-bottom: 5px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Скрыть скроллбар в Firefox */
    scroll-snap-type: x mandatory;
    scroll-padding: 0 30px;
}

.nav-tabs::-webkit-scrollbar {
    display: none; /* Скрыть скроллбар в Chrome/Safari */
}

/* Стили для кнопок табов */
.nav-link {
    position: relative;
    padding: 12px 16px;
    margin: 0 4px;
    white-space: nowrap;
    background: none;
    border: none;
    color: #555;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    outline: none;
    border-radius: 0; /* Убираем скругления */
}

/* Состояние при наведении на неактивный таб */
.nav-link:not(.active):hover {
    color: #0a58ca; /* Темно-синий цвет при наведении */
    background-color: rgba(13, 110, 253, 0.05); /* Очень легкий синий фон */
}

.nav-link.active {
    color: #0d6efd;
    font-weight: 600;
}

/* Синяя полоска под активным табом */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #0d6efd;
    border-radius: 3px 3px 0 0;
    transform: scaleY(1);
    transition: transform 0.2s ease;
}

/* Анимация при наведении на неактивный таб */
.nav-link:not(.active):hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgba(13, 110, 253, 0.2);
    border-radius: 2px 2px 0 0;
}

/* Бейджи для счетчиков */
.nav-badge {
    background: #e9ecef;
    color: #495057;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: normal;
    transition: all 0.2s ease;
}

.nav-link.active .nav-badge {
    background: #d0e3ff;
    color: #0d6efd;
}

.nav-link:hover .nav-badge {
    background: #dee2e6;
}

/* Кнопки прокрутки */
.tabs-scroll-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tabs-scroll-btn {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}

.tabs-scroll-btn:hover {
    background: #f5f5f5;
}

.tabs-scroll-btn.scroll-left {
    left: 0;
}

.tabs-scroll-btn.scroll-right {
    right: 0;
}

.nav-tabs-wrapper:hover .tabs-scroll-btn,
.nav-tabs-wrapper.touch-device .tabs-scroll-btn {
    opacity: 1;
}

/* Градиенты для визуального указания на возможность прокрутки */
.nav-tabs-wrapper::before,
.nav-tabs-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-tabs-wrapper::before {
    left: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%);
}

.nav-tabs-wrapper::after {
    right: 0;
    background: linear-gradient(270deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%);
}

.nav-tabs-wrapper.scroll-left::before,
.nav-tabs-wrapper.scroll-right::after {
    opacity: 1;
}

.nav-tabs-wrapper:hover .nav-tabs-mask {
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav-link {
        padding: 8px 12px;
        font-size: 14px;
    }
}

.tab-pane {
    display: none;
    padding: 15px 0;
}
.tab-pane.active {
    display: block;
}
.tab-content {
    padding: 15px 0;
}

.info-card,
.rating-card,
.review-card,
.photo-card,
.empty-card {
    background: rgba(245, 245, 245, 0.5);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
    display: flex;
    gap: 15px;
}

.card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d6efd;
    color: white;
    border-radius: 50%;
    font-size: 18px;
    flex-shrink: 0;
}

.card-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.card-content {
    flex: 1;
}

/* Специфичные стили для каждого таба */

/* Инфо */
.info-card .card-icon {
    background: #17a2b8;
}

/* Рейтинг */
.rating-card .card-icon {
    background: #ffc107;
    color: #333;
}

.rating-stars {
    color: #ffc107;
    font-size: 18px;
    letter-spacing: 2px;
}
.rating-stars.hoverable {
    display: inline-flex;
    font-size: 24px;
    letter-spacing: 2px;
    position: relative;
}

.rating-stars.hoverable i {
    color: #d3d3d3; /* Серый цвет для незаполненных звезд */
    cursor: pointer;
    transition: color 0.2s;
    padding: 0 2px;
    position: relative;
    z-index: 1;
}

/* Закрашивание звезд при наведении */
.rating-stars.hoverable:hover i {
    color: #ffc107 !important; /* Желтый цвет при наведении */
}

/* Сброс цвета для звезд после той, на которую наведено */
.rating-stars.hoverable i:hover ~ i {
    color: #d3d3d3 !important;
}

/* Закрепление выбранного рейтинга */
.rating-stars.hoverable i.active {
    color: #ffc107 !important;
}

.overall-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.average {
    font-size: 24px;
    font-weight: bold;
}

.count {
    color: #666;
    font-size: 14px;
}

/* Отзывы */
.review-card {
    align-items: flex-start;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.review-date {
    color: #666;
    font-size: 13px;
    margin-bottom: 10px;
}

.review-text {
    position: relative;
    line-height: 1.5;
}

.review-text p.excerpt {margin-bottom: 0;}

.read-more {
    color: #0d6efd;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    margin-top: 5px;
    transition: opacity 0.2s;
}

.read-more:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.more-text {
    transition: opacity 0.3s;
}



/* Фото */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.photo-card {
    position: relative;
    padding: 0;
    overflow: hidden;
    aspect-ratio: 1;
    margin-bottom: 0;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay i {
    color: white;
    font-size: 24px;
}

/* Пустые состояния */
.empty-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px;
}

.empty-card i {
    font-size: 40px;
    color: #ccc;
    margin-bottom: 15px;
}

.empty-card p {
    color: #666;
    margin: 0;
}
/* Контейнер контактов */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

/* Карточка контакта */
.contact-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(245, 245, 245, 0.5);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.contact-card:hover {
    background: rgba(245, 245, 245, 0.8);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-card {
        padding: 12px;
    }
}

/* Иконка */
.contact-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d6efd;
    color: white;
    border-radius: 50%;
    font-size: 18px;
}

/* Детали контакта */
.contact-details {
    flex: 1;
}

.contact-details h5 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.contact-details p, 
.contact-details a {
    margin: 0;
    font-size: 16px;
    color: #333;
}

/* Ссылки */
.contact-link {
    text-decoration: none;
    transition: color 0.2s;
}

.contact-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* Соцсети */
.social-card .contact-icon {
    background: #333;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f0f0f0;
    color: #555;
    border-radius: 50%;
    font-size: 18px;
    transition: all 0.2s;
}

a.social-link {
    font-size: 24px;
    text-decoration: none;
}
.social-link:hover {
    transform: scale(1.1);
    color: white;
}

/* Специфичные цвета для соцсетей */
.social-link[title="vk"]:hover { background: #4a76a8; }
.social-link[title="telegram"]:hover { background: #2AABEE; }
.social-link[title="instagram"]:hover { background: #E4405F; }
.social-link[title="facebook"]:hover { background: #1877F2; }
.social-link[title="wechat"]:hover { background: #07C160; }
.social-link[title="weibo"]:hover { background: #E6162D; }

/* Стили для отзывов */
.user-reviews {
    margin-top: 20px;
}
.review {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}
.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    flex-direction: column;
    align-items: start;
}
.review-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}
.user-info {
    flex-grow: 1;
}
.user-rating {
    color: #ffc107;
}

.review-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.review-photo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.review-photo:hover {
    transform: scale(1.05);
}

/* Лайтбокс для фотографий отзывов */
.review-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.review-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
    text-align: center;
}

.review-lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.review-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.review-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.review-lightbox-prev {
    left: 20px;
}

.review-lightbox-next {
    right: 20px;
}

.review-lightbox-counter {
    color: white;
    margin-top: 15px;
    font-size: 16px;
}

/* Галерея фото */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.photo-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}
.photo-item img:hover {
    transform: scale(1.03);
}

/* Кнокпи фильтра категории */
.category-tiles {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 8px;
}

.btn-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    color: #495057;
    transition: all 0.3s ease;
    padding: 12px;
}

.btn-tile:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.btn-tile.active {
    background: #e9ecef;
    border-color: #0d6efd;
    color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.tile-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.btn-tile span {
    font-size: 14px;
}


.user-location-icon {
    position: relative;
    width: 20px;
    height: 20px;
    background: #28a745; /* зелёный */
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
}

.user-location-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(40, 167, 69, 0.6); /* зелёный с прозрачностью */
    animation: pulse 1.5s ease-out infinite;
    top: 0;
    left: 0;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.user-location-moving i {
    color: #0d6efd;
    text-shadow: 0 0 3px white;
}

.user-arrow {
    color: #0d6efd;
    text-shadow: 0 0 3px white;
    transition: transform 0.3s ease;
}

.user-arrow-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.user-arrow-icon {
    color: #0d6efd;
    z-index: 2;
}

.user-arrow-trail {
    bottom: -10px;
    width: 8px;
    height: 20px;
    position: absolute;
    bottom: -8px;
    width: 6px;
    height: 16px;
    background: rgba(13, 110, 253, 0.3);
    border-radius: 3px;
    filter: blur(1px);
    animation: trail-fade 1s ease-out infinite;
    z-index: 1;
}

@keyframes trail-fade {
    0% {
        transform: scaleY(1);
        opacity: 0.6;
    }
    100% {
        transform: scaleY(2.2);
        opacity: 0;
    }
}

/* Поиск */
#clear-search-btn {
    font-size: 1rem;
    z-index: 2;
    right: 3rem; /* чтобы не перекрывать кнопку лупы */
    cursor: pointer;
}
#clear-search-btn:hover i {
    color: #000;
}

#clear-route-btn-map {
    display: none; 
    bottom: 20px; 
    right: 90px; 
    z-index: 1000;
    padding: 6px 12px;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}


.sidebar-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

#search-input {
    flex: 1;
}

#clear-search-btn {
    margin-left: 5px;
}


/* Стили для скроллбара в сайдбаре и карточке места */
#sidebar::-webkit-scrollbar,
#place-panel::-webkit-scrollbar {
    width: 8px; /* Ширина вертикального скроллбара */
    height: 8px; /* Высота горизонтального скроллбара */
}

/* Дорожка (трек) скроллбара */
#sidebar::-webkit-scrollbar-track,
#place-panel::-webkit-scrollbar-track {
    background: #f1f1f1; /* Светло-серый фон */
    border-radius: 4px;
    margin: 4px 0;
}

/* Ползунок (thumb) скроллбара */
#sidebar::-webkit-scrollbar-thumb,
#place-panel::-webkit-scrollbar-thumb {
    background: #a0a0a0; /* Серый цвет ползунка */
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

/* Ползунок при наведении */
#sidebar::-webkit-scrollbar-thumb:hover,
#place-panel::-webkit-scrollbar-thumb:hover {
    background: #808080; /* Темнее при hover */
}

/* Для Firefox */
#sidebar,
#place-panel {
    scrollbar-width: thin;
    scrollbar-color: #a0a0a0 #f1f1f1;
}

/* Плавная прокрутка скроллбара */
#sidebar,
#place-panel {
    scroll-behavior: smooth;
}

/* Стили для темной темы */
@media (prefers-color-scheme: dark) {
    #sidebar::-webkit-scrollbar-thumb,
    #place-panel::-webkit-scrollbar-thumb {
        background: #555;
    }
    #sidebar::-webkit-scrollbar-track,
    #place-panel::-webkit-scrollbar-track {
        background: #222;
    }
}

/* переключатель языка */
.language-switcher {
    display: flex;
    gap: 10px;
    align-items: center;
}

.language-switcher .lang-flag {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border 0.3s, transform 0.2s;
}

.language-switcher .lang-flag:hover {
    transform: scale(1.05);
}

.language-switcher .lang-flag.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

/* кнопки построения маршрута */
.route-controls {
    padding: 8px 0;
}

#travel-mode .btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#route-btn {
    width: 100%;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 10px;
}

/* Координаты */
.coordinates {
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-coords {
    padding: 0 5px;
    font-size: 0.8em;
}

/* Кнопки маршрута */
.route-card .route-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.route-card .btn-group {
    flex-shrink: 0;
}

.route-card .btn {
    padding: 5px 10px;
}

.route-mode .btn {
    position: relative;
    width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.route-mode .btn::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.route-mode .btn:hover::after {
    opacity: 1;
}

.route-mode .btn i {
    margin: 0;
    font-size: 16px;
}

.no-photo-placeholder {
    text-align: center;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 15px;
}

.no-photo-placeholder img {
    max-width: 100%;
    max-height: 200px;
    opacity: 0.7;
}

.no-photo-text {
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

.place-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.place-link:hover {
    color: inherit;
}

/* Стили для контейнера маршрутизации Leaflet */
.leaflet-routing-container {
    background: white;
    border-radius: 8px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    padding: 10px !important;
    width: 300px !important;
    max-height: 70vh;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Заголовок маршрута */
.leaflet-routing-container h2 {
    font-size: 16px !important;
    margin: 0 0 5px 0 !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* Подзаголовок (расстояние и время) */
.leaflet-routing-container h3 {
    font-size: 14px !important;
    margin: 0 0 10px 0 !important;
    color: #666 !important;
    font-weight: normal !important;
}

/* Таблица с инструкциями */
.leaflet-routing-container table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
}

/* Строки инструкций */
.leaflet-routing-container tr {
    border-bottom: 1px solid #f0f0f0 !important;
}

.leaflet-routing-container tr:last-child {
    border-bottom: none !important;
}

/* Ячейки инструкций */
.leaflet-routing-container td {
    padding: 8px 5px !important;
    vertical-align: middle !important;
    font-size: 14px !important;
}

/* Иконки инструкций */
.leaflet-routing-icon {
    width: 20px !important;
    height: 20px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Специфичные стили для иконок */
.leaflet-routing-icon-depart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231A3E72'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") !important;
}

.leaflet-routing-icon-arrive {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FF7A45'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") !important;
}

.leaflet-routing-icon-turn-left {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231A3E72'%3E%3Cpath d='M13.5 5v6H21V5h-7.5zm-2 0H3v6h8.5V5zM3 19h8.5v-6H3v6zm11 0h7.5v-6h-7.5v6z'/%3E%3C/svg%3E") !important;
}

.leaflet-routing-icon-turn-right {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231A3E72'%3E%3Cpath d='M10.5 5v6H3V5h7.5zm2 0H21v6h-8.5V5zM21 19h-8.5v-6H21v6zm-11 0H3v-6h7.5v6z'/%3E%3C/svg%3E") !important;
}

/* Расстояние в инструкциях */
.leaflet-routing-instruction-distance {
    color: #666 !important;
    text-align: right !important;
    white-space: nowrap !important;
    padding-left: 10px !important;
}

/* Альтернативные маршруты */
.leaflet-routing-alt {
    margin-bottom: 15px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #eee !important;
}

.leaflet-routing-alt:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

/* Сворачивание альтернативных маршрутов */
.leaflet-routing-alt-minimized h2 {
    cursor: pointer !important;
}

.leaflet-routing-alt-minimized h2::after {
    content: "+";
    float: right;
    font-weight: bold;
}

.leaflet-routing-alt-minimized table {
    display: none !important;
}

/* Кнопка закрытия */
.leaflet-routing-close {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    width: 20px !important;
    height: 20px !important;
    background: #f0f0f0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: #666 !important;
}

.leaflet-routing-close:hover {
    background: #e0e0e0 !important;
    color: #333 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .leaflet-routing-container {
        width: 250px !important;
        max-height: 50vh;
    }
    
    .leaflet-routing-container h2 {
        font-size: 14px !important;
    }
    
    .leaflet-routing-container td {
        font-size: 13px !important;
        padding: 6px 3px !important;
    }
}

/* Кастомный скроллбар */
.leaflet-routing-container::-webkit-scrollbar {
    width: 6px;
}

.leaflet-routing-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.leaflet-routing-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.leaflet-routing-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Поддержка китайских иероглифов */
.leaflet-routing-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 
               'Microsoft YaHei', '微软雅黑', STXihei, '华文细黑', 
               'PingFang SC', 'Hiragino Sans GB', sans-serif !important;
  line-height: 1.5;
}

/* Увеличиваем отступы для китайского текста */
.lang-cn .leaflet-routing-container td {
  padding: 10px 5px !important;
}

/* Увеличиваем размер шрифта для китайских иероглифов */
.lang-cn .leaflet-routing-container {
  font-size: 15px !important;
}

.lang-cn .leaflet-routing-container h2 {
  font-size: 16px !important;
}

.lang-cn .leaflet-routing-container h3 {
  font-size: 15px !important;
}

.route-instructions-container {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.route-steps {
  padding-left: 20px;
  margin: 10px 0 0 0;
}

.route-step {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.step-text {
  flex-grow: 1;
}

.step-distance {
  color: #666;
  font-size: 13px;
  white-space: nowrap;
}

/* Для китайского языка - увеличиваем межстрочный интервал */
.lang-cn .route-step {
  line-height: 1.6;
}

.custom-tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    z-index: 9999;
    font-size: 14px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}