/*
 * PLP Adaptive Header & Menu Fixer 2.0
 * The plugin intentionally avoids branding rules. It only supplies structural
 * classes used after the JS has detected a real desktop header/menu problem.
 */

html.plp-ahf-running,
html.plp-ahf-running * {
    box-sizing: border-box;
}

@media (min-width: 1025px) {
    .plp-ahf-menu {
        max-width: 100%;
    }

    .plp-ahf-menu.plp-ahf-flex-menu {
        align-items: center !important;
    }

    .plp-ahf-menu.plp-ahf-single-row {
        flex-wrap: nowrap !important;
    }

    .plp-ahf-menu .plp-ahf-item,
    .plp-ahf-menu .plp-ahf-item > a,
    .plp-ahf-menu .plp-ahf-anchor {
        vertical-align: middle !important;
    }

    .plp-ahf-menu .plp-ahf-anchor {
        white-space: nowrap !important;
    }

    /* Last-resort layout: if a genuinely long navigation cannot fit on one
       desktop line, wrap the whole menu evenly instead of leaving only the
       plugin items stranded on a random second line. */
    .plp-ahf-menu.plp-ahf-balanced-wrap {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: center !important;
        align-content: center !important;
        column-gap: var(--plp-ahf-wrap-col-gap, 14px) !important;
        row-gap: var(--plp-ahf-wrap-row-gap, 10px) !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .plp-ahf-menu.plp-ahf-balanced-wrap > .plp-ahf-item {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        transform: none !important;
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
    }

    .plp-ahf-menu .plp-ahf-relocated {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }

    .plp-ahf-hidden-desktop {
        display: none !important;
    }
}
