/* Public-site layout for screens narrower than the desktop layout. */
@media screen and (max-width: 899px) {
    body {
        font-size: 14px;
    }

    #main,
    #footer-content {
        box-sizing: border-box;
        width: 100%;
        padding-inline: 16px;
    }

    #main {
        margin-bottom: 16px;
    }

    #header {
        box-sizing: border-box;
        width: 100%;
        height: 68px;
        padding-right: 56px;
        display: flex;
        align-items: center;
    }

    #header > a {
        display: block;
        position: relative;
        width: 184px;
        max-width: 100%;
        height: 44px;
        background: url('/images/routerlv-mobile-logo.png') left center / contain no-repeat;
    }

    #header > a:has(img[src$="routerslt.png"]) {
        background-image: url('/images/routerslt-mobile-logo.png');
    }

    #header > a img,
    #cart img {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

    #cart {
        top: 12px;
        right: 16px;
        z-index: 1;
        width: auto;
        height: auto;
    }

    #cart a {
        position: relative;
        display: grid;
        place-items: center;
        box-sizing: border-box;
        width: 44px;
        height: 44px;
        border: 1px solid #e3e8d9;
        border-radius: 10px;
        background: #f9faf5 url('/images/routerlv-mobile-cart.png') center / 24px no-repeat;
    }

    #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;
    }

    #lang_links,
    #currency_links,
    #head_login,
    #twitter {
        position: static;
        width: auto;
    }

    #lang_links,
    #currency_links,
    #head_login {
        display: inline-flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 5px;
        margin: 4px 7px 4px 0;
        vertical-align: middle;
        text-align: left;
    }

    #lang_links {
        display: flex;
        width: max-content;
        max-width: 100%;
    }

    #lang_links a,
    #currency_links a,
    #head_login .signin {
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        min-height: 36px;
        margin: 0;
        padding: 4px 9px;
        border: 1px solid #e3e8d9;
        border-radius: 7px;
        background: #f9faf5;
        color: #3b4329;
        font-size: 12px;
        line-height: 1.25;
        text-decoration: none;
    }

    #lang_links a.curr_lang,
    #currency_links a.curr_cur,
    #head_login .signin {
        border-color: #425126;
        background: #425126;
        color: #fff;
    }

    #topnav {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 3px 5px;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        margin: 10px 0 14px;
        padding: 5px;
        border: 1px solid #e0e4d6;
        border-radius: 10px;
        background: #fafbf7;
    }

    #topnav a {
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        min-height: 36px;
        height: auto;
        padding: 5px 8px;
        border-radius: 6px;
        background: none;
        color: #3b4329;
        text-decoration: none;
    }

    #topnav a.active {
        background: #e7edda;
    }

    #header a:focus-visible,
    #cart a:focus-visible,
    #lang_links a:focus-visible,
    #currency_links a:focus-visible,
    #head_login a:focus-visible,
    #topnav a:focus-visible {
        outline: 2px solid #61752a;
        outline-offset: 2px;
    }

    #content {
        width: 100%;
        overflow-wrap: anywhere;
    }

    #content:has(> #content-right) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(175px, 27%);
        gap: 16px;
    }

    #content-left,
    #content-right {
        float: none;
        min-width: 0;
        width: auto;
        padding-top: 0;
    }

    #content img,
    #content video,
    #content iframe,
    #content object,
    #content embed {
        max-width: 100% !important;
    }

    #content img,
    #content video {
        height: auto;
    }

    #content input,
    #content select,
    #content textarea,
    #content fieldset {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
    }

    #content input[type="text"],
    #content input[type="email"],
    #content input[type="password"],
    #content input[type="tel"],
    #content select,
    #content textarea {
        font-size: 16px;
    }

    #content table {
        max-width: 100%;
    }

    #content .global-table,
    #content .techspec,
    #content #customers {
        display: block;
        overflow-x: auto;
    }

    #content .fona-laukums,
    #content #main-image img {
        box-sizing: border-box;
        max-width: 100%;
    }

    #content .wrapper-zeni {
        float: none;
        display: flow-root;
    }

    #content .wrapper-zeni .description,
    #content .wrapper-zeni .piedavajums-ligums {
        position: static;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        margin-top: 12px;
        padding: 12px;
    }

    #content .wrapper-zeni .skaits {
        font-size: 42px;
    }

    #calendar-container {
        max-width: 100%;
        overflow-x: auto;
    }

    #calendar-container #calendar {
        min-width: 480px;
    }

    #content pre {
        max-width: 100%;
        overflow: auto;
    }

    #slides {
        margin-bottom: 18px;
    }

    #slides .slides_container,
    #slides .slides_container .slide {
        width: min(520px, 100%);
        height: auto;
        aspect-ratio: 520 / 282;
    }

    #slides .slides_container {
        overflow: hidden;
    }

    #slides .slides_control:not([style*="width"]) {
        width: 100%;
        height: auto;
    }

    #slides .slides_control[style*="width"] > .slide {
        width: calc(100% / 3);
    }

    #slides .slides_control:has(> .slide:only-child),
    #slides .slides_control > .slide:only-child {
        width: 100% !important;
        height: auto !important;
        left: 0 !important;
    }

    #slides .slides_control > .slide:only-child {
        position: relative !important;
    }

    #slides .slides_container .slide img {
        display: block;
        width: 100%;
    }

    #footer {
        position: static;
    }

    #footer-content {
        padding-top: 16px;
        padding-bottom: 12px;
        overflow-wrap: anywhere;
    }

    #footer-links a {
        display: inline-block;
        padding: 5px;
    }

    #fancybox-wrap {
        box-sizing: border-box;
        max-width: 100vw;
    }

    #fancybox-content {
        box-sizing: border-box;
        max-width: 100%;
    }
}

