dana-medical-site/web/src/components/Header.css
2026-10-14 13:33:13 +00:00

188 lines
3.5 KiB
CSS

.header {
position: relative;
z-index: 40;
background: var(--surface);
}
/* ---------- десктоп: макет 1440, высота шапки 189 ---------- */
.header__desktop {
position: relative;
display: flex;
flex-direction: column;
gap: 18px;
padding: 28px 0 22px;
}
/* раскрытое меню висит под шапкой и не двигает содержимое страницы */
.header__mega {
position: absolute;
left: 0;
right: 0;
top: calc(100% - 15px);
z-index: 50;
}
.header__top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
height: 72px;
}
.header__logo {
display: flex;
flex-direction: column;
justify-content: space-between;
width: 160px;
height: 47.83px;
flex-shrink: 0;
}
/* логотип — ссылка на главную: без выделения и перетаскивания картинки курсором */
.header__logo,
.header__mobile > a {
cursor: pointer;
user-select: none;
-webkit-user-drag: none;
}
.header__logo img,
.header__mobile > a img {
pointer-events: none;
}
.header__logo img:first-child {
width: 160px;
height: 33.71px;
}
.header__logo img:last-child {
width: 160px;
height: 10.14px;
}
.header__search {
width: 300px;
flex-shrink: 1;
}
.header__phone {
font-weight: 600;
font-size: 21px;
color: var(--navy);
white-space: nowrap;
}
.header__cta {
padding: 12px 18px;
font-size: 19px;
}
.header__nav {
display: flex;
align-items: center;
justify-content: space-between;
height: 44px;
}
.nav {
display: flex;
align-items: center;
gap: 32px;
}
.nav__item {
display: inline-flex;
align-items: center;
gap: 7px;
padding: 10px 0;
font-size: 20px;
color: var(--ink);
border-radius: var(--r-10);
white-space: nowrap;
}
.nav__item:hover {
color: var(--coral);
}
.nav__item--active {
color: var(--coral);
font-weight: 600;
}
.nav__item--open {
color: var(--coral);
}
.header__hours {
font-size: 18px;
color: var(--text-muted);
white-space: nowrap;
}
/* ---------- компактная шапка из мобильного макета ---------- */
.header__mobile {
display: none;
}
@media (max-width: 1199px) {
.header {
position: sticky;
top: 0;
box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.1);
}
.header__desktop {
display: none;
}
.header__mobile {
display: flex;
align-items: center;
justify-content: space-between;
height: 56px;
padding: 0 var(--gutter);
}
.header__mobile img {
width: 92.996px;
height: 27.992px;
}
.header__mobile-right {
display: flex;
align-items: center;
gap: 12px;
}
.header__mobile-phone {
font-weight: 600;
font-size: 14px;
line-height: 20px;
color: var(--navy);
white-space: nowrap;
}
.burger {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 5px;
width: 36px;
height: 36px;
}
.burger span {
display: block;
width: 20px;
height: 2px;
background: var(--navy);
transition: transform 0.2s ease, opacity 0.2s ease;
}
/* открытое меню: две полоски под ±45° крестиком, как в макете */
.burger--open span:nth-child(1) {
transform: translateY(7px) rotate(45deg);
}
.burger--open span:nth-child(2) {
opacity: 0;
}
.burger--open span:nth-child(3) {
transform: translateY(-7px) rotate(-45deg);
}
}