/* ========================================
   МОБИЛЬНОЕ МЕНЮ
   ======================================== */

/* Скрываем мобильные элементы на десктопе */
#mobile-header-bar,
#mobile-trigger,
.mobile-search-icon,
#mob-menu,
#mobile-menu-bottom-fill {
    display: none;
}

/* ТОЛЬКО для мобильных устройств (до 999px) */
@media (max-width: 1065px) {
    
    /* Синяя панель сверху */
    #mobile-header-bar {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 50px;
        background: #2e75b6;
        z-index: 1000000;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    }
	
    
    /* Кнопка меню - СЛЕВА */
    #mobile-trigger {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        position: fixed;
        left: 0;
        top: 0;
        width: 60px;
        height: 50px;
        text-decoration: none;
        background: transparent;
        padding: 0;
        z-index: 1000001;
    }
    
    /* Три полоски гамбургера */
    .hamburger-line {
        display: block;
        width: 24px;
        height: 3px;
        background: #ffffff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
	
	.bps-wrapper { margin-top: -50px!important;}
    
	@supports (-webkit-touch-callout: none) {
		@media (max-width: 480px) {
  .site-header {
    margin-bottom: 25px !important; /* или нужное значение */
  }
}
	}
	
    /* Кнопка поиска - СПРАВА с SVG иконкой */
    .mobile-search-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: 0;
        top: 0;
        width: 60px;
        height: 50px;
        color: #ffffff;
        font-size: 20px;
        text-decoration: none;
        z-index: 1000001;
    }
    
    /* Скрываем Font Awesome иконку поиска */
    .mobile-search-icon i {
        display: none;
    }
    
    /* Добавляем SVG иконку поиска */
    .mobile-search-icon::before {
        content: '';
        display: block;
        width: 20px;
        height: 20px;
        background-image: url('data:image/svg+xml;utf8,<svg fill="%23ffffff" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M12.027 9.92L16 13.95 14 16l-4.075-3.976A6.465 6.465 0 0 1 6.5 13C2.91 13 0 10.083 0 6.5 0 2.91 2.917 0 6.5 0 10.09 0 13 2.917 13 6.5a6.463 6.463 0 0 1-.973 3.42zM1.997 6.452c0 2.48 2.014 4.5 4.5 4.5 2.48 0 4.5-2.015 4.5-4.5 0-2.48-2.015-4.5-4.5-4.5-2.48 0-4.5 2.014-4.5 4.5z" fill-rule="evenodd"/></svg>');
        background-repeat: no-repeat;
        background-size: contain;
        background-position: center;
    }
    
    /* Само мобильное меню - НА ВСЮ ВЫСОТУ ЭКРАНА */
    #mob-menu {
        display: block;
        position: fixed;
        left: -280px;
        top: 50px;
        bottom: 0 !important;
        width: 280px;
        height: auto !important;
        max-height: none !important;
        background: #2e75b5;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 999998;
        transition: left 0.5s ease-in-out;
        padding: 0 0 0px 0;
    }
    
    /* Меню открыто */
    #mob-menu.menu-open {
        left: 0;
    }
    
    /* Синяя заливка внизу экрана на всю ширину */
    #mobile-menu-bottom-fill {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        bottom: -10px;
        width: 100%;
        height: 10px;
        background: #2e75b5;
        z-index: 999997;
    }
    
    /* Показываем заливку когда меню открыто */
    body.mobile-menu-open #mobile-menu-bottom-fill {
        display: block;
        bottom: 0;
    }
    
    /* Убираем стандартные маркеры списков */
    #mob-menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    #mob-menu li {
        position: relative;
    }
    
    /* Основные пункты меню - СИНИЙ #2e75b5 */
    #mob-menu > ul > li > a {
        display: block;
        padding: 13px 40px 13px 20px;
        color: #ffffff;
        text-decoration: none;
        font-size: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: #2e75b5;
        transition: background 0.3s ease;
        position: relative;
    }
    
    #mob-menu > ul > li > a:hover {
        background: #3680c2;
    }
    
    /* SVG стрелочка вниз для основных пунктов с подменю */
    #mob-menu > ul > li.menu-item-has-children > a::after {
        content: '';
        display: inline-block;
        width: 12px;
        height: 12px;
        background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="%23ffffff" d="M6 15l5-5-5-5 1-2 7 7-7 7z"/></svg>');
        background-repeat: no-repeat;
        background-size: contain;
        background-position: center;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%) rotate(90deg);
        transition: transform 0.3s ease;
    }
    
    /* Подпункты первого уровня (.sub-menu) - #27649b */
    #mob-menu .sub-menu {
        background: #27649b !important;
    }
    
    #mob-menu .sub-menu > li > a {
        display: block;
        padding: 13px 40px 13px 40px;
        color: #ffffff;
        text-decoration: none;
        font-size: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: #27649b !important;
        transition: background 0.3s ease;
        position: relative;
    }
    
    #mob-menu .sub-menu > li > a:hover {
        background: #2f72aa !important;
    }
    
    /* SVG стрелочка вниз для подпунктов с подподменю */
    #mob-menu .sub-menu > li.menu-item-has-children > a::after {
        content: '';
        display: inline-block;
        width: 12px;
        height: 12px;
        background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="%23ffffff" d="M6 15l5-5-5-5 1-2 7 7-7 7z"/></svg>');
        background-repeat: no-repeat;
        background-size: contain;
        background-position: center;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%) rotate(90deg);
        transition: transform 0.3s ease;
    }
    
    /* Подподпункты второго уровня (.sub-menu внутри .sub-menu) - #204f7b */
    #mob-menu .sub-menu .sub-menu {
        background: #204f7b !important;
    }
    
    #mob-menu .sub-menu .sub-menu > li > a {
        display: block;
        padding: 13px 40px 13px 60px;
        color: #ffffff;
        text-decoration: none;
        font-size: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: #204f7b !important;
        transition: background 0.3s ease;
        position: relative;
    }
    
    #mob-menu .sub-menu .sub-menu > li > a:hover {
        background: #285c8c !important;
    }
    
    /* Отступ сверху для body */
    body {
        padding-top: 50px;
    }
    
    /* Скрываем десктопное меню */
    #main-nav {
        display: none;
    }
    
    /* Скрываем верхнюю полоску с датой */
    #tophead {
        display: none;
    }
    
    /* Корректируем шапку */
    .site-header {
        margin-top: 0;
        padding-top: 20px;
    }
}

