header { 
    position: sticky; 
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 999; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.5); 
    background: #222; 
    box-sizing: border-box; 
}

.top-banner-area { background: #cce6ff; width: 100%; text-align: center; }
.top-banner-widget { padding: 10px; font-weight: bold; color: #000; }
.top-banner-widget p { margin: 0; }
.top-banner-widget img { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.site-header { display: flex; align-items: center; gap: 15px; padding: 10px 20px; background: #222; color: #fff; flex-wrap: wrap; position: relative; }
.hamburger { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }
.logo { display: flex; align-items: center; }
.logo a { text-decoration: none; }
.logo h2 { margin: 0; color: #00a046; }
.logo img { max-height: 45px; width: auto !important; object-fit: contain;}

.btn-catalog { padding: 10px 15px; background: rgba(255,255,255,0.1); border: none; color: #fff; border-radius: 4px; cursor: pointer; display: flex; gap: 8px; align-items: center; }

.search-bar { flex-grow: 1; display: flex; background: #fff; border-radius: 4px; overflow: hidden; min-width: 200px; }
.search-bar input { width: 100%; padding: 10px; border: none; outline: none; }
.search-bar .mic { background: none; border: none; padding: 0 10px; cursor: pointer; font-size: 18px; }
.search-bar .find { padding: 10px 20px; background: #00a046; color: #fff; border: none; cursor: pointer; }

.header-actions { display: flex; gap: 15px; font-size: 20px; align-items: center; }

@media (min-width: 769px) {
    #catalog-menu { 
        display: none; 
        position: absolute; 
        top: 100%; 
        left: 50%; 
        transform: translateX(-50%);
        width: 100%; 
        max-width: 1400px;
        background: #fff; 
        color: #333; 
        box-shadow: 0 10px 20px rgba(0,0,0,0.15); 
        z-index: 100; 
        min-height: 450px;
        border-radius: 0 0 8px 8px;
    }
    
    .catalog-left { 
        width: 280px; 
        background: #fff; 
        padding: 15px 0; 
        flex-shrink: 0;
        border-right: 1px solid #e9e9e9;
    }
    
    .catalog-left li { 
        padding: 12px 20px; 
        cursor: pointer; 
        list-style: none; 
        margin: 0; 
        transition: 0.2s;
        border-left: 3px solid transparent;
    }
    
    .catalog-left li:hover, 
    .catalog-left li.active { 
        background: #f5f5f5; 
        color: #00a046; 
        border-left-color: #00a046;
        font-weight: bold;
    }

    .catalog-right { 
        padding: 30px; 
        flex-grow: 1; 
        background: #fbfbfb;
        display: flex;
        flex-direction: column;
    }
    
    .sub-cats { 
        display: none; 
        gap: 30px; 
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        align-content: flex-start;
        flex-grow: 1;
        position: relative;
        padding-bottom: 150px;
    }
    
    .sub-cats.active { display: grid; }
    
    .sub-col { width: 100%; }
    
    .sub-col h4 { margin-top: 0; margin-bottom: 15px; font-size: 16px; border-bottom: 2px solid #00a046; padding-bottom: 8px; display: inline-block; }
    .sub-col ul { list-style: none; padding: 0; margin: 0; }
    .sub-col ul li { margin-bottom: 10px; font-size: 14px; }
    .sub-col ul li a { text-decoration: none; color: #555; transition: 0.2s; }
    .sub-col ul li a:hover { color: #f84147; }

    .main-cat-bottom-info { position: absolute; bottom: 0; right: 0; width: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 20px; pointer-events: none; }
    .main-cat-bottom-info * { pointer-events: auto; }
    .main-cat-link-bottom { font-size: 26px; color: #333; text-decoration: none; font-weight: bold; transition: 0.2s; }
    .main-cat-link-bottom span { color: #00a046; text-decoration: underline; }
    .main-cat-link-bottom:hover span { color: #f84147; }
    .main-cat-img-bottom { max-width: 200px; max-height: 280px; object-fit: contain; }
}

.btn-servise { padding: 10px 15px; background: rgba(255,255,255,0.1); border: none; color: #fff; border-radius: 4px; cursor: pointer; display: flex; gap: 8px; align-items: center; transition: 0.2s; }
.btn-servise:hover { background: rgba(255,255,255,0.2); }

#servise-menu { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; color: #333; box-shadow: 0 4px 5px rgba(0,0,0,0.2); z-index: 100; padding: 30px; box-sizing: border-box; }

ul.servise-grid { display: grid !important; grid-template-columns: repeat(5, 1fr); gap: 30px; max-width: 1400px; margin: 0 auto !important; padding: 0 !important; list-style: none !important; }
ul.servise-grid > li.menu-item { margin: 0 !important; }
ul.servise-grid > li.menu-item > a { display: block !important; margin: 0 0 15px 0 !important; font-size: 18px !important; color: #333 !important; border-bottom: 2px solid #00a046 !important; padding-bottom: 8px !important; font-weight: bold !important; text-decoration: none !important; }
ul.servise-grid .sub-menu { list-style: none !important; padding: 0 !important; margin: 0 !important; }
ul.servise-grid .sub-menu li { margin-bottom: 10px !important; }
ul.servise-grid .sub-menu li a { color: #3e77aa !important; text-decoration: none !important; font-size: 14px !important; font-weight: normal !important; border: none !important; padding: 0 !important; display: inline !important; }
ul.servise-grid .sub-menu li a:hover { color: #f84147 !important; text-decoration: underline !important; }

@media (max-width: 992px) { ul.servise-grid { grid-template-columns: repeat(3, 1fr); } }
.hide-desktop { display: none; }

@media (max-width: 768px) {
    .hide-desktop { display: block; }
    
    .site-header {
        display: grid;
        grid-template-columns: auto 1fr auto auto;
        grid-template-areas:
            "lang logo search cart"
            "searchbar searchbar searchbar searchbar";
        align-items: center;
        gap: 15px;
        padding: 10px 15px;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .hamburger, .btn-catalog, .btn-servise,
    .header-actions .hide-mobile,
    #catalog-menu,
    #servise-menu {
        display: none !important;
    }

    .header-actions { display: contents !important; }

    /* Жестко задаем белый цвет без подчеркиваний */
    .custom-language-switcher a,
    .header-actions a {
        color: #fff !important;
        text-decoration: none !important;
    }

    .custom-language-switcher { grid-area: lang; }
    .logo { grid-area: logo; text-align: center; margin: 0 auto; }
    .logo img { max-height: 40px !important; }
    .mob-search-label { grid-area: search; font-size: 20px; cursor: pointer; color: #fff; margin-top: 2px; }
    .header-actions a[href="/cart/"] { grid-area: cart; font-size: 22px; text-decoration: none; }

    .search-bar {
        grid-area: searchbar;
        display: none !important;
        width: 100% !important;
        margin: 10px 0 5px 0 !important;
    }

    #mob-search-toggle:checked ~ .site-header .search-bar {
        display: flex !important;
    }
}

.mobile-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #fff; z-index: 10000; flex-direction: column; overflow-y: auto; }
.mobile-modal.active { display: flex; }
.mobile-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: #f5f5f5; border-bottom: 1px solid #ddd; }
.mobile-modal-header h3 { margin: 0; font-size: 18px; color: #333; }
#mobile-catalog-close { background: none; border: none; font-size: 28px; cursor: pointer; color: #333; }
.mobile-cat-list { list-style: none; padding: 0; margin: 0; }
.mobile-cat-list > li { border-bottom: 1px solid #eee; }
.mob-cat-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; }
.mob-cat-item a { text-decoration: none; color: #333; font-size: 16px; font-weight: bold; flex-grow: 1; }
.mob-cat-toggle { padding: 5px 15px; background: #f5f5f5; border-radius: 4px; cursor: pointer; transition: 0.3s; font-size: 12px; }
.mob-cat-toggle.open { transform: rotate(180deg); background: #00a046; color: #fff; }
.mob-sub-cat-list { list-style: none; padding: 0; margin: 0; display: none; background: #fafafa; }
.mob-sub-cat-list li a { display: block; padding: 12px 20px 12px 40px; color: #555; text-decoration: none; font-size: 14px; font-weight: normal; border-bottom: 1px solid #eee; }

.mobile-servise-list { list-style: none; padding: 0; margin: 0; }
.mobile-servise-list li { border-bottom: 1px solid #eee; position: relative; }
.mobile-servise-list li a { display: block; padding: 15px 20px; text-decoration: none; color: #333; font-size: 16px; font-weight: bold; }
.mobile-servise-list .sub-menu { list-style: none; padding: 0; margin: 0; background: #fafafa; display: none; }
.mobile-servise-list .sub-menu li a { padding: 12px 20px 12px 40px; font-size: 14px; font-weight: normal; border-bottom: 1px solid #eee; }

.mobile-servise-list li.menu-item-has-children > a::after { content: '▼'; position: absolute; right: 20px; font-size: 12px; transition: 0.3s; }
.mobile-servise-list li.menu-item-has-children.open > .sub-menu { display: block; }
.mobile-servise-list li.menu-item-has-children.open > a::after { transform: rotate(180deg); }

/* Жесткая фиксация меню для мобільних (отключение скриптов темы) */
@media (max-width: 768px) {
    body {
        /* Отступ сверху для шапки и снизу для нижнего меню */
        padding-top: 65px !important; 
        padding-bottom: 70px !important; 
    }
    
    header {
        position: fixed !important; /* Меняем sticky на fixed */
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 99999 !important;
        /* Намертво блокируем любые попытки JS сдвинуть шапку: */
        transform: none !important; 
        margin-top: 0 !important;
    }

    .mobile-bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 99999 !important;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        /* Намертво блокируем сдвиги нижнего меню: */
        transform: none !important;
        margin-bottom: 0 !important;
        padding-bottom: env(safe-area-inset-bottom);
    }
}
/* Жесткая фиксация меню для мобільних (отключение скриптов темы) */
@media (max-width: 768px) {
    body {
        /* Отступ сверху для шапки и снизу для нижнего меню */
        padding-top: 65px !important; 
        padding-bottom: 70px !important; 
    }
    
    header {
        position: fixed !important; /* Меняем sticky на fixed */
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 99999 !important;
        /* Намертво блокируем любые попытки JS сдвинуть шапку: */
        transform: none !important; 
        margin-top: 0 !important;
    }

    .mobile-bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 99999 !important;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        /* Намертво блокируем сдвиги нижнего меню: */
        transform: none !important;
        margin-bottom: 0 !important;
        padding-bottom: env(safe-area-inset-bottom);
    }
}