.bmh-wrap {
    display: none;
}
.bmh-wrap * {
    box-sizing: border-box;
}

@media (max-width: 768px) {
    /* Font family inheritance from Customizer */
    .bmh-wrap,
    .bmh-sidebar,
    .bmh-menu a,
    .bmh-sidebar-cta a,
    .bt-lang-dropdown {
        font-family: var(--bt-menu-font), var(--bt-font), system-ui, -apple-system, sans-serif;
    }

    body.bmh-enabled {
        padding-top: 92px;
    }
    
    .bmh-wrap {
        display: block;
    }
    
    .bmh-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 99990;
        min-height: 92px;
        background: rgba(255, 255, 255, .92);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid #eef2f7;
        padding: 18px 16px 12px;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: min-height 0.2s ease, padding 0.2s ease;
    }
    
    .bmh-logo {
        flex: 1;
        min-width: 0;
    }
    
    /* Logo sizing & adaptive styles */
    .bmh-logo img,
    .bmh-sidebar-logo img {
        max-height: 36px !important;
        width: auto !important;
        display: block;
        transition: max-height 0.2s ease;
    }
    
    .bmh-brand-logo--light {
        display: none !important;
    }
    
    .bmh-brand-logo--dark {
        display: block !important;
    }
    
    body.botmotics-theme-light .bmh-brand-logo--dark,
    body.botmotics-theme-white-premium .bmh-brand-logo--dark {
        display: none !important;
    }
    
    body.botmotics-theme-light .bmh-brand-logo--light,
    body.botmotics-theme-white-premium .bmh-brand-logo--light {
        display: block !important;
    }
    
    .bmh-site-name {
        font-size: 28px;
        font-weight: 800;
        color: var(--bmh-navy);
        text-decoration: none;
    }
    
    .bmh-actions {
        margin-left: auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
    }
    
    /* Circular action buttons */
    .bmh-icon-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border: 1px solid #e5ebf3;
        background: #fff;
        color: #071a3a;
        border-radius: 50% !important; /* perfectly circular */
        box-shadow: 0 8px 24px rgba(7, 26, 58, .06);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        cursor: pointer;
        outline: none;
        transition: border-color 0.2s ease, color 0.2s ease;
    }
    
    .bmh-icon-btn:hover {
        border-color: rgba(37, 99, 235, 0.2);
        color: #2563eb;
    }
    
    .bmh-icon-btn svg {
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    
    /* Premium Translation Switcher styles for bmh-wrap */
    .bmh-wrap .bt-lang-dropdown {
        position: relative;
        display: inline-block;
    }
    
    .bmh-wrap .bt-lang-toggle {
        height: 44px;
        min-height: 44px;
        padding: 0 12px;
        border: 1px solid #e5ebf3;
        background: #fff;
        color: #071a3a;
        border-radius: 999px !important; /* rounded pill shape */
        box-shadow: 0 8px 24px rgba(7, 26, 58, .06);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        font-weight: 700;
        font-size: 14px;
        cursor: pointer;
        position: relative;
        outline: none;
        transition: border-color 0.2s ease, color 0.2s ease;
    }
    
    .bmh-wrap .bt-lang-toggle:hover {
        border-color: rgba(37, 99, 235, 0.2);
        color: #2563eb;
    }
    
    .bmh-wrap .bt-lang-toggle::after {
        content: "⌄" !important;
        position: static !important;
        display: inline-block !important;
        border: 0 !important;
        width: auto !important;
        height: auto !important;
        transform: none !important;
        font-size: 16px !important;
        color: #2563eb !important;
        pointer-events: auto !important;
        transition: none !important;
        margin-left: 2px !important;
    }
    
    .bmh-wrap .bt-lang-flag {
        width: 20px !important;
        height: 20px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        aspect-ratio: 1/1 !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
    }
    
    .bmh-wrap .bt-lang-name {
        display: inline-block;
    }
    
    .bmh-wrap .bt-lang-menu {
        position: absolute;
        top: 100%;
        right: 0;
        margin-top: 8px;
        padding: 6px;
        list-style: none;
        background: #fff;
        border: 1px solid #e5ebf3;
        border-radius: 16px;
        box-shadow: 0 16px 48px rgba(7, 26, 58, 0.16);
        min-width: 140px;
        z-index: 100000;
        display: none;
    }
    
    .bmh-wrap .bt-lang-dropdown.open .bt-lang-menu {
        display: block;
    }
    
    .bmh-wrap .bt-lang-menu li {
        margin: 0;
        padding: 0;
    }
    
    .bmh-wrap .bt-lang-menu a {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 12px !important;
        color: #ffffff !important;
        font-weight: 600 !important;
        font-size: 14px !important;
        text-decoration: none !important;
        border-radius: 10px !important;
        transition: background 0.2s ease !important;
        border-bottom: 0 !important;
        min-height: auto !important;
    }
    
    .bmh-wrap .bt-lang-menu a:hover {
        background: #f5f8fc !important;
        color: #2563eb !important;
    }
    
    .bmh-wrap .bt-lang-menu .bt-lang-flag {
        width: 18px !important;
        height: 18px !important;
    }

    .bmh-overlay {
        position: fixed;
        inset: 0;
        background: rgba(5, 14, 32, .42);
        z-index: 99991;
    }
    
    .bmh-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: min(88vw, 390px);
        height: 100dvh;
        background: #fff;
        z-index: 99992;
        transform: translateX(105%);
        transition: transform .28s ease;
        border-radius: 24px 0 0 24px;
        box-shadow: -24px 0 80px rgba(7, 26, 58, .25);
        padding: 18px;
        overflow: auto;
    }
    
    .bmh-sidebar.is-open {
        transform: translateX(0);
    }
    
    .bmh-sidebar-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 18px;
        border-bottom: 1px solid #eef2f7;
    }
    
    .bmh-sidebar-actions {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 4px;
        border-bottom: 1px solid #eef2f7;
        margin-bottom: 12px;
    }
    
    .bmh-sidebar-logo img {
        max-height: 34px !important;
        width: auto !important;
    }
    
    /* Circular close button */
    .bmh-close {
        width: 42px;
        height: 42px;
        border: 1px solid #e5ebf3;
        background: #fff;
        border-radius: 50% !important; /* perfectly circular close button */
        font-size: 28px;
        color: #071a3a;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        outline: none;
        transition: border-color 0.2s ease, color 0.2s ease;
    }

    .bmh-close:hover {
        border-color: rgba(37, 99, 235, 0.2);
        color: #2563eb;
    }
    
    .bmh-menu {
        list-style: none;
        margin: 18px 0 0;
        padding: 0;
    }
    
    .bmh-menu li {
        margin: 0;
    }
    
    /* Left-aligned menu categories next to icons */
    .bmh-menu a {
        display: flex;
        align-items: center;
        justify-content: flex-start; /* left align */
        gap: 12px; /* space between icon and text */
        min-height: 52px;
        border-bottom: 1px solid #f0f3f7;
        text-decoration: none;
        color: #071a3a;
        font-weight: 700;
        padding: 0 4px;
        position: relative;
        padding-right: 32px; /* space for absolute arrow */
        transition: color 0.2s ease;
    }

    .bmh-menu a:hover {
        color: #2563eb;
    }

    .bmh-menu .bt-mega-title-icon {
        margin-right: 0 !important; /* use flex gap instead */
    }

    /* Animated CSS Border Chevron for items with submenus */
    .bmh-menu .menu-item-has-children > a::after {
        content: "" !important;
        position: absolute;
        right: 12px;
        top: 50%;
        width: 7px;
        height: 7px;
        border-right: 2px solid #071a3a;
        border-bottom: 2px solid #071a3a;
        transform: translateY(-50%) rotate(-45deg);
        transition: transform 0.22s ease, border-color 0.2s ease;
        pointer-events: none;
    }

    .bmh-menu .menu-item-has-children > a:hover::after {
        border-color: #2563eb;
    }

    .bmh-menu .menu-item-has-children.is-open > a::after {
        transform: translateY(-75%) rotate(45deg); /* rotate downwards when open */
    }
    
    .bmh-menu .sub-menu {
        display: none;
        list-style: none;
        margin: 0 0 8px 12px;
        padding: 0;
    }
    
    .bmh-menu .menu-item-has-children.is-open > .sub-menu {
        display: block;
    }
    
    .bmh-menu .sub-menu a {
        font-weight: 600;
        color: #516072;
        min-height: 42px;
    }
    
    .bmh-sidebar-cta {
        display: grid;
        gap: 10px;
        margin-top: 24px;
    }
    
    .bmh-sidebar-cta a {
        height: 56px;
        border-radius: 16px;
        background: #f5f8fc;
        color: #071a3a;
        text-decoration: none;
        font-weight: 800;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 16px;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .bmh-sidebar-cta a:hover {
        background: #eef2f8;
        color: #2563eb;
    }
    
    .bmh-sidebar-cta strong {
        margin-left: auto;
        font-size: 24px;
    }

    /* Sidebar Footer Switcher Styles */
    .bmh-sidebar-lang-switcher .bt-lang-dropdown {
        width: 100%;
        position: relative;
    }
    
    .bmh-sidebar-lang-switcher .bt-lang-toggle {
        width: 100%;
        height: 56px;
        min-height: 56px;
        border-radius: 16px;
        background: #f5f8fc;
        color: #071a3a;
        border: 1px solid transparent;
        padding: 0 16px;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        cursor: pointer;
        position: relative;
        outline: none;
        transition: background 0.2s ease, color 0.2s ease;
    }
    
    .bmh-sidebar-lang-switcher .bt-lang-toggle:hover {
        background: #eef2f8;
        color: #2563eb;
    }
    
    .bmh-sidebar-lang-switcher .bt-lang-toggle::after {
        content: '›' !important;
        position: absolute !important;
        right: 16px !important;
        font-size: 24px !important;
        color: #071a3a !important;
        border: 0 !important;
        width: auto !important;
        height: auto !important;
        transform: none !important;
        pointer-events: none !important;
        line-height: 1 !important;
        top: calc(50% - 13px) !important;
    }

    .bmh-sidebar-lang-switcher .bt-lang-toggle:hover::after {
        color: #2563eb !important;
    }
    
    .bmh-sidebar-lang-switcher .bt-lang-flag {
        width: 20px !important;
        height: 20px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        border: 1px solid rgba(0, 0, 0, 0.08) !important;
    }
    
    .bmh-sidebar-lang-switcher .bt-lang-menu {
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        margin-bottom: 8px;
        padding: 6px;
        list-style: none;
        background: #fff;
        border: 1px solid #e5ebf3;
        border-radius: 16px;
        box-shadow: 0 -16px 48px rgba(7, 26, 58, 0.16);
        z-index: 100000;
        display: none;
    }

    .bmh-sidebar-lang-switcher .bt-lang-dropdown.open .bt-lang-menu {
        display: block;
    }
    
    .bmh-sidebar-lang-switcher .bt-lang-menu li {
        margin: 0;
        padding: 0;
    }
    
    .bmh-sidebar-lang-switcher .bt-lang-menu a {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 10px 14px !important;
        color: #ffffff !important;
        font-weight: 700 !important;
        font-size: 15px !important;
        text-decoration: none !important;
        border-radius: 10px !important;
        transition: background 0.2s ease !important;
        border-bottom: 0 !important;
        min-height: auto !important;
    }
    
    .bmh-sidebar-lang-switcher .bt-lang-menu a:hover {
        background: #f5f8fc !important;
        color: #2563eb !important;
    }
    
    /* Compact scroll state changes */
    .bmh-header.is-compact {
        min-height: 66px;
        padding: 10px 12px;
    }
    
    .bmh-header.is-compact .bmh-logo img {
        max-height: 28px !important;
    }
    
    body.bmh-enabled.bmh-compact {
        padding-top: 66px;
    }
}

