.wfh-element-wrapper.wfh-element-burger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Базові правила видимості пристроїв */
.wfh-device-mobile { display: none; }
.wfh-device-desktop { display: block; }

.wfh-row.wfh-row-top {
    display: flex !important;
    align-items: center !important;
}

/* Це потрібно додати туди, де в тебе стилізується клас липкості */
.wfh-row.wfh-is-sticky-row.wfh-sticky-active { 
    background-color: var(--wfh-sticky-bg, #ffffff) !important;
}

.wfh-row.wfh-row-main {
    display: flex;
    align-items: center;
}

/* Адаптивність: Ховаємо десктоп і показуємо мобільну версію на екранах < 1024px */
@media (max-width: 1024px) {
    .wfh-device-desktop { display: none !important; }
    .wfh-device-mobile { display: block !important; }
    .wfh-device-mobile .wfh-row.wfh-row-main.wfh-is-sticky-row {
    padding: 0 20px !important;
}
}

.wfh-row.wfh-row-main.wfh-is-sticky-row {
    display: flex;
}

/* =========================================
   СТРАХОВКА ДЛЯ КОНТЕЙНЕРА ЛОГОТИПУ
========================================= */
.wfh-logo-wrapper {
    display: flex; align-items: center; height: 100%; max-height: inherit; min-height: 0;
}
.wfh-logo-link {
    display: inline-flex; align-items: center; text-decoration: none; transition: opacity 0.3s ease; height: 100%; max-height: 100%;
}
.wfh-logo-img {
    width: auto; height: auto; max-width: 100%; object-fit: contain; display: block;
    max-height: calc(var(--wfh-row-height, 1000px) - 20px);
}

/* =========================================
   МОБІЛЬНА БІЧНА ПАНЕЛЬ (Offcanvas)
========================================= */

/* Затемнений фон */
.wfh-mobile-sidebar-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999998;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.wfh-mobile-sidebar-overlay.wfh-panel-active {
    opacity: 1; visibility: visible;
}

/* Сама виїзна панель */
.wfh-mobile-sidebar {
    position: fixed;
    top: 0; left: 0; 
    width: 320px; max-width: 90vw; 
    
    /* ФІКС: Використовуємо 100% як базу, 100vh для старих браузерів, і 100dvh для сучасних мобільних */
    height: 100%;
    height: 100vh;
    height: 100dvh; 
    
    background-color: #ffffff; 
    z-index: 999999;
    overflow-y: auto; overflow-x: hidden;
    transform: translateX(-100%); /* ГАРАНТІЯ ПРИХОВУВАННЯ ПРИ ЗАВАНТАЖЕННІ */
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* ФІКС: Додаємо відступ знизу для системної смужки iOS (Home Indicator) та простору для кнопки */
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0px);
}

/* Позиція ЗЛІВА */
.wfh-mobile-sidebar.wfh-pos-left {
    left: 0; right: auto;
    transform: translateX(-100%);
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
}
.wfh-mobile-sidebar.wfh-pos-left.wfh-panel-active {
    transform: translateX(0);
}

/* Позиція СПРАВА */
.wfh-mobile-sidebar.wfh-pos-right {
    left: auto; right: 0;
    transform: translateX(100%);
    box-shadow: -2px 0 15px rgba(0,0,0,0.1);
}
.wfh-mobile-sidebar.wfh-pos-right.wfh-panel-active {
    transform: translateX(0);
}

/* Кнопка закриття */
.wfh-sidebar-close-btn {
    position: absolute; top: 15px; right: 15px;
    width: 30px; height: 30px;
    background: #f1f1f1; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10;
    transition: background 0.3s ease;
}
.wfh-sidebar-close-btn:hover {
    background: #e1e1e1;
}
.wfh-sidebar-close-btn .dashicons {
    color: #333; font-size: 18px; width: 18px; height: 18px; line-height: 18px; display: flex;
    align-items: center;
    justify-content: center;
}

/* Внутрішній контейнер для флексу */
.wfh-sidebar-inner {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; 
    
    /* ФІКС: Аналогічно змінюємо min-height */
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}
.wfh-panel-element-wrapper {
    width: 100%;
}

