/* Scoped to the shared storefront header; existing JSF forms remain independent. */
.ns-header .ns-header-desktop,
.ns-header .ns-header-mobile {
    background: linear-gradient(110deg, #087b49 0%, #0a8b57 100%);
    color: #fff;
    border-bottom: 1px solid #076d41;
    box-shadow: 0 4px 16px rgba(20, 64, 44, .12);
}
.ns-header .ns-header-desktop > .container {
    width: 100%;
    max-width: none;
    padding: 0 24px;
}
.ns-header .ns-header-row {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    align-items: center;
    gap: 20px;
    direction: rtl;
    min-height: 88px;
    padding: 12px 0;
}
.ns-header .ns-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    direction: rtl;
}
.ns-header .ns-header-row > .ns-header-brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}
.ns-header #side_bar_menu_id,
.ns-header #show-sidebar {
    position: static;
    inset: auto;
    transform: none;
    filter: none;
}
.ns-header #show-sidebar.ns-header-control {
    height: 44px;
    color: #213b31;
    border-radius: 50% !important;
}
.ns-header .ns-header-account {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.ns-header .ns-header-account a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}
.ns-header .ns-header-account img {
    width: 40px;
    height: 40px;
    margin: 0 !important;
    object-fit: contain;
}
.ns-header .ns-header-search-section {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    max-width: 680px;
    justify-self: center;
}
.ns-header .ns-header-search {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 6px;
    padding: 4px;
    min-width: 0;
    width: 100%;
    background: #f7faf8;
    border: 1px solid #dce6df;
    border-radius: 28px;
}
.ns-header .ns-header-search .ns-header-search-input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 24px;
    background: transparent;
    box-shadow: none;
    color: #213b31;
    direction: rtl;
    text-align: right;
    font-family: inherit;
    font-size: 14px;
}
.ns-header .ns-header-search-input::placeholder { color: #6e7d74; opacity: 1; }
.ns-header .ns-header-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #087b49;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}
.ns-header .ns-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    grid-column: 3;
    grid-row: 1;
    direction: rtl;
    justify-self: end;
}
.ns-header .ns-header-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #dce6df;
    border-radius: 24px;
    background: #fff;
    color: #213b31;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.ns-header .ns-header-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 22px;
    flex-shrink: 0;
}
.ns-header .ns-header-control:hover,
.ns-header .header_icon:hover {
    background: #edf7f1;
    border-color: #a8cdb8;
    color: #087b49;
}
.ns-header button:focus-visible,
.ns-header a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.ns-header .ns-header-search-input:focus-visible {
    outline: 2px solid #087b49;
    outline-offset: -2px;
}
.ns-header .ns-header-search:focus-within { border-color: #087b49; }
.ns-header .ns-header-cart { position: relative; }
.ns-header .circle-red-basket {
    position: absolute;
    top: -5px;
    right: -3px;
    bottom: auto;
    width: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 12px;
    background: #087b49;
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}
.ns-header .onhover-div .show-div.shopping-cart {
    top: 100%;
    left: 0;
    right: auto;
    transform: none;
    width: min(500px, calc(100vw - 32px));
    max-width: none;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #e4ece7;
    box-shadow: 0 12px 32px rgba(20, 64, 44, .14);
    z-index: 20;
}
.ns-header .onhover-div:focus-within > .show-div {
    visibility: visible;
    opacity: 1;
}
.ns-header .header_shoping-cart { background: #087b49; }
.ns-header .ns-header-mobile { display: none !important; }
@media (min-width: 769px) and (max-width: 991px) {
    .ns-header .ns-header-row {
        grid-template-columns: 1fr auto;
        gap: 12px;
    }
    .ns-header .ns-header-actions { grid-column: 2; }
    .ns-header .ns-header-search-section { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 768px) {
    .ns-header .ns-header-desktop { display: none !important; }
    .ns-header .ns-header-mobile {
        display: block !important;
        height: auto;
        padding: 12px;
        direction: rtl;
    }
    .ns-header .headerPage {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
        height: auto;
        padding: 0;
        min-height: 52px;
        position: relative;
        direction: rtl;
    }
    .ns-header .headerPage > .ns-header-brand { margin-left: auto; gap: 6px; }
    .ns-header .headerPage > button { margin-right: auto; }
    .ns-header .header_icon {
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid #dce6df;
        color: #213b31;
        font-size: 22px;
        background: #fff;
        filter: none;
        cursor: pointer;
        position: relative;
        text-decoration: none;
    }
    .ns-header .headerPage .onhover-div { padding: 0; position: static; }
    .ns-header .returnWorkbook-img,
    .ns-header .mobile-club-customer { width: auto !important; height: auto !important; }
    .ns-header .headerPage .show-div.shopping-cart {
        top: 100%;
        left: 0;
        right: auto;
    }
    .ns-header .ns-header-mobile-search { margin-top: 12px; }
}
@media (max-width: 390px) {
    .ns-header .headerPage { gap: 4px; }
    .ns-header .header_icon { width: 40px; height: 44px; }
    .ns-header .ns-header-brand { gap: 4px; }
}

/* Mobile header controls have their own markup; keep them visible and aligned. */
@media (max-width: 768px) {
    .ns-header .ns-header-mobile .headerPage { flex-wrap: nowrap; gap: 6px; }
    .ns-header .ns-header-mobile .ns-header-brand { min-width: 0; flex-shrink: 0; }
    .ns-header .ns-header-mobile .ns-header-account { display: flex; align-items: center; gap: 4px; }
    .ns-header .ns-header-mobile .headerPage > .onhover-div,
    .ns-header .ns-header-mobile .ns-header-account > .onhover-div { display: block !important; flex-shrink: 0; }
    .ns-header .ns-header-mobile .header_icon { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; flex-shrink: 0; }
    .ns-header .ns-header-mobile .headerPage > button { margin-right: 0; }
}
@media (max-width: 360px) {
    .ns-header .ns-header-mobile { padding: 10px 8px; }
    .ns-header .ns-header-mobile .headerPage { gap: 3px; }
    .ns-header .ns-header-mobile .header_icon { width: 38px; height: 44px; font-size: 20px; }
}