:root {
    --brand-light-green: #4fce6b;
    --brand-green: #27a742;
    --brand-green-hover: #0c6f21;
    --brand-orange: #e28432;
    --brand-orange-hover: #cb6206;
    --main-text: #263238;
    --main-bg-grey: #f3f3f3;
    --main-white: #fff;
    --main-dark: #31313f;
    --main-dark-grey: #bdbdbd;
    --main-red: #dc3545;
    --font-family: "Forma DJR Cyrillic Micro", sans-serif;
    --second-family: "Montserrat", sans-serif;
}

.denvic-global-header {
    background-color: #fff;
    color: #fff;
    padding: 20px;
    border-bottom: 1px solid #e3e3e3;
    position: fixed;
    width: 100%;
    height: 56px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 99999;
}



.denvic-global-header .header-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.denvic-global-header .header-inner a {
    display: flex;
    /* flex-direction: column; */
}

.denvic-global-header .header-inner svg {
    width: 156px;
}

#global-search {
    width: 350px;
    padding: 0px 14px;
    border-radius: 6px;
    border: 1px solid #e3e3e3;
    font-size: 14px;
    height: 40px;
    border-radius: 150px;
    color: #000;
    box-shadow: none !important;
    outline: unset !important;
}

#global-search:active,
#global-search:focus,
#global-search:focus-visible {
    border-color: #27a742 !important;
}

#global-search::placeholder {
    color: #000;
}

div#root {
    /* margin-top: 56px !important; */
    position: fixed;
    width: 100%;
}

.header-search {
    position: relative;

}

.header-search .header-search-result {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border: 1px solid #e3e3e3;
    border-radius: 20px;
    visibility: hidden;
    pointer-events: none;
    background-color: #fff;
    font-size: 14px;
    max-height: 400px;
    overflow-y: auto;

}

.header-search .header-search-result::after {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 8px;
}

.header-search-result .result-item {
    padding: 2px 6px;
    border-radius: 10px;
    color: #263238;
}

.header-search-result .result-item:hover {
    background: #f3f3f3;

}

.header-search .header-search-result.open {
    visibility: visible;
    pointer-events: all;
}

.result-item .snippet {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
}

mark {
    background: #fff3b0;
}

.header-search-result .empty {
    color: #263238;
    padding: 2px 6px;
    border-radius: 10px;
}

/* КАСТОМНЫЙ СКРОЛЛ */
.header-search .header-search-result {
    scrollbar-width: thin;
    scrollbar-color: #c7c7c7 #f5f5f5;
}

/* Chrome / Edge / Opera */
.header-search .header-search-result::-webkit-scrollbar {
    width: 8px;
}

.header-search .header-search-result::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.header-search .header-search-result::-webkit-scrollbar-thumb {
    background: #c7c7c7;
    border-radius: 10px;
    transition: background 0.2s ease, width 0.2s ease;
}

.header-search .header-search-result::-webkit-scrollbar-thumb:hover {
    background: #a5a5a5;
}

/* При активном скролле — чуть темнее */
.header-search .header-search-result:active::-webkit-scrollbar-thumb {
    background: #8e8e8e;
}

*[aria-describedby="popup-2"],
*[aria-describedby="popup-7"],
*[aria-describedby="popup-8"] {
    display: none !important;
}

#root>div>div:nth-child(1)>div>div>div:nth-child(1)>div>div>div>div.iconWrapper>div.css-bkhmc9.buttonLink>div>*[aria-describedby*="popup-"] {
    display: none !important;
}




/* === OVERLAY === */
.denvic-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    padding-top: 160px;
    padding-bottom: 60px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 999999;
}

.denvic-search-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* === POPUP CARD === */
.denvic-search-popup {
    width: 94%;
    max-width: 700px;
    background: #fff;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, .18);
    transform: translateY(-20px) scale(.96);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
    display: flex;
    flex-direction: column;
    max-height: 120px;
    /* только инпут */
    transition: max-height .25s ease, transform .25s ease, opacity .25s ease;
    /* попап не больше 70% экрана */
    overflow: hidden;
}

.denvic-search-popup.has-results {
    max-height: 90vh;
}

.denvic-search-popup.has-results .search-popup-result {
    display: block;
}

.denvic-search-overlay.open .denvic-search-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* === INPUT === */
#global-search-popup {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--brand-green);
    border-radius: 24px;
    font-size: 18px;
    font-family: var(--font-family);
    outline: none;
    color: #000;
}

#global-search-popup:focus {
    border-color: var(--brand-green-hover);
}

/* === RESULTS === */

.search-popup-result {
    flex: 1 1 auto;
    max-height: 100%;
    overflow-y: auto;
    margin-top: 20px;
    border-radius: 20px;
    padding-right: 4px;
    display: none;
}

/* Chrome scroll */
.search-popup-result::-webkit-scrollbar {
    width: 8px;
}

.search-popup-result::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.search-popup-result::-webkit-scrollbar-thumb {
    background: #c7c7c7;
    border-radius: 10px;
}

/* result items */
.search-popup-result .result-item {
    display: block;
    padding: 12px 16px;
    border-radius: 14px;
    color: #263238;
    text-decoration: none;
    transition: background .15s;
}

.search-popup-result .result-item:hover {
    background: #f3f3f3;
}

.search-popup-result .title {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    line-height: 1.1;
}

.search-popup-result .title .doc-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 2px;
    background-color: #263238;
    color: #fff;
    white-space: nowrap;
}

.search-popup-result .snippet {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.search-popup-result .empty {
    padding: 12px 16px;
    color: var(--main-text);
}

.search-popup-result .search-divider {
    padding: 12px 16px;
    color: var(--main-text);
    margin-top: 12px;
    position: relative;
}

.search-popup-result .search-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 1px;
    width: 60%;

    background-color: var(--main-dark-grey);
}

.search-popup-result .search-divider:first-child {
    margin-top: 0;
}

.search-popup-result .search-divider:first-child::before {
    display: none;
}

mark {
    background: #fff3b0;
}

@media (max-width: 767px) {
    #global-search {
        width: 210px;
    }

    .denvic-search-overlay {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .denvic-search-popup {
        padding: 16px;
    }

    #global-search-popup {
        padding: 12px 16px;
        font-size: 16px;
    }

    .search-popup-result .result-item {
        padding: 6px 8px;
    }

    .search-popup-result .title {
        font-size: 14px;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 8px;
        align-items: flex-start;
    }
    .search-popup-result .title .doc-badge {
        font-size: 10px;
    }

    .denvic-global-header .header-inner svg {
        width: 120px;
    }
}