/* Всплывающая форма поиска для мобильной версии */
@media (max-width: 1065px) {
    /* Скрываем иконку поиска когда форма открыта */
    .mobile-search-icon.hidden {
        opacity: 0;
        visibility: hidden;
    }
    
    .mobile-search-box-wrap {
        display: none;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        background: rgba(46, 117, 182, 0.98);
        backdrop-filter: blur(10px);
        padding: 20px;
        z-index: 999999;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-search-container {
        width: 100%;
    }
    
    .mobile-search-box-wrap .search-form {
        width: 100%;
        position: relative;
    }
    
    .mobile-search-box-wrap .search-field {
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-radius: 6px;
        padding: 12px 60px 12px 18px;
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
        font-size: 15px;
        width: 100%;
        box-sizing: border-box;
        height: 48px;
    }
    
    .mobile-search-box-wrap .search-field:focus {
        border-color: #d83645;
        background: rgba(255, 255, 255, 0.25);
        outline: none;
        box-shadow: 0 0 0 3px rgba(216, 54, 69, 0.2);
    }
    
    .mobile-search-box-wrap .search-field::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .mobile-search-box-wrap .search-submit {
        position: absolute !important;
        right: 4px !important;
        top: 4px !important;
        background: #d83645 url('data:image/svg+xml;utf8,<svg fill="%23ffffff" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M12.027 9.92L16 13.95 14 16l-4.075-3.976A6.465 6.465 0 0 1 6.5 13C2.91 13 0 10.083 0 6.5 0 2.91 2.917 0 6.5 0 10.09 0 13 2.917 13 6.5a6.463 6.463 0 0 1-.973 3.42zM1.997 6.452c0 2.48 2.014 4.5 4.5 4.5 2.48 0 4.5-2.015 4.5-4.5 0-2.48-2.015-4.5-4.5-4.5-2.48 0-4.5 2.014-4.5 4.5z" fill-rule="evenodd"/></svg>') center center no-repeat !important;
        background-size: 18px 18px !important;
        border: none !important;
        border-radius: 4px !important;
        padding: 0 !important;
        width: 40px !important;
        height: 40px !important;
        cursor: pointer !important;
        font-size: 0 !important;
        text-indent: -9999px !important;
        overflow: hidden !important;
        transition: all 0.2s ease !important;
    }
    
    .mobile-search-box-wrap .search-submit:hover {
        background-color: #c12d3a !important;
    }
}



/* ========================================
   УЛУЧШЕННОЕ МЕНЮ ДЛЯ ДЕСКТОПА В СТИЛЕ САЙТА
   ======================================== */

/* Основной контейнер меню */
#main-nav {
    background: #2e75b6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Меню первого уровня */
#primary-menu > li > a {
    padding: 18px 20px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

/* Эффект подчеркивания при наведении */
#primary-menu > li > a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: #d83645;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

#primary-menu > li > a:hover::before,
#primary-menu > li.current-menu-item > a::before {
    width: 80%;
}

