/* --- ОСНОВНОЙ СТИЛЬ --- */
body {
    margin: 0;
    padding: 0;
    font-family:
        -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    overflow: hidden;
    background: #e7e7df;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

/* --- ПРЕЛОАДЕР --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fefffd;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #cac4b7;
    border-top: 4px solid #c9fb00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- ПАНЕЛЬ УПРАВЛЕНИЯ --- */
.ui-layout {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 1500;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

.left-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: auto;
}

.left-panel {
    width: fit-content;
    align-items: flex-start;
}

.right-panel {
    width: 300px;
    align-items: flex-end;
}

/* --- КОНТЕЙНЕР ПОИСКА (МИНИМАЛИЗМ) --- */
.search-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    z-index: 600;
    order: 2;
}

.search-box {
    background: rgba(254, 255, 253, 0.9);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(202, 196, 183, 0.6);
    border-radius: 30px;
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-shadow: 0 8px 32px rgba(19, 21, 10, 0.1);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
}

.search-box:hover,
.search-box:focus-within {
    width: 300px;
    padding: 0 18px;
    gap: 12px;
    border-color: #c9fb00;
    box-shadow: 0 0 20px rgba(201, 251, 0, 0.2);
    cursor: text;
}

#map-search {
    background: transparent;
    border: none;
    outline: none;
    width: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    font-size: 16px;
    font-weight: 500;
    color: #13150a;
    transition: all 0.4s ease;
}

.search-box:hover #map-search,
.search-box:focus-within #map-search {
    width: 100%;
    opacity: 1;
}

.search-icon {
    font-size: 18px;
    color: #787664;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.search-box:hover .search-icon,
.search-box:focus-within .search-icon {
    color: #c9fb00;
}

/* ВЫПАДАЮЩИЕ ПОДСКАЗКИ */
.search-results-dropdown {
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: #fefffd;
    border-radius: 20px;
    border: 1px solid rgba(19, 21, 10, 0.05);
    max-height: 280px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 15px 45px rgba(19, 21, 10, 0.15);
    z-index: 9999 !important;
}

.search-item {
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e7e7df;
}

.search-item:hover {
    background: #faf7f4;
}

.search-item .item-title {
    font-weight: 600;
    font-size: 14px;
    color: #13150a;
}

/* --- КНОПКИ ФИЛЬТРОВ (ДЕСКТОП) --- */
.vertical-filters-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    padding-bottom: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    order: 1;
    flex-grow: 1;
}

.vertical-filters-container::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex-shrink: 0;
    background: rgba(254, 255, 253, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(202, 196, 183, 0.6);
    border-radius: 20px;
    padding: 0 20px;
    height: 48px;
    font-size: 14px;
    font-weight: 700;
    color: #13150a;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.filter-btn.active {
    background: #c9fb00;
    color: #13150a;
    border-color: #c9fb00;
}