/* =========================================
   МЕНЮ В МОБІЛЬНІЙ ПАНЕЛІ (ЯДЕРНЕ СКИДАННЯ ТЕМИ)
========================================= */
.wfh-mobile-sidebar .wfh-nav-menu ul,
.wfh-mobile-sidebar .wfh-nav-menu li {
    list-style: none !important; padding: 0 !important; margin: 0 !important;
    flex-direction: column !important; gap: 0 !important;
    background: transparent !important; box-shadow: none !important;
}
.wfh-mobile-sidebar .wfh-nav-menu li {
    position: relative !important; width: 100% !important;
    border-bottom: 1px solid #f2f2f2 !important; display: block !important;
}
.wfh-mobile-sidebar .wfh-nav-menu li:last-child {
    border-bottom: none !important;
}

.wfh-mobile-sidebar .wfh-nav-menu > ul > li > a {
    display: flex !important; align-items: center !important; 
    padding: 15px 20px !important; color: #333 !important;
    font-size: 14px !important; font-weight: 600 !important; 
    text-decoration: none !important; text-transform: uppercase !important;
    background: transparent !important; border: none !important;
}

/* --- ВАЖЛИВІ ФІКСИ ДЕСКТОПНИХ СТИЛІВ --- */

/* 1. Приховуємо оригінальну десктопну стрілку від WoodMart */
.wfh-mobile-sidebar .wfh-nav-menu .menu-item-has-children > a::after,
.wfh-mobile-sidebar .wfh-nav-menu .menu-item-has-children > a::before,
.wfh-mobile-sidebar .wfh-nav-menu a .wfh-menu-arrow,
.wfh-mobile-sidebar .wfh-nav-menu a svg,
.wfh-mobile-sidebar .wfh-nav-menu a i {
    display: none !important; content: none !important;
}

/* 2. Змінюємо позиціонування підменю з випадаючого на акордеон */
.wfh-mobile-sidebar .wfh-nav-menu ul.sub-menu,
.wfh-mobile-sidebar .wfh-nav-menu ul.children {
    position: static !important; /* Перебиваємо десктопний absolute */
    width: 100% !important;
    box-shadow: none !important; /* Перебиваємо тінь */
    transform: none !important; /* Перебиваємо анімацію виїзду */
    opacity: 1 !important; 
    visibility: visible !important;
    display: none; /* Ховаємо для роботи JS slideToggle */
    background-color: #fafafa !important; padding: 0 !important; margin: 0 !important;
    border: none !important; height: auto !important; max-height: none !important;
}

/* 3. Блокуємо відкриття підменю по наведенню (hover) */
.wfh-mobile-sidebar .wfh-nav-menu li:hover > ul.sub-menu,
.wfh-mobile-sidebar .wfh-nav-menu li:hover > ul.children {
    display: none; /* Тільки JS має керувати відкриттям */
}

/* --- КІНЕЦЬ ФІКСІВ --- */

/* Стилі посилань підменю */
.wfh-mobile-sidebar .wfh-nav-menu ul.sub-menu > li > a,
.wfh-mobile-sidebar .wfh-nav-menu ul.children > li > a {
    display: block !important;
    padding: 12px 20px 12px 35px !important; font-size: 14px !important; font-weight: 400 !important;
    color: #555 !important; text-transform: none !important; border-top: 1px solid #e9e9e9 !important;
}
.wfh-mobile-sidebar .wfh-nav-menu ul.sub-menu .sub-menu a {
    padding-left: 50px !important;
}

/* Кнопка-стрілка (Arrow Action) */
.wfh-submenu-toggle {
    position: absolute; top: 0; right: 0; width: 50px; height: 49px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-left: 1px solid #f2f2f2;
    background-color: transparent; z-index: 10; transition: background 0.2s ease;
}
.wfh-submenu-toggle:hover {
    background-color: #f7f7f7;
}
.wfh-submenu-toggle::after {
    content: "\f345" !important; /* dashicons-arrow-down-alt2 */
    font-family: dashicons !important; font-size: 18px !important; color: #888 !important;
    transition: transform 0.3s ease !important; display: block !important;
}