/* Активный пункт меню */
#main-nav li.current-menu-item > a,
#main-nav li.current_page_item > a {
    background-color: rgba(216, 54, 69, 0.15);
}

/* МОДИФИЦИРУЕМ существующие стрелочки: вправо → по умолчанию */
/* Убираем Font Awesome и используем вашу SVG */
.main-navigation ul li.menu-item-has-children > a::after,
.main-navigation ul li.page_item_has_children > a::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="%23ffffff" d="M6 15l5-5-5-5 1-2 7 7-7 7z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 1;
    transition: transform 0.3s ease, opacity 0.2s ease !important;
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-left: 0 !important;
}

/* При наведении поворачиваем вниз ↓ */
.main-navigation ul li.menu-item-has-children:hover > a::after,
.main-navigation ul li.page_item_has_children:hover > a::after {
    transform: translateY(-50%) rotate(90deg) !important;
    opacity: 1;
}

/* Добавляем отступ справа для текста пункта меню */
.main-navigation ul li.menu-item-has-children > a,
.main-navigation ul li.page_item_has_children > a {
    padding-right: 30px !important;
}

/* Для вложенных подменю стрелочка вправо → (серый цвет) */
.main-navigation ul li li.menu-item-has-children > a::after,
.main-navigation ul li li.page_item_has_children > a::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="%23374151" d="M6 15l5-5-5-5 1-2 7 7-7 7z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 1;
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-left: 0 !important;
}

/* При наведении на вложенные - двигается вправо */
.main-navigation ul li li.menu-item-has-children:hover > a::after,
.main-navigation ul li li.page_item_has_children:hover > a::after {
    transform: translateY(-50%) translateX(3px) !important;
    opacity: 1;
}

/* Добавляем отступ справа для вложенных пунктов */
.main-navigation ul ul li.menu-item-has-children > a,
.main-navigation ul ul li.page_item_has_children > a {
    padding-right: 35px !important;
}


/* Выпадающие подменю */
#main-nav ul ul,
#main-nav .sub-menu {
    background: #ffffff !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    padding: 8px 0 !important;
}

/* Убираем все границы у элементов списка */
#main-nav ul ul li,
#main-nav .sub-menu li {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* Добавляем разделители МЕЖДУ пунктами (не снаружи) */
#main-nav ul ul li:not(:last-child),
#main-nav .sub-menu li:not(:last-child) {
    border-bottom: 1px solid #f3f4f6 !important;
}


#main-nav ul ul li a {
    padding: 12px 20px;
    color: #374151;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.2s ease;
}

#main-nav ul ul li a:hover {
    background: #f9fafb;
    color: #d83645;
    padding-left: 25px;
    border-left: 3px solid #d83645;
}

/* Вложенные подменю (третий уровень) */
#main-nav ul ul ul {
    left: 100%;
    top: 0;
    margin-top: 0;
    border-radius: 8px;
    border-top: 2px solid #d83645;
}

/* Поиск в шапке */
.header-search-box .search-icon {
    background: transparent;
    color: #ffffff;
    padding: 18px 20px;
    transition: all 0.2s ease;
    border-radius: 0;
}

.header-search-box .search-icon:hover {
    background: rgba(216, 54, 69, 0.9);
    color: #ffffff;
}

/* Форма поиска */
.search-box-wrap {
    background: rgba(46, 117, 182, 0.98);
    backdrop-filter: blur(10px);
}

.search-form .search-field {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 15px;
    transition: all 0.3s ease;
}

.search-form .search-field:focus {
    border-color: #d83645;
    background: rgba(255, 255, 255, 0.25);
    outline: none;
    box-shadow: 0 0 0 3px rgba(216, 54, 69, 0.2);
}

.search-form .search-field::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Кнопка поиска */
.search-form .search-submit {
    background: #d83645;
    border: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-form .search-submit:hover {
    background: #c12d3a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(216, 54, 69, 0.3);
}

/* Скрываем Font Awesome иконку поиска в десктопном меню */
.header-search-box .search-icon i {
    display: none;
}

/* Добавляем SVG иконку поиска */
.header-search-box .search-icon::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23ffffff" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M12.027 9.92L16 13.95 14 16l-4.075-3.976A6.465 6.465 0 0 1 6.5 13C2.91 13 0 10.083 0 6.5 0 2.91 2.917 0 6.5 0 10.09 0 13 2.917 13 6.5a6.463 6.463 0 0 1-.973 3.42zM1.997 6.452c0 2.48 2.014 4.5 4.5 4.5 2.48 0 4.5-2.015 4.5-4.5 0-2.48-2.015-4.5-4.5-4.5-2.48 0-4.5 2.014-4.5 4.5z" fill-rule="evenodd"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}


/* Липкое меню */
#main-nav {
	position: sticky;
	top: 0;
	z-index: 99999;
}
