/*
 * FreeLYFE Rx mobile fixes.
 *
 * Elementor element IDs are opaque hashes, so here is the map of what this file
 * touches. They are stable for the life of a template and only change if a
 * section is rebuilt from scratch.
 *
 *   Header (sticky, present on every page)
 *     b308e93  header container
 *     8df30f1  logo column          eb723ae  logo image widget
 *     e22af46  nav + phone column   a70c1df  nav menu widget
 *                                   8d64e58  phone button widget
 *
 *   Home page hero and "Why Us" mosaic
 *     100cae8  decorative cutout, positioned outside the phone viewport
 *     2c93596  the mosaic grid
 *     188e3f5  photo tile (lab glassware, spans two rows on desktop)
 *     d94b177  photo tile (vials)
 *     551e697  photo tile (technician, spans two columns on desktop)
 *
 *   Floating widgets
 *     7bccde8  rotated "Get Started" rail pinned to the right edge
 *     e627882  sticky bottom bar, "GET STARTED / CALL" -- kept, it belongs on phones
 *
 *   Footer
 *     a537008  Quick Links menu     a75f4e8  Follow Us menu
 *     aff7382  legal links menu
 *
 * Two breakpoints, both Elementor's own. 1024px is where the header swaps the
 * desktop navigation for the hamburger, so everything to do with the menu, the
 * footer menus, forms and touch targets belongs there. 767px is where the
 * header itself and the mosaic need a different layout, not just bigger targets.
 */

/* ==========================================================================
   Tablet and below: wherever the hamburger is the navigation
   ========================================================================== */