/* Планшет */
/* --- Виправлення конфлікту стрілок для нового Mobile Menu --- */
@media (max-width: 1024px) {
    body .wfh-submenu-toggle::after {
    display: none !important;
}
    /* 1. Завжди показуємо нашу функціональну кнопку-стрілку (працює і для Слайду, і для Акордеона) */
    body .wfh-mobile-sidebar[data-submenu-action="link"] .wfh-mobile-menu-wrapper .wfh-submenu-toggle {
        display: flex !important;
    }
    
    /* 2. Ховаємо "стару" глобальну стрілку-дублікат, щоб в Акордеоні була лише одна стрілочка */
    body .wfh-mobile-sidebar[data-submenu-action="link"] .wfh-mobile-menu-wrapper .menu-item-has-children > a::after {
        display: none !important;
        content: none !important;
    }
    body .wfh-mobile-sidebar[data-submenu-action="link"] .menu-item-has-children > a {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding-right: 15px !important;
}
}

.wfh-submenu-toggle.wfh-open::after {
    transform: rotate(180deg) !important; color: #333 !important;
}

/* Зменшена висота кнопки для підменю */
.wfh-mobile-sidebar .wfh-nav-menu ul.sub-menu .wfh-submenu-toggle {
    height: 43px;
}

/* Дія "Клік по всьому посиланню" (Link Action) */
.wfh-mobile-sidebar[data-submenu-action="link"] .wfh-submenu-toggle {
    display: none !important;
}
.wfh-mobile-sidebar[data-submenu-action="link"] .menu-item-has-children > a {
    display: flex !important; justify-content: space-between !important; align-items: center !important; padding-right: 15px !important;
}
.wfh-mobile-sidebar[data-submenu-action="link"] .menu-item-has-children > a::after {
    content: "\f345" !important; font-family: dashicons !important; font-size: 18px !important; color: #888 !important;
    transition: transform 0.3s ease !important; margin-left: 10px !important; display: block !important;
}
.wfh-mobile-sidebar[data-submenu-action="link"] .menu-item-has-children > a.wfh-open::after {
    transform: rotate(180deg) !important; color: #333 !important;
}

/* =========================================
   КЛОНОВАНИЙ ЛИПКИЙ ХЕДЕР (Як в Elementor)
========================================= */
.wfh-sticky-clone .wfh-nav-menu > li > ul.sub-menu {
    top: calc(70% + var(--current-drop-off)) !important;
}

.wfh-sticky-clone {
    position: fixed !important;
    /* Стартуємо вище екрану. -150px достатньо, щоб сховати хедер, але не робити ривків */
    top: -150px !important; 
    left: 0 !important;
    width: 100% !important;
    z-index: 99990 !important;
    background-color: var(--wfh-sticky-bg, #ffffff);
    visibility: hidden;
    
    /* Твоя улюблена плавна анімація з Elementor */
    transition: top 0.4s ease-in-out, visibility 0.4s, background-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Коли хедер з'являється */
.wfh-sticky-clone.wfh-is-visible {
    top: 0 !important;
    visibility: visible;
}

.wfh-sticky-clone.wfh-no-animation {
    transition: visibility 0s, box-shadow 0.3s ease !important;
}

.wfh-sticky-clone.wfh-has-shadow.wfh-is-visible {
    /* box-shadow: 0 5px 25px rgba(0,0,0,0.08); */
}

/* ФІКСИ ДЛЯ ADMIN BAR (Відпрацьовують тільки коли хедер видимий) */
.admin-bar .wfh-sticky-clone.wfh-is-visible { top: 32px !important; }
@media screen and (max-width: 782px) {
    .admin-bar .wfh-sticky-clone.wfh-is-visible { top: 46px !important; }
}
@media screen and (max-width: 600px) {
    .admin-bar .wfh-sticky-clone.wfh-is-visible { top: 0 !important; }
}