@font-face {
	font-weight: normal;
	font-style: normal;
	font-family: "woodmart-font";
	src: url("//rast-anhaenger.com/wp-content/themes/woodmart/fonts/woodmart-font-1-400.woff2?v=7.3.2") format("woff2");
}

.wd-popup.wd-promo-popup{
	background-color:rgb(248,248,248);
	background-image: url(https://rast-anhaenger.com/wp-content/uploads/2022/05/popup-banner.jpg);
	background-repeat:no-repeat;
	background-size:cover;
	background-position:center center;
}

.page-title-default{
	background-color:rgb(15,23,42);
	background-image: none;
	background-size:cover;
	background-position:center center;
}

.footer-container{
	background-color:rgb(6,21,43);
	background-image: none;
}

:root{
--wd-text-font:"Poppins", Arial, Helvetica, sans-serif;
--wd-text-font-weight:400;
--wd-text-color:#777777;
--wd-text-font-size:16px;
}
:root{
--wd-title-font:"Rajdhani", Arial, Helvetica, sans-serif;
--wd-title-font-weight:700;
--wd-title-color:#242424;
}
:root{
--wd-entities-title-font:"Rajdhani", Arial, Helvetica, sans-serif;
--wd-entities-title-font-weight:700;
--wd-entities-title-transform:none;
--wd-entities-title-color:rgb(36,36,36);
--wd-entities-title-color-hover:rgb(51 51 51 / 65%);
}
:root{
--wd-alternative-font:"Poppins", Arial, Helvetica, sans-serif;
}
:root{
--wd-widget-title-font:"Mulish", Arial, Helvetica, sans-serif;
--wd-widget-title-font-weight:700;
--wd-widget-title-transform:none;
--wd-widget-title-color:#333;
--wd-widget-title-font-size:16px;
}
:root{
--wd-header-el-font:"Rajdhani", Arial, Helvetica, sans-serif;
--wd-header-el-font-weight:700;
--wd-header-el-transform:capitalize;
--wd-header-el-font-size:14px;
}
html .wd-nav.wd-nav-secondary > li > a{
	font-family: "Mulish", Arial, Helvetica, sans-serif;font-weight: 800;
}

html .product.category-grid-item .wd-entities-title, html .product.category-grid-item.cat-design-replace-title .wd-entities-title, html .categories-style-masonry-first .category-grid-item:first-child .wd-entities-title, html .product.wd-cat .wd-entities-title{
	font-size: 18px;text-transform: none;
}

@media (max-width: 767px){
html .product.category-grid-item .wd-entities-title, html .product.category-grid-item.cat-design-replace-title .wd-entities-title, html .categories-style-masonry-first .category-grid-item:first-child .wd-entities-title, html .product.wd-cat .wd-entities-title{
	font-size: 16px;
}

}
html .wd-nav-mobile > li > a{
	text-transform: none;
}

.whb-general-header .wd-nav.wd-nav-secondary > li > a{
	font-weight: 400;color: rgb(119,119,119);
}

.whb-general-header .wd-nav.wd-nav-secondary > li:hover > a, .whb-general-header .wd-nav.wd-nav-secondary > li.current-menu-item > a{
	color: rgb(36,36,36);
}

:root{
--wd-primary-color:#0B1F33;
}
:root{
--wd-alternative-color:rgb(200,169,107);
}
:root{
--wd-link-color:rgb(11,31,51);
--wd-link-color-hover:rgb(176,141,79);
}
.page .main-page-wrapper{
	background-color:rgb(255,255,255);
	background-image: none;
}

.woodmart-archive-shop:not(.single-product) .main-page-wrapper{
	background-color:rgb(255,255,255);
	background-image: none;
}

.woodmart-archive-blog .main-page-wrapper{
	background-color:rgb(249,250,251);
	background-image: none;
}

.woodmart-archive-portfolio .main-page-wrapper{
	background-color:rgb(243,244,246);
	background-image: none;
}

:root{
--btn-default-font-family:"Rajdhani", Arial, Helvetica, sans-serif;
--btn-default-font-weight:700;
--btn-default-transform:uppercase;
}
:root{
--btn-default-bgcolor:rgb(11,31,51);
}
:root{
--btn-default-bgcolor-hover:rgb(200,169,107);
}
:root{
--btn-accented-font-family:"Rajdhani", Arial, Helvetica, sans-serif;
--btn-accented-font-weight:700;
--btn-accented-transform:uppercase;
}
:root{
--btn-accented-bgcolor:#C8A96B;
}
:root{
--btn-accented-bgcolor-hover:rgb(11,31,51);
}
html .entry-summary .single_add_to_cart_button, .wd-single-add-cart .single_add_to_cart_button, html .wd-sticky-btn-cart .single_add_to_cart_button, html .wd-sticky-add-to-cart, html .wd-sticky-btn.wd-quantity-overlap div.quantity input[type]{
	font-family: "Rajdhani", Arial, Helvetica, sans-serif;font-weight: 700;color: rgb(255,255,255);background: rgb(11,31,51);
}

html .entry-summary .single_add_to_cart_button:hover, .wd-single-add-cart .single_add_to_cart_button:hover, html .wd-sticky-btn-cart .single_add_to_cart_button:hover, html .wd-sticky-add-to-cart:hover, html .wd-sticky-btn.wd-quantity-overlap .cart:hover > div.quantity input[type], html .wd-sticky-btn.wd-quantity-overlap .cart:hover > div.quantity+.button{
	color: rgb(24,33,43);background: rgb(200,169,107);
}

:root{
--notices-success-bg:#459647;
}
:root{
--notices-success-color:#fff;
}
:root{
--notices-warning-bg:#E0B252;
}
:root{
--notices-warning-color:#fff;
}
.product-labels .product-label.onsale{
	background-color:rgb(249,115,22);
}

.product-labels .product-label.new{
	background-color:rgb(15,23,42);
}


	:root{
					
			
							--wd-form-brd-radius: 0px;
					
					--wd-form-brd-width: 0px;
		
					--btn-default-color: #fff;
		
					--btn-default-color-hover: #333;
		
					--btn-accented-color: #333;
		
					--btn-accented-color-hover: #fff;
		
					
			
							--btn-default-brd-radius: 35px;
				--btn-default-box-shadow: none;
				--btn-default-box-shadow-hover: none;
			
					
					
			
							--btn-accented-brd-radius: 35px;
				--btn-accented-box-shadow: none;
				--btn-accented-box-shadow-hover: none;
			
					
									--wd-sticky-btn-height: 95px;
					
					--wd-brd-radius: 0px;
		
			}

			@media (max-width: 1024px) {
			:root {
				--wd-sticky-btn-height: 95px;
			}
		}
	
			@media (max-width: 768px) {
			:root {
				--wd-sticky-btn-height: 42px;
			}
		}
	
			:root{
			--wd-container-w: 1222px;
		}
	
			@media (min-width: 1239px) {
			.platform-Windows .wd-section-stretch > .elementor-container {
				margin-left: auto;
				margin-right: auto;
			}
		}
		@media (min-width: 1222px) {
			html:not(.platform-Windows) .wd-section-stretch > .elementor-container {
				margin-left: auto;
				margin-right: auto;
			}
		}
	
			div.wd-popup.popup-quick-view {
			max-width: 920px;
		}
	
	
	
	
			.woodmart-woocommerce-layered-nav .wd-scroll-content {
			max-height: 223px;
		}
	
	
	body, [class*=color-scheme-light], [class*=color-scheme-dark], .wd-search-form[class*="wd-header-search-form"] form.searchform, .wd-el-search .searchform {

									--wd-form-color: rgb(119,119,119);
					
									--wd-form-placeholder-color: rgb(119,119,119);
					
							
							
									--wd-form-bg: rgba(15,15,15,0.04);
						}
<?php
/**
 * =========================================================
 * RAST ANHAENGER - COMPLETE HEADER + DESIGN CSS
 * + ONE ROW MENU + AUTOMATIC MORE BUTTON
 * =========================================================
 */


/* =========================================================
   1. ADD CSS + JAVASCRIPT TO FRONTEND
   ========================================================= */

add_action('wp_footer', function () {
    if (is_admin()) {
        return;
    }
    ?>

<style>

/* =========================================================
   RAST COLOUR SYSTEM
   ========================================================= */

:root {
    --rast-green: #18352F;
    --rast-dark-green: #102620;
    --rast-gold: #C8A96B;
    --rast-ivory: #F7F3E8;
    --rast-light-cream: #EFE9DA;
    --rast-white: #FFFFFF;
    --rast-text: #18352F;
    --rast-border: #D8D0BD;
    --rast-hero: #292A27;
}


/* =========================================================
   2. PRODUCT OLD PRICE HIDE
   ========================================================= */

.price del,
.product-grid-item .price del,
.single-product .summary-inner > .price del,
.woodmart-hover-base .price del,
.cart-subtotal .amount del {
    display: none !important;
}


/* =========================================================
   3. PRODUCT GRID
   ========================================================= */

.product-grid-item {
    border: 1px solid #E1E1E1 !important;
    transition: all 0.3s ease-in-out !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #FFFFFF !important;
}

.product-grid-item:hover {
    border-color: #C8A96B !important;
    box-shadow: 0 10px 25px rgba(24,53,47,0.12) !important;
    transform: translateY(-5px) !important;
}


/* =========================================================
   4. PRODUCT TITLE
   ========================================================= */

.wd-entities-title,
.product-grid-item .wd-entities-title,
.woodmart-product-title a {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;

    height: 3.2em !important;
    min-height: 3.2em !important;
    line-height: 1.5em !important;

    white-space: normal !important;
    text-align: center !important;

    margin-bottom: 8px !important;
    word-break: break-word !important;
}


/* =========================================================
   5. STAR RATING + PRICE
   ========================================================= */

.star-rating {
    margin: 10px auto !important;
    min-height: 18px !important;
}

.price ins,
.price > .amount {
    text-decoration: none !important;
    font-weight: bold !important;
}


/* =========================================================
   6. CONTACT SECTION
   ========================================================= */

.contact-wrapper {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.contact-info {
    flex: 1;
    min-width: 280px;
    padding: 35px;
    border-radius: 16px;

    color: #FFFFFF !important;

    background: linear-gradient(
        135deg,
        #18352F,
        #102620
    ) !important;
}

.contact-form-box {
    flex: 1;
    min-width: 300px;

    background: #FFFFFF !important;
    padding: 35px;

    border-radius: 16px;
    border: 1px solid #E5E1D7;

    box-shadow: 0 10px 25px rgba(24,53,47,0.08);
}

.contact-form-box input[type="submit"] {
    width: 100%;
    padding: 14px;

    border: none;
    border-radius: 8px;

    background: #C8A96B !important;
    color: #18352F !important;

    font-weight: 700;
    cursor: pointer;

    transition: all 0.3s ease;
}

.contact-form-box input[type="submit"]:hover {
    background: #18352F !important;
    color: #FFFFFF !important;
}


/* =========================================================
   7. MAIN HEADER - IVORY
   ========================================================= */

body .whb-main-header {
    background-color: #F7F3E8 !important;
}


/* Main menu text */

body .whb-main-header .wd-nav > li > a,
body .whb-main-header .wd-nav.wd-style-default > li > a,
body .whb-header .whb-main-header .wd-nav > li > a,
body .whb-header .whb-row .wd-nav-main > li > a {

    color: #18352F !important;

    font-family: 'Rajdhani', sans-serif !important;

    font-weight: 600 !important;

    font-size: 15px !important;

    opacity: 1 !important;

    transition: all 0.3s ease !important;
}


/* Hover */

body .whb-main-header .wd-nav > li:hover > a,
body .whb-main-header .wd-nav.wd-style-default > li:hover > a,
body .whb-header .whb-main-header .wd-nav > li:hover > a,
body .whb-header .whb-row .wd-nav-main > li:hover > a {

    color: #C8A96B !important;
}


/* Arrows */

body .whb-main-header .wd-nav > li > a:after,
body .whb-main-header .wd-nav.wd-style-default > li > a:after,
body .whb-header .whb-row .wd-nav-main > li > a:after {

    color: #18352F !important;
}

body .whb-main-header .wd-nav > li:hover > a:after,
body .whb-main-header .wd-nav.wd-style-default > li:hover > a:after,
body .whb-header .whb-row .wd-nav-main > li:hover > a:after {

    color: #C8A96B !important;
}


/* Remove faded text */

body .whb-main-header .wd-nav-link .nav-link-text,
body .whb-header .wd-nav-link .nav-link-text {
    opacity: 1 !important;
}


/* =========================================================
   8. IMPORTANT:
   REMOVE OLD 6-COLUMN GRID
   KEEP MENU IN ONE ROW
   ========================================================= */

body .whb-main-header .wd-nav.wd-style-default {

    display: flex !important;

    flex-wrap: nowrap !important;

    align-items: center !important;

    justify-content: flex-end !important;

    gap: 0 !important;

    text-align: left !important;

    width: 100% !important;
}


/* Menu items */

body .whb-main-header .wd-nav.wd-style-default > li {

    margin: 0 !important;

    flex: 0 0 auto !important;
}


/* Menu links */

body .whb-main-header .wd-nav.wd-style-default > li > a {

    white-space: nowrap !important;

    font-size: 13px !important;

    padding-left: 16px !important;

    padding-right: 16px !important;

    justify-content: center !important;
}


/* =========================================================
   9. AUTOMATIC MORE BUTTON
   ========================================================= */

.rast-more-menu-item {
    position: relative !important;

    flex: 0 0 auto !important;

    display: none !important;

    margin-left: 5px !important;
}


/* More button */

.rast-more-menu-button {

    display: inline-flex !important;

    align-items: center !important;

    justify-content: center !important;

    gap: 7px !important;

    padding: 8px 14px !important;

    border: 1px solid #C8A96B !important;

    border-radius: 5px !important;

    background: #18352F !important;

    color: #FFFFFF !important;

    font-family: 'Rajdhani', sans-serif !important;

    font-size: 13px !important;

    font-weight: 700 !important;

    line-height: 1 !important;

    white-space: nowrap !important;

    cursor: pointer !important;

    transition: all 0.25s ease !important;
}


/* More hover */

.rast-more-menu-button:hover {

    background: #C8A96B !important;

    color: #18352F !important;
}


/* More arrow */

.rast-more-arrow {

    font-size: 11px !important;

    transition: transform 0.25s ease !important;
}


/* Rotate arrow */

.rast-more-menu-item.rast-more-open .rast-more-arrow {

    transform: rotate(180deg) !important;
}


/* =========================================================
   10. MORE DROPDOWN
   ========================================================= */

.rast-more-dropdown {

    position: absolute !important;

    top: calc(100% + 10px) !important;

    right: 0 !important;

    min-width: 230px !important;

    max-width: 300px !important;

    padding: 8px !important;

    background: #FFFFFF !important;

    border: 1px solid #D8D0BD !important;

    border-radius: 8px !important;

    box-shadow: 0 12px 35px rgba(0,0,0,0.18) !important;

    z-index: 999999 !important;

    display: none !important;
}


/* Open dropdown */

.rast-more-menu-item.rast-more-open .rast-more-dropdown {

    display: block !important;
}


/* Dropdown item */

.rast-more-dropdown a {

    display: block !important;

    padding: 11px 14px !important;

    border-radius: 5px !important;

    color: #18352F !important;

    background: #FFFFFF !important;

    font-family: 'Rajdhani', sans-serif !important;

    font-size: 14px !important;

    font-weight: 600 !important;

    text-decoration: none !important;

    white-space: nowrap !important;

    transition: all 0.2s ease !important;
}


/* Dropdown hover */

.rast-more-dropdown a:hover {

    background: #F7F3E8 !important;

    color: #C8A96B !important;
}


/* =========================================================
   11. HEADER BOTTOM
   FOREST GREEN
   ========================================================= */

body .whb-header-bottom,
body .whb-header-bottom .whb-row,
body .whb-header-bottom .whb-row-inner,

body .whb-secondary-menu,
body .whb-secondary-menu .whb-row,
body .whb-secondary-menu .whb-row-inner {

    background-color: #18352F !important;
}


/* =========================================================
   12. BOTTOM HEADER TEXT
   ========================================================= */

body .whb-header-bottom .wd-nav > li > a,
body .whb-secondary-menu .wd-nav > li > a,

body .whb-header-bottom .wd-nav > li > a .nav-link-text,
body .whb-secondary-menu .wd-nav > li > a .nav-link-text {

    color: #FFFFFF !important;

    opacity: 1 !important;
}


/* Hover */

body .whb-header-bottom .wd-nav > li:hover > a,
body .whb-secondary-menu .wd-nav > li:hover > a,

body .whb-header-bottom .wd-nav > li:hover > a .nav-link-text,
body .whb-secondary-menu .wd-nav > li:hover > a .nav-link-text {

    color: #C8A96B !important;
}


/* =========================================================
   13. BOTTOM HEADER ICONS
   ========================================================= */

body .whb-header-bottom .wd-nav > li > a i,
body .whb-header-bottom .wd-nav > li > a svg,

body .whb-secondary-menu .wd-nav > li > a i,
body .whb-secondary-menu .wd-nav > li > a svg {

    color: #C8A96B !important;
}


/* =========================================================
   14. BOTTOM HEADER LINKS
   ========================================================= */

body .whb-header-bottom a,
body .whb-secondary-menu a {

    color: #FFFFFF !important;

    opacity: 1 !important;
}

body .whb-header-bottom a:hover,
body .whb-secondary-menu a:hover {

    color: #C8A96B !important;
}


/* =========================================================
   15. SEARCH BOX
   ========================================================= */

body .whb-header-bottom .searchform,
body .whb-secondary-menu .searchform {

    background-color: #FFFFFF !important;

    border-color: #D8D0BD !important;
}


body .whb-header-bottom .searchform input,
body .whb-secondary-menu .searchform input {

    color: #18352F !important;

    background: #FFFFFF !important;
}


body .whb-header-bottom .searchform input::placeholder,
body .whb-secondary-menu .searchform input::placeholder {

    color: #6B756F !important;

    opacity: 1 !important;
}


/* =========================================================
   16. WISHLIST / COMPARE / CART
   ========================================================= */

body .whb-header-bottom .wd-tools-element > a,
body .whb-secondary-menu .wd-tools-element > a {

    color: #FFFFFF !important;
}


body .whb-header-bottom .wd-tools-element > a:hover,
body .whb-secondary-menu .wd-tools-element > a:hover {

    color: #C8A96B !important;
}


body .whb-header-bottom .wd-tools-element svg,
body .whb-header-bottom .wd-tools-element i,

body .whb-secondary-menu .wd-tools-element svg,
body .whb-secondary-menu .wd-tools-element i {

    color: #FFFFFF !important;
}


body .whb-header-bottom .wd-tools-element:hover svg,
body .whb-header-bottom .wd-tools-element:hover i,

body .whb-secondary-menu .wd-tools-element:hover svg,
body .whb-secondary-menu .wd-tools-element:hover i {

    color: #C8A96B !important;
}


/* =========================================================
   17. ANNOUNCEMENT BAR
   ========================================================= */

body .marquee-container {

    width: 100% !important;

    overflow: hidden !important;

    background: #18352F !important;

    border: none !important;

    border-bottom: 1px solid #C8A96B !important;
}


body .marquee-content span {

    color: #F7F3E8 !important;
}


/* =========================================================
   18. BUTTONS
   ========================================================= */

body .button,
body .btn,
body .add_to_cart_button,
body .wd-buy-btn {

    background-color: #18352F !important;

    color: #FFFFFF !important;

    transition: all 0.3s ease !important;
}


body .button:hover,
body .btn:hover,
body .add_to_cart_button:hover,
body .wd-buy-btn:hover {

    background-color: #C8A96B !important;

    color: #18352F !important;
}


/* =========================================================
   19. SINGLE PRODUCT CART
   ========================================================= */

body .single_add_to_cart_button {

    background-color: #18352F !important;

    color: #FFFFFF !important;
}


body .single_add_to_cart_button:hover {

    background-color: #C8A96B !important;

    color: #18352F !important;
}


/* =========================================================
   20. CTA BUTTONS
   ========================================================= */

body .wd-button-wrapper .wd-button,
body .wd-button-wrapper .btn {

    background-color: #C8A96B !important;

    color: #18352F !important;
}


body .wd-button-wrapper .wd-button:hover,
body .wd-button-wrapper .btn:hover {

    background-color: #18352F !important;

    color: #FFFFFF !important;
}


/* =========================================================
   21. SALE BADGE
   ========================================================= */

body .onsale,
body .product-label.onsale {

    background-color: #18352F !important;

    color: #FFFFFF !important;
}


/* =========================================================
   22. BREADCRUMBS
   ========================================================= */

body .breadcrumbs,
body .wd-breadcrumbs {

    color: #18352F !important;
}


body .breadcrumbs a,
body .wd-breadcrumbs a {

    color: #18352F !important;
}


body .breadcrumbs a:hover,
body .wd-breadcrumbs a:hover {

    color: #C8A96B !important;
}


/* =========================================================
   23. FOOTER ICON
   ========================================================= */

.elementor-icon-list-icon {

    width: 20px !important;

    max-width: 20px !important;
}


.elementor-icon-list-icon i,
.elementor-icon-list-icon svg {

    font-size: 20px !important;

    width: 20px !important;

    height: 20px !important;

    color: #C8A96B !important;
}


.elementor-icon-list-item a:hover .elementor-icon-list-icon i,
.elementor-icon-list-item a:hover .elementor-icon-list-icon svg {

    color: #FFFFFF !important;
}


/* =========================================================
   24. MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .contact-wrapper {
        flex-direction: column;
    }

    .wd-entities-title,
    .woodmart-product-title a {

        font-size: 13px !important;

        height: 3em !important;

        min-height: 3em !important;

        line-height: 1.4em !important;
    }


    body .whb-main-header .wd-nav.wd-style-default {

        display: flex !important;

        flex-wrap: nowrap !important;
    }


    body .whb-main-header .wd-nav.wd-style-default > li > a {

        padding-left: 8px !important;

        padding-right: 8px !important;

        font-size: 12px !important;
    }


    body .rast-more-menu-button {

        padding: 7px 10px !important;

        font-size: 12px !important;
    }


    body .rast-more-dropdown {

        right: 0 !important;

        min-width: 200px !important;
    }
}


/* =========================================================
   END CSS
   ========================================================= */

</style>


<script>
document.addEventListener('DOMContentLoaded', function () {

    /*
     * =====================================================
     * RAST AUTOMATIC MORE MENU
     * =====================================================
     */

    function createRastMoreMenu() {

        const menus = document.querySelectorAll(
            '.whb-main-header .wd-nav.wd-style-default'
        );

        if (!menus.length) {
            return;
        }

        menus.forEach(function(menu) {

            /* Prevent duplicate initialization */
            if (menu.dataset.rastMoreReady === '1') {
                return;
            }

            menu.dataset.rastMoreReady = '1';

            const items = Array.from(
                menu.children
            ).filter(function(item) {

                return item.tagName === 'LI';

            });

            if (items.length <= 1) {
                return;
            }


            /* ---------------------------------------------
               Create MORE item
               --------------------------------------------- */

            const moreItem = document.createElement('li');

            moreItem.className = 'rast-more-menu-item';


            /* More button */

            const moreButton = document.createElement('button');

            moreButton.type = 'button';

            moreButton.className = 'rast-more-menu-button';

            moreButton.innerHTML =
                'MEHR <span class="rast-more-arrow">▼</span>';


            /* Dropdown */

            const dropdown = document.createElement('div');

            dropdown.className = 'rast-more-dropdown';


            moreItem.appendChild(moreButton);

            moreItem.appendChild(dropdown);

            menu.appendChild(moreItem);


            /*
             * Keep calculating the available width.
             */

            function calculateMenu() {

                /* Close menu while calculating */

                moreItem.classList.remove(
                    'rast-more-open'
                );


                /* Reset all items */

                items.forEach(function(item) {

                    item.style.display = '';

                });


                dropdown.innerHTML = '';


                moreItem.style.display = 'none';


                /*
                 * Available menu width
                 */

                const menuWidth =
                    menu.getBoundingClientRect().width;


                if (!menuWidth) {
                    return;
                }


                /*
                 * More button width
                 */

                moreItem.style.display = 'list-item';

                const moreWidth =
                    moreItem.getBoundingClientRect().width;


                moreItem.style.display = 'none';


                /*
                 * We keep a little safety space.
                 */

                const safetySpace = 25;


                let usedWidth = 0;

                let hiddenItems = [];


                /*
                 * Calculate which items fit.
                 */

                items.forEach(function(item) {

                    item.style.display = 'block';


                    const itemWidth =
                        item.getBoundingClientRect().width;


                    if (
                        usedWidth +
                        itemWidth +
                        moreWidth +
                        safetySpace
                        <= menuWidth
                    ) {

                        usedWidth += itemWidth;

                    } else {

                        item.style.display = 'none';

                        hiddenItems.push(item);
                    }

                });


                /*
                 * If everything fits,
                 * don't show MORE.
                 */

                if (hiddenItems.length === 0) {

                    moreItem.style.display = 'none';

                    return;
                }


                /*
                 * Show MORE.
                 */

                moreItem.style.display = 'list-item';


                /*
                 * Add hidden categories
                 * to dropdown.
                 */

                hiddenItems.forEach(function(item) {

                    const link =
                        item.querySelector('a');

                    if (!link) {
                        return;
                    }


                    const dropdownLink =
                        document.createElement('a');


                    dropdownLink.href =
                        link.href;


                    dropdownLink.innerHTML =
                        link.innerHTML;


                    dropdown.appendChild(
                        dropdownLink
                    );

                });

            }


            /*
             * More button click
             */

            moreButton.addEventListener(
                'click',
                function(event) {

                    event.preventDefault();

                    event.stopPropagation();

                    moreItem.classList.toggle(
                        'rast-more-open'
                    );

                }
            );


            /*
             * Close when clicking outside
             */

            document.addEventListener(
                'click',
                function(event) {

                    if (
                        !moreItem.contains(
                            event.target
                        )
                    ) {

                        moreItem.classList.remove(
                            'rast-more-open'
                        );

                    }

                }
            );


            /*
             * Initial calculation
             */

            setTimeout(
                calculateMenu,
                300
            );


            /*
             * Recalculate after resize
             */

            let resizeTimer;

            window.addEventListener(
                'resize',
                function() {

                    clearTimeout(resizeTimer);

                    resizeTimer = setTimeout(
                        calculateMenu,
                        150
                    );

                }
            );


            /*
             * Recalculate after fonts load
             */

            if (document.fonts) {

                document.fonts.ready.then(
                    function() {

                        calculateMenu();

                    }
                );

            }

        });

    }


    /*
     * Run
     */

    createRastMoreMenu();


    /*
     * WoodMart / Elementor may load
     * header slightly later.
     */

    setTimeout(
        createRastMoreMenu,
        1000
    );

    setTimeout(
        createRastMoreMenu,
        2500
    );

});
</script>

<?php
});