/* Адаптивная сетка */
@media (max-width: 992px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .bento-grid { grid-template-columns: 1fr; }
    .wide, .tall { grid-column: span 1; }
}

/* Мобильный поиск и оверлей */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 25, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    display: none;
    flex-direction: column;
    padding: 0;
}

.mobile-search-overlay.active {
    display: flex;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100vw;
    padding: calc(env(safe-area-inset-top, 20px) + 60px) 15px 15px 15px;
    gap: 10px;
    box-sizing: border-box;
}

.search-container-mobile {
    flex: 1;
    min-width: 0;
    position: relative;
}

#kbSearchMobile {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 10px 10px 40px;
    color: #fff;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
}

.search-icon-mobile {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.cancel-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--secondary);
    font-weight: 500;
    font-size: 1rem;
    white-space: nowrap;
    padding: 5px 5px;
    margin: 0;
}

.search-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    margin-top: 20px;
    text-align: center;
}

/* Плавающая кнопка и скрытие десктопного поиска */
@media (max-width: 767px) {
    .search-section.d-none.d-md-flex {
        display: none !important;
    }

    .mobile-floating-btn {
        display: block !important;
        position: fixed;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
    }

    .samokat-btn {
        background: #fff;
        color: #000;
        border: none;
        padding: 14px 24px;
        border-radius: 50px;
        font-weight: 700;
        box-shadow: 0 10px 25px rgba(0,0,0,0.4);
        display: flex;
        align-items: center;
        gap: 8px;
        text-transform: uppercase;
        font-size: 0.8rem;
    }
}





@media (max-width: 767px) {
    /* Сетка превращается в горизонтальную ленту */
    .bento-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding: 10px 20px 20px 20px;
        scrollbar-width: none; /* Скрываем скроллбар в Firefox */
        -webkit-overflow-scrolling: touch;
        animation: hint-bounce 1s ease-in-out; /* Эффект подсказки при загрузке */
    }

    /* Скрываем скроллбар в Chrome/Safari */
    .bento-grid::-webkit-scrollbar {
        display: none;
    }

    .bento-item {
        flex: 0 0 85vw; /* Карточка на 85% ширины, чтобы было видно край следующей */
        scroll-snap-align: center;
        display: flex !important; /* Убеждаемся, что фильтрация не сломает flex */
    }

    /* Стили для точек пагинации */
    .kb-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 5px;
        margin-bottom: 20px;
    }

    .dot {
        width: 6px;
        height: 6px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .dot.active {
        width: 18px;
        background: var(--secondary);
        border-radius: 10px;
    }

    /* Анимация: легкое покачивание всей ленты, чтобы показать, что она свайпается */
    @keyframes hint-bounce {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(-10px); }
    }
}

/* Гарантируем, что в WEB точек НИКОГДА не будет видно */
@media (min-width: 768px) {
    .kb-pagination {
        display: none !important;
    }
}

/* Обновленная сетка в стиле 2026 года */
.popular-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.popular-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 16px;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Эффект при клике (как в мобильных аппах) */
.popular-card:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.07);
}

.card-icon-wrapper {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-icon-wrapper i {
    font-size: 1.4rem;
    color: var(--secondary); /* Ваш бирюзовый/фиолетовый цвет */
    filter: drop-shadow(0 0 8px rgba(136, 211, 206, 0.4));
}

.card-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.card-subtitle {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-family: 'Monospace', sans-serif;
}

.arrow-icon {
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
}

/* Секционный заголовок */
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--secondary);
    opacity: 0.8;
    margin-bottom: 20px;
    margin-top: 10px;
    padding-left: 20px;
}