/* --- САЙДБАР --- */
.sidebar {
    position: absolute;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(130%);
    background: #fefffd;
    box-shadow: -10px 0 40px rgba(19, 21, 10, 0.15);
    border-left: 1px solid rgba(202, 196, 183, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

@media (min-width: 769px) {
    .sidebar {
        top: 90px;
        right: 20px;
        width: 380px;
        max-height: calc(100vh - 120px);
        border-radius: 36px;
    }
    .sidebar.active {
        transform: translateX(0);
    }
}

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 768px) {
    .sidebar {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 75vh;
        border-radius: 40px 40px 0 0;
        transform: translateY(110%);
        border-left: none;
        border-top: 1px solid rgba(202, 196, 183, 0.5);
    }
    .sidebar.active {
        transform: translateY(0);
    }

    .ui-layout {
        flex-direction: column;
        top: 15px;
        left: 10px;
        right: 10px;
        bottom: auto;
        justify-content: flex-start;
    }
    .left-panel {
        width: 100%;
        align-items: stretch;
    }
    .brand-block {
        align-self: center;
        width: fit-content;
    }

    /* ИСПРАВЛЕНИЕ: Бесконечный горизонтальный скролл фильтров */
    .vertical-filters-container {
        display: flex; /* Возвращаем Flexbox */
        flex-direction: row;
        width: calc(100% + 20px); /* Вырываем за пределы padding */
        margin-left: -10px;
        padding-left: 10px; /* Выравниваем первую кнопку */
        padding-right: 20px;
        box-sizing: border-box;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .right-panel {
        width: 100%;
    }

    /* ИСПРАВЛЕНИЕ: Раскрытие поиска на всю ширину */
    .search-box:hover,
    .search-box:focus-within {
        width: 100%;
    }
}

#sb-img {
    /* ИСПРАВЛЕНИЕ: Картинка от края до края. Скругления теперь делает сам сайдбар! */
    width: 100%;
    margin: 0;
    border-radius: 0;
    height: 280px; /* Чуть увеличили высоту для премиального размаха */
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-content {
    padding: 24px 28px 60px;
    overflow-y: visible;
    flex-grow: 1;
}

/* Обертка для тегов и стиль цены */
.tags-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}
.tag {
    background: #232c26;
    color: #c9fb00;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    display: inline-block;
}
.tag.price-tag {
    background: #232c26;
    color: #c9fb00;
}

h2 {
    font-size: 24px;
    margin: 15px 0 10px;
    color: #13150a;
    font-weight: 800;
}
p {
    line-height: 1.6;
    color: #232c26;
    font-size: 16px;
    margin-bottom: 25px;
}

.action-btn {
    width: 100%;
    background: #c9fb00;
    color: #13150a;
    border: none;
    padding: 18px;
    border-radius: 20px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(201, 251, 0, 0.25);
}
.close-btn {
    position: sticky;
    top: 20px;
    align-self: flex-end;
    margin-top: 20px;
    margin-right: 20px;
    margin-bottom: -56px;
    background: rgba(254, 255, 253, 0.75);
    backdrop-filter: blur(10px);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #13150a;
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

/* --- МАРКЕРЫ --- */
.custom-marker {
    background: #fefffd;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 0;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(19, 21, 10, 0.15);
    border: 2px solid #fefffd;
    transition:
        border-color 0.3s,
        box-shadow 0.3s,
        background 0.3s;
    will-change: transform;
}
.custom-marker:hover {
    transform: scale(1.15);
    border-color: #c9fb00;
}
.custom-marker.active-marker {
    border-color: #c9fb00 !important;
    box-shadow: 0 0 25px rgba(201, 251, 0, 0.5);
    transform: scale(1.25);
    z-index: 999;
    transition:
        border-color 0.3s,
        box-shadow 0.3s,
        transform 0.3s;
}
.style-switcher {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: 100;
    background: #fefffd;
    color: #13150a;
    border: none;
    padding: 12px 20px;
    border-radius: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(19, 21, 10, 0.1);
    transition: all 0.3s ease;
}

/* --- БЛОК СОВЕТ ГИДА --- */
.guide-tip-container {
    background: #e7e7df;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    color: #13150a;
}
.guide-header {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}
.guide-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(202, 196, 183, 0.3);
    flex-shrink: 0;
}
.guide-name {
    font-size: 16px;
    font-weight: 800;
    color: #13150a;
    margin-bottom: 2px;
}
.guide-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #787664;
    margin-bottom: 10px;
}
.guide-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
    font-weight: 500;
    color: #232c26;
}
.guide-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #13150a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: opacity 0.2s;
}
.guide-link:hover {
    opacity: 0.8;
}
.link-icon {
    font-size: 14px;
    color: #c9fb00;
}

/* --- АУДИОПЛЕЕР (APPLE STYLE) --- */
.apple-audio-player {
    background: #13150a;
    border-radius: 22px;
    padding: 12px 16px;
    margin-bottom: 25px;
    border: 1px solid rgba(254, 255, 253, 0.1);
    box-shadow: 0 10px 25px rgba(19, 21, 10, 0.15);
}
.player-body {
    display: flex;
    align-items: center;
    gap: 15px;
}
.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #c9fb00;
    color: #13150a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s ease;
}
.play-btn:active {
    transform: scale(0.9);
}
.audio-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.audio-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fefffd;
}
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(254, 255, 253, 0.15);
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill {
    width: 0%;
    height: 100%;
    background: #c9fb00;
    transition: width 0.1s linear;
}