@media (max-width: 1024px) {

	/* ----------------------------------------------------------------------
	   Floating widgets that landed on top of each other and on the content
	   ---------------------------------------------------------------------- */

	/*
	 * A 39px-wide rail holding vertical text, pinned over the right edge of the
	 * content. It sits on top of body copy at every scroll position and offers
	 * the same call to action as the sticky bottom bar, which is only shown at
	 * these widths. One of the two has to go, and the bottom bar is the one a
	 * thumb can actually hit.
	 */
	.elementor-element-7bccde8 {
		display: none !important;
	}

	/* The scroll-to-top button sat on top of the sticky bar's right half. */
	.eael-ext-scroll-to-top-button {
		right: 12px !important;
		bottom: 64px !important;
	}

	/*
	 * UserWay pins its launcher to the vertical middle of the left edge, where it
	 * covers body text and the first column of every card grid. Moved down beside
	 * the scroll-to-top button, clear of the sticky bar but still one tap away.
	 */
	.uwy .userway_buttons_wrapper,
	.uwy.userway_p6 .userway_buttons_wrapper {
		top: auto !important;
		bottom: 64px !important;
		left: 12px !important;
	}

	/* ----------------------------------------------------------------------
	   Mobile menu: a 218px panel floating in the right half of the screen
	   ----------------------------------------------------------------------
	   Elementor anchors the dropdown to the nav widget, which sits at the far
	   right of the header, so the panel inherited the widget's narrow width and
	   its offset -- 218px of menu starting 331px into an iPad screen. Taking the
	   intermediate containers out of the positioning chain leaves the header as
	   the dropdown's containing block, and left/right:0 then stretches the panel
	   across it.

	   Note the panel is the nav element. Elementor gives the submenu <ul>s the
	   same elementor-nav-menu--dropdown class, so anything meant for the panel
	   alone has to say nav.elementor-nav-menu__container or it lands on the
	   submenus too.
	   ---------------------------------------------------------------------- */

	header.elementor-element-b308e93 .elementor-element-e22af46,
	header.elementor-element-b308e93 .elementor-element-e22af46 > .e-con-inner,
	header.elementor-element-b308e93 .elementor-element-a70c1df,
	header.elementor-element-b308e93 .elementor-element-a70c1df > .elementor-widget-container {
		position: static !important;
	}

	header.elementor-element-b308e93 nav.elementor-nav-menu__container.elementor-nav-menu--dropdown {
		position: absolute !important;
		top: 100% !important;
		right: 0 !important;
		left: 0 !important;
		width: auto !important;
		max-width: none !important;
		max-height: calc(100vh - 100px) !important;
		padding-bottom: 8px !important;
		overflow-y: auto !important;
		box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16) !important;
		-webkit-overflow-scrolling: touch;
	}

	header.elementor-element-b308e93 .elementor-nav-menu--dropdown a.elementor-item,
	header.elementor-element-b308e93 .elementor-nav-menu--dropdown a.elementor-sub-item {
		display: flex !important;
		align-items: center !important;
		min-height: 52px !important;
		padding: 12px 20px !important;
		font-size: 16px !important;
	}

	/*
	 * Submenus inherit Elementor's desktop behaviour: absolutely positioned at
	 * top:100% of their parent item, so on a touch device an expanded submenu
	 * floated over the menu items underneath it -- opening "About Us" hid
	 * "Franchise Opportunity" and "Resources" and left "Contact Us" half
	 * covered. Putting them back in flow turns the panel into the accordion it
	 * should have been, and the panel's own max-height and overflow absorb the
	 * extra length.
	 */
	header.elementor-element-b308e93 nav.elementor-nav-menu__container ul.sub-menu {
		position: static !important;
		width: 100% !important;
		min-width: 0 !important;
		margin: 0 !important;
		border: 0 !important;
		box-shadow: none !important;
		background-color: rgba(0, 0, 0, 0.035) !important;
	}

	header.elementor-element-b308e93 .elementor-nav-menu--dropdown a.elementor-sub-item {
		min-height: 48px !important;
		padding-left: 38px !important;
		font-size: 15px !important;
	}

	/* The chevron is its own tap target and was far too small to aim at. */
	header.elementor-element-b308e93 .elementor-nav-menu--dropdown .sub-arrow {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		min-width: 44px !important;
		min-height: 44px !important;
		margin: 0 0 0 auto !important;
		padding: 0 !important;
	}

	/* The toggle itself was a 33px square. */
	header.elementor-element-b308e93 .elementor-menu-toggle {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		width: 44px !important;
		height: 44px !important;
		padding: 0 !important;
	}

	/* ----------------------------------------------------------------------
	   Footer menus were hidden behind hamburgers
	   ----------------------------------------------------------------------
	   Both link columns are nav-menu widgets set to collapse at the tablet
	   breakpoint, so the footer rendered two stray hamburger buttons where
	   "Quick Links" and "Follow Us" should be. A footer exists to be scanned;
	   there is nothing to save by collapsing thirteen links behind a tap.
	   ---------------------------------------------------------------------- */

	.elementor-element-a537008 .elementor-menu-toggle,
	.elementor-element-a75f4e8 .elementor-menu-toggle,
	.elementor-element-aff7382 .elementor-menu-toggle {
		display: none !important;
	}

	.elementor-element-a537008 .elementor-nav-menu--dropdown,
	.elementor-element-a75f4e8 .elementor-nav-menu--dropdown,
	.elementor-element-aff7382 .elementor-nav-menu--dropdown {
		position: static !important;
		display: block !important;
		width: 100% !important;
		max-width: none !important;
		max-height: none !important;
		margin: 0 !important;
		padding: 0 !important;
		overflow: visible !important;
		visibility: visible !important;
		opacity: 1 !important;
		background: transparent !important;
		border: 0 !important;
		box-shadow: none !important;
		transform: none !important;
	}

	.elementor-element-a537008 .elementor-nav-menu--dropdown a,
	.elementor-element-a75f4e8 .elementor-nav-menu--dropdown a,
	.elementor-element-aff7382 .elementor-nav-menu--dropdown a {
		display: flex !important;
		align-items: center !important;
		min-height: 44px !important;
		padding: 8px 0 !important;
		background: transparent !important;
		font-size: 15px !important;
	}

	/* The legal row is a horizontal strip on desktop; let it wrap rather than
	   turn into a narrow indented column. */
	.elementor-element-aff7382 .elementor-nav-menu--dropdown ul {
		display: flex !important;
		flex-wrap: wrap !important;
		gap: 0 20px !important;
		justify-content: center !important;
	}

	.elementor-element-aff7382 .elementor-nav-menu--dropdown li {
		width: auto !important;
	}

	/* ----------------------------------------------------------------------
	   Forms
	   ----------------------------------------------------------------------
	   Every text field was 14-15px. Safari on iOS and iPadOS zooms the whole
	   page in when a field smaller than 16px takes focus, and does not zoom back
	   out, so starting to fill in the enquiry form left the visitor stranded at
	   1.3x with the layout overflowing sideways. 16px is the threshold, not a
	   preference.
	   ---------------------------------------------------------------------- */

	.elementor-field-textual,
	.elementor-field-textual.elementor-size-sm,
	.elementor-field-textual.elementor-size-xs {
		min-height: 48px !important;
		font-size: 16px !important;
	}

	textarea.elementor-field-textual {
		min-height: 96px !important;
	}

	/* 13px consent boxes, below the smallest reliable tap target. */
	.elementor-field-type-acceptance input[type="checkbox"],
	.elementor-field-subgroup input[type="checkbox"],
	.elementor-field-subgroup input[type="radio"] {
		flex: 0 0 auto !important;
		width: 20px !important;
		height: 20px !important;
		margin-right: 10px !important;
	}

	.elementor-field-type-acceptance .elementor-field-option,
	.elementor-field-subgroup .elementor-field-option {
		display: flex !important;
		align-items: flex-start !important;
		line-height: 1.45 !important;
	}

	.elementor-field-type-acceptance .elementor-field-option label,
	.elementor-field-subgroup .elementor-field-option label {
		font-size: 14px !important;
	}

	/* ----------------------------------------------------------------------
	   Buttons and in-page anchors
	   ---------------------------------------------------------------------- */

	/* Content buttons were 39px tall. Extra block padding lifts them past 44px
	   without changing how their width is computed. The header's compact phone
	   button is sized separately below. */
	.elementor-button:not(.elementor-size-xs) {
		padding-top: 14px !important;
		padding-bottom: 14px !important;
	}

	/* Without this, a link to an on-page section scrolls the target underneath
	   the sticky header. */
	html {
		scroll-padding-top: 104px;
	}
}

