/* ============================================================
   bundle.css — объединённые глобальные стили dobrist.com
   Источники: azbyka-style + mobile-burger-menu + mobile-navigation
              + mobile-feedback + badge + navigation-badges + dropdown-fix
   ============================================================ */


/* ======================================================
   ОСНОВНЫЕ СТИЛИ (azbyka-style.css)
   ====================================================== */

/* Улучшенные стили для портала "Добрые истории" */
:root {
    /* Основные цвета */
    --primary-color: #1a365d;
    --primary-hover: #2d3748;
    --secondary-color: #4a5568;
    --accent-color: #e53e3e;
    --accent-hover: #c53030;
    
    /* Цвета для разделов */
    --stories-color: #2B5AA0;
    --books-color: #38a169;
    --audio-color: #3182ce;
    --fairy-tales-color: #9f7aea;
    --shop-color: #d69e2e;
    
    /* Нейтральные цвета */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-accent: #edf2f7;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Тени */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Скругления */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Переходы */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

/* Стили для страницы рассказа */
.story-actions {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* ================== АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНОЙ НАВИГАЦИИ ================== */
@media (max-width: 991.98px) {
    /* Скрываем десктопную навигацию на мобильных */
    .navbar.desktop-nav {
        display: none !important;
    }
}

.story-actions .btn {
    display: inline-flex !important;
    align-items: center;
    white-space: nowrap;
    margin-right: 0;
}

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Улучшенная типографика */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-primary);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Навигация */
.navbar {
    background-color: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    z-index: 1050; /* Высокий приоритет для навигации */
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}

.navbar-brand:hover {
    color: var(--accent-color) !important;
}

.orthodox-cross {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-right: 0.75rem;
    transition: transform var(--transition-normal);
}

.navbar-brand:hover .orthodox-cross {
    transform: scale(1.1);
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--accent-color) !important;
    background-color: var(--bg-accent);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--accent-color) !important;
    background-color: var(--bg-accent);
}

/* Dropdown улучшения */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
    z-index: 1055; /* Выше навигации */
    position: relative;
}

.dropdown-item {
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
}

.dropdown-item:hover {
    background-color: var(--bg-accent);
    color: var(--accent-color);
    transform: translateX(4px);
}

/* Героическая секция */
.hero-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-accent) 100%);
    border-radius: var(--radius-xl);
    padding: 4rem 2rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    z-index: 1; /* Низкий приоритет */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(229, 62, 62, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.hero-section h1 {
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.hero-section .lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 2;
}

/* Кнопки */
.btn {
    border-radius: var(--radius-lg);
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: var(--shadow-md);
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-outline-light {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.btn-outline-light:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary {
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-accent);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* Карточки */
.card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    background-color: var(--bg-primary);
    overflow: hidden;
    position: relative;
    z-index: 1; /* Низкий приоритет */
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--stories-color), var(--books-color), var(--audio-color));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-color);
}

.card:hover::before {
    opacity: 1;
}

.card-body {
    padding: 2rem;
    position: relative;
}

.card-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-align: center !important; /* 🔄 Принудительное центрирование */
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Иконки разделов */
.section-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
    transition: all var(--transition-normal);
}

.icon-stories {
    color: var(--stories-color);
}

.icon-books {
    color: var(--books-color);
}

.icon-audio {
    color: var(--audio-color);
}

.card:hover .section-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Бейджи и теги */
.badge {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    margin: 0.25rem;
    transition: all var(--transition-fast);
}

.tag-cloud .badge {
    background-color: var(--bg-accent) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color);
    text-decoration: none;
}

.tag-cloud .badge:hover {
    background-color: var(--accent-color) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Призыв к действию - фиксированный */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    text-align: center;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 40px);
    overflow: hidden;
    color: white;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    transform: translateY(100%);
    animation: slideInUp 0.5s ease-out 1s forwards;
}

