:root {
    --kxm-accent: #00758f;
    --kxm-accent-hover: #005f75;
}

/*
 * The category toolbar is painted after the header in document order. Put the
 * complete header in a higher stacking context so utility panels cannot be
 * covered by sorting, filters or product content.
 */
@media (min-width: 1024px) {
    .kxm-project-header {
        position: relative !important;
        z-index: 4000 !important;
        isolation: isolate;
    }
}

@media (max-width: 1023px) {
    .kxm-project-header {
        z-index: 4000 !important;
        isolation: isolate;
    }
}

@media only screen and (min-width: 1024px) {
    .kxm-project-header .header-minicart #header-cart,
    .kxm-project-header .kxm-header-dropdown-menu,
    .kxm-project-header .kxm-header-search-wrap #header-search.kxm-header-search-panel {
        top: calc(100% + 4px) !important;
    }

    .kxm-project-header #header-account {
        top: 66px !important;
        right: 76px !important;
    }

    /* Start every desktop submenu below the 56 px navigation row. */
    .kxm-project-header .nav-primary > li.parent > ul.level0 {
        top: 56px !important;
        max-height: min(320px, calc(100vh - 180px));
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* The manufacturer menu contains the complete Magento option list. Keep
     * every brand visible at once instead of hiding the lower options behind
     * the generic 320 px submenu scrollbar. */
    .kxm-project-header .nav-primary > li.parent:has(> ul.level0.producers) {
        position: relative !important;
    }

    .kxm-project-header .nav-primary > li.parent > ul.level0.producers {
        top: 100% !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: min(720px, calc(100vw - 48px)) !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 18px 20px !important;
        overflow: visible !important;
        box-sizing: border-box;
    }

    .kxm-project-header .nav-primary ul.producers > li.manufacturers-group {
        float: left !important;
        width: 33.3333% !important;
        margin: 0 !important;
        padding: 0 16px !important;
        box-sizing: border-box;
    }

    .kxm-project-header .nav-primary ul.producers a.level1 {
        min-height: 0;
        padding: 7px 0 !important;
        line-height: 1.35;
        white-space: normal;
    }

}

.kxm-project-header .header-minicart #header-cart,
.kxm-project-header #header-account,
.kxm-project-header .kxm-header-dropdown-menu,
.kxm-project-header .kxm-header-search-wrap #header-search.kxm-header-search-panel {
    z-index: 3200 !important;
    border: 1px solid #d8d8d8 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08) !important;
    box-sizing: border-box;
}

.kxm-project-header .header-minicart #header-cart {
    right: 0 !important;
    width: 360px !important;
    max-height: calc(100vh - 156px);
    padding: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
}

.kxm-project-header #header-cart .minicart-wrapper {
    padding: 18px;
}

.kxm-project-header #header-cart .block-subtitle {
    margin: 0 0 14px;
    padding: 0 28px 12px 0;
    border-bottom: 1px solid #e5e5e5;
    color: #111;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-transform: none;
}

.kxm-project-header #header-cart .close {
    top: 14px;
    right: 14px;
}

.kxm-project-header #header-cart .mini-products-list li {
    padding: 14px 0;
    border-bottom: 1px solid #e5e5e5;
}

.kxm-project-header #header-cart .mini-products-list .product-image {
    width: 72px;
    height: 92px;
    margin-right: 14px;
    background: #f4f4f4;
}

.kxm-project-header #header-cart .mini-products-list .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kxm-project-header #header-cart .mini-products-list .product-details {
    margin-left: 86px;
}

.kxm-project-header #header-cart .product-name,
.kxm-project-header #header-cart .product-name a {
    color: #111;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    text-decoration: none;
    text-transform: none;
}

.kxm-project-header #header-cart .info-wrapper {
    color: #777;
    font-size: 12px;
}

.kxm-project-header #header-cart .price {
    color: var(--kxm-accent);
    font-size: 13px;
    font-weight: 500;
}

.kxm-project-header #header-cart .subtotal {
    margin: 0;
    padding: 16px 18px;
    border: 0;
    background: #f4f4f4;
    color: #111;
    font-size: 13px;
}

.kxm-project-header #header-cart .subtotal .price {
    color: #111;
    font-size: 14px;
}

.kxm-project-header #header-cart .minicart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
    padding: 14px 18px 18px;
}

.kxm-project-header #header-cart .minicart-actions .cart-link,
.kxm-project-header #header-cart .minicart-actions .checkout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #111;
    border-radius: 0;
    background: #fff;
    color: #111;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    text-transform: none;
}

.kxm-project-header #header-cart .minicart-actions .checkout-button {
    border-color: var(--kxm-accent);
    background: var(--kxm-accent);
    color: #fff;
}

.kxm-project-header #header-cart .minicart-actions .checkout-button:hover,
.kxm-project-header #header-cart .minicart-actions .checkout-button:focus-visible {
    border-color: var(--kxm-accent-hover);
    background: var(--kxm-accent-hover);
}

.kxm-project-header #header-account {
    width: 230px !important;
    padding: 8px 0 !important;
}

.kxm-project-header #header-account li {
    margin: 0;
    border: 0;
}

.kxm-project-header #header-account a {
    display: block;
    padding: 11px 18px;
    color: #111;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
    text-transform: none;
}

.kxm-project-header #header-account a:hover,
.kxm-project-header #header-account a:focus-visible,
.kxm-project-header .kxm-header-dropdown-menu a:hover,
.kxm-project-header .kxm-header-dropdown-menu a:focus-visible {
    background: #f4f4f4;
    color: #111;
}

.kxm-project-header .kxm-header-dropdown-menu {
    min-width: 190px !important;
    padding: 8px 0 !important;
}

.kxm-project-header .kxm-header-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 14px;
    color: #111;
    font-size: 13px;
    text-decoration: none;
}

.kxm-project-header .kxm-header-search-wrap #header-search.kxm-header-search-panel {
    right: 0 !important;
    width: 360px !important;
    height: auto !important;
    padding: 12px !important;
}

.kxm-project-header .skip-cart .count {
    background: var(--kxm-accent) !important;
}

@media only screen and (max-width: 1023px) {
    .kxm-project-header .header-minicart #header-cart,
    .kxm-project-header .kxm-header-dropdown-menu,
    .kxm-project-header .kxm-header-search-wrap #header-search.kxm-header-search-panel {
        position: fixed !important;
        top: 60px !important;
        right: 0 !important;
        left: auto !important;
        width: min(360px, 100vw) !important;
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
        overflow-y: auto;
    }

    .kxm-project-header #header-account {
        position: fixed !important;
        top: 60px !important;
        right: 0 !important;
        left: auto !important;
        width: min(300px, 100vw) !important;
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
        overflow-y: auto;
    }

    .kxm-project-header #header-cart .minicart-actions {
        grid-template-columns: 1fr;
    }
}