/* ==========================================================================
   Phones
   ========================================================================== */

@media (max-width: 767px) {

	/* ----------------------------------------------------------------------
	   Header: 256px of mostly empty space, reduced to a single row
	   ----------------------------------------------------------------------
	   The container is flex-wrap:wrap and its two children carry the desktop's
	   explicit widths (270px and 372px), which together exceed the phone's
	   content box. So they wrapped onto separate lines, and the nav and phone
	   button inside the second child wrapped again -- three stacked rows, all
	   of it under a sticky header eating 28% of the screen on every page.

	   Dropping the fixed widths and forbidding the wrap puts the logo, phone
	   number and hamburger on one line. The rules apply to the sticky header and
	   to the hidden spacer clone Elementor pairs with it, which share this class,
	   so the spacer shrinks in step and no gap opens under the header.
	   ---------------------------------------------------------------------- */

	header.elementor-element-b308e93 {
		flex-wrap: nowrap !important;
		align-items: center !important;
		gap: 10px !important;
		padding: 8px 16px !important;
	}

	header.elementor-element-b308e93 > .elementor-element-8df30f1 {
		flex: 0 1 auto !important;
		width: auto !important;
		max-width: 150px !important;
	}

	header.elementor-element-b308e93 > .elementor-element-e22af46 {
		flex: 1 1 auto !important;
		width: auto !important;
		min-width: 0 !important;
	}

	header.elementor-element-b308e93 .elementor-element-e22af46 > .e-con-inner {
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: flex-end !important;
		gap: 8px !important;
	}

	header.elementor-element-b308e93 .elementor-element-a70c1df,
	header.elementor-element-b308e93 .elementor-element-8d64e58 {
		flex: 0 0 auto !important;
		width: auto !important;
	}

	header.elementor-element-b308e93 .elementor-element-eb723ae img {
		width: 150px !important;
		max-width: 100% !important;
		height: auto !important;
	}

	/* Keeps the number on one line as the row tightens on narrow screens. */
	header.elementor-element-b308e93 .elementor-element-8d64e58 .elementor-button {
		min-height: 0 !important;
		padding: 10px 14px !important;
		font-size: 14px !important;
		white-space: nowrap !important;
	}

	header.elementor-element-b308e93 .elementor-button {
		padding-top: 10px !important;
		padding-bottom: 10px !important;
	}

	/* The panel hangs off a 64px header here rather than a 92px one. */
	header.elementor-element-b308e93 nav.elementor-nav-menu__container.elementor-nav-menu--dropdown {
		max-height: calc(100vh - 72px) !important;
	}

	html {
		scroll-padding-top: 76px;
	}

	/* ----------------------------------------------------------------------
	   "Why Us" mosaic: four desktop columns became "20px 252px" on phones
	   ----------------------------------------------------------------------
	   The first track resolved to 20px, so four of the nine tiles rendered as
	   slivers -- three colour cards showing one character per line, and one
	   photograph reduced to a 20px stripe. What was left looked like coloured
	   cards separated by empty gaps. The tiles also keep the row and column
	   spans that make the desktop mosaic work, and those cannot place sensibly
	   in two narrow tracks.

	   A single column with the spans reset stacks the nine tiles in source
	   order, which is the same reading order as the desktop mosaic. The mosaic
	   itself survives down to the 768px tablet layout, so this only applies to
	   phones.
	   ---------------------------------------------------------------------- */

	.elementor-element-2c93596 {
		grid-template-columns: 1fr !important;
		grid-template-rows: none !important;
		grid-auto-rows: auto !important;
		gap: 16px !important;
	}

	.elementor-element-2c93596 > .e-con {
		grid-area: auto !important;
		width: auto !important;
		min-width: 0 !important;
	}

	/*
	 * These three carry only a background image, so with the desktop row spans
	 * gone they have no content to give them height. One shared height also
	 * stops the stack from running unusually long.
	 */
	.elementor-element-2c93596 > .elementor-element-188e3f5,
	.elementor-element-2c93596 > .elementor-element-d94b177,
	.elementor-element-2c93596 > .elementor-element-551e697 {
		height: auto !important;
		min-height: 200px !important;
		background-position: center !important;
		background-size: cover !important;
	}

	/*
	 * The hero's decorative cutout is absolutely positioned about 100px past the
	 * right edge of a phone viewport, so it renders entirely outside the screen.
	 * Taking it out keeps an off-canvas 412px element from masking a real
	 * overflow the next time one appears.
	 */
	.elementor-element-100cae8 {
		display: none !important;
	}
}

/* ==========================================================================
   Narrow phones
   ==========================================================================
   Below roughly 380px the header row has about 320px to work with, so the logo
   and the phone number both give up a little more.
   ========================================================================== */

@media (max-width: 380px) {

	header.elementor-element-b308e93 {
		gap: 6px !important;
		padding: 8px 12px !important;
	}

	header.elementor-element-b308e93 > .elementor-element-8df30f1 {
		max-width: 118px !important;
	}

	header.elementor-element-b308e93 .elementor-element-eb723ae img {
		width: 118px !important;
	}

	header.elementor-element-b308e93 .elementor-element-8d64e58 .elementor-button {
		padding: 9px 10px !important;
		font-size: 13px !important;
	}
}
