/* Only applied to the detected, existing sticky site masthead. */
@media (min-width: 1025px) {
    .motovante-header-compact:not(.elementor-sticky__spacer):not(.elementor-sticky--spacer).motovante-header-compact-box,
    .motovante-header-compact:not(.elementor-sticky__spacer):not(.elementor-sticky--spacer) .motovante-header-compact-box {
        padding-top: var(--mv-header-pad-top) !important;
        padding-bottom: var(--mv-header-pad-bottom) !important;
        min-height: var(--mv-header-min) !important;
        height: auto !important;
    }
    .motovante-header-compact:not(.elementor-sticky__spacer):not(.elementor-sticky--spacer) .motovante-header-compact-logo {
        max-height: var(--mv-header-logo-height) !important;
        max-width: min(100%, var(--mv-header-logo-width)) !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
    }
    .motovante-header-compact:not(.elementor-sticky__spacer):not(.elementor-sticky--spacer) .motovante-header-compact-link {
        padding-top: var(--mv-header-pad-top) !important;
        padding-bottom: var(--mv-header-pad-bottom) !important;
        min-height: 32px;
    }
    @media (prefers-reduced-motion: no-preference) {
        .motovante-header-compact-box, .motovante-header-compact-link {
            transition: padding-top 180ms ease, padding-bottom 180ms ease, min-height 180ms ease;
        }
    }
}

/* Mobile/tablet: compact from first load, regardless of existing sticky status. */
@media (max-width: 1024px), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
    .motovante-header-mobile.motovante-header-mobile-box,
    .motovante-header-mobile .motovante-header-mobile-box {
        min-height: 0 !important;
        height: auto !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    /* Keep the outer template flush. Apply breathing room only to the logo/menu row,
       which is normally inside the painted Elementor section. */
    .motovante-header-mobile.motovante-header-mobile-row,
    .motovante-header-mobile .motovante-header-mobile-row {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }
    .motovante-header-mobile .motovante-header-mobile-dropdown {
        margin-top: 0 !important;
    }
    .motovante-header-mobile .motovante-header-mobile-dropdown.motovante-header-mobile-dropdown-aligned {
        top: var(--mv-header-dropdown-top) !important;
    }
    .motovante-header-mobile .motovante-header-mobile-logo {
        display: block;
        max-height: 70px !important;
        max-width: min(100%, 180px) !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
    }
    .motovante-header-mobile .motovante-header-mobile-toggle {
        min-height: 44px;
        min-width: 44px;
        box-sizing: border-box;
    }
}

/* Expanded mobile dropdowns are an independent scroll area, not page content.
   Do not change root/body overflow or positioning: either can disrupt the native sticky header. */
@media (max-width: 1024px), (max-width: 1366px) and (hover: none) and (pointer: coarse) {
    html.motovante-header-menu-open {
        overscroll-behavior-y: none;
        scroll-behavior: auto !important;
    }
    .motovante-header-mobile .motovante-header-dropdown-open {
        max-height: max(0px, calc(var(--mv-header-menu-max-height, 100vh) - env(safe-area-inset-bottom, 0px))) !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }
    /* Keep the navigation above page actions, without changing the page height. */
    html.motovante-header-menu-open .motovante-mobile-contact,
    html.motovante-header-menu-open .motovante-single-toolbar {
        visibility: hidden !important;
        pointer-events: none !important;
    }
}
