/* Shared layout styles — tokens in css/base/tokens.css */
body:has(.site-header) {
    background: #efefef;
    font-family: "Roboto", sans-serif;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

body:has(.site-header) * {
    font-family: inherit;
}

/* Shared header (home + inner pages) */
.yar-logo {
    display: inline-flex;
    align-items: flex-start;
    flex-shrink: 0;
}

.yar-logo__img {
    display: block;
    object-fit: contain;
}

.yar-logo--header {
    flex-shrink: 0;
}

/* Figma «Шапка v1 - 1920»: logo Group 111 = 62.39 × 72 (aspect ≈ 147×170) */
@media (min-width: 768px) {
    .yar-logo--header {
        width: 62px;
        height: 72px;
        overflow: visible;
        align-self: center;
    }

    .yar-logo--header a {
        display: block;
        width: 62px;
        height: 72px;
        line-height: 0;
    }

    .yar-logo--header .yar-logo__img {
        display: block;
        width: 62px;
        height: 72px;
        object-fit: contain;
        object-position: left center;
    }
}

.header-main {
    border-bottom: none !important;
    box-shadow: none !important;
    box-sizing: border-box;
}

.header-main .wrapper {
    max-width: 100%;
    width: 100%;
    height: 100%;
    padding: 0 20px;
    margin: 0;
    box-sizing: border-box;
}

.header-main .header__menu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(8px, 1.2vw, 20px);
    padding: 0 var(--header-inner-pad-x);
    height: 100%;
    box-sizing: border-box;
    min-width: 0;
}

@media (min-width: 2560px) {
    :root {
        --hero-logo-header-left: 80px;
    }
}

@media (max-width: 767px) {
    :root {
        --hero-logo-header-left: 20px;
    }
}

.header-main .header__menu .logo {
    flex-shrink: 0;
}

/* margin, not padding: logo has fixed 62×72 and global box-sizing:border-box */
@media (min-width: 768px) {
    .header-main .header__menu .logo {
        margin-left: var(--hero-logo-header-left);
        padding-left: 0;
    }
}

.header-main .header__menu .login {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
}

.header-main .header__menu .login .account__login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.header-main .menu {
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
    overflow: hidden;
}

.header-main .menu ul {
    font-size: var(--header-menu-font-size);
    font-weight: 400;
    gap: var(--header-menu-gap);
    justify-content: center;
    flex-wrap: nowrap;
    min-width: 0;
}

.header-main .menu ul a {
    color: var(--color-text);
    padding: 8px 0;
    position: relative;
    text-decoration: none;
    white-space: nowrap;
}

.header-main .menu ul a:hover {
    text-decoration: none;
}

.header-main .menu ul a.link_active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: var(--radius-card);
}

.header-main .menu ul .link_active {
    font-weight: 400;
}

.header__actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    flex-shrink: 0;
    gap: 8px;
    margin-left: auto;
}

.header-main .header__actions .login {
    margin-left: 0;
}

.header-main .burger {
    display: none;
}

