Files
sportpressa_front/src/styles/components/main-menu.css
2026-01-11 16:16:59 +03:00

256 lines
6.1 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.mobile-menu-overlay {
display: none;
}
/* Гамбургер кнопка */
.hamburger {
display: none;
cursor: pointer;
z-index: 10001;
width: 23px;
height: 16px;
background: none;
border: none;
position: relative;
}
.hamburger-icon {
display: block;
width: 23px;
height: 16px;
background-image: url('data:image/svg+xml;utf8,<svg width="23" height="16" viewBox="0 0 23 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 0H23V2H0V0Z" fill="%23FFFFFF"/><path d="M0 7H23V9H0V7Z" fill="%23FFFFFF"/><path d="M0 14H23V16H0V14Z" fill="%23FFFFFF"/></svg>');
background-repeat: no-repeat;
background-size: contain;
}
/* Кнопка закрытия */
.mobile-menu-close {
display: block;
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
padding: 10px;
z-index: 10001;
background: none;
border: none;
}
.close-icon {
display: block;
width: 22px;
height: 22px;
background-image: url('data:image/svg+xml;utf8,<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="22.7616" height="1.4226" rx="0.711302" transform="matrix(0.707056 -0.707157 0.707056 0.707157 2.44824 18.5456)" fill="%23FFFFFF"/><rect width="22.7616" height="1.4226" rx="0.711302" transform="matrix(0.707056 0.707157 -0.707056 0.707157 3.4585 2.44843)" fill="%23FFFFFF"/></svg>');
background-repeat: no-repeat;
background-size: contain;
}
/* Мобильные стили */
@media (max-width: 768px) {
.hamburger {
display: block;
margin-left: 4px;
margin-right: 18px;
}
.site-header-content {
position: relative;
align-items: center;
}
/* Скрываем десктопное меню */
.desktop-nav {
display: none;
}
/* Меню скрыто по умолчанию */
.mobile-menu-overlay {
display: none; /* Изначально скрыто */
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-color: #3c3c3c;
z-index: 10000;
transform: translateX(100%);
transition: transform 0.3s ease;
overflow-y: auto;
padding: 20px;
}
/* Когда активно - показываем и выдвигаем */
.mobile-menu-overlay.active {
display: block;
transform: translateX(0);
}
/* Мобильная навигация */
.mobile-nav {
margin-top: 60px;
}
.mobile-main-menu {
list-style: none;
padding: 0;
margin: 0;
}
.mobile-main-menu > li {
border-bottom: 1px solid #555;
}
.mobile-main-menu > li > a {
display: block;
padding: 18px 10px;
color: white;
font-size: 1.4rem;
font-weight: bold;
text-decoration: none;
position: relative;
}
/* Стрелка для пунктов с подменю */
.mobile-main-menu .menu-item-has-children > a::after {
content: '';
position: absolute;
right: 10px;
font-size: 2rem;
color: #006842;
}
/* Подменю скрыто по умолчанию */
.mobile-main-menu .sub-menu {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-color: #2a2a2a;
z-index: 10002;
padding: 20px;
overflow-y: auto;
transform: translateX(100%);
transition: transform 0.3s ease;
list-style: none;
margin: 0;
}
/* Показываем подменю при клике */
.mobile-main-menu .menu-item-has-children.active > .sub-menu {
display: block;
transform: translateX(0);
}
/* Кнопка "Назад" в подменю */
.mobile-main-menu .sub-menu::before {
content: ' Назад';
display: block;
padding: 18px 10px;
color: white;
font-size: 1.2rem;
font-weight: bold;
border-bottom: 1px solid #444;
margin-bottom: 10px;
cursor: pointer;
}
.mobile-main-menu .sub-menu li {
border-bottom: 1px solid #444;
}
.mobile-main-menu .sub-menu a {
display: block;
padding: 15px 10px;
color: white;
font-size: 1.1rem;
text-decoration: none;
}
.mobile-main-menu a:hover,
.mobile-main-menu a:active {
color: red;
}
/* Блокировка скролла body при открытом меню */
body.menu-open {
overflow: hidden;
}
}
/* Десктопные стили */
@media (min-width: 769px) {
.mobile-menu-overlay {
display: none !important;
}
.desktop-nav {
display: block;
position: relative;
z-index: 100;
}
.main-menu {
display: flex;
gap: 12px;
align-items: center;
list-style: none;
margin: 0 0 0 32px;
padding: 0;
}
.main-menu li {
position: relative;
}
.main-menu a {
font-weight: bold;
font-size: 1.6rem;
color: white;
text-decoration: none;
display: block;
padding: 10px 15px;
}
.main-menu a:hover {
color: red;
}
.main-menu ul {
display: none;
position: absolute;
top: 100%;
left: 0;
background-color: #333;
min-width: 400px;
max-width: max-content;
padding: 15px;
list-style: none;
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
z-index: 9999;
grid-template-columns: repeat(2, auto);
gap: 10px 20px;
}
.main-menu li:hover > ul {
display: grid;
}
.main-menu ul li {
width: auto;
}
.main-menu ul a {
font-size: 1rem;
font-weight: normal;
padding: 8px 15px;
white-space: nowrap;
}
.main-menu ul a:hover {
background-color: #555;
color: white;
}
}