/* Unified Toru-Jüri header. All selectors are scoped to the new header. */
.tj-site-header.site-header {
    margin: 0;
    margin-bottom: 0 !important;
    padding: 0;
    border: 0;
    padding-block: 3px;
    border-bottom: 1px solid #e9ecf1;
    background: linear-gradient(to bottom, #f7f8fa 0 40px, #fff 40px);
    box-shadow: 0 6px 24px rgba(26, 29, 62, .035);
    color: #1a1d3e;
}

.tj-site-header *,
.tj-site-header *::before,
.tj-site-header *::after {
    box-sizing: border-box;
}

.tj-header__inner {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) auto;
    grid-template-rows: 40px 100px 62px;
    grid-template-areas:
        "utility utility cart"
        "brand search search"
        "nav nav language";
    align-items: center;
    column-gap: 24px;
    max-width: 1368px;
    margin: 0 auto;
    padding: 0 24px;
}

.tj-header__utility {
    grid-area: utility;
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    height: 100%;
}

.tj-header__utility-link,
.tj-header__mobile-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #333;
    text-decoration: none;
}

.tj-site-header .tj-header__utility-link {
    font-size: 13px;
    line-height: 1.2;
}

.tj-site-header .tj-header__utility-link:hover,
.tj-site-header .tj-header__mobile-action:hover {
    color: var(--primary, #ea242e);
}

.tj-header__utility-link svg,
.tj-header__mobile-action svg {
    display: block;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tj-header__cart {
    grid-area: cart;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.tj-site-header .tj-header__cart a {
    color: #1a1d3e;
    text-decoration: none;
}

.tj-header__cart-fallback {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    font-size: 13px;
}

.tj-header__cart-fallback svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tj-header__cart-count {
    position: absolute;
    top: 0;
    left: 14px;
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--primary, #ea242e);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.tj-header__brand {
    grid-area: brand;
    display: flex;
    align-items: center;
    min-width: 0;
}

.tj-header__brand .logo,
.tj-header__brand .site-title {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.tj-header__brand .custom-logo-link,
.tj-header__brand .tj-header__site-name {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    color: #1a1d3e;
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
}

.tj-header__brand img {
    display: block;
    width: auto;
    max-width: min(100%, 210px);
    max-height: 66px;
    object-fit: contain;
}

.tj-header__search {
    grid-area: search;
    min-width: 0;
    width: 100%;
}

.tj-header__search .tjps-search {
    width: 100%;
}

.tj-header__desktop-nav {
    grid-area: nav;
    display: flex;
    align-items: center;
    gap: 25px;
    min-width: 0;
    height: 100%;
}

.tj-header__products {
    flex: 0 0 auto;
}

.tj-header__products-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 9px;
    background: var(--primary, #ea242e);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.tj-header__page-nav {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.tj-header__page-nav::-webkit-scrollbar {
    display: none;
}

.tj-site-header .tj-header__page-list {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.4vw, 24px);
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tj-site-header .tj-header__page-list > li {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tj-site-header .tj-header__page-list > li > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    background: transparent;
    color: #1a1d3e;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.tj-site-header .tj-header__page-list > li > a:hover,
.tj-site-header .tj-header__page-list > li.current-menu-item > a {
    color: var(--primary, #ea242e);
}

.tj-header__language {
    grid-area: language;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.tj-header__mobile-menu,
.tj-header__mobile-actions {
    display: none;
}

/* The side-cart plugin provides the explicit cart trigger in this header. */
.xoo-wsc-basket {
    display: none !important;
}

.tj-site-header a:focus-visible,
.tj-site-header button:focus-visible {
    outline: 2px solid var(--primary, #ea242e);
    outline-offset: 3px;
}

.tj-site-header a:focus-visible {
    outline-color: var(--primary, #ea242e) !important;
}

.tj-site-header .tjps-search__input[type="search"] {
    text-transform: none !important;
}

.tj-site-header .tjps-search__input[type="search"]::placeholder {
    text-transform: uppercase;
}

@media (max-width: 1100px) and (min-width: 768px) {
    .tj-header__inner {
        grid-template-columns: 190px minmax(0, 1fr) auto;
        column-gap: 16px;
    }

    .tj-header__desktop-nav {
        gap: 12px;
    }

    .tj-site-header .tj-header__page-list > li > a {
        font-size: 12px;
    }
}

@media (max-width: 767px) {
    .tj-site-header.site-header {
        background: #fff;
    }

    .tj-header__inner {
        grid-template-columns: minmax(0, 1fr) 46px 48px;
        grid-template-rows: 76px auto auto;
        grid-template-areas:
            "brand cart mobile-menu"
            "search search search"
            "language language language";
        column-gap: 10px;
        row-gap: 0;
        padding: 0 14px 12px;
    }

    .tj-header__utility,
    .tj-header__desktop-nav {
        display: none;
    }

    .tj-header__brand img {
        max-width: min(100%, 195px);
        max-height: 55px;
    }

    .tj-header__cart {
        justify-content: center;
    }

    .tj-header__cart-text {
        display: none;
    }

    .tj-header__mobile-menu {
        grid-area: mobile-menu;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        width: 48px;
    }

    .tj-header__mobile-menu .rl-mm-mobile {
        display: inline-flex;
    }

    .tj-site-header .tj-header__mobile-menu .rl-mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        min-width: 48px;
        height: 48px;
        min-height: 48px;
        margin: 0;
        padding: 0;
        border-radius: 9px;
        background: var(--primary, #ea242e);
        color: #fff;
    }

    .tj-site-header .tj-header__mobile-menu .rl-mobile-menu-toggle:hover,
    .tj-site-header .tj-header__mobile-menu .rl-mobile-menu-toggle:focus {
        background: #c71d28;
        color: #fff;
    }

    .tj-header__search {
        padding: 4px 0 12px;
    }

    .tj-header__search .tjps-search__form {
        min-height: 52px;
    }

    .tj-header__language {
        align-self: center;
        justify-self: start;
        justify-content: flex-start;
        padding-top: 5px;
    }

    .tj-header__mobile-actions {
        grid-area: language;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        justify-self: end;
        gap: 3px;
        min-width: 0;
        padding-top: 5px;
    }

    .tj-site-header .tj-header__mobile-action {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 44px;
        min-height: 48px;
        padding: 3px;
        color: #1a1d3e;
        font-size: 10px;
        font-weight: 600;
        line-height: 1;
        text-align: center;
        text-decoration: none;
    }

    .tj-header__mobile-action svg {
        width: 21px;
        height: 21px;
    }
}

@media (max-width: 390px) {
    .tj-header__inner {
        grid-template-columns: minmax(0, 1fr) 42px 44px;
        column-gap: 8px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .tj-site-header .tj-header__mobile-menu .rl-mobile-menu-toggle {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }

    .tj-header__mobile-menu {
        width: 44px;
    }


}

@media (max-width: 340px) {
    .tj-header__inner {
        grid-template-rows: 72px auto auto auto;
        grid-template-areas:
            "brand cart mobile-menu"
            "search search search"
            "language language language"
            "mobile-actions mobile-actions mobile-actions";
    }

    .tj-header__mobile-actions {
        grid-area: mobile-actions;
        justify-self: stretch;
        justify-content: space-around;
    }
}