body:has(.site-header) > .header.header-main.site-header,
.header.header-main.site-header,
.site-header {
    position: relative;
    top: auto;
    z-index: 200;
    width: var(--header-width);
    max-width: var(--header-max-width);
    height: 100px !important;
    min-height: 0;
    margin: var(--header-offset-top) auto 0;
    padding: 0;
    background: #fff;
    border-radius: var(--radius-card);
    border-bottom: none !important;
    box-shadow: none !important;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .site-header {
        width: var(--header-width);
        max-width: var(--header-max-width);
    }

    .header__page-title {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1150px) {
    .header-main .menu {
        display: none !important;
    }

    .header-main .header__menu {
        gap: 8px;
        justify-content: flex-start;
        align-items: center;
        padding-left: var(--header-inner-pad-x);
        padding-right: var(--header-inner-pad-x);
    }

    .header-main .burger {
        display: block !important;
        flex: 0 0 20px;
        width: 20px;
        min-width: 20px;
        height: 20px;
        min-height: 20px;
        position: relative;
        margin-top: 0;
        margin-left: 0;
        align-self: center;
        cursor: pointer;
        z-index: 2000;
    }

    .header-main .burger span {
        top: 9px;
        height: 2px;
        width: 100%;
        background: #000;
        position: absolute;
        left: 0;
    }

    .header-main .burger span::before {
        top: -7px;
        height: 2px;
        width: 100%;
        background: #000;
        position: absolute;
        left: 0;
        content: "";
    }

    .header-main .burger span::after {
        top: 7px;
        height: 2px;
        width: 100%;
        background: #000;
        position: absolute;
        left: 0;
        content: "";
    }

    .header-main .header__menu .logo {
        margin-left: var(--hero-logo-header-left);
        padding-left: 0;
    }

    .header__actions {
        margin-left: auto;
        gap: 8px;
    }

    .header__page-title {
        display: block !important;
        flex: 0 1 auto;
        width: fit-content;
        max-width: 100%;
        min-width: 0;
        text-align: left;
        font-size: 14px;
        font-weight: 400;
        line-height: normal;
        color: var(--color-text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 0 3px;
        position: relative;
        align-self: center;
    }

    .header__page-title::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: 2px;
        background: var(--color-primary);
        border-radius: 30px;
    }
}

@media (max-width: 1200px) {
    .header-main .menu ul a {
        padding-left: 0;
        padding-right: 0;
    }
}

@media (max-width: 992px) {
    .header-main .menu ul a {
        padding-left: 0;
        padding-right: 0;
        font-size: clamp(12px, 1.1vw, 14px);
    }
}


/* Legacy header / mobile nav (from style.css) */
.header {
    height: 125px;
    background-color: #ffffff;
    z-index: 200;
    border-bottom: 1px solid #797979;
    position: relative;
    top: auto;
}

.header__menu {
    font-weight: 300;
    display: flex;
    justify-content: space-between;
    vertical-align: middle;
    padding: 27px 0;
}

.header__menu .logo {
    font-size: 36px;
    font-weight: 700;
}

.header__menu .logo img {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    margin-bottom: auto;
}

.header__menu .login {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    margin-bottom: auto;
}

.header-main .header__menu .login {
    flex-direction: row;
    margin-top: 0;
    margin-bottom: 0;
}

.burger {
    display: none;
}

.menu {
    height: 30px;
    display: flex;
    flex-direction: column;
    margin-top: auto;
    margin-bottom: auto;
}

.menu ul {
    padding: 0;
    margin-top: auto;
    margin-bottom: auto;
    list-style: none;
    display: flex;
    justify-content: space-between;
    font-weight: 300;
    font-size: 24px;
    letter-spacing: 0;
    line-height: 100%;
}

.menu ul a {
    color: #494949;
    text-decoration: none;
    padding-right: 35px;
}

.menu ul a:hover {
    text-decoration: underline;
}

.menu ul .link_active {
    text-decoration: none;
    font-weight: 500;
}

.mobile_menu {
    display: block;
    background-color: #ffffff;
    width: 320px;
    height: 100%;
    position: fixed;
    border-bottom: 1px #E0E0E0 solid;
    border-right: 1px #E0E0E0 solid;
    border-top: 1px #E0E0E0 solid;
    left: -1000px;
    transition: all ease 1s;
    z-index: 1500;
}

.mobile_menu ul {
    margin-top: 125px;
    list-style: none;
    font-size: 26px;
    padding-left: 0;
}

.mobile_menu ul li {
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 30px;
    border: 1px solid #E0E0E0;
}

.mobile_menu ul li:hover a {
    text-decoration: none;
}

.burger__active {
    left: 0;
    transition: all ease 1s;
}

html.header--no-transition,
html.header--no-transition * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
}

@media screen and (max-width: 1919px) {
    .menu ul {
        font-size: 16px;
    }
}

@media (max-width: 1359px) {
    .header__menu .logo {
        margin-right: 35px;
        padding-right: 0;
    }

    .menu ul {
        font-size: 15px;
    }
}

@media (max-width: 1239px) {
    .menu ul {
        font-size: 13px;
    }
}

@media (max-width: 1100px) {
    .header:not(.header-main) .menu {
        display: none;
    }

    .header:not(.header-main) .header__menu {
        justify-content: space-around;
    }

    .header:not(.header-main) .header__menu .logo {
        padding-right: 0;
    }

    .header:not(.header-main) .header__menu .logo img {
        margin-right: 0;
    }

    .header:not(.header-main) .burger {
        display: block;
        width: 50px;
        position: relative;
        cursor: pointer;
        margin-top: 15px;
        z-index: 2000;
    }

    .header:not(.header-main) .burger span {
        content: '';
        height: 3px;
        width: 100%;
        background: #000000;
        position: absolute;
        top: 20px;
        z-index: 200;
    }

    .header:not(.header-main) .burger span::after {
        content: '';
        height: 3px;
        width: 100%;
        background: #000000;
        position: absolute;
        bottom: 10px;
        z-index: 200;
    }

    .header:not(.header-main) .burger span::before {
        content: '';
        height: 3px;
        width: 100%;
        background: #000000;
        position: absolute;
        top: 10px;
        z-index: 200;
    }

    .header:not(.header-main) .cross {
        display: block;
        width: 50px;
        height: 50px;
        position: relative;
        cursor: pointer;
        top: 40px;
        left: 30px;
        z-index: 2000;
    }

    .header:not(.header-main) .cross span {
        content: '';
        height: 3px;
        width: 0;
    }

    .header:not(.header-main) .cross span::after {
        content: '';
        height: 3px;
        width: 100%;
        background: #000000;
        position: absolute;
        bottom: 27px;
        z-index: 200;
        transform: rotate(135deg);
    }

    .header:not(.header-main) .cross span::before {
        content: '';
        height: 3px;
        width: 100%;
        background: #000000;
        position: absolute;
        top: 20px;
        z-index: 200;
        transform: rotate(45deg);
    }

    .account__login img {
        margin-right: 0;
    }
}

.header-avatar-img {
    max-width: 53px !important;
    max-height: 53px !important;
    border-radius: 50%;
    object-fit: cover;
}
