body:has(.site-header) { background: #fafbf8; }

.site-header {
    margin-bottom: 20px;
    color: #eef2e5;
}
.site-header-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 12px 12px 0 0;
    background: #303b24;
}
.site-header #header {
    position: static;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 0;
}
.site-header #header > a {
    display: block;
    position: relative;
    width: 184px;
    max-width: 100%;
    height: 42px;
    background: url('/images/routerlv-mobile-logo.png') left center / contain no-repeat;
}
.site-header #header > a:has(img[src$="routerslt.png"]) {
    background-image: url('/images/routerslt-mobile-logo.png');
}
.site-header #header img, .site-header #cart img {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.site-header-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px 12px;
}
.site-header #lang_links, .site-header #currency_links, .site-header #head_login {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    width: auto;
    margin: 0;
}
.site-header #lang_links a, .site-header #currency_links a, .site-header #head_login .signin {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    float: none;
    min-width: 30px;
    min-height: 32px;
    width: auto;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid #6f7d5e;
    border-radius: 6px;
    background: #3b472d;
    color: #f2f5eb;
    font: 12px/1.2 Tahoma, Arial, sans-serif;
    text-decoration: none;
}
.site-header #lang_links a.curr_lang, .site-header #currency_links a.curr_cur,
.site-header #head_login .signin, .site-header #lang_links a:hover, .site-header #currency_links a:hover {
    border-color: #e4ecd4;
    background: #e4ecd4;
    color: #303b24;
}
.site-header #head_login .signin:hover { background: #fff; }
.site-header #head_login .head-hello {
    position: static;
    display: block;
    max-width: 135px;
    margin: 0;
    color: #e4ecd4;
    font: 12px/1.2 Tahoma, Arial, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-header #cart {
    position: static;
    width: auto;
    height: auto;
}
.site-header #cart a {
    position: relative;
    display: block;
    width: 44px;
    height: 44px;
    border: 1px solid #e4ecd4;
    border-radius: 9px;
    background: #f7f9f0 url('/images/routerlv-mobile-cart.png') center / 24px no-repeat;
}
.site-header #cart a:has(img[src*="cart_full"])::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #6d831c;
}
.site-header #topnav {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 7px;
    border: 1px solid #dce3cb;
    border-radius: 0 0 12px 12px;
    background: #fff;
}
.site-header #topnav a {
    display: inline-flex;
    align-items: center;
    float: none;
    min-height: 36px;
    height: auto;
    padding: 5px 10px;
    border-radius: 6px;
    background: none;
    color: #3b482b;
    font-size: 13px;
    text-decoration: none;
}
.site-header #topnav a.active, .site-header #topnav a:hover { background: #e7edda; }
.site-header a:focus-visible { outline: 2px solid #aebd88; outline-offset: 2px; }

@media screen and (max-width: 899px) {
    .site-header { margin-top: 8px; margin-bottom: 14px; }
    .site-header-bar { gap: 8px; padding: 9px; }
    .site-header-tools {
        display: grid;
        width: 145px;
        grid-template-columns: 90px 51px;
        gap: 4px;
        justify-content: start;
    }
    .site-header #lang_links { grid-column: 1 / -1; }
    .site-header #lang_links a, .site-header #currency_links a, .site-header #head_login .signin {
        min-height: 29px;
        padding: 0;
    }
    .site-header #lang_links a { width: 32px; font-size: 0; }
    .site-header #lang_links a::after { font-size: 11px; font-weight: 600; }
    .site-header #lang_links a[href$="lang=lt"]::after { content: "LT" / ""; }
    .site-header #lang_links a[href$="lang=lv"]::after { content: "LV" / ""; }
    .site-header #lang_links a[href$="lang=eng"]::after { content: "EN" / ""; }
    .site-header #lang_links a[href$="lang=ru"]::after { content: "RU" / ""; }
    .site-header #currency_links a { min-width: 26px; }
    .site-header #head_login .signin { width: 51px; }
    .site-header #head_login:has(.head-hello) { display: contents; }
    .site-header #head_login .head-hello { grid-row: 3; grid-column: 1 / -1; max-width: 100%; }
    .site-header #head_login .signin { grid-row: 2; grid-column: 2; }
}

@media screen and (max-width: 359px) {
    .site-header-bar { grid-template-columns: minmax(0, 1fr) auto; }
    .site-header #header { grid-column: 1; grid-row: 1; }
    .site-header #cart { grid-column: 2; grid-row: 1; }
    .site-header-tools { grid-column: 1 / -1; grid-row: 2; }
}

.site-header { margin-top: 0; }
.site-header-bar {
    border-radius: 0;
    box-shadow: 0 0 0 100vmax #303b24;
    clip-path: inset(0 -100vmax);
}
.site-header #topnav { padding-inline-start: 0; }
.site-header #lang_links, .site-header #currency_links {
    box-sizing: border-box;
    justify-self: start;
    width: max-content;
    padding: 2px;
    gap: 1px;
    border: 1px solid #6f7d5e;
    border-radius: 6px;
    background: #39462c;
}
.site-header #lang_links a, .site-header #currency_links a {
    min-width: 24px;
    min-height: 23px;
    width: auto;
    padding: 2px 6px;
    border: 0;
    border-radius: 3px;
    background: transparent;
}
.site-header #lang_links a { font-size: 0; }
.site-header #lang_links a::after { font-size: 11px; font-weight: 600; }
.site-header #lang_links a[href$="lang=lt"]::after { content: "LT" / ""; }
.site-header #lang_links a[href$="lang=lv"]::after { content: "LV" / ""; }
.site-header #lang_links a[href$="lang=eng"]::after { content: "EN" / ""; }
.site-header #lang_links a[href$="lang=ru"]::after { content: "RU" / ""; }
.site-header #lang_links a.curr_lang, .site-header #currency_links a.curr_cur,
.site-header #lang_links a:hover, .site-header #currency_links a:hover {
    background: #e4ecd4;
    color: #303b24;
}
@media screen and (max-width: 899px) {
    .site-header-tools { width: 137px; grid-template-columns: 82px 51px; }
    .site-header #lang_links a, .site-header #currency_links a { min-height: 25px; padding-inline: 5px; }
}

#container { container-type: inline-size; }
.site-header #topnav {
    position: relative;
    isolation: isolate;
    border-color: transparent;
    background: transparent;
}
.site-header #topnav::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset-block: -1px;
    left: 50%;
    width: 100cqw;
    box-sizing: border-box;
    transform: translateX(-50%);
    border: 1px solid #dce3cb;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: #fff;
    pointer-events: none;
}
@media screen and (min-width: 1024px) {
    #main { width: min(calc(100% - 40px), 1250px); }
    #main > #content { width: 100%; }
    #main > #content:has(> #content-right) > #content-left { width: calc(100% - 289px); }
}

.site-header #head_login .signin[href="/logout.php"] {
    min-height: 29px;
    padding: 2px 6px;
    border-color: #6f7d5e;
    background: #39462c;
    color: #f2f5eb;
}
.site-header #head_login .signin[href="/logout.php"]:hover {
    border-color: #e4ecd4;
    background: #e4ecd4;
    color: #303b24;
}
@media screen and (max-width: 899px) {
    .site-header #head_login .signin[href="/logout.php"] { min-height: 31px; }
}

.site-header #topnav a { gap: 6px; }
:is(.site-header #topnav, .site-sidebar-links) a::before {
    content: '';
    flex: 0 0 16px;
    height: 16px;
    background: url('/images/catalog-category-icons.png') no-repeat 0 0 / 240px 16px;
}
:is(.site-header #topnav, .site-sidebar-links) a[href^="/lv/12/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/eng/28/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/ru/23/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/lt/37/"]::before { background-position: -96px 0; }
:is(.site-header #topnav, .site-sidebar-links) a[href^="/lv/41/"]::before { background-position: -160px 0; }
:is(.site-header #topnav, .site-sidebar-links) a[href^="/lv/11/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/eng/19/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/ru/24/"]::before { background-position: -208px 0; }
:is(.site-header #topnav, .site-sidebar-links) a[href^="/lv/14/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/ru/27/"]::before { background-position: -128px 0; }
:is(.site-header #topnav, .site-sidebar-links) a[href^="/lv/29/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/eng/30/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/ru/38/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/lt/36/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/eng/20/"]::before { background-position: -192px 0; }
:is(.site-header #topnav, .site-sidebar-links) a[href^="/lv/4/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/eng/15/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/ru/22/"]::before,
:is(.site-header #topnav, .site-sidebar-links) a[href^="/lt/33/"]::before { background: url('/images/topnav-envelope.png') center / 16px no-repeat; }