@media (max-width: 380px) {
    .bmh-header {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .bmh-logo img {
        max-height: 30px !important;
    }
    
    .bmh-actions {
        gap: 6px;
    }
    
    .bmh-icon-btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }
    
    .bmh-wrap .bt-lang-toggle {
        height: 40px;
        min-height: 40px;
        padding: 0 9px;
    }
    
    .bmh-wrap .bt-lang-toggle span:nth-child(2) {
        font-size: 13px;
    }
}

/* ==========================================================================
   FASE 2: DETECTED ISSUES & EXTRA STYLING OVERRIDES
   ========================================================================== */
@media (max-width: 768px) {
    /* Hide desktop header completely */
    .bm-header {
        display: none !important;
    }

    /* Reset spacing between mobile header and content */
    body.bmh-enabled .bt-site,
    body.bmh-enabled:is(.blog, .archive, .single-post) .bt-site {
        padding-top: 0 !important;
    }

    /* Force perfect circular dimensions on all bmh buttons */
    .bmh-icon-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Style mobile search & menu/burger buttons to match desktop design (using theme vars) */
    .bmh-header [data-botmotics-search-toggle],
    .bmh-header [data-bmh-open] {
        background: rgba(255, 255, 255, 0.08) !important;
        color: var(--bt-text) !important;
        border: 1px solid var(--bt-line) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
        transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease !important;
    }

    .bmh-header [data-botmotics-search-toggle]:hover,
    .bmh-header [data-botmotics-search-toggle]:focus,
    .bmh-header [data-bmh-open]:hover,
    .bmh-header [data-bmh-open]:focus {
        border-color: rgba(102, 244, 255, 0.36) !important;
        background: rgba(102, 244, 255, 0.1) !important;
        color: var(--bt-cyan) !important;
    }

    /* Theme-specific overrides for search and burger buttons */
    body.botmotics-theme-white-premium .bmh-header [data-botmotics-search-toggle],
    body.botmotics-theme-white-premium .bmh-header [data-bmh-open] {
        background: rgba(15, 23, 42, 0.03) !important;
        color: #0f172a !important;
        border-color: rgba(15, 23, 42, 0.05) !important;
        box-shadow: none !important;
    }
    body.botmotics-theme-white-premium .bmh-header [data-botmotics-search-toggle]:hover,
    body.botmotics-theme-white-premium .bmh-header [data-bmh-open]:hover {
        color: var(--bt-cyan) !important;
        border-color: rgba(37, 99, 235, 0.2) !important;
        background: rgba(37, 99, 235, 0.05) !important;
    }

    body.botmotics-theme-light .bmh-header [data-botmotics-search-toggle],
    body.botmotics-theme-light .bmh-header [data-bmh-open] {
        background: rgba(255, 255, 255, 0.62) !important;
        color: var(--bt-text) !important;
        border-color: rgba(17, 30, 55, 0.12) !important;
    }
    body.botmotics-theme-light .bmh-header [data-botmotics-search-toggle]:hover,
    body.botmotics-theme-light .bmh-header [data-bmh-open]:hover {
        border-color: rgba(102, 244, 255, 0.36) !important;
        background: rgba(102, 244, 255, 0.1) !important;
        color: var(--bt-cyan) !important;
    }

    body.botmotics-theme-custom .bmh-header [data-botmotics-search-toggle],
    body.botmotics-theme-custom .bmh-header [data-bmh-open] {
        background: rgba(255, 255, 255, 0.8) !important;
        color: var(--bt-text) !important;
        border-color: var(--bt-line) !important;
    }
    body.botmotics-theme-custom .bmh-header [data-botmotics-search-toggle]:hover,
    body.botmotics-theme-custom .bmh-header [data-bmh-open]:hover {
        color: var(--bt-cyan) !important;
        border-color: var(--bt-cyan) !important;
        background: rgba(255, 255, 255, 0.9) !important;
    }

    /* Contact button keeps the original grey outline/icon style */
    a.bmh-icon-btn:not([data-botmotics-search-toggle]):not([data-bmh-open]) {
        border: 1px solid #e5ebf3 !important;
        background: #fff !important;
        color: #071a3a !important;
        box-shadow: 0 8px 24px rgba(7, 26, 58, .06) !important;
    }
    a.bmh-icon-btn:not([data-botmotics-search-toggle]):not([data-bmh-open]):hover {
        border-color: rgba(37, 99, 235, 0.2) !important;
        color: #2563eb !important;
        background: rgba(37, 99, 235, 0.05) !important;
    }

    /* Compact language switcher toggle and menu styling */
    .bmh-wrap .bmh-compact-lang .bt-lang-toggle {
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 10px !important;
        border-radius: 999px !important;
        font-size: 13px !important;
        gap: 4px !important;
    }
    .bmh-wrap .bmh-compact-lang .bt-lang-name {
        display: inline-block !important;
    }

    /* Reposition search modal on mobile */
    .bt-search-modal {
        padding-top: 4.8rem !important;
    }
    .bt-search-panel {
        max-height: calc(100vh - 6rem) !important;
    }
}

@media (max-width: 380px) {
    .bmh-icon-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }
    .bmh-wrap .bmh-compact-lang .bt-lang-toggle {
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 8px !important;
    }
}
