/**
 * Стили для фильтров географии (bottomsheet внутри filter-modal)
 */

/* Чипы для открытия bottomsheet */
.geo-filter-chip {
    display: inline-flex;
    align-items: center;
    height: 36px;
    background-color: var(--surface-secondary);
    border: none;
    border-radius: 12px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    color: var(--text-color);
    font-family: inherit;
    font-size: inherit;
    gap: 4px;
}

@media (hover: hover) {
    .geo-filter-chip:hover {
        background-color: var(--hover-light);
    }
}

.geo-filter-chip.active {
    background-color: var(--accent-color);
}

.geo-filter-chip.active .chip-text {
    color: var(--surface-primary);
}

.geo-filter-chip.active .geo-chip-arrow {
    color: var(--surface-primary);
}

.geo-chip-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.geo-chip-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 2px;
}

.geo-filter-chip.active .geo-chip-clear {
    display: inline-flex;
}

/* ============================================
   GEO BOTTOMSHEET (внутри filter-modal)
   (восстановлено из основной темы)
   ============================================ */

.geo-bottomsheet {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
}

.geo-bottomsheet.visible {
    opacity: 1;
    visibility: visible;
}

/* Overlay под модалкой гео */
.geo-bottomsheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-primary);
    opacity: 0.65;
    pointer-events: none;
}

/* Контент bottomsheet */
.geo-bottomsheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: calc(100% - 80px);
    background-color: var(--surface-primary);
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1) !important;
}

.geo-bottomsheet.visible .geo-bottomsheet-content {
    transform: translateY(0);
}

html.dark-theme .geo-bottomsheet-content {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Хедер bottomsheet */
.geo-bottomsheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--filter-divider);
}

.geo-bottomsheet-title {
    font-family: var(--font-primary);
    font-size: var(--fs-16);
    letter-spacing: var(--ls-16);
    line-height: var(--lh-16);
    font-weight: var(--fw-medium);
    color: var(--text-color);
}

.geo-bottomsheet-close {
    width: 32px;
    height: 32px;
    border: none;
    background-color: var(--surface-secondary);
    border-radius: 999px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

@media (hover: hover) {
    .geo-bottomsheet-close:hover {
        background-color: var(--hover-light);
    }
}

html.dark-theme .geo-bottomsheet-close svg path {
    fill: var(--text-muted);
}

/* Поиск */
.geo-bottomsheet-search {
    padding: 12px 16px 12px 16px;
    position: relative;
    flex-shrink: 0;
}

.geo-search-icon {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.geo-search-input {
    width: 100%;
    height: 44px;
    background-color: var(--surface-secondary);
    border: none;
    border-radius: 12px;
    padding: 0 16px 0 44px;
    font-family: var(--font-primary);
    font-size: var(--fs-16);
    letter-spacing: var(--ls-16);
    line-height: var(--lh-16);
    color: var(--text-color);
    box-sizing: border-box;
}

.geo-search-input::placeholder {
    color: var(--text-muted);
}

.geo-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* Список опций */
.geo-bottomsheet-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
    overscroll-behavior: contain;
}

/* Кастомный скроллбар */
.geo-bottomsheet-list::-webkit-scrollbar {
    width: 6px;
}

.geo-bottomsheet-list::-webkit-scrollbar-track {
    background: transparent;
}

.geo-bottomsheet-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.geo-bottomsheet-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

html.dark-theme .geo-bottomsheet-list::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

html.dark-theme .geo-bottomsheet-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.geo-option {
    display: flex;
    align-items: center;
    padding: 6px 12px 6px 12px;
    cursor: pointer;
    border-radius: 12px;
    transition: background-color 0.15s ease;
    gap: 12px;
}

@media (hover: hover) {
    .geo-option:hover {
        background-color: var(--surface-secondary);
    }
}

.geo-option-name {
    flex: 1;
    font-family: var(--font-primary);
    font-size: var(--fs-16);
    letter-spacing: var(--ls-16);
    line-height: var(--lh-16);
    color: var(--text-color);
}

.geo-option-count {
    font-family: var(--font-primary);
    font-size: var(--fs-14);
    letter-spacing: var(--ls-14);
    line-height: var(--lh-14);
    color: var(--text-muted);
}

.geo-empty-message {
    padding: 24px 20px;
    text-align: center;
    font-family: var(--font-primary);
    font-size: var(--fs-14);
    color: var(--text-muted);
}

/* Футер bottomsheet */
.geo-bottomsheet-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--filter-divider);
    flex-shrink: 0;
}

.geo-action-btn {
    background: none;
    border: none;
    font-family: var(--font-primary);
    font-size: var(--fs-14);
    letter-spacing: var(--ls-14);
    line-height: 17px;
    font-weight: var(--fw-medium);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

@media (hover: hover) {
    .geo-action-btn:hover {
        color: var(--text-color);
    }
}

.geo-apply-btn {
    margin-left: auto;
    color: var(--accent-color);
    font-weight: var(--fw-semibold);
}

@media (hover: hover) {
    .geo-apply-btn:hover {
        color: var(--accent-color-hover, var(--accent-color));
    }
}

/* Mobile: bottomsheet внутри filter-modal, 90% высоты + затемнение */
@media (max-width: 1279px) {
    .filter-modal .geo-bottomsheet {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 24px;
        overflow: hidden;
    }
    .filter-modal .geo-bottomsheet-content {
        top: auto;
        bottom: 0;
        max-height: 95%;
        border-radius: 24px;
    }
    .filter-modal .geo-bottomsheet-overlay {
        pointer-events: auto;
    }
    .filter-modal .geo-bottomsheet-header {
        padding: 12px 20px;
    }
    .filter-modal .geo-bottomsheet-footer {
        padding: 12px 20px;
    }
}

/* Desktop: привязываем bottomsheet к блоку фильтров, 90% высоты */
@media (min-width: 1280px) {
    .filters-container .geo-bottomsheet {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 24px;
        overflow: hidden;
    }
    .filters-container .geo-bottomsheet-content {
        top: auto;
        bottom: 0;
        max-height: 95%;
        border-radius: 24px;
    }
    .filters-container .geo-bottomsheet-overlay {
        pointer-events: auto;
    }
}