/* --- СТИЛИ ДЛЯ ВЕКТОРНЫХ SVG-ИКОНОК --- */
.custom-marker {
    color: #13150a;
}
.custom-marker.active-marker {
    background: #13150a !important;
    color: #c9fb00 !important;
}
.custom-marker svg {
    width: 24px;
    height: 24px;
    transition: color 0.3s ease;
}
.search-item svg,
.filter-btn svg {
    width: 18px;
    height: 18px;
}

/* --- PREMIUM SYSTEM --- */
.lock-icon {
    margin-left: 6px;
    font-size: 12px;
    opacity: 0.7;
}
#premium-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#premium-modal.active {
    opacity: 1;
    pointer-events: auto;
}
.premium-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
}
.premium-box {
    position: relative;
    width: 90%;
    max-width: 380px;
    background: #fefffd;
    border-radius: 32px;
    padding: 32px;
    text-align: center;
    z-index: 2;
    box-shadow: 0 30px 80px rgba(19, 21, 10, 0.35);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
#premium-modal.active .premium-box {
    transform: translateY(0);
}
.premium-icon {
    font-size: 48px;
    margin-bottom: 14px;
}
.premium-box h2 {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 800;
    color: #13150a;
}
.premium-box p {
    margin-bottom: 24px;
    color: #787664;
    font-size: 15px;
    line-height: 1.5;
}
.premium-unlock-btn {
    width: 100%;
    border: none;
    background: #c9fb00;
    color: #13150a;
    height: 54px;
    border-radius: 18px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.premium-unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(201, 251, 0, 0.35);
}
.premium-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f3f3ee;
    cursor: pointer;
    font-size: 16px;
    color: #13150a;
}
.premium-input {
    width: 100%;
    height: 54px;
    border-radius: 18px;
    border: 2px solid #e7e7df;
    padding: 0 16px;
    box-sizing: border-box;
    font-size: 15px;
    margin-bottom: 16px;
    outline: none;
    transition: 0.2s ease;
}
.premium-input:focus {
    border-color: #c9fb00;
}
.premium-error {
    margin-top: 12px;
    color: #ff4d4d;
    font-size: 13px;
    display: none;
}

/* --- БЛОК БРЕНДИНГА --- */
.brand-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(19, 21, 10, 0.9);
    backdrop-filter: blur(20px);
    padding: 0 20px;
    height: 48px;
    border-radius: 20px;
    border: 1px solid rgba(202, 196, 183, 0.15);
    box-shadow: 0 8px 32px rgba(19, 21, 10, 0.3);
    flex-shrink: 0;
}

.brand-logo {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #13150a;
    line-height: 1;
    text-transform: uppercase;
}

.brand-link {
    font-size: 9px;
    font-weight: 700;
    color: #c9fb00;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.brand-link:hover {
    opacity: 1;
}

.mapboxgl-ctrl-bottom-left {
    bottom: 80px !important;
    left: 10px !important;
    z-index: 100;
}
/* --- СФОКУСИРОВАННЫЙ РЕЖИМ (Скрытие левой панели) --- */
.left-panel {
    /* Добавляем плавность всем изменениям позиции и прозрачности */
    transition:
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.5s ease;
}

/* Класс-триггер, который уводит панель вверх и делает прозрачной */
.left-panel.hidden-up {
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none; /* Отключаем случайные клики по невидимым кнопкам */
}

/* --- СИНХРОННЫЙ ПОДЪЕМ ПОИСКА В СФОКУСИРОВАННОМ РЕЖИМЕ --- */
.right-panel {
    /* Добавляем панели поиска плавность */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 768px) {
    .right-panel.focus-up {
        /* Поднимаем лупу точно на высоту исчезнувшего блока с фильтрами (около 115px) */
        transform: translateY(-115px);
    }
}

/* --- ПРЕМИАЛЬНАЯ АНИМАЦИЯ В СТИЛЕ APPLE --- */
.sidebar-swipe-anim {
    animation: appleSwipe 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes appleSwipe {
    0% {
        opacity: 0;
        transform: translateX(30px) scale(0.98);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

/* PRIME IFRAME FULLSCREEN NORMALIZE */

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
}

#map {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}