/* Ukrainian subsite only; the existing header remains intact on other sites. */
.fv-header--ua .fv-header-compare{display:none;}
.fv-header--ua .fv-header-shortcuts{display:none;}
.fv-header--ua a:focus-visible,.fv-header--ua button:focus-visible{outline:3px solid #075e54;outline-offset:3px;}
.fv-header--ua a[aria-current="page"]{color:#075e54;background:#e6f3ef;text-decoration:underline;text-underline-offset:4px;}

.fv-header--ua .fv-header-tool-link{
    align-items:center;
    justify-content:center;
    border-radius:999px;
    box-sizing:border-box;
}

.fv-header--ua .fv-header-primary-cta{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:0 15px;
    border:1px solid #dfad27;
    border-radius:999px;
    box-sizing:border-box;
    color:#172033;
    background:#f2c94c;
    font-weight:800;
    line-height:1;
    transition:background-color .15s ease,border-color .15s ease;
}

.fv-header--ua .fv-header-primary-cta:hover,
.fv-header--ua .fv-header-primary-cta:focus-visible{
    color:#172033;
    border-color:#d59f18;
    background:#e9b949;
}

.fv-header--ua .fv-header-primary-cta[aria-current="page"]{
    color:#172033;
    border-color:#c89210;
    background:#e9b949;
    text-decoration:underline;
    text-underline-offset:4px;
}

.fv-header--ua .fv-header-desktop-tool{
    display:inline-flex;

    gap:6px;

    min-height:40px;
    padding:0 12px;

    border:1px solid #4ea99f;
    background:#f0fbf3;

    border-radius:999px;
}

.fv-header--ua .fv-header-desktop-tool:hover,
.fv-header--ua .fv-header-desktop-tool:focus-visible{
    border-color:#0d6b5d;
    background:#dbf3e7;
}

.fv-header--ua .fv-header-desktop-tool[aria-current="page"]{
    background:#d6efdc;
    border-color:#0c7a68;
}

.fv-header--ua .fv-header-desktop-tool img{
    width:18px;
    height:18px;
}

.fv-header--ua .fv-header-desktop-tool span{
    line-height:1;
    font-size:16px;
}

@media(max-width:767px){
    .fv-header.fv-header--ua{position:sticky!important;}
    .fv-header--ua + .fv-main{padding-top:0;}
    .fv-header--ua .fv-header__inner{flex-wrap:wrap;gap:8px;}
    /* Override the existing important logo widths only for this mobile header. */
    .fv-header--ua .fv-logo{width:clamp(96px,calc(100vw - 252px),124px)!important;max-width:124px!important;height:40px!important;}
    .fv-header--ua .fv-logo img{width:100%!important;max-width:100%!important;}
    .fv-header--ua .fv-header-shortcuts{display:flex;align-items:center;gap:4px;margin-left:auto;}
    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link{
        display:flex;
        width:44px;
        height:44px;
        border:1px solid #4ea99f;
        border-radius:11px;
        background:#f1fcf6;
        padding:0;
    }
    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link img{
        width:26px;
        height:26px;
    }
    .fv-header--ua .fv-header-shortcuts .fv-header-credit{
        border-color:#dfad27;
        background:#f2c94c;
    }
    .fv-header--ua .fv-header-shortcuts .fv-header-credit:hover,
    .fv-header--ua .fv-header-shortcuts .fv-header-credit:focus-visible,
    .fv-header--ua .fv-header-shortcuts .fv-header-credit[aria-current="page"]{
        border-color:#d59f18;
        background:#e9b949;
    }
    .fv-header--ua .fv-menu-toggle{display:none;flex:0 0 44px;width:44px;height:44px;margin-left:0;}
    .fv-header--ua.is-nav-enhanced .fv-menu-toggle{display:block;}
    .fv-header--ua .fv-primary-nav{position:static;display:block;flex:1 0 100%;border:0;box-shadow:none;padding:6px;max-height:calc(100dvh - 110px);overflow-y:auto;}
    .fv-header--ua.is-nav-enhanced .fv-primary-nav:not(.is-open){display:none;}
    .fv-header--ua:not(.is-nav-enhanced){position:relative!important;}
    .fv-header--ua .fv-primary-nav__list a{min-height:44px;}
}
/* Complete UA navigation: desktop collections flyout and grouped mobile drawer. */
.fv-header--ua .fv-primary-nav__mobile{display:none;}
.fv-header--ua .fv-primary-nav__collections{position:relative;}
.fv-header--ua .fv-nav-dropdown{position:relative;}
.fv-header--ua .fv-nav-dropdown > summary{
    display:flex;
    align-items:center;
    gap:6px;
    min-height:38px;
    padding:8px 12px;
    border-radius:9px;
    color:#344054;
    font-size:14px;
    line-height:1.2;
    font-weight:700;
    cursor:pointer;
    list-style:none;
    transition:background-color .15s ease,color .15s ease;
}
.fv-header--ua .fv-nav-dropdown > summary::-webkit-details-marker{display:none;}
.fv-header--ua .fv-nav-dropdown > summary::after{
    content:"";
    width:7px;
    height:7px;
    border-right:2px solid currentColor;
    border-bottom:2px solid currentColor;
    transform:translateY(-2px) rotate(45deg);
    transition:transform .15s ease;
}
.fv-header--ua .fv-nav-dropdown[open] > summary::after{transform:translateY(2px) rotate(225deg);}
.fv-header--ua .fv-nav-dropdown > summary:hover,
.fv-header--ua .fv-nav-dropdown:focus-within > summary,
.fv-header--ua .fv-nav-dropdown.is-current > summary{
    color:#075e54;
    background:#eef7f4;
}
.fv-header--ua .fv-nav-dropdown::after{
    content:"";
    position:absolute;
    z-index:99;
    top:100%;
    left:0;
    width:100%;
    height:10px;
}
.fv-header--ua .fv-nav-dropdown__menu{
    position:absolute;
    z-index:100;
    top:calc(100% + 8px);
    left:0;
    display:grid;
    width:min(320px,calc(100vw - 32px));
    max-height:calc(100vh - 92px);
    gap:2px;
    margin:0;
    padding:8px;
    overflow-y:auto;
    border:1px solid #d8e4e1;
    border-radius:14px;
    background:#fff;
    box-shadow:0 14px 28px rgba(16,24,40,.13);
    list-style:none;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateY(-4px);
    transition:opacity .15s ease,transform .15s ease,visibility .15s ease;
}
.fv-header--ua .fv-nav-dropdown[open] > .fv-nav-dropdown__menu,
.fv-header--ua .fv-nav-dropdown:hover > .fv-nav-dropdown__menu,
.fv-header--ua .fv-nav-dropdown:focus-within > .fv-nav-dropdown__menu{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translateY(0);
}
.fv-header--ua .fv-nav-dropdown__menu a{
    min-height:38px;
    padding:8px 10px;
    border-radius:8px;
    font-size:13px;
    font-weight:600;
    line-height:1.3;
}

@media(min-width:768px) and (max-width:1050px){
    .fv-header--ua .fv-header__inner{gap:10px;}
    .fv-header--ua .fv-primary-nav__desktop{gap:2px;}
    .fv-header--ua .fv-primary-nav__desktop > li > a,
    .fv-header--ua .fv-nav-dropdown > summary{
        padding-right:6px;
        padding-left:6px;
        font-size:13px;
    }
    .fv-header--ua .fv-header-desktop-tool{gap:4px;padding:0 7px;}
    .fv-header--ua .fv-header-primary-cta{padding:0 9px;font-size:13px;}
    .fv-header--ua .fv-header-desktop-tool span{font-size:13px;}
}

@media(max-width:767px){
    .fv-header--ua .fv-primary-nav__desktop{display:none;}
    .fv-header--ua .fv-primary-nav__mobile{display:grid;gap:13px;}
    .fv-header--ua .fv-mobile-nav-group{
        padding:5px 5px 10px;
        border-bottom:1px solid #e4ece9;
    }
    .fv-header--ua .fv-mobile-nav-group:last-child{padding-bottom:4px;border-bottom:0;}
    .fv-header--ua .fv-mobile-nav-group__title{
        margin:0 0 4px;
        padding:0 8px;
        color:#667085;
        font-size:11px;
        line-height:1.4;
        font-weight:800;
        letter-spacing:.07em;
        text-transform:uppercase;
    }
    .fv-header--ua .fv-primary-nav__mobile .fv-primary-nav__list{
        display:grid;
        gap:2px;
    }
    .fv-header--ua .fv-primary-nav__mobile .fv-primary-nav__list a{
        min-height:44px;
        padding:10px 8px;
        font-size:15px;
        line-height:1.35;
    }
    .fv-header--ua .fv-mobile-nav-group--secondary .fv-primary-nav__list a,
    .fv-header--ua .fv-mobile-nav-group--about .fv-primary-nav__list a{
        font-size:14px;
        font-weight:650;
    }
}

/* === HEADER REAL CONTROLS V2 START === */

/* DESKTOP */
@media (min-width:768px){

    /* Кредити: жёлтая ОБВОДКА вместо сплошной жёлтой заливки */
    .fv-header--ua nav a[href$="/kredyty/"]{
        display:inline-flex !important;
        align-items:center !important;
        justify-content:center !important;
        min-height:40px !important;
        padding:0 18px !important;

        background:#fffdf7 !important;
        border:1.5px solid #d6aa22 !important;
        border-radius:999px !important;

        color:#172033 !important;
        text-decoration:none !important;
        box-shadow:none !important;
    }

    .fv-header--ua nav a[href$="/kredyty/"]:hover{
        background:#fff8dc !important;
        border-color:#c99a12 !important;
        color:#172033 !important;
    }

    /* Добірки — обычный пункт, как Довідник / Про нас */
    .fv-header--ua nav li:last-child > button{
        min-height:auto !important;
        padding:0 !important;

        background:transparent !important;
        border:0 !important;
        border-radius:0 !important;
        box-shadow:none !important;

        color:#334155 !important;
        font:inherit !important;
        font-weight:600 !important;
    }

    .fv-header--ua nav li:last-child > button:hover{
        background:transparent !important;
        color:#075e54 !important;
    }
}


/* MOBILE */
@media (max-width:767px){

    /*
     * Реальная структура:
     * .fv-header--ua
     *   .fv-header-shortcuts
     *      1 = Кредити
     *      2 = Порівняти
     *      3 = Калькулятор
     */

    .fv-header--ua .fv-header__inner{
        gap:5px !important;
        flex-wrap:wrap !important;
    }

    /*
     * Раскрытое burger-меню должно занимать отдельную
     * полную строку под верхними контролами, а не ехать вправо.
     */
    .fv-header--ua [data-fv-primary-nav]{
        flex:0 0 100% !important;
        width:100% !important;
        max-width:100% !important;
        min-width:0 !important;
    }

    /* Освобождаем место за счёт логотипа */
    .fv-header--ua .fv-logo{
        width:92px !important;
        max-width:92px !important;
        height:auto !important;
        flex:0 0 92px !important;
    }

    .fv-header--ua .fv-logo img{
        width:100% !important;
        max-width:100% !important;
        height:auto !important;
    }

    .fv-header--ua .fv-header-shortcuts{
        display:flex !important;
        align-items:center !important;
        gap:4px !important;
        margin-left:auto !important;
        flex:0 1 auto !important;
    }

    /* Вместо квадратных иконок — компактные текстовые кнопки */
    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link{
        display:inline-flex !important;
        align-items:center !important;
        justify-content:center !important;

        width:auto !important;
        min-width:0 !important;
        height:40px !important;
        padding:0 7px !important;

        border:1.5px solid #49aa9e !important;
        border-radius:12px !important;
        background:#f8fffd !important;

        color:#172033 !important;
        font-size:0 !important;
        line-height:1 !important;
        text-decoration:none !important;
        white-space:nowrap !important;
        box-sizing:border-box !important;
    }

    /* Старые картинки полностью скрываем */
    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link img,
    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link svg{
        display:none !important;
    }

    /* Текст */
    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link::after{
        display:block !important;
        font-size:10px !important;
        line-height:1 !important;
        font-weight:700 !important;
        letter-spacing:-0.15px !important;
        color:#172033 !important;
    }

    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link:nth-child(1)::after{
        content:"Кредити";
    }

    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link:nth-child(2)::after{
        content:"Порівняти";
    }

    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link:nth-child(3)::after{
        content:"Калькулятор";
    }

    /* Первая кнопка — жёлтая ОБВОДКА */
    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link:nth-child(1){
        background:#fffdf7 !important;
        border-color:#d6aa22 !important;
    }

    /*
     * Текущая страница не должна превращать Кредити
     * обратно в мятную заливку через общий aria-current.
     */
    .fv-header--ua .fv-header-shortcuts .fv-header-tool-link:nth-child(1)[aria-current="page"]{
        background:#fff8dc !important;
        border-color:#c99a12 !important;
        color:#172033 !important;
        text-decoration:none !important;
    }
}

/* === HEADER REAL CONTROLS V2 END === */

/* Nested lender navigation under the clickable MFO directory parent. */
.fv-header--ua .fv-nav-dropdown__item--nested{position:relative;}
.fv-header--ua .fv-nav-submenu{position:relative;}
.fv-header--ua .fv-nav-submenu>summary{
    display:flex;align-items:center;gap:4px;min-height:38px;
    border-radius:8px;list-style:none;cursor:pointer;
}
.fv-header--ua .fv-nav-submenu>summary::-webkit-details-marker{display:none;}
.fv-header--ua .fv-nav-submenu>summary>a{flex:1;min-width:0;}
.fv-header--ua .fv-nav-submenu__chevron{
    flex:0 0 7px;width:7px;height:7px;margin-right:11px;
    border-right:2px solid #667085;border-bottom:2px solid #667085;
    transform:rotate(-45deg);transition:transform .15s ease;
}
.fv-header--ua .fv-nav-submenu[open] .fv-nav-submenu__chevron{transform:rotate(45deg);}
.fv-header--ua .fv-nav-submenu__menu{
    position:static;display:none;width:auto;gap:2px;margin:2px 7px 7px;padding:5px;
    border:0;border-left:2px solid #cfe3de;border-radius:0;background:#f7fbfa;
    box-shadow:none;list-style:none;
}
.fv-header--ua .fv-nav-submenu[open]>.fv-nav-submenu__menu,
.fv-header--ua .fv-nav-submenu:hover>.fv-nav-submenu__menu,
.fv-header--ua .fv-nav-submenu:focus-within>.fv-nav-submenu__menu{display:grid;}
.fv-header--ua .fv-nav-submenu__menu a{font-size:13px;font-weight:600;}

@media(max-width:767px){
    .fv-header--ua .fv-mobile-nav-nested>.fv-nav-submenu>summary{min-height:44px;}
    .fv-header--ua .fv-mobile-nav-nested .fv-nav-submenu__chevron{
        margin-right:14px;transform:rotate(45deg);
    }
    .fv-header--ua .fv-mobile-nav-nested .fv-nav-submenu[open] .fv-nav-submenu__chevron{
        transform:rotate(225deg);
    }
    .fv-header--ua .fv-mobile-nav-nested .fv-nav-submenu__menu{
        position:static;display:none;width:auto;margin:2px 8px 6px;padding:5px;
        border:0;border-left:2px solid #cfe3de;border-radius:0;background:#f7fbfa;
        box-shadow:none;opacity:1;visibility:visible;pointer-events:auto;transform:none;
    }
    .fv-header--ua .fv-mobile-nav-nested .fv-nav-submenu[open]>.fv-nav-submenu__menu{display:grid;}
    .fv-header--ua .fv-mobile-nav-nested .fv-nav-submenu__menu a{
        min-height:40px;padding:8px 12px;font-size:13px;
    }
}
