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, .sticky-header-nav) 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, .sticky-header-nav) a[href^="/lv/12/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/eng/28/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/ru/23/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/lt/37/"]::before { background-position: -96px 0; }
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/lv/41/"]::before { background-position: -160px 0; }
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/lv/11/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/eng/19/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/ru/24/"]::before { background-position: -208px 0; }
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/lv/14/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/ru/27/"]::before { background-position: -128px 0; }
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/lv/29/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/eng/30/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/ru/38/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/lt/36/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/eng/20/"]::before { background-position: -192px 0; }
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/lv/4/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/eng/15/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/ru/22/"]::before,
:is(.site-header #topnav, .site-sidebar-links, .sticky-header-nav) a[href^="/lt/33/"]::before { background: url('/images/topnav-envelope.png') center / 16px no-repeat; }

.sticky-site-header {
    position: fixed;
    z-index: 400;
    inset: 0 0 auto;
    border-bottom: 1px solid #dce3cb;
    border-radius: 0 0 10px 10px;
    background: #fff;
    box-shadow: 0 4px 13px rgba(48,59,36,.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: transform 230ms ease, opacity 200ms ease, visibility 230ms;
}
.sticky-site-header.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.sticky-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px var(--sticky-inset, 12px);
}
.sticky-header-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-width: 0; }
.sticky-header-nav a, .sticky-header-tools a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 4px 6px;
    box-sizing: border-box;
    border-radius: 5px;
    color: #425126;
    font: 13px/1.2 Tahoma,Arial,sans-serif;
    text-decoration: none;
    white-space: nowrap;
}
.sticky-header-nav a:hover,.sticky-header-nav a.active,.sticky-header-tools a:hover { background-color: #e7edda; }
.sticky-header-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.sticky-header-tools a.signin { margin: 0; float: none; background: #425126; color: #fff; }
.sticky-header-tools a.signin:hover { background: #303b24; }
.sticky-header-tools a.sticky-header-cart {
    position: relative;
    width: 36px;
    height: 34px;
    border: 1px solid #dce3cb;
    background: #f7f9f0 url('/images/routerlv-mobile-cart.png') center / 20px no-repeat;
}
.sticky-header-cart img { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sticky-header-cart:has(img[src*="cart_full"])::after {
    content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px;
    border-radius: 50%; background: #6d831c;
}
.sticky-site-header a:focus-visible { outline: 2px solid #61752a; outline-offset: -2px; }
@media screen and (max-width: 700px) {
    .sticky-header-inner { flex-wrap: wrap; gap: 3px; }
    .sticky-header-nav { width: 100%; padding-bottom: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
    .sticky-header-nav a { flex-shrink: 0; }
    .sticky-header-tools { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .sticky-site-header { transition: none; } }

@media screen and (max-width: 899px) {
    .sticky-site-header { display: none; }
}

.sticky-header-nav a, .sticky-header-tools a { color: #111; font-weight: 700; }
.sticky-header-tools a.signin { background: #e7edda; color: #111; }
.sticky-header-tools a.signin:hover { background: #dce7ca; color: #111; }

.mobile-back-top { display: none; }
@media screen and (max-width: 899px) {
    .mobile-back-top {
        position: fixed;
        right: max(14px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
        z-index: 400;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border: 1px solid #bec9a9;
        border-radius: 50%;
        background: #425126;
        color: #fff;
        box-shadow: 0 3px 12px rgba(48,59,36,.22);
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
        cursor: pointer;
    }
    .mobile-back-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
    .mobile-back-top::before {
        content: '';
        width: 10px;
        height: 10px;
        border-top: 2px solid currentColor;
        border-left: 2px solid currentColor;
        transform: translateY(2px) rotate(45deg);
    }
    .mobile-back-top:focus-visible { outline: 2px solid #61752a; outline-offset: 3px; }
    body:has(.cc-window.cc-banner:not(.cc-invisible)) .mobile-back-top { bottom: 116px; }
}
@media (prefers-reduced-motion: reduce) { .mobile-back-top { transition: none; } }

@media screen and (max-width: 899px) {
    .site-header-bar.has-mobile-controls {
        position: relative;
        z-index: 2;
        isolation: isolate;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-rows: auto;
        box-shadow: none;
        clip-path: none;
    }
    .site-header-bar.has-mobile-controls::before {
        content: '';
        position: absolute;
        z-index: -1;
        inset: 0;
        box-shadow: 0 0 0 100vmax #303b24;
        clip-path: inset(0 -100vmax);
        pointer-events: none;
    }
    .site-header-bar.has-mobile-controls #header { grid-column: 1; grid-row: 1; }
    .site-header-bar.has-mobile-controls .site-header-tools {
        display: flex;
        align-items: center;
        gap: 5px;
        width: auto;
        grid-column: 2;
        grid-row: 1;
    }
    .site-header-bar.has-mobile-controls #cart { grid-column: 3; grid-row: 1; }
    .mobile-header-menu > summary,
    .site-header-bar.has-mobile-controls > .site-header-tools > #head_login .signin {
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 42px;
        min-height: 42px;
        padding: 5px 8px;
        border: 1px solid #6f7d5e;
        border-radius: 8px;
        background: #39462c;
        color: #f2f5eb;
        font: 600 12px/1 Tahoma,Arial,sans-serif;
        cursor: pointer;
        list-style: none;
    }
    .mobile-header-menu > summary::-webkit-details-marker { display: none; }
    .mobile-header-settings > summary { gap: 5px; white-space: nowrap; }
    .mobile-header-settings > summary::after {
        content: '';
        width: 5px;
        height: 5px;
        border-right: 1px solid;
        border-bottom: 1px solid;
        transform: translateY(-2px) rotate(45deg);
    }
    .mobile-header-menu[open] > summary { background: #e4ecd4; color: #303b24; }
    .mobile-header-menu > summary:focus-visible { outline: 2px solid #d6e5ad; outline-offset: 2px; }
    .mobile-header-panel {
        position: absolute;
        z-index: 2;
        top: calc(100% + 5px);
        right: 0;
        width: max-content;
        max-width: 100%;
        box-sizing: border-box;
        padding: 9px;
        border: 1px solid #dce3cb;
        border-radius: 9px;
        background: #fff;
        box-shadow: 0 5px 14px rgba(48,59,36,.2);
    }
    .mobile-header-panel-label { display: block; margin: 0 0 4px; color: #425126; font-size: 13px; font-weight: 700; }
    .mobile-header-panel-label:not(:first-child) { margin-top: 8px; }
    .site-header-bar.has-mobile-controls .mobile-header-panel #lang_links,
    .site-header-bar.has-mobile-controls .mobile-header-panel #currency_links {
        width: auto;
    }
    .site-header-bar.has-mobile-controls .mobile-header-panel #lang_links a,
    .site-header-bar.has-mobile-controls .mobile-header-panel #currency_links a {
        min-width: 36px;
        min-height: 34px;
    }
    .site-header-bar.has-mobile-controls .mobile-header-panel #head_login {
        display: flex;
        align-items: center;
        gap: 7px;
    }
    .site-header-bar.has-mobile-controls .mobile-header-panel #head_login .head-hello {
        max-width: 150px;
        color: #425126;
    }
    .site-header-bar.has-mobile-controls > .site-header-tools > #head_login .signin,
    .mobile-header-account > summary { position: relative; width: 42px; font-size: 0; }
    .site-header-bar.has-mobile-controls > .site-header-tools > #head_login .signin::before,
    .mobile-header-account > summary::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 16px;
        width: 8px;
        height: 8px;
        box-sizing: border-box;
        border: 1.5px solid currentColor;
        border-radius: 50%;
    }
    .site-header-bar.has-mobile-controls > .site-header-tools > #head_login .signin::after,
    .mobile-header-account > summary::after {
        content: '';
        position: absolute;
        left: 13px;
        bottom: 10px;
        width: 14px;
        height: 8px;
        box-sizing: border-box;
        border: 1.5px solid currentColor;
        border-radius: 8px 8px 3px 3px;
    }
}

@media screen and (max-width: 899px) {
    .site-header-bar.has-mobile-controls .site-header-tools {
        display: grid;
        grid-template-columns: max-content 42px;
        grid-template-rows: 42px;
        align-items: center;
    }
    .site-header-bar.has-mobile-controls .site-header-tools > .mobile-header-settings {
        grid-column: 1;
        grid-row: 1;
    }
    .site-header-bar.has-mobile-controls .site-header-tools > #head_login,
    .site-header-bar.has-mobile-controls .site-header-tools > .mobile-header-account {
        grid-column: 2;
        grid-row: 1;
        width: 42px;
        height: 42px;
    }
    .site-header-bar.has-mobile-controls .mobile-header-account > summary {
        border-color: #e4ecd4;
        background: #e4ecd4;
        color: #303b24;
    }
    .site-header-bar.has-mobile-controls .mobile-header-account[open] > summary {
        border-color: #b6c798;
        background: #c9d8ae;
    }
}