@media screen and (max-width: 620px) {
    #content:has(> #content-right) {
        display: block;
    }

    #content-right {
        margin-top: 20px;
    }

    #content .product_table,
    #content .product_table > tbody,
    #content .product_table > tbody > tr,
    #content .product_table > tbody > tr > td {
        display: block;
        box-sizing: border-box;
        width: 100% !important;
    }

    #content .product_table > tbody > tr > td:last-child {
        padding: 0 10px 10px;
    }

    #content label {
        float: none;
        width: auto;
    }
}

@media screen and (max-width: 359px) {
    #head_login .head-hello {
        order: 1;
    }
}

@media screen and (min-width: 360px) and (max-width: 899px) {
    #header {
        height: 88px;
        padding-right: 219px;
    }

    #cart {
        top: 22px;
    }

    #lang_links,
    #currency_links,
    #head_login {
        position: absolute;
        left: auto;
        z-index: 1;
        margin: 0;
        gap: 4px;
    }

    #lang_links {
        top: 6px;
        right: 70px;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 33px;
    }

    #currency_links {
        top: 46px;
        right: 128px;
    }

    #head_login {
        top: 44px;
        right: 70px;
    }

    #head_login .head-hello {
        position: absolute;
        top: 40px;
        right: 0;
        max-width: 156px;
        margin: 0;
        overflow: hidden;
        color: #f9faf5;
        font-size: 11px;
        line-height: 14px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #lang_links a,
    #currency_links a,
    #head_login .signin {
        min-width: 0;
        min-height: 34px;
        padding: 0;
    }

    #lang_links a,
    #currency_links a {
        min-height: 30px;
    }

    #lang_links a {
        font-size: 0;
    }

    #lang_links a::after {
        font-size: 11px;
        font-weight: 600;
    }

    #lang_links a[href$="lang=lt"]::after  { content: "LT" / ""; }
    #lang_links a[href$="lang=lv"]::after  { content: "LV" / ""; }
    #lang_links a[href$="lang=eng"]::after { content: "EN" / ""; }
    #lang_links a[href$="lang=ru"]::after  { content: "RU" / ""; }

    #currency_links a {
        width: 26px;
    }

    #head_login .signin {
        width: 54px;
    }

    #topnav {
        margin-top: 54px;
    }
}
