/* Trade section — isolate Site1 header from sidebar2.css (Bootstrap 4) */

.trade-site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    width: 100%;
    flex: 0 0 auto;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    background: #6C8F2B;
}

.trade-site-header *,
.trade-site-header-sub *,
.trade-site-header *::before,
.trade-site-header *::after,
.trade-site-header-sub *::before,
.trade-site-header-sub *::after {
    box-sizing: border-box;
}

.trade-site-header .header {
    padding: 0;
    background: #6C8F2B url(https://cdn.funder.co.il/funder/assets/img/hdr_bg.jpg) left top repeat-x;
}

.trade-site-header .header .row {
    display: block;
    margin-right: -15px;
    margin-left: -15px;
    padding: 0;
}

.trade-site-header .header .row:before,
.trade-site-header .header .row:after {
    content: " ";
    display: table;
}

.trade-site-header .header .row:after {
    clear: both;
}

.trade-site-header .container,
.trade-site-header-sub.container {
    width: 100%;
    max-width: 1170px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 1440px) {
    .trade-site-header .container,
    .trade-site-header-sub.container {
        max-width: 1366px;
    }
}

.trade-site-header [class*="col-"],
.trade-site-header-sub [class*="col-"] {
    float: right;
    position: relative;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
}

.trade-site-header .pad_none,
.trade-site-header-sub .pad_none {
    padding: 0 !important;
}

.trade-site-header .mrg-hdr2 {
    margin: 10px 0;
}

.trade-site-header .pb10 {
    padding-bottom: 10px;
}

.trade-site-header .mrg-botm12 {
    margin-bottom: 12px;
}

/* Search row layout — live-search.css owns form sizing; only layout isolation here */
@media (min-width: 768px) {
    .trade-site-header .header-fund-filters {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 6px;
        width: 100%;
    }

    .trade-site-header .header-fund-filters .header-fund-filter {
        flex: 1 1 0;
        min-width: 0;
        padding: 0;
    }

    .trade-site-header .header-fund-filters select.form-control {
        width: 100%;
    }
}

