/*
 * Desktop categories menu (≥ 992 px): fly-out panels of the fieldvmegamenu vertical menu.
 * Groups flow into balanced columns instead of fixed-width floats, so one long group no longer
 * makes the panel taller than the window. Placement (top under the bar, min/max height) is set
 * by js/vmenu-desktop.js. Loaded last from header.tpl.
 * Revert: remove the two vmenu-desktop lines from header.tpl.
 */
@media (min-width: 992px) {
    html.vmd-ready .v-megamenu .v-main-section-links {
        /* Column widths measured 2026-11-18 so every panel fits within the menu's own height:
           150 px = 4 columns in the 730 px panel (992-1229 px windows, tallest panel 506 px vs
           a 522 px menu); 170 px in the 920 px panel (tallest 421 px vs 465 px). */
        -webkit-column-width: 150px;
        column-width: 150px;
        -webkit-column-gap: 20px;
        column-gap: 20px;
    }
}
@media (min-width: 1230px) {
    html.vmd-ready .v-megamenu .v-main-section-links {
        -webkit-column-width: 170px;
        column-width: 170px;
    }
}
@media (min-width: 992px) {
    html.vmd-ready .v-megamenu .v-main-section-links > li {
        float: none !important;
        display: block;
        width: auto !important;
        max-width: none;
        margin: 0 !important;
        padding: 0 0 8px !important;
        /* A group (heading + its sub-links) stays in one column: splitting it let Chrome
           break headings mid-line and balance the columns worse (tried 2026-11-18). */
        -webkit-column-break-inside: avoid;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    /* "Catalogues & Tarifs" bar: icon and label centred on one line, pointer where the bar
       toggles the menu (not on the homepage top, class Click), no +/− (the icon says it). */
    html.vmd-ready #header_menu .v-megamenu-title {
        display: flex;
        align-items: center;
        height: 48px;
        padding: 0 15px;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    }
    html.vmd-ready #header_menu .v-megamenu-title:not(.Click) {
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
    }
    html.vmd-ready #header_menu .v-megamenu-title::before {
        content: none !important;
        display: none !important;
    }
    html.vmd-ready #header_menu .v-megamenu-title .icon-reorder {
        position: relative;
        top: auto;
        flex: 0 0 20px;
        width: 20px;
        height: 2px;
        margin: 0 14px 0 0;
        background: #fff;
        border-radius: 1px;
        font-size: 0;
    }
    html.vmd-ready #header_menu .v-megamenu-title .icon-reorder::before,
    html.vmd-ready #header_menu .v-megamenu-title .icon-reorder::after {
        content: "";
        position: absolute;
        left: 0;
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 1px;
    }
    html.vmd-ready #header_menu .v-megamenu-title .icon-reorder::before { top: -6px; }
    html.vmd-ready #header_menu .v-megamenu-title .icon-reorder::after { top: 6px; }
    html.vmd-ready #header_menu .v-megamenu-title h3 {
        /* the module positions the label absolutely (top: 14px); make it a flex item */
        position: static;
        margin: 0;
        line-height: 1;
        -webkit-text-box: trim-both cap alphabetic;
        text-box: trim-both cap alphabetic;
    }
    /* Column starts chosen by js/vmenu-desktop.js (columns()). */
    html.vmd-ready .v-megamenu .v-main-section-links > li.vmd-break {
        -webkit-column-break-before: always;
        break-before: column;
    }
    /* The fmsid4 panel carried a -20 px offset tuned for the floats. */
    html.vmd-ready .v-megamenu .fmsid4 .v-main-section {
        margin-top: 0;
    }
    /* Panels taller than the window scroll inside (js/vmenu-desktop.js sets max-height). */
    html.vmd-ready .v-megamenu > ul > li div.submenu {
        padding: 20px 24px 6px 20px;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    }
}
