/* ==========================================================================
   Palmadex — Mobile Header / Top Bar
   Theme: Consultio 3.2.7 (header layout 24 / top bar 12) — palmadex.com
   Scope: 0px – 767px.  768px+ is left completely untouched (desktop design).

   WHAT THIS FILE DOES
   1.  Renders the compact blue contact bar (.pmx-topbar) — restores the
       desktop top bar on mobile instead of hiding it.
   2.  Compacts the theme's existing logo row (#ct-header) + hamburger.
   3.  Converts the theme's 260px left drawer (.ct-header-navigation) into a
       full-width slide-down panel underneath the header.
   4.  Enlarges every tap target to 44px, kills hover-dependent menus.

   RULES USED
   - Nothing is hard-coded to a fixed pixel width. All sizing is flex +
     clamp() + min-width:0, so text can never overflow the viewport.
   - Only classes prefixed `pmx-` are new; theme overrides are scoped with
     `#ct-header-wrap` so nothing outside the header can be affected.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Tokens
   -------------------------------------------------------------------------- */
:root {
    --pmx-blue:        #0093dd;  /* Palmadex brand blue (top bar 12 / theme primary) */
    --pmx-blue-dark:   #0078b4;
    --pmx-blue-darker: #00608f;
    --pmx-ink:         #1f2233;  /* Consultio default text colour */
    --pmx-muted:       #5b6472;
    --pmx-line:        #e8edf3;
    --pmx-topbar-base:  48px;   /* overwritten by the plugin from Settings */
    --pmx-topbar-h:     var(--pmx-topbar-base);
    --pmx-row-h:        58px;   /* height of the logo row */
    --pmx-bar-gutter:  10px;
    --pmx-tag-color:    #d63638;  /* country badge — overwritten by the plugin from Settings */
    --pmx-ease:        cubic-bezier(.4, 0, .2, 1);
}

/* --------------------------------------------------------------------------
   0. SHARED MARKUP DEFAULTS (outside every media query)
   -------------------------------------------------------------------------- */

/* The desktop contact strip inside #pmx-topbar. Hidden everywhere by
   default; the ≥768px desktop section below shows it only when the
   "pmx-mh-desktop" body class is present (Settings → Desktop contact bar). */
.pmx-topbar__desk { display: none; }

/* --------------------------------------------------------------------------
   1. MOBILE ONLY — everything below lives in a max-width:767px cage
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {

    /* --- Safety nets ---------------------------------------------------- */
    /* `clip` does NOT create a scroll container, so position:sticky keeps
       working (unlike overflow-x:hidden). Guards against any third-party
       element forcing horizontal scroll. */
    @supports (overflow: clip) {
        body.pmx-mh-active { overflow-x: clip; }
    }

    /* The desktop top bar stays hidden (theme already does this <1200px) —
       our .pmx-topbar replaces it, so make sure it never double-renders. */
    #ct-header-wrap #ct-header-top { display: none !important; }

    /* ====================================================================
       2. TOP CONTACT BAR  (Palmadex blue, 48px)
       ==================================================================== */
    .pmx-topbar {
        position: sticky;            /* falls back to fixed — see .pmx-topbar--fixed */
        top: 0;
        z-index: 1001;               /* above #ct-header-wrap (z-index:999) */
        display: block;
        width: 100%;
        background: var(--pmx-blue);
        color: #fff;
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
        font-family: 'Barlow', 'Poppins', -apple-system, BlinkMacSystemFont,
                     'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
    }
    /* Fallback mode: printed in wp_footer because the theme has no
       wp_body_open(). Behaves identically but needs body padding. */
    .pmx-topbar--fixed { position: fixed; left: 0; right: 0; }
    body.pmx-mh-fixed  { padding-top: var(--pmx-topbar-h); }

    .pmx-topbar__row {
        display: flex;
        align-items: center;
        gap: 4px;
        height: var(--pmx-topbar-h);
        padding: 0 max(var(--pmx-bar-gutter), env(safe-area-inset-right))
                 0 max(var(--pmx-bar-gutter), env(safe-area-inset-left));
        box-sizing: border-box;
    }

    /* --- shared link / button skin ------------------------------------- */
    .pmx-tb-link,
    .pmx-tb-btn,
    .pmx-lang__btn {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        height: 32px;
        padding: 0 9px;
        border: 0;
        margin: 0;
        border-radius: 16px;
        background: transparent;
        color: #fff;
        font-size: clamp(10.5px, 3.15vw, 12.5px);
        font-weight: 600;
        line-height: 1;
        letter-spacing: .1px;
        text-decoration: none;
        white-space: nowrap;
        box-sizing: border-box;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
        transition: background-color .18s var(--pmx-ease);
    }
    .pmx-tb-link:focus-visible,
    .pmx-tb-btn:focus-visible,
    .pmx-lang__btn:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 1px;
    }

    /* Phone: never shrinks (it is the primary action) */
    .pmx-tb-phone {
        flex: 0 0 auto;
        padding-left: 0;
        padding-right: 0;
    }
    /* Email: absorbs the leftover space and ellipsises before the phone does */
    .pmx-tb-mail {
        flex: 1 1 auto;
        min-width: 0;
        padding-left: 0;
        padding-right: 0;
        font-weight: 500;
    }
    .pmx-tb-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
    .pmx-tb-link svg,
    .pmx-tb-btn svg {
        flex: 0 0 auto;
        width: 13px;
        height: 13px;
        fill: currentColor;
    }

    /* More / Contact info + language chips */
    .pmx-tb-btn,
    .pmx-lang__btn {
        flex: 0 0 auto;
        position: relative;          /* anchor for the expanded hit area */
        background: rgba(255, 255, 255, .16);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .34);
    }
    .pmx-tb-btn[aria-expanded="true"],
    .pmx-lang__btn[aria-expanded="true"] {
        background: rgba(255, 255, 255, .30);
    }
    /* 32px visual, 44px real touch target */
    .pmx-tb-btn::after,
    .pmx-lang__btn::after {
        content: "";
        position: absolute;
        top: -6px; bottom: -6px; left: -2px; right: -2px;
    }
    .pmx-tb-btn svg,
    .pmx-lang__btn svg { width: 11px; height: 11px; }

    /* --- language selector --------------------------------------------- */
    .pmx-lang { position: relative; flex: 0 0 auto; }
    .pmx-lang__btn { padding: 0 7px; gap: 4px; }
    .pmx-lang__flag {
        width: 16px; height: 11px;
        border-radius: 2px;
        object-fit: cover;
        display: block;
        flex: 0 0 auto;
    }
    .pmx-lang__list {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        z-index: 1002;
        min-width: 150px;
        max-height: 46vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        padding: 5px;
        list-style: none;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 12px 28px rgba(9, 32, 58, .22);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity .18s var(--pmx-ease),
                    transform .18s var(--pmx-ease),
                    visibility .18s step-end;
    }
    .pmx-lang__list[data-open="true"] {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        transition-timing-function: var(--pmx-ease);
        transition: opacity .18s var(--pmx-ease),
                    transform .18s var(--pmx-ease),
                    visibility .18s step-start;
    }
    .pmx-lang__list li { margin: 0; }
    .pmx-lang__list button {
        display: flex;
        align-items: center;
        gap: 9px;
        width: 100%;
        min-height: 40px;
        padding: 0 10px;
        border: 0;
        border-radius: 7px;
        background: transparent;
        color: var(--pmx-ink);
        font: inherit;
        font-size: 13.5px;
        text-align: left;
        cursor: pointer;
    }
    .pmx-lang__list button:hover,
    .pmx-lang__list button:focus-visible { background: #eff6fb; }
    .pmx-lang__list button[aria-current="true"] {
        color: var(--pmx-blue);
        font-weight: 700;
        background: #eaf6fd;
    }
    .pmx-lang__list button:focus-visible { outline: 2px solid var(--pmx-blue); outline-offset: -2px; }

    /* ====================================================================
       3. "More / Contact info" PANEL
       ==================================================================== */
    .pmx-panel {
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        background: #fff;
        color: var(--pmx-ink);
        box-shadow: 0 10px 20px rgba(9, 32, 58, .10);
        transition: max-height .28s var(--pmx-ease), visibility .28s step-end;
    }
    .pmx-topbar[data-contact-open="true"] .pmx-panel {
        max-height: min(74vh, 480px);
        visibility: visible;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: max-height .28s var(--pmx-ease), visibility .28s step-start;
    }
    .pmx-panel__inner {
        padding: 6px max(var(--pmx-bar-gutter), env(safe-area-inset-right))
                 calc(10px + env(safe-area-inset-bottom))
                 max(var(--pmx-bar-gutter), env(safe-area-inset-left));
    }
    .pmx-panel__title {
        margin: 4px 0 2px;
        padding: 0 2px;
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .8px;
        text-transform: uppercase;
        color: var(--pmx-muted);
    }
    .pmx-c-list { margin: 0; padding: 0; list-style: none; }
    .pmx-c-list li { margin: 0; border-bottom: 1px solid var(--pmx-line); }
    .pmx-c-list li:last-child { border-bottom: 0; }
    .pmx-c-link {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        min-height: 44px;
        padding: 9px 2px;
        color: var(--pmx-ink);
        font-size: 13px;
        line-height: 1.4;
        text-decoration: none;
        box-sizing: border-box;
    }
    .pmx-c-link:active { background: #f4f9fd; }
    .pmx-c-link svg {
        flex: 0 0 auto;
        width: 15px; height: 15px;
        margin-top: 2px;
        fill: var(--pmx-blue);
    }
    .pmx-c-link strong { display: block; font-weight: 600; }
    .pmx-c-link small {
        display: block;
        margin-top: 1px;
        color: var(--pmx-muted);
        font-size: 11.5px;
    }
    .pmx-c-tag {
        display: inline-block;
        margin-left: 6px;
        padding: 1px 7px;
        border-radius: 9px;
        background: var(--pmx-tag-color, #d63638);   /* Settings → Desktop bar layout → Country tag colour */
        color: #fff;
        font-size: 9.5px;
        font-weight: 700;
        letter-spacing: .4px;
        line-height: 1.5;
        vertical-align: 1px;
        white-space: nowrap;
    }
    .pmx-social {
        display: flex;
        gap: 8px;
        padding: 10px 2px 2px;
        margin: 0;
        list-style: none;
        border-top: 1px solid var(--pmx-line);
    }
    .pmx-social a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px; height: 38px;
        border-radius: 8px;
        background: #eef4f9;
        color: var(--pmx-blue);
    }
    .pmx-social svg { width: 16px; height: 16px; fill: currentColor; }

    /* ====================================================================
       4. MAIN HEADER ROW — logo + cart + hamburger  (theme markup)
       ==================================================================== */
    #ct-header-wrap #ct-header {
        position: relative;
        z-index: 2;                  /* above .pmx-backdrop */
        background: #fff;
    }
    #ct-header-wrap #ct-header > .container {
        width: 100%;
        max-width: 100%;
        padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
        box-sizing: border-box;
    }
    #ct-header-wrap #ct-header > .container > .row {
        display: flex;
        align-items: center;
        min-height: 58px;
        margin: 0;                   /* neutralise bootstrap -15px gutters */
    }
    #ct-header-wrap #ct-header .ct-header-branding {
        margin: 0 !important;
        padding: 0;
        min-height: 0;
        flex: 1 1 auto;
        min-width: 0;
    }
    #ct-header-wrap #ct-header .ct-header-branding-inner { display: block; }
    /* Only the mobile logo may render — guards against a stacked logo if the
       theme's own logo rules change in an update. */
    #ct-header-wrap #ct-header .ct-header-branding a.logo-dark,
    #ct-header-wrap #ct-header .ct-header-branding a.logo-light { display: none !important; }
    #ct-header-wrap #ct-header .ct-header-branding a.logo-mobile {
        display: block;
        max-width: 100%;
        line-height: 0;
    }
    /* Logo: ~168px on a 375px phone → 200px from ~435px up.
       max-height caps the visible height; object-fit:contain prevents any
       squashing (the box may be a little wider than the artwork). */
    #ct-header-wrap #ct-header .ct-header-branding a.logo-mobile img {
        width: clamp(168px, 46vw, 200px);
        height: auto;
        max-height: 54px;
        object-fit: contain;
    }
    /* Theme hides .ct-header-meta below 1200px — keep it that way, the
       search + cart live in #ct-menu-mobile instead. */
    #ct-header-wrap #ct-header .ct-header-meta { display: none !important; }

    /* --- #ct-menu-mobile: cart / search / burger ------------------------ */
    #ct-header-wrap #ct-menu-mobile {
        /* The real Consultio markup renders this strip as a direct child of
           #ct-header — NOT inside the .row. Pin it to the right edge,
           vertically centred on the logo row, so the logo and the ☰ button
           share one line. */
        position: absolute;
        top: 50%;
        right: max(12px, env(safe-area-inset-right));
        transform: translateY(-50%);
        display: flex !important;
        align-items: center;
        gap: 2px;
        margin: 0;
        padding: 0;
        z-index: 5;
    }
    #ct-header-wrap #ct-menu-mobile .btn-nav-cart,
    #ct-header-wrap #ct-menu-mobile .pmx-icon-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 40px; height: 44px;
        color: var(--pmx-ink);
        font-size: 17px;
        line-height: 1;
        cursor: pointer;
        background: none;
        border: 0;
        padding: 0;
        -webkit-appearance: none;
        appearance: none;
        text-decoration: none;
        border-radius: 8px;
    }
    #ct-header-wrap #ct-menu-mobile .btn-nav-cart:hover,
    #ct-header-wrap #ct-menu-mobile .pmx-icon-btn:hover { color: var(--pmx-blue); }
    #ct-header-wrap #ct-menu-mobile .btn-nav-cart:focus-visible,
    #ct-header-wrap #ct-menu-mobile .pmx-icon-btn:focus-visible,
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile:focus-visible {
        outline: 2px solid var(--pmx-blue);
        outline-offset: 1px;
        border-radius: 8px;
    }
    #ct-header-wrap #ct-menu-mobile .btn-nav-cart i,
    #ct-header-wrap #ct-menu-mobile .pmx-icon-btn i { font-size: 18px; line-height: 1; }
    #ct-header-wrap #ct-menu-mobile .pmx-icon-btn svg { width: 17px; height: 17px; fill: currentColor; }

    /* Cart counter badge */
    #ct-header-wrap #ct-menu-mobile .widget_cart_counter_header,
    #ct-header-wrap #ct-menu-mobile .pmx-cart-count {
        position: absolute;
        top: 5px;
        right: 3px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 8px;
        background: var(--pmx-blue);
        color: #fff;
        font-family: 'Barlow', 'Poppins', Arial, sans-serif;
        font-size: 10px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
        box-sizing: border-box;
    }

    /* --- hamburger: 44x44 blue button, CSS-drawn bars ------------------- */
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 44px !important;
        height: 44px !important;
        margin: 0 0 0 2px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: var(--pmx-blue) !important;
        cursor: pointer;
        font-size: 0;                /* hide any glyph fallback */
        line-height: 0;
        -webkit-appearance: none;
        appearance: none;
        box-shadow: 0 2px 6px rgba(0, 147, 221, .28);
    }
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile:active { background: var(--pmx-blue-dark) !important; }
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile::before,
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile::after,
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile > span {
        content: "";
        position: absolute;
        left: 12px;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: #fff !important;
        display: block;
        opacity: 1;
        transform-origin: 50% 50%;
        transition: transform .2s var(--pmx-ease), top .2s var(--pmx-ease), opacity .12s linear;
    }
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile::before { top: 15px; }
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile > span  { top: 21px; }
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile::after  { top: 27px; }
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile.opened::before {
        top: 21px;
        transform: rotate(45deg);
    }
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile.opened::after {
        top: 21px;
        transform: rotate(-45deg);
    }
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile.opened > span { opacity: 0; }

    /* ====================================================================
       5. MOBILE MENU — full-width slide-down panel (theme drawer restyled)
       ==================================================================== */
    #ct-header-wrap .ct-header-navigation {
        position: absolute !important;
        /* --pmx-menu-shift: Settings → Fine-tuning → "Opened menu up/down" (0 by default) */
        top: calc(100% + var(--pmx-menu-shift, 0px));
        left: 0;
        right: 0;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        overflow: visible !important;
        z-index: 1000;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity .2s var(--pmx-ease),
                    transform .2s var(--pmx-ease),
                    visibility .2s step-end;
    }
    #ct-header-wrap .ct-header-navigation.navigation-open {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        transition: opacity .2s var(--pmx-ease),
                    transform .2s var(--pmx-ease),
                    visibility .2s step-start;
    }
    #ct-header-wrap .ct-header-navigation .ct-main-navigation {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        left: auto; right: auto; top: auto; bottom: auto;
        padding: 0;
        background: #fff;
        overflow: hidden;
        transform: none !important;
        border-top: 1px solid var(--pmx-line);
        box-shadow: 0 16px 32px rgba(9, 32, 58, .16);
    }
    #ct-header-wrap .ct-header-navigation .ct-main-navigation .ct-main-navigation-inner {
        height: auto !important;
        max-height: calc(100vh - var(--pmx-topbar-h) - var(--pmx-row-h));
        /* iOS: dvh excludes the collapsing URL bar */
        max-height: calc(100dvh - var(--pmx-topbar-h) - var(--pmx-row-h));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        margin-right: 0 !important;
        padding: 10px max(12px, env(safe-area-inset-right))
                 calc(18px + env(safe-area-inset-bottom))
                 max(12px, env(safe-area-inset-left));
        box-sizing: border-box;
    }
    /* Duplicate logo inside the drawer — not needed, the bar already has one */
    #ct-header-wrap .ct-header-navigation .ct-logo-mobile { display: none !important; }

    /* --- search (lives at the top of the drawer) ------------------------ */
    #ct-header-wrap .ct-header-navigation .header-mobile-search {
        margin: 0 0 8px;
        position: relative;
    }
    #ct-header-wrap .ct-header-navigation .header-mobile-search .search-field {
        width: 100%;
        height: 46px;
        margin: 0;
        padding: 0 52px 0 14px;
        border: 1px solid #dde5ee;
        border-radius: 10px;
        background: #f6f9fc;
        color: var(--pmx-ink);
        font-family: inherit;
        font-size: 15px;             /* >=16px would zoom iOS; 15px + safe padding */
        box-shadow: none;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }
    #ct-header-wrap .ct-header-navigation .header-mobile-search .search-field:focus {
        border-color: var(--pmx-blue);
        background: #fff;
        outline: none;
    }
    #ct-header-wrap .ct-header-navigation .header-mobile-search .search-submit {
        position: absolute;
        top: 0; right: 0;
        width: 48px;
        height: 46px;
        padding: 0;
        border: 0;
        border-radius: 0 10px 10px 0;
        background: var(--pmx-blue);
        color: #fff;
        font-size: 15px;
        line-height: 46px;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
    }
    #ct-header-wrap .ct-header-navigation .header-mobile-search .search-submit:active {
        background: var(--pmx-blue-dark);
    }

    /* --- menu items: 52px rows, no hover dependency --------------------- */
    #ct-header-wrap .ct-main-menu { margin: 0; padding: 0; }
    #ct-header-wrap .ct-main-menu li { position: relative; }
    #ct-header-wrap .ct-main-menu > li > a {
        display: flex !important;
        align-items: center;
        min-height: 52px;
        padding: 0 52px 0 4px;
        border-bottom: 1px solid var(--pmx-line);
        color: var(--pmx-ink);
        font-family: 'Poppins', 'Barlow', Arial, sans-serif;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.3;
        text-decoration: none;
        box-sizing: border-box;
    }
    #ct-header-wrap .ct-main-menu > li > a:active { color: var(--pmx-blue); }
    #ct-header-wrap .ct-main-menu > li.current-menu-item > a,
    #ct-header-wrap .ct-main-menu > li.current-menu-ancestor > a { color: var(--pmx-blue); }

    #ct-header-wrap .ct-main-menu .sub-menu { box-shadow: none; }
    /* Fallback for when the theme's slideToggle() script is not available.
       Inline styles written by slideToggle always win over this rule, so the
       theme's animation is unaffected. */
    #ct-header-wrap .ct-main-menu .sub-menu.submenu-open,
    #ct-header-wrap .ct-main-menu .children.submenu-open { display: block; }
    #ct-header-wrap .ct-main-menu .sub-menu li a {
        display: flex;
        align-items: center;
        min-height: 46px;
        padding: 0 52px 0 14px !important;
        border: 0 !important;
        color: #37414f;
        font-size: 15px;
        font-weight: 400;
        line-height: 1.3;
    }
    #ct-header-wrap .ct-main-menu .sub-menu .sub-menu li a { padding-left: 26px !important; font-size: 14px; }

    /* --- submenu toggles: 44x44, CSS chevron (no icon-font dependency) --- */
    #ct-header-wrap .ct-main-menu .ct-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute !important;
        top: 4px;
        right: 0;
        width: 44px !important;
        height: 44px !important;
        padding: 0;
        border: 1px solid #e2e9f1 !important;
        border-radius: 10px;
        background: #f7fafc !important;
        cursor: pointer;
    }
    #ct-header-wrap .ct-main-menu .sub-menu .ct-menu-toggle { top: 1px; }
    #ct-header-wrap .ct-main-menu .ct-menu-toggle::before {
        content: "" !important;
        position: absolute;
        top: 50%; left: 50%;
        width: 7px; height: 7px;
        margin: -3px 0 0 -4px;
        border-right: 2px solid var(--pmx-blue);
        border-bottom: 2px solid var(--pmx-blue);
        border-radius: 1px;
        transform: rotate(45deg);
        transition: transform .2s var(--pmx-ease), margin .2s var(--pmx-ease);
        font-family: inherit;
        font-size: 0;
        line-height: 0;
    }
    #ct-header-wrap .ct-main-menu .ct-menu-toggle.toggle-open::before {
        margin-top: -1px;
        transform: rotate(-135deg);
    }
    #ct-header-wrap .ct-main-menu .ct-menu-toggle:focus-visible {
        outline: 2px solid var(--pmx-blue);
        outline-offset: 1px;
    }

    /* --- extras injected by JS: language + quick contact ---------------- */
    .pmx-menu-extra {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--pmx-line);
    }
    .pmx-menu-extra__title {
        margin: 0 0 6px;
        font-size: 10.5px;
        font-weight: 700;
        letter-spacing: .8px;
        text-transform: uppercase;
        color: var(--pmx-muted);
    }
    .pmx-menu-extra__row { display: flex; gap: 8px; flex-wrap: wrap; }
    .pmx-menu-extra a.pmx-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 40px;
        padding: 0 12px;
        border-radius: 20px;
        background: #eef6fc;
        color: var(--pmx-blue-dark);
        font-size: 13.5px;
        font-weight: 600;
        text-decoration: none;
    }
    .pmx-menu-extra a.pmx-chip svg { width: 14px; height: 14px; fill: currentColor; }
    .pmx-menu-extra select {
        width: 100%;
        height: 44px;
        padding: 0 12px;
        border: 1px solid #dde5ee;
        border-radius: 10px;
        background: #f6f9fc;
        color: var(--pmx-ink);
        font-family: inherit;
        font-size: 15px;
        -webkit-appearance: none;
        appearance: none;
    }

    /* ====================================================================
       6. STICKY CO-ORDINATION
          The theme pins #ct-header to top:0 on scroll; shift it below our
          contact bar so the two stack instead of overlapping.
       ==================================================================== */
    #ct-header-wrap #ct-header.h-fixed {
        top: var(--pmx-topbar-h) !important;
        left: 0; right: 0;
    }
    /* WordPress admin bar (mobile height 46px) */
    .admin-bar .pmx-topbar--sticky,
    .admin-bar .pmx-topbar--fixed { top: 46px; }
    .admin-bar #ct-header-wrap #ct-header.h-fixed { top: calc(var(--pmx-topbar-h) + 46px) !important; }

    /* NOTE: the floating GTranslate widget is hidden on mobile by the plugin
       (inline CSS) when Settings → Mobile Header → "Replace GTranslate widget"
       is ticked. Untick it to keep GTranslate's own switcher on phones. */

    /* Backdrop for the open drawer */
    .pmx-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1;
        background: rgba(12, 28, 46, .38);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s var(--pmx-ease), visibility .2s step-end;
    }
    .pmx-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
        transition: opacity .2s var(--pmx-ease), visibility .2s step-start;
    }
}

/* --------------------------------------------------------------------------
   7. BREAKPOINTS
   -------------------------------------------------------------------------- */

/* --- 481px – 767px: larger phones / small tablets ------------------------ */
@media (min-width: 481px) and (max-width: 767px) {
    :root { --pmx-topbar-h: calc(var(--pmx-topbar-base) + 2px); --pmx-bar-gutter: 14px; }
    .pmx-topbar__row { gap: 8px; }
    .pmx-tb-link, .pmx-tb-btn, .pmx-lang__btn { font-size: 13px; height: 34px; }
    #ct-header-wrap #ct-header .ct-header-branding a.logo-mobile img {
        width: clamp(180px, 42vw, 210px);
        max-height: 58px;
    }
    #ct-header-wrap #ct-header > .container > .row { min-height: 62px; }
    :root { --pmx-row-h: 62px; }
}

/* --- 375px – 480px: every modern iPhone / Android ----------------------- */
@media (min-width: 375px) and (max-width: 480px) {
    :root { --pmx-bar-gutter: 12px; }
    .pmx-topbar__row { gap: 6px; }
    /* Tighten the utility bar so the email stays legible next to the phone */
    .pmx-tb-link, .pmx-tb-btn, .pmx-lang__btn {
        height: 30px;
        padding: 0 7px;
        gap: 4px;
        font-size: 11.5px;
    }
    .pmx-tb-phone, .pmx-tb-mail { padding: 0; }
    .pmx-tb-mail { font-size: 11px; }
    .pmx-lang__btn { padding: 0 5px; gap: 3px; }
    /* Flag-only language chip here; the full list also lives in the menu */
    .pmx-lang__text { position: absolute; width: 1px; height: 1px; overflow: hidden;
                      clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}

/* --- 320px – 374px: iPhone SE / small Androids -------------------------- */
@media (max-width: 374px) {
    :root { --pmx-topbar-h: calc(var(--pmx-topbar-base) - 2px); --pmx-bar-gutter: 8px; }
    .pmx-topbar__row { gap: 3px; }
    .pmx-tb-link, .pmx-tb-btn, .pmx-lang__btn {
        font-size: 11px;
        height: 30px;
        padding: 0 7px;
        gap: 4px;
    }
    .pmx-tb-link svg, .pmx-tb-btn svg { width: 12px; height: 12px; }
    /* Language selector moves into the mobile menu at this width */
    .pmx-topbar .pmx-lang { display: none; }
    #ct-header-wrap #ct-header .ct-header-branding a.logo-mobile img {
        width: clamp(158px, 50vw, 180px);
        max-height: 50px;
    }
    #ct-header-wrap #ct-header > .container > .row { min-height: 56px; }
    :root { --pmx-row-h: 56px; }
    /* Keep logo + 3 controls inside 320px: hide the bar search icon */
    #ct-header-wrap #ct-menu-mobile .pmx-icon-btn--search { display: none !important; }
}

/* --- 768px+: disabled by default, OR the desktop contact bar -------------
   Without the "pmx-mh-desktop" body class nothing changes: the component
   stays fully disabled and the theme header is untouched (v1.2 behaviour).
   With the class, #pmx-topbar becomes a wide blue contact strip above the
   theme header showing every phone / email / office at once (mockup:
   3 columns — emails | phones | addresses — language switcher stays
   GTranslate's own, and "+ More" links to the Contact Us page).
   Pure CSS: the plugin JS still does nothing above 767px. */
@media (min-width: 768px) {

    /* Off switch (desktop bar unticked) — exactly the old behaviour. */
    body:not(.pmx-mh-desktop) .pmx-topbar,
    .pmx-backdrop { display: none !important; }
    body.pmx-mh-fixed:not(.pmx-mh-desktop) { padding-top: 0 !important; }

    /* The bar sits in normal flow above the theme header and scrolls away
       with the page, so the theme's own sticky header keeps behaving
       exactly as before. */
    body.pmx-mh-desktop .pmx-topbar {
        position: static;
        z-index: auto;
        display: block;
        width: 100%;
        background: var(--pmx-blue);
        color: #fff;
        font-family: 'Barlow', 'Poppins', -apple-system, BlinkMacSystemFont,
                     'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
    }

    /* Mobile-only pieces of the shared markup never show on desktop. */
    body.pmx-mh-desktop .pmx-topbar__row,
    body.pmx-mh-desktop .pmx-panel,
    body.pmx-mh-desktop .pmx-lang { display: none !important; }

    /* The theme's own top bar carries fewer details — ours replaces it. */
    body.pmx-mh-desktop #ct-header-wrap #ct-header-top { display: none !important; }

    body.pmx-mh-desktop .pmx-topbar__desk {
        display: flex;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 5px 36px;
        max-width: 1240px;
        margin: 0 auto;
        padding: 12px 30px;
        box-sizing: border-box;
        font-size: 13px;
        line-height: 1.45;
    }

    body.pmx-mh-desktop .pmx-desk__col {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    body.pmx-mh-desktop .pmx-desk__col--mails  { flex: 0 1 auto; }
    body.pmx-mh-desktop .pmx-desk__col--phones { flex: 0 0 auto; }
    body.pmx-mh-desktop .pmx-desk__col--places { flex: 1 1 300px; min-width: 0; }

    body.pmx-mh-desktop .pmx-desk__link {
        display: inline-flex;
        align-items: flex-start;
        flex-wrap: wrap;          /* long address + badge wraps to a clean 2nd line */
        gap: 2px 8px;
        max-width: 100%;
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        line-height: 1.45;
        letter-spacing: .1px;
        text-decoration: none;
    }
    body.pmx-mh-desktop .pmx-desk__link svg {
        width: 14px;
        height: 14px;
        margin-top: 2px;      /* line up with the first text line */
        fill: #fff;
        flex: 0 0 auto;
    }
    body.pmx-mh-desktop .pmx-desk__link span { overflow-wrap: break-word; }
    body.pmx-mh-desktop .pmx-desk__tag {
        display: inline-block;
        margin-left: 8px;
        padding: 1px 8px;
        border-radius: 9px;
        background: var(--pmx-tag-color, #d63638);   /* red country badge */
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.5;
        letter-spacing: .3px;
        white-space: nowrap;
        vertical-align: 1px;
    }
    body.pmx-mh-desktop .pmx-desk__link:hover span,
    body.pmx-mh-desktop .pmx-desk__more:hover { text-decoration: underline; }
    body.pmx-mh-desktop .pmx-desk__link:focus-visible,
    body.pmx-mh-desktop .pmx-desk__more:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
        border-radius: 2px;
    }

    body.pmx-mh-desktop .pmx-desk__more {
        margin-left: auto;
        align-self: flex-end;     /* bottom-right, as mocked up */
        color: #fff;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.45;
        letter-spacing: .2px;
        text-decoration: none;
        white-space: nowrap;
        padding: 0 0 2px;
    }

    /* Fallback mode (theme without wp_body_open): pin the strip to the top
       and pad the page by its height. Height varies with content, so the
       padding is an approximation tuned for the default 3-row layout. */
    :root { --pmx-desk-h: 118px; }
    body.pmx-mh-desktop .pmx-topbar--fixed {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
    }
    body.pmx-mh-fixed.pmx-mh-desktop { padding-top: var(--pmx-desk-h) !important; }

    /* 768–1023px: tight fit — smaller text, less air. */
    body.pmx-mh-desktop .pmx-topbar__desk { gap: 4px 24px; padding: 10px 18px; }
    body.pmx-mh-desktop .pmx-desk__link,
    body.pmx-mh-desktop .pmx-desk__more { font-size: 12.5px; }
    body.pmx-mh-desktop .pmx-desk__link svg { width: 13px; height: 13px; }
}

@media (min-width: 1024px) {
    :root { --pmx-desk-h: 112px; }
    body.pmx-mh-desktop .pmx-topbar__desk { gap: 5px 30px; padding: 11px 24px; }
    body.pmx-mh-desktop .pmx-desk__link,
    body.pmx-mh-desktop .pmx-desk__more { font-size: 13px; }
    body.pmx-mh-desktop .pmx-desk__link svg { width: 14px; height: 14px; }
}

@media (min-width: 1200px) {
    :root { --pmx-desk-h: 104px; }
    body.pmx-mh-desktop .pmx-topbar__desk { gap: 5px 36px; padding: 12px 30px; }
}

/* --------------------------------------------------------------------------
   8. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .pmx-panel,
    .pmx-lang__list,
    .pmx-backdrop,
    #ct-header-wrap .ct-header-navigation,
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile::before,
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile::after,
    #ct-header-wrap #ct-menu-mobile .btn-nav-mobile > span,
    #ct-header-wrap .ct-main-menu .ct-menu-toggle::before {
        transition-duration: .001ms !important;
        animation-duration: .001ms !important;
    }
}