@media (min-width: 992px) {
    .trade-site-header .search-header-col {
        position: relative;
        float: right !important;
        min-height: 1px;
        padding-left: 15px;
        padding-right: 15px;
        width: 23% !important;
    }

    .trade-site-header .header-fund-filters-col {
        float: right !important;
        width: 66% !important;
    }

    .trade-site-header .searchBoxHeader--compact {
        width: 100%;
        display: block;
        background: none;
        padding: 0;
        margin-top: 0;
        height: auto;
        border-radius: 0;
    }

    .trade-site-header .desktop-search-toolbar {
        display: block;
        width: 100%;
    }

    .trade-site-header .input-group.desktop-header-search-group {
        position: relative;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        width: 100% !important;
        direction: rtl;
    }

    .trade-site-header .desktop-header-search-group .form-control.search_text--desktop {
        flex: 1 1 auto;
        min-width: 0;
        width: auto !important;
        height: 34px !important;
        min-height: 34px !important;
        padding: 6px 12px !important;
        border: 1px solid #e6d5b4 !important;
        border-left: 0 !important;
        border-radius: 0 4px 4px 0 !important;
        background: #fff !important;
        color: #333 !important;
        font-size: 14px !important;
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075) !important;
    }

    .trade-site-header .desktop-header-search-group .form-control.search_text--desktop:focus {
        border-color: #c8b96a !important;
        outline: none;
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px rgba(200, 185, 106, 0.35) !important;
    }

    .trade-site-header .desktop-header-search-actions,
    .trade-site-header .input-group-btn.desktop-header-search-actions {
        display: flex !important;
        flex: 0 0 auto !important;
        width: auto !important;
        white-space: nowrap;
        vertical-align: middle;
    }

    .trade-site-header .advanced-search-link--header {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        height: 34px !important;
        min-height: 34px !important;
        padding: 6px 12px !important;
        margin: 0 !important;
        font-size: 14px !important;
        font-weight: normal !important;
        line-height: 1.42857143 !important;
        white-space: nowrap;
        float: none !important;
        color: #333 !important;
        text-shadow: 0 1px 0 #e6d5b4;
        background-color: #fefaf0 !important;
        background-image: linear-gradient(to bottom, #e6d5b4 0, #fefaf0 100%) !important;
        border: 1px solid #e6d5b4 !important;
        border-radius: 4px 0 0 4px !important;
        box-shadow: none !important;
        text-decoration: none !important;
    }

    .trade-site-header .advanced-search-link--header:hover,
    .trade-site-header .advanced-search-link--header:focus {
        color: #333 !important;
        background-color: #f3e9d4 !important;
        background-image: linear-gradient(to bottom, #dcc9a8 0, #f9f3ea 100%) !important;
        border-color: #e6d5b4 !important;
        text-decoration: none !important;
        outline: none;
    }

    .trade-site-header .desktop-header-search-group .form-control.search_text--desktop::placeholder {
        color: #8a8172;
        opacity: 1;
    }
}

/* Navbar */
.trade-site-header .navbar {
    position: relative;
    min-height: 50px;
    margin-bottom: 0;
    border: none !important;
    border-radius: 0;
    display: block;
    width: 100%;
    clear: both;
    box-shadow: none !important;
    outline: none !important;
}

.trade-site-header .navbar-inverse {
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.trade-site-header .navbar-collapse,
.trade-site-header #navbar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding-right: 0;
    padding-left: 0;
    width: auto;
}

@media (min-width: 768px) {
    .trade-site-header .navbar-collapse.collapse {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        padding-bottom: 0;
        border: none !important;
        box-shadow: none !important;
    }

    /* Empty mobile header block creates a seam next to first nav item */
    .trade-site-header .navbar-header {
        display: none !important;
    }
}

.trade-site-header .navbar-nav {
    display: block !important;
    float: right;
    margin: 0;
    padding: 0;
    list-style: none;
    border: none !important;
    box-shadow: none !important;
}

.trade-site-header .navbar-nav > li {
    display: block;
    float: right;
    position: relative;
    border: none !important;
    box-shadow: none !important;
}

.trade-site-header .navbar-nav > li + li {
    border: none !important;
}

.trade-site-header .navbar-inverse .nav > li > a,
.trade-site-header .navbar-inverse .navbar-nav > li > a {
    color: #fff !important;
    font-size: large;
    font-weight: bold;
    padding: 10px !important;
    line-height: 1.42857143 !important;
    text-shadow: none;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0 !important;
    display: block;
    box-sizing: border-box;
}

.trade-site-header .navbar-inverse .nav > li > a:hover,
.trade-site-header .navbar-inverse .navbar-nav > li > a:hover,
.trade-site-header .navbar-inverse .navbar-nav > .active > a,
.trade-site-header .navbar-inverse .navbar-nav > .active > a:hover,
.trade-site-header .navbar-inverse .navbar-nav > .active > a:focus {
    background-color: #99ca3b !important;
    background-image: none !important;
    color: #000 !important;
    padding: 10px !important;
    line-height: 1.42857143 !important;
    box-shadow: none !important;
    border: 0 !important;
}

.trade-site-header .navbar-inverse .navbar-toggle {
    border: 0;
    background: transparent;
}

.trade-site-header .navbar-inverse .navbar-toggle .icon-bar {
    background-color: #fff;
}

.trade-site-header .menuH1 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    display: inline;
}

.trade-site-header .navbar-header {
    float: right;
}

@media (max-width: 767px) {
    .trade-site-header .navbar-toggle {
        float: right;
        margin: 12px 0 13px 0;
    }

    .trade-site-header .navbar-brand {
        float: left;
        height: auto;
        padding: 10px 15px 5px 0;
    }

    .trade-site-header .navbar {
        min-height: 0;
    }

    .trade-site-header #navbar {
        width: 100%;
        clear: both;
    }

    .trade-site-header .navbar-collapse.collapse:not(.in) {
        display: none;
    }

    .trade-site-header .navbar-collapse.collapse.in {
        display: block;
        clear: both;
    }

    .trade-site-header .webViewBox {
        width: 100%;
        margin-bottom: 10px;
        float: left;
        margin-top: 2px;
    }

    .trade-site-header .navbar-nav {
        float: none;
        width: 100%;
    }

    .trade-site-header .navbar-nav > li {
        float: none;
        width: 100%;
    }
}

