/* Champion Plan Finder — mobile language switcher width guard.
 *
 * Unlike the rest of this plugin's CSS, this file deliberately targets theme
 * markup rather than .pf-* elements. The GTranslate switcher lives in the
 * Elementor header, not in anything this plugin renders, but the plugin's
 * pages are the ones whose content depends on it — so a switcher nobody can
 * read is a plan finder nobody can read.
 *
 * The header template carries an Elementor width override on the shortcode
 * widget holding the switcher inside the off-canvas (hamburger) menu:
 *
 *   @media (max-width: 767px) {
 *     .elementor-14 .elementor-element.elementor-element-1a425a8 {
 *       width: var( --container-widget-width, 40px );
 *       max-width: 40px;
 *     }
 *   }
 *
 * 40px less the select's own 16px side padding leaves ~8px for text, so on a
 * phone the control renders as a bare chevron in a white box — still tappable,
 * but unreadable and unrecognisable as a language picker. Above 767px the same
 * widget is `width: initial` and renders at 192px, which is why this only ever
 * showed up on phones. The real fix is clearing that width in the Elementor
 * editor; this rule is the plugin-side guard.
 *
 * !important on min-width/max-width: the theme rule is a plain three-class
 * selector, and out-specifying it would mean hardcoding
 * `elementor-element-1a425a8` — an id that changes whenever the widget is
 * rebuilt. Matching structurally and overriding outright survives that.
 *
 * min-width rather than width: this only ever widens a switcher squeezed below
 * usable size. One the theme sizes larger (the footer placement, on layouts
 * that use it) keeps the width it was given. 12rem is what the same control
 * renders at above the 767px breakpoint.
 *
 * :has() is what finds the widget without hardcoding its Elementor id.
 * Browsers without it (Firefox < 121, Safari < 15.4) fall through to the
 * current behaviour rather than to anything worse.
 */

.elementor-widget-shortcode:has(> .elementor-widget-container > .elementor-shortcode > .gtranslate_wrapper) {
  min-width: 12rem !important;
  max-width: 100% !important;
}