@keyframes slideInUp {
    to {
        transform: translateY(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
    to {
        transform: translateY(0) translateX(100%);
        opacity: 0;
    }
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.cta-section::after {
    content: '☦';
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    opacity: 0.15;
    color: white;
}

.cta-section h3 {
    color: white;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    font-size: 1.25rem;
    font-weight: 800;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
    line-height: 1.4;
}

.cta-section .btn {
    position: relative;
    z-index: 2;
    margin: 0.25rem;
    border-radius: var(--radius-md);
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition-normal);
    display: inline-block;
}

.cta-section .btn-primary {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
}

.cta-section .btn-primary:hover {
    background: transparent;
    color: white;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.cta-section .btn-outline-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
}

.cta-section .btn-outline-secondary:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Кнопка закрытия */
.cta-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 5;
    line-height: 1;
    user-select: none;
}

.cta-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.cta-close:active {
    transform: scale(0.95);
}

/* Скрыть блок */
.cta-section.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Футер */
footer {
    background-color: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

footer h5, footer h6 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

footer .text-muted {
    color: var(--text-muted) !important;
}

footer a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Секция разделов */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Теги облако */
.tag-cloud {
    margin-bottom: 2rem;
}

/* Популярные теги */
.popular-tags-section {
    margin-top: 4rem;
    margin-bottom: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    position: relative;
    z-index: 1; /* Низкий приоритет */
    background-color: var(--bg-primary);
}

.popular-tags-section h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.tag-cloud-wrapper {
    text-align: center;
    margin-bottom: 1.5rem;
}

.all-tags-btn {
    text-align: center;
    margin-top: 1.5rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .hero-section {
        padding: 2.5rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .section-icon {
        font-size: 2.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
        width: 100%;
    }
    
    .btn-primary {
        margin-right: 0;
    }
    
    .cta-section {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        padding: 1.5rem 1rem;
    }
    
    .cta-section h3 {
        font-size: 1.1rem;
    }
    
    .cta-section p {
        font-size: 0.85rem;
    }
    
    .cta-section .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        margin: 0.2rem;
        display: block;
        width: 100%;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .orthodox-cross {
        font-size: 1.5rem;
        margin-right: 0.5rem;
    }
    
    .popular-tags-section {
        margin-top: 2.5rem;
        padding-top: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .sections-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cta-section {
        bottom: 10px;
        right: 5px;
        left: 5px;
        padding: 1.2rem 0.8rem;
    }
    
    .cta-section .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        margin: 0.15rem;
    }
    
    .popular-tags-section {
        margin-top: 2rem;
        padding-top: 1rem;
    }
    
    .popular-tags-section h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
}

/* Православный крест */
.orthodox-cross::before {
    content: "☦";
}

/* Дополнительные улучшения */
.container {
    max-width: 1200px;
}

/* Анимация загрузки страницы */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .hero-section, .cta-section {
    animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.2s;
}

/* Улучшения для доступности */
.btn:focus,
.nav-link:focus,
.dropdown-item:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Скролл-бар */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Правильные отступы для иконок */
.btn i:not(:only-child) {
    margin-right: 0.5rem;
}

.dropdown-item i {
    margin-right: 0.75rem;
    width: 1.2rem;
    text-align: center;
}

.nav-link i:not(:only-child) {
    margin-right: 0.3rem;
}

/* Общие классы для отступов иконок */
.me-1 {
    margin-right: 0.25rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.me-3 {
    margin-right: 1rem !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

.ms-3 {
    margin-left: 1rem !important;
}

/* Социальные сети - исправления */
.social-media-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid var(--border-light);
    text-align: center;
}

.social-media-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.social-media-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.social-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.social-btn i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.social-btn:hover::before {
    left: 100%;
}

/* Telegram кнопка */
.social-btn.telegram {
    background: linear-gradient(135deg, #0088cc 0%, #0077b3 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.social-btn.telegram:hover {
    background: linear-gradient(135deg, #0077b3 0%, #006699 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

/* YouTube кнопка - красная */
.social-btn.youtube {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.social-btn.youtube:hover {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

/* ВКонтакте кнопка */
.social-btn.vk {
    background: linear-gradient(135deg, #4c75a3 0%, #45688e 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.social-btn.vk:hover {
    background: linear-gradient(135deg, #45688e 0%, #3e5b7a 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
}

/* Адаптивность для социальных кнопок */
@media (max-width: 768px) {
    .social-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .social-btn {
        width: 100%;
        max-width: 280px;
        min-width: auto;
    }
    
    .social-media-section {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
}

@media (max-width: 576px) {
    .social-media-section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .social-media-section h4 {
        font-size: 1.1rem;
    }
    
    .social-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    max-width: 100%;
}
} /* закрытие @media (max-width: 576px) */

/* Bootstrap dropdown исправления */
.navbar .dropdown-menu {
    z-index: 1080 !important; /* Еще выше! */
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    display: none;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.navbar .dropdown-menu.show {
    display: block !important;
    z-index: 1080 !important; /* Дублируем */
}

.navbar .dropdown {
    position: relative;
    z-index: 1080 !important;
}

.navbar {
    z-index: 1080 !important; /* Навигация на самом верху */
}

/* Общие правила для Bootstrap dropdown */
.dropdown-menu {
    z-index: 1080 !important;
}

.dropdown-menu.show {
    z-index: 1080 !important;
}

/* Особые стили для разделов с низким z-index */
.hero-section,
.card,
.popular-tags-section,
.filter-section,
.product-card,
.btn,
.form-control,
.form-select {
    z-index: 1 !important;
    position: relative;
}

/* Принудительно низкий z-index для всех кнопок */
.btn:not(.navbar *) {
    z-index: 1 !important;
    position: relative !important;
}

/* Магазин - все элементы с низким приоритетом */
.container .row,
.container .col-12,
.container .col-md-3,
.container .col-md-2,
.container .col-md-1,
.container .col-lg-3,
.container .col-md-4,
.container .col-sm-6 {
    z-index: 1 !important;
}

/* Тестовый виджет */
.test-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1040; /* Ниже навигации */
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Пульсация для кнопок */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
}

/* Пульсация для желтых кнопок */
@keyframes pulse-warning {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
}

/* ==================================================
   СТИЛИ ПАГИНАЦИИ
   ================================================== */

.pagination {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 0;
    background: white;
}

.pagination .page-link {
    border: none;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    background: transparent;
}

.pagination .page-link:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-1px);
    z-index: 2;
    box-shadow: 0 4px 8px rgba(229, 62, 62, 0.3);
}

.pagination .page-item.active .page-link {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background-color: var(--bg-secondary);
    cursor: not-allowed;
}

.pagination .page-item:first-child .page-link {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.pagination .page-item:last-child .page-link {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* Адаптивность пагинации */
@media (max-width: 768px) {
    .pagination {
        font-size: 0.9rem;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
    }
    
    .pagination-lg {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .pagination {
        font-size: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        min-width: 40px;
        text-align: center;
    }
}

/* ==========================================
   РЕЙТИНГ ЗВЁЗД
   ========================================== */

.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.rating-input input {
    display: none;
}

.rating-input .star-label {
    color: #ddd;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    margin-right: 5px;
}

.rating-input .star-label:hover,
.rating-input .star-label:hover ~ .star-label,
.rating-input input:checked ~ .star-label {
    color: #ffc107; /* Жёлтый цвет */
}

/* ==========================================
   ИСПРАВЛЕНИЕ МОБИЛЬНЫХ ПЛЕЙЛИСТОВ
   ========================================== */

/* Стили для заголовка плейлиста */
.playlist-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(0,0,0,0.05);
}

.playlist-title {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.playlist-description {
    color: #6c757d;
    margin-bottom: 1rem;
}

.playlist-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.playlist-meta span {
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.playlist-meta i {
    margin-right: 0.5rem;
    flex-shrink: 0;
    color: #e74c3c;
    font-size: 1rem;
}

.playlist-actions {
    margin-top: 1rem;
}

/* КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ для мобильных устройств */
@media (max-width: 768px) {
    .playlist-header {
        padding: 1.25rem;
        text-align: left;
    }
    
    .playlist-header .d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .playlist-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .playlist-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    /* МОЩНОЕ ИСПРАВЛЕНИЕ для мобильных плейлистов */
    .playlist-meta {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Статус приватности - первая строка, обе колонки */
    .playlist-meta span:nth-child(3) {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        display: flex !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 8px !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Количество рассказов - вторая строка, первая колонка */
    .playlist-meta span:nth-child(1) {
        grid-column: 1 !important;
        grid-row: 2 !important;
        display: flex !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 0.8rem !important;
        padding: 0.4rem 0.6rem !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 6px !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    }
    
    /* Дата - вторая строка, вторая колонка */
    .playlist-meta span:nth-child(2) {
        grid-column: 2 !important;
        grid-row: 2 !important;
        display: flex !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 0.8rem !important;
        padding: 0.4rem 0.6rem !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 6px !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    }
    
    .playlist-meta span i {
        margin-right: 0.5rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Кнопки действий на мобильных */
    .playlist-actions .btn-group {
        width: 100% !important;
        display: flex !important;
    }
    
    .playlist-actions .btn {
        flex: 1 !important;
        font-size: 0.85rem !important;
        padding: 0.5rem !important;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 400px) {
    .playlist-header {
        padding: 1rem !important;
    }
    
    .playlist-title {
        font-size: 1.3rem !important;
    }
    
    .playlist-meta span:nth-child(1),
    .playlist-meta span:nth-child(2) {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.5rem !important;
    }
    
    .playlist-meta span i {
        margin-right: 0.3rem !important;
        font-size: 0.85rem !important;
    }
}

/* Стили для десктопной версии - исправляем отступы между иконками и текстом */
.playlist-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.playlist-meta span {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.playlist-meta span i {
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* ===================================================== */
/* ИСПРАВЛЕНИЕ КАРТОЧЕК РАССКАЗОВ - ОДИНАКОВАЯ ВЫСОТА */
/* ===================================================== */

/* Основные стили для карточек рассказов */
.story-card {
    display: flex !important;
    flex-direction: column !important;
    min-height: 420px !important; /* Фиксированная минимальная высота */
    height: 100% !important; /* Заполняет родительский контейнер */
    transition: var(--transition-normal) !important;
}

.story-card .card-body {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    padding: 1.5rem !important;
}

.story-content {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Заголовки - фиксированная высота */
.story-title {
    min-height: 65px !important; /* Место для заголовка в 2-3 строки */
    display: flex !important;
    align-items: flex-start !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
    overflow: hidden !important;
}

/* Описание - ограниченное количество строк */
.story-description {
    flex-grow: 1 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important; /* Максимум 3 строки */
    -webkit-box-orient: vertical !important;
    line-height: 1.5 !important;
    margin-bottom: 1rem !important;
    color: var(--text-secondary) !important;
}

/* Контейнер для тегов - фиксированная высота */
.story-tags {
    min-height: 55px !important; /* Фиксированная высота для тегов */
    display: flex !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin: 1rem 0 !important;
    overflow: hidden !important;
}

/* Стили для отдельных тегов */
.tag-item {
    display: inline-block !important;
    background: linear-gradient(45deg, #e3f2fd, #f3e5f5) !important;
    color: #1976d2 !important;
    padding: 4px 10px !important;
    border-radius: 15px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 110px !important; /* Ограничиваем ширину тегов */
    border: 1px solid rgba(25, 118, 210, 0.2) !important;
    transition: var(--transition-fast) !important;
}

.tag-item:hover {
    background: linear-gradient(45deg, #bbdefb, #e1bee7) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2) !important;
}

/* Кнопки всегда внизу карточки */
.story-actions {
    margin-top: auto !important;
    padding-top: 1rem !important;
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

/* Обеспечиваем равномерную высоту в сетке Bootstrap */
.row.story-grid {
    display: flex !important;
    flex-wrap: wrap !important;
}

.row.story-grid > [class*="col-"] {
    display: flex !important;
    margin-bottom: 1.5rem !important;
}

/* Дополнительные стили для карточек */
.story-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: var(--shadow-lg) !important;
}

.story-card .card-img-top {
    height: 200px !important;
    object-fit: cover !important;
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .story-card {
        min-height: 380px !important;
    }
    
    .story-title {
        min-height: 50px !important;
        font-size: 1.1rem !important;
    }
    
    .story-description {
        -webkit-line-clamp: 2 !important;
        font-size: 0.9rem !important;
    }
    
    .story-tags {
        min-height: 45px !important;
    }
    
    .tag-item {
        max-width: 90px !important;
        font-size: 10px !important;
        padding: 3px 8px !important;
    }
    
    .story-card .card-body {
        padding: 1rem !important;
    }
}

@media (max-width: 576px) {
    .story-card {
        min-height: 350px !important;
    }
    
    .story-title {
        min-height: 45px !important;
        font-size: 1rem !important;
    }
    
    .tag-item {
        max-width: 80px !important;
        font-size: 9px !important;
    }
}

/* Альтернативный подход через CSS Grid (если нужно) */
.story-grid-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 1.5rem !important;
    grid-auto-rows: 1fr !important; /* Все строки одинаковой высоты */
}

/* Стили для состояний карточек */
.story-card.featured {
    border: 2px solid var(--accent-color) !important;
    background: linear-gradient(135deg, #fff, #fff5f5) !important;
}

.story-card.new {
    position: relative !important;
}

.story-card.new::before {
    content: "Новое" !important;
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    background: var(--accent-color) !important;
    color: white !important;
    padding: 2px 8px !important;
    border-radius: 10px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    z-index: 10 !important;
}

/* ======================================================
   БУРГЕР-МЕНЮ (mobile-burger-menu.css)
   ====================================================== */

/* Дополнительные стили для улучшенной мобильной навигации */

/* ================== КНОПКА-БУРГЕР В ПРАВОМ ВЕРХНЕМ УГЛУ ================== */
.mobile-burger-menu {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
    display: none; /* Скрыта на десктопе */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.5);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-burger-menu:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.mobile-burger-menu:active {
    transform: scale(0.95);
}

.mobile-burger-icon {
    font-size: 20px;
    color: var(--primary-color, #1a365d);
    transition: all 0.3s ease;
}

/* Анимация иконки бургера */
.mobile-burger-menu.active .mobile-burger-icon {
    transform: rotate(90deg);
}

/* ================== УЛУЧШЕННОЕ МОДАЛЬНОЕ МЕНЮ ================== */
.mobile-menu-modal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.mobile-menu-modal .modal-header {
    background: linear-gradient(135deg, var(--primary-color, #1a365d) 0%, var(--secondary-color, #4a5568) 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    padding: 20px 24px;
}

.mobile-menu-modal .modal-title {
    font-weight: 600;
    font-size: 18px;
}

.mobile-menu-modal .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.mobile-menu-modal .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.mobile-menu-modal .modal-body {
    padding: 0;
}

.mobile-menu-modal .list-group-item {
    border: none;
    padding: 16px 24px;
    transition: all 0.3s ease;
}

.mobile-menu-modal .list-group-item:hover {
    background: rgba(26, 54, 93, 0.05);
    transform: translateX(5px);
}

.mobile-menu-modal .list-group-item i {
    width: 24px;
    text-align: center;
}

.mobile-menu-modal .dropdown-divider {
    margin: 8px 24px;
}

/* Группировка элементов в модальном меню */
.menu-group {
    padding: 12px 0;
}

.menu-group-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #718096);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 24px 4px;
    margin: 0;
}

/* ================== АДАПТИВНОСТЬ ДЛЯ КНОПКИ-БУРГЕРА ================== */

/* Скрываем бургер на больших экранах (десктоп) */
@media (min-width: 992px) {
    .mobile-burger-menu {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .mobile-burger-menu {
        display: flex; /* Показываем на мобильных */
    }
    
    /* Увеличиваем отступ сверху для контента, чтобы не перекрывала бургер */
    body.has-mobile-nav main.container {
        padding-top: 15px;
    }
}

@media (max-width: 575.98px) {
    .mobile-burger-menu {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
    
    .mobile-burger-icon {
        font-size: 18px;
    }
}

/* ================== УЛУЧШЕНИЯ ДЛЯ МОБИЛЬНОЙ НАВИГАЦИИ ================== */

/* Обновленная навигация с 5 основными разделами */
.mobile-nav-items {
    justify-content: space-between; /* Равномерное распределение */
}

/* Специальные стили для аудио раздела */
.mobile-nav-item[data-section="audio"] {
    color: var(--audio-color, #3182ce);
}

.mobile-nav-item[data-section="audio"].active {
    background: rgba(49, 130, 206, 0.15);
}

/* Убираем старую кнопку "Еще" - теперь у нас аудио */
.mobile-nav-item[data-section="menu"] {
    display: none;
}

/* ================== ЭФФЕКТЫ И АНИМАЦИИ ================== */

/* Плавное появление бургер-меню */
.mobile-burger-menu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Эффект пульсации для уведомлений на бургере */
.mobile-burger-menu.has-notifications::before {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: var(--accent-color, #e53e3e);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ================== ТЕМНАЯ ТЕМА ДЛЯ БУРГЕРА ================== */
@media (prefers-color-scheme: dark) {
    .mobile-burger-menu {
        background: rgba(26, 32, 44, 0.9);
        border-color: rgba(45, 55, 72, 0.5);
    }
    
    .mobile-burger-menu:hover {
        background: rgba(26, 32, 44, 1);
    }
    
    .mobile-burger-icon {
        color: #a0aec0;
    }
}

/* ================== ДОСТУПНОСТЬ ================== */
.mobile-burger-menu:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Увеличенная область клика для сенсорных экранов */
.mobile-burger-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: transparent;
    border-radius: 20px;
}

/* БЫСТРОЕ ИСПРАВЛЕНИЕ БЕЛОГО ТЕКСТА */
.mobile-menu-modal .modal-title {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
}

.mobile-menu-modal .modal-header {
    color: white !important;
}


/* ======================================================
   МОБИЛЬНАЯ НАВИГАЦИЯ (mobile-navigation.css)
   ====================================================== */

/* ================== МОБИЛЬНАЯ НАВИГАЦИЯ ================== */
/* Файл: static/css/mobile-navigation.css */

/* ================== ИСПРАВЛЕНИЕ КОНФЛИКТОВ С БУРГЕР-МЕНЮ ================== */
/* Универсальное правило для плавающих элементов, чтобы не перекрывались с бургер-меню */
@media (max-width: 991.98px) {
    /* Все плавающие элементы в правом верхнем углу сдвигаем влево */
    .cart-indicator,
    .floating-action,
    .fixed-top-right {
        left: 20px !important;
        right: auto !important;
        top: 15px !important;
    }
    
    /* Для очень маленьких экранов */
    @media (max-width: 575.98px) {
        .cart-indicator,
        .floating-action,
        .fixed-top-right {
            left: 12px !important;
            top: 12px !important;
        }
    }
}

/* Основные переменные для мобильной навигации */
:root {
    --mobile-nav-height: 70px;
    --mobile-nav-bg: #ffffff;
    --mobile-nav-border: #e2e8f0;
    --mobile-nav-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    --mobile-nav-text: #64748b;
    --mobile-nav-active: var(--accent-color, #e53e3e);
    --mobile-nav-radius: 12px;
}

/* Отступ снизу для контента, чтобы навигация не перекрывала */
body.has-mobile-nav {
    padding-bottom: var(--mobile-nav-height);
}

/* Контейнер мобильной навигации */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mobile-nav-bg);
    border-top: 1px solid var(--mobile-nav-border);
    box-shadow: var(--mobile-nav-shadow);
    z-index: 1000;
    display: none; /* Скрыта на десктопе */
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); /* Учитываем notch */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Список элементов навигации */
.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0;
    padding: 0 12px;
    list-style: none;
    max-width: 500px;
    margin: 0 auto;
}

/* Отдельный элемент навигации */
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--mobile-nav-text);
    min-width: 50px;
    padding: 6px 8px;
    border-radius: var(--mobile-nav-radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Ховер эффект */
.mobile-nav-item:hover {
    color: var(--primary-color);
    background: rgba(26, 54, 93, 0.05);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Активное состояние */
.mobile-nav-item.active {
    color: var(--mobile-nav-active);
    background: rgba(229, 62, 62, 0.1);
}

/* Иконка в навигации */
.mobile-nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

/* Анимация активной иконки */
.mobile-nav-item.active .mobile-nav-icon {
    transform: scale(1.1);
}

/* Текст под иконкой */
.mobile-nav-text {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.025em;
}

/* ================== ЦВЕТОВАЯ СХЕМА ДЛЯ РАЗДЕЛОВ ================== */

/* Видео-рассказы */
.mobile-nav-item[data-section="stories"] {
    color: var(--stories-color, #2B5AA0);
}
.mobile-nav-item[data-section="stories"].active {
    background: rgba(43, 90, 160, 0.15);
}

/* Книги */
.mobile-nav-item[data-section="books"] {
    color: var(--books-color, #38a169);
}
.mobile-nav-item[data-section="books"].active {
    background: rgba(56, 161, 105, 0.15);
}

/* Аудио */
.mobile-nav-item[data-section="audio"] {
    color: var(--audio-color, #3182ce);
}
.mobile-nav-item[data-section="audio"].active {
    background: rgba(49, 130, 206, 0.15);
}

/* Сказки */
.mobile-nav-item[data-section="fairy-tales"] {
    color: var(--fairy-tales-color, #9f7aea);
}
.mobile-nav-item[data-section="fairy-tales"].active {
    background: rgba(159, 122, 234, 0.15);
}

/* Магазин */
.mobile-nav-item[data-section="shop"] {
    color: var(--shop-color, #d69e2e);
}
.mobile-nav-item[data-section="shop"].active {
    background: rgba(214, 158, 46, 0.15);
}

/* Корзина */
.mobile-nav-item[data-section="cart"] {
    color: var(--shop-color, #d69e2e);
}
.mobile-nav-item[data-section="cart"].active {
    color: var(--shop-color, #d69e2e);
    background: rgba(214, 158, 46, 0.15);
}

/* Главная страница */
.mobile-nav-item[data-section="home"] .mobile-nav-icon {
    font-size: 22px;
    color: var(--primary-color, #1a365d);
}

/* ================== БЕЙДЖИ УВЕДОМЛЕНИЙ ================== */
.mobile-nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: var(--accent-color, #e53e3e);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
    animation: pulseIn 0.3s ease-out;
}

/* Анимация появления бейджа */
@keyframes pulseIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ================== АДАПТИВНОСТЬ ================== */
@media (max-width: 991.98px) {
    /* Показываем мобильную навигацию */
    .mobile-bottom-nav {
        display: block;
    }
    
    /* Добавляем отступ снизу */
    body {
        padding-bottom: var(--mobile-nav-height);
    }
    
    /* Скрываем десктопную навигацию на мобильных */
    .navbar.desktop-nav {
        display: none !important;
    }
    
    /* Увеличиваем область клика */
    .mobile-nav-item {
        min-height: 50px;
        justify-content: center;
        padding: 8px 6px;
    }
}

@media (max-width: 575.98px) {
    /* Уменьшаем размеры на очень маленьких экранах */
    .mobile-nav-text {
        font-size: 9px;
    }
    
    .mobile-nav-icon {
        font-size: 18px;
    }
    
    .mobile-nav-item[data-section="home"] .mobile-nav-icon {
        font-size: 20px;
    }
    
    .mobile-nav-items {
        padding: 0 8px;
    }
}

/* ================== АНИМАЦИИ ================== */

/* Появление навигации */
.mobile-bottom-nav {
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Эффект нажатия */
.mobile-nav-item:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Плавное скрытие/показ при скролле */
.mobile-bottom-nav.hide {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-bottom-nav.show {
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================== ТЕМНАЯ ТЕМА (опционально) ================== */
@media (prefers-color-scheme: dark) {
    :root {
        --mobile-nav-bg: #1a202c;
        --mobile-nav-border: #2d3748;
        --mobile-nav-text: #a0aec0;
        --mobile-nav-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .mobile-nav-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* ================== ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ================== */

/* Индикатор загрузки для навигации */
.mobile-nav-item.loading .mobile-nav-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Эффект ряби при клике */
.mobile-nav-item {
    overflow: hidden;
    position: relative;
}

.mobile-nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mobile-nav-item:active::before {
    width: 60px;
    height: 60px;
}

/* Улучшенная доступность */
.mobile-nav-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ================== МОДАЛЬНОЕ ОКНО "ЕЩЁ" ================== */

/* Кнопка "Ещё" в навигации */
.mobile-nav-items li button.mobile-nav-item {
    background: none;
    border: none;
    width: 100%;
}

/* Контент модального окна */
.more-nav-modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Горизонтальная сетка разделов — всегда в ряд */
.more-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 4px 0 8px;
}

/* Элемент сетки */
.more-nav-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 12px 4px;
    border-radius: 16px;
    transition: background 0.2s ease;
    position: relative;
    color: var(--mobile-nav-text);
}

.more-nav-grid-item:hover,
.more-nav-grid-item:active {
    background: rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: var(--primary-color);
}

/* Иконка в сетке */
.more-nav-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--soft-gray, #f8f9fa);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    position: relative;
    font-size: 22px;
    transition: transform 0.2s ease;
}

.more-nav-grid-item:active .more-nav-icon-wrap {
    transform: scale(0.92);
}

/* Подпись */
.more-nav-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 90px;
}

/* Badge в модальном окне */
.more-nav-badge {
    top: -4px;
    right: -4px;
    font-size: 9px;
    padding: 1px 5px;
}

/* ================== АНИМАЦИЯ ИКОНКИ "НАПОМИНАНИЯ" ================== */

.badge-reminders-icon {
    animation: heartbeat 1.5s ease-in-out infinite;
    color: #e74c3c !important;
    display: block;
}

.reminders-icon-wrap {
    background: rgba(231, 76, 60, 0.1) !important;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25%       { transform: scale(1.15); }
    50%       { transform: scale(1); }
}

/* ================== СКРЫТИЕ ТЕКСТА ПРИ УЗКИХ ЭКРАНАХ ================== */

/* Скрытие текста при очень узких экранах */
@media (max-width: 350px) {
    .mobile-nav-text {
        display: none;
    }
    
    .mobile-nav-item {
        padding: 12px 4px;
    }
    
    .mobile-nav-icon {
        margin-bottom: 0;
        font-size: 20px;
    }
}


/* ======================================================
   МОБИЛЬНАЯ ОБРАТНАЯ СВЯЗЬ (mobile-feedback.css)
   ====================================================== */

/* Стили для системы мобильной обратной связи */

/* Основные переменные */
:root {
    --feedback-primary: #667eea;
    --feedback-secondary: #764ba2;
    --feedback-success: #28a745;
    --feedback-warning: #ffc107;
    --feedback-danger: #dc3545;
    --feedback-overlay: rgba(0, 0, 0, 0.8);
}

/* Оверлей обратной связи */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--feedback-overlay);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-overlay.show {
    display: flex;
    opacity: 1;
}

/* Модальное окно */
.feedback-modal {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin: 20px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    transition: transform 0.3s ease-out;
}

.feedback-overlay.show .feedback-modal {
    transform: translateY(0);
}

/* Кнопка закрытия */
.feedback-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.feedback-close:hover {
    color: #333;
    background: #f1f1f1;
}

/* Заголовок */
.feedback-header {
    text-align: center;
    margin-bottom: 25px;
    padding-right: 30px;
}

.feedback-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--feedback-primary) 0%, var(--feedback-secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 24px;
}

.feedback-header h4 {
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.feedback-header p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Опции выбора */
.feedback-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.feedback-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.feedback-option:nth-child(1) { animation-delay: 0.1s; }
.feedback-option:nth-child(2) { animation-delay: 0.15s; }
.feedback-option:nth-child(3) { animation-delay: 0.2s; }
.feedback-option:nth-child(4) { animation-delay: 0.25s; }
.feedback-option:nth-child(5) { animation-delay: 0.3s; }
.feedback-option:nth-child(6) { animation-delay: 0.35s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-option:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
}

.feedback-option.selected {
    background: linear-gradient(135deg, var(--feedback-primary) 0%, var(--feedback-secondary) 100%);
    border-color: var(--feedback-primary);
    color: white;
}

.feedback-option-icon {
    width: 40px;
    height: 40px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--feedback-primary);
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.feedback-option.selected .feedback-option-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.feedback-option-text {
    flex: 1;
}

.feedback-option-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 16px;
}

.feedback-option-desc {
    font-size: 13px;
    opacity: 0.7;
    margin: 0;
}

/* Текстовое поле */
.feedback-textarea {
    width: 100%;
    min-height: 120px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    resize: vertical;
    font-family: inherit;
    margin: 20px 0;
    transition: border-color 0.3s ease;
    font-size: 14px;
    line-height: 1.5;
    background: white;
    box-sizing: border-box;
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--feedback-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.feedback-textarea::placeholder {
    color: #999 !important;
    font-style: italic;
    opacity: 0.8;
}

.feedback-textarea::-webkit-input-placeholder {
    color: #999 !important;
    font-style: italic;
    opacity: 0.8;
}

.feedback-textarea::-moz-placeholder {
    color: #999 !important;
    font-style: italic;
    opacity: 0.8;
}

.feedback-textarea:-ms-input-placeholder {
    color: #999 !important;
    font-style: italic;
    opacity: 0.8;
}

/* Кнопки */
.feedback-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-feedback-cancel {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-feedback-cancel:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-feedback-submit {
    background: linear-gradient(135deg, var(--feedback-primary) 0%, var(--feedback-secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 2;
    min-width: 140px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-feedback-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-feedback-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Индикатор долгого нажатия */
.long-press-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(102, 126, 234, 0.9);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    pointer-events: none;
}

.long-press-circle {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Уведомления */
.feedback-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--feedback-success);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback-toast.show {
    transform: translateX(0);
}

.feedback-toast.error {
    background: var(--feedback-danger);
}

/* Стили для успешной отправки */
.feedback-success-content {
    text-align: center;
    padding: 40px 20px;
}

.feedback-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--feedback-success) 0%, #20c997 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 32px;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.feedback-success-content h4 {
    color: var(--feedback-success);
    margin-bottom: 12px;
    font-weight: 600;
}

.feedback-success-content p {
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Адаптивность */
@media (max-width: 576px) {
    .feedback-modal {
        margin: 10px;
        padding: 20px;
        max-height: 90vh;
        border-radius: 16px;
    }

    .feedback-buttons {
        flex-direction: column;
    }

    .btn-feedback-cancel,
    .btn-feedback-submit {
        flex: 1;
        min-width: auto;
    }

    .feedback-option {
        padding: 12px 16px;
        gap: 12px;
    }

    .feedback-option-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .feedback-option-title {
        font-size: 15px;
    }

    .feedback-option-desc {
        font-size: 12px;
    }

    .feedback-textarea {
        min-height: 100px;
        padding: 12px;
    }

    .long-press-indicator {
        width: 70px;
        height: 70px;
    }

    .long-press-circle {
        width: 50px;
        height: 50px;
    }

    .feedback-success-icon {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
}

/* Только для мобильных устройств */
@media (min-width: 992px) {
    .feedback-overlay,
    .long-press-indicator {
        display: none !important;
    }
}

/* Дополнительные стили для улучшенной доступности */
.feedback-option:focus-visible {
    outline: 2px solid var(--feedback-primary);
    outline-offset: 2px;
}

.btn-feedback-cancel:focus-visible,
.btn-feedback-submit:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.feedback-textarea:focus-visible {
    outline: none;
    border-color: var(--feedback-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Скрываем бейдж reCAPTCHA — он перехватывает тач-события на мобилке.
   Согласно правилам Google, достаточно упомянуть reCAPTCHA в тексте формы. */
.grecaptcha-badge {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ======================================================
   DROPDOWN НАВИГАЦИИ (dropdown-fix.css)
   ====================================================== */

/* =========================== */
/* ИСПРАВЛЕНИЯ НАВИГАЦИИ       */
/* =========================== */

/* Фиксация ширины пользовательского dropdown меню */
.navbar-nav .dropdown-menu {
    min-width: 250px !important;
    width: max-content !important;
    max-width: 320px !important;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
}

/* Стили для пунктов dropdown меню */
.navbar-nav .dropdown-item {
    white-space: nowrap !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    color: #495057 !important;
    display: flex !important;
    align-items: center !important;
    transition: all 0.2s ease;
}

.navbar-nav .dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #2B5AA0 !important;
}

/* Иконки в dropdown меню */
.navbar-nav .dropdown-item i {
    width: 18px !important;
    text-align: center !important;
    margin-right: 10px !important;
    font-size: 14px !important;
    flex-shrink: 0;
}

/* Разделители в dropdown */
.navbar-nav .dropdown-divider {
    margin: 8px 0 !important;
    border-top: 1px solid #e9ecef !important;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .navbar-nav .dropdown-menu {
        min-width: 280px !important;
        max-width: 90vw !important;
        left: auto !important;
        right: 0 !important;
    }
    
    .navbar-nav .dropdown-item {
        padding: 12px 20px !important;
        font-size: 15px !important;
    }
    
    .navbar-nav .dropdown-item i {
        width: 20px !important;
        margin-right: 12px !important;
        font-size: 15px !important;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .navbar-nav .dropdown-menu {
        min-width: 260px !important;
        max-width: 85vw !important;
    }
}

/* Специальные стили для кнопки выхода */
.navbar-nav .dropdown-item.text-danger:hover {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

/* Улучшенное позиционирование dropdown */
.navbar-nav .nav-item.dropdown {
    position: relative;
}

.navbar-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    z-index: 1000;
    margin-top: 2px;
}

/* Треугольник-указатель для dropdown */
.navbar-nav .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
    z-index: 1001;
}

.navbar-nav .dropdown-menu::after {
    content: '';
    position: absolute;
    top: -7px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #dee2e6;
    z-index: 1000;
}

/* Анимация появления dropdown - ОТКЛЮЧЕНО для совместимости */
/*
.navbar-nav .dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.navbar-nav .dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
*/

/* Исправление для случаев, когда dropdown выходит за границы экрана */
@media (max-width: 576px) {
    .navbar-nav .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 60px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        border-radius: 12px;
        margin: 0 !important;
    }
    
    .navbar-nav .dropdown-menu::before,
    .navbar-nav .dropdown-menu::after {
        display: none;
    }
}

/* Дополнительные улучшения для читаемости */
.navbar-nav .dropdown-item {
    line-height: 1.4 !important;
}

/* Особый стиль для имени пользователя в навигации */
.navbar-nav .nav-link.dropdown-toggle {
    font-weight: 500;
    color: #495057 !important;
}

.navbar-nav .nav-link.dropdown-toggle:hover {
    color: #2B5AA0 !important;
}

/* Исправления для Bootstrap 5 */
.navbar-nav .dropdown-toggle::after {
    margin-left: 8px;
}


/* ======================================================
   БЕЙДЖИ НАВИГАЦИИ (navigation-badges.css)
   ====================================================== */

/* Стили для бейджей в навигации */

/* Бейдж избранного */
#favorites-badge {
    background-color: #f39c12 !important;
    color: white !important;
}

/* Бейдж корзины */
#cart-badge {
    background-color: #dc3545 !important;
    color: white !important;
}

/* Принудительная загрузка до рендера */
.desktop-nav-badge {
    position: absolute !important;
    top: -8px !important;
    right: -14px !important;
    width: 1.2rem !important;
    height: 1.2rem !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 0.6rem !important;
    font-weight: 600 !important;
    z-index: 10 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.nav-link:has(.desktop-nav-badge) {
    position: relative !important;
    display: inline-block !important;
    padding-right: 6px !important;
}

/* ======================================================
   PWA BADGE (pwa/css/badge.css)
   ====================================================== */

/* ========== BADGE СТИЛИ ========== */

.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    border-radius: 10px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    min-width: 18px;
}

/* Общий значок в шапке меню */
.badge-primary {
    background-color: #FF6B9D; /* child-pink */
    color: white;
}

/* Значки для разных разделов */
.badge-notification {
    background-color: #D4AF37; /* gold-accent */
    color: white;
}

.badge-stories {
    background-color: #2B5AA0; /* orthodox-blue */
    color: white;
}

.badge-fairy-tales {
    background-color: #FF6B9D; /* child-pink */
    color: white;
}

/* Анимация появления */
.badge {
    transition: all 0.3s ease-in-out;
}

.badge[style*="display: none"] {
    display: none !important;
}

@keyframes badgePulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.badge:not([style*="display: none"]) {
    animation: badgePulse 0.3s ease-in-out;
}

/* Позиционирование в меню */
.menu-items li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.menu-items li a:hover {
    background-color: rgba(43, 90, 160, 0.1);
}

.menu-items li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.menu-items li a .badge {
    margin-left: auto;
}

/* Header menu badge */
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.menu-header h3 {
    margin: 0;
    font-size: 18px;
}