.trade-site-header .navbar-brand {
    float: right;
    height: 50px;
    padding: 10px 15px;
}

.trade-site-header .pull-left {
    float: left !important;
}

.trade-site-header .plNone {
    padding-left: 0 !important;
}

.trade-site-header .navbar .pull-left.plNone {
    float: left !important;
    padding-top: 8px;
}

.trade-site-header .fb-logo,
.trade-site-header .tw-logo {
    width: 25px;
    height: 25px;
    display: inline-block;
    vertical-align: middle;
}

.trade-site-header .mobile-search-row {
    background: #6C8F2B;
    clear: both;
}

.trade-site-header .live-search-dropdown {
    z-index: 1300;
}

.trade-site-header #accessbility_hd {
    background: #000;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 12px;
    color: #fff;
    border: 0;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 0 6px 6px 0;
    z-index: 2;
}

/* Sub nav */
.trade-site-header-sub {
    background: #fefaf0;
    flex: 0 0 auto;
    clear: both;
}

.trade-site-header-sub .nav_sub {
    line-height: 30px;
    height: 30px;
    margin-bottom: 0;
    float: none;
    width: 100%;
}

.trade-site-header-sub .bg-black {
    background-color: #fefaf0 !important;
}

.trade-site-header-sub .nav_sub a {
    color: #000;
    padding: 0 10px;
    font-weight: bold;
}

.trade-site-header-sub .nav_sub a:hover {
    color: #333;
    text-decoration: none;
}

.trade-site-header-sub .nav_submenu a {
    font-size: medium;
    font-weight: normal;
}

/* Page layout */
body.trade-with-header {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.trade-with-header > .wrapper {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

/* Sidebar + toggle always below site header (never overlap) */
body.trade-with-header {
    --trade-header-h: 52px;
}

body.trade-with-header #sidebar {
    z-index: 50;
}

body.trade-with-header #sidebar > .p-3 {
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    max-height: none !important;
}

body.trade-with-header #sidebar .custom-menu {
    z-index: 50;
}

body.trade-with-header #content {
    position: relative;
}

/* RTL dropdowns — under trigger, above sidebar */
body.trade-with-header #content .dropdown-menu {
    right: 0;
    left: auto;
    z-index: 1000;
}

body.trade-with-header #content .bootstrap-select .dropdown-menu {
    right: 0;
    left: auto;
    z-index: 1000;
}

body.trade-with-header #content .dropdown-content2,
body.trade-with-header #content .dropdown-content3,
body.trade-with-header #content .dropdown-content4 {
    right: 0;
    left: auto;
    z-index: 1000;
}

body.trade-with-header #anychart-menu-wrapper,
body.trade-with-header #anychart-menu-wrapper .anychart-menu {
    z-index: 1000 !important;
}

body.trade-with-header #sidebarCollapse .fa {
    color: #c5b737;
}

@media (max-width: 991.98px) {
    body.trade-with-header > .wrapper {
        display: flex;
        align-items: flex-start;
        overflow: visible;
    }

    body.trade-with-header > .wrapper > #content {
        flex: 1 1 0;
        min-width: 0;
        width: auto !important;
        max-width: 100%;
    }

    /* Override sidebar2 absolute/fixed positioning on small screens */
    body.trade-with-header #sidebar {
        position: relative !important;
        margin-right: 0 !important;
    }

    /* Closed: zero flex footprint — hide panel, keep peek toggle only */
    body.trade-with-header #sidebar:not(.active) {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        margin-right: 0 !important;
        border: 0 !important;
        overflow: visible;
        flex-shrink: 0;
    }

    body.trade-with-header #sidebar:not(.active) > .p-3 {
        display: none !important;
    }

    /* Open: side-by-side — content shrinks (with or without hamburger) */
    body.trade-with-header #sidebar.active {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        width: 220px !important;
        min-width: 220px !important;
        max-width: 220px !important;
        margin-right: 0 !important;
        height: auto !important;
        max-height: none !important;
        flex-shrink: 0;
        overflow: visible !important;
        z-index: 50;
    }

    body.trade-with-header #sidebar.active > .p-3 {
        display: block;
        overflow: hidden !important;
        max-height: none !important;
    }

    /* Closed: full yellow toggle inset from right edge (not half-clipped) */
    body.trade-with-header #sidebar:not(.active) .custom-menu {
        left: auto !important;
        right: 4px !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        top: 10px !important;
        z-index: 120;
    }

    /* Open: toggle sits on left edge of panel, not over sidebar content */
    body.trade-with-header #sidebar.active .custom-menu {
        left: -16px;
        right: auto;
        top: 6px !important;
        margin-right: 0 !important;
        margin-left: 0;
        z-index: 120;
    }

    body.trade-with-header #sidebar .custom-menu {
        position: absolute !important;
    }

    .trade-site-header .header > .container {
        padding-left: 0;
        padding-right: 0;
    }

    .trade-site-header .navbar {
        margin: 0;
        width: 100%;
    }

    /*
     * List pages (קרנות סל / מניות / אג"ח): sidebar overlays tables —
     * content stays full width (does not shrink when sidebar is open).
     */
    body.trade-with-header:has(.trade-etf-list) > .wrapper > #content,
    body.trade-with-header:has(.trade-stock-list) > .wrapper > #content,
    body.trade-with-header:has(.trade-bond-list) > .wrapper > #content {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }

    body.trade-with-header:has(.trade-etf-list) #sidebar.active,
    body.trade-with-header:has(.trade-stock-list) #sidebar.active,
    body.trade-with-header:has(.trade-bond-list) #sidebar.active {
        position: fixed !important;
        top: var(--trade-header-h) !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: 220px !important;
        min-width: 220px !important;
        max-width: 220px !important;
        height: auto !important;
        max-height: none !important;
        margin-right: 0 !important;
        flex-shrink: 0;
        overflow: visible !important;
        z-index: 150;
    }

    body.trade-with-header:has(.trade-etf-list) #sidebar.active > .p-3,
    body.trade-with-header:has(.trade-stock-list) #sidebar.active > .p-3,
    body.trade-with-header:has(.trade-bond-list) #sidebar.active > .p-3 {
        overflow: hidden !important;
        max-height: none !important;
    }
}

/* sidebar.css sets height:270vh on mobile active — breaks trade layout */
@media (max-width: 768px) {
    body.trade-with-header #sidebar.active {
        height: auto !important;
        overflow: visible !important;
    }
}

/* Desktop (≥992): production collapse — slide panel off, keep yellow toggle peeking */
@media (min-width: 992px) {
    body.trade-with-header > .wrapper {
        display: flex;
        align-items: flex-start;
        overflow: visible;
    }

    body.trade-with-header > .wrapper > #content {
        flex: 1 1 0;
        min-width: 0;
        width: auto !important;
    }

    body.trade-with-header #sidebar {
        position: relative;
        overflow: visible !important;
        flex-shrink: 0;
    }

    /* Collapsed (.active): panel slides off-screen; toggle stays on right seam */
    body.trade-with-header #sidebar.active {
        margin-right: -220px !important;
        overflow: visible !important;
    }

    body.trade-with-header #sidebar.active .custom-menu {
        position: absolute !important;
        left: auto !important;
        right: auto !important;
        top: 10px !important;
        margin-right: 10px !important;
        margin-left: 0 !important;
        z-index: 120;
    }

    /* Keep chart toolbar clear of the peeking collapse arrow */
    body.trade-with-header #sidebar.active ~ #content #drawingToolsPanel,
    body.trade-with-header #sidebar.active ~ #content .drawingtool {
        padding-right: 44px !important;
        box-sizing: border-box;
    }

    /* Open: toggle on left edge of panel */
    body.trade-with-header #sidebar:not(.active) .custom-menu {
        position: absolute !important;
        left: -16px;
        right: auto;
        top: 6px !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        z-index: 120;
    }

    .trade-site-header .visible-lg {
        display: block !important;
    }
    .trade-site-header .hidden-lg {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .trade-site-header .visible-md {
        display: block !important;
    }
    .trade-site-header .hidden-md {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .trade-site-header .visible-sm.hidden-md.hidden-lg {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .trade-site-header .visible-xs {
        display: block !important;
    }
    .trade-site-header .hidden-xs {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .trade-site-header .visible-sm {
        display: block !important;
    }
    .trade-site-header .hidden-sm {
        display: none !important;
    }
}
