/* TMC Mobile Fixes v4 (2026-11-21, Air agent; footer fix approved by Terry). Loaded by mu-plugin tmc-mobile-fixes.php.
   Versioned filenames ensure changed CSS is fetched even when the site strips ?ver=. */

/* 1. Wide tables (Resources pages: up to 1,724px, nowrap) — wrap text and scroll inside their own box on phones/tablets */
@media (max-width: 767px) {
	.elementor-widget-text-editor table,
	.elementor-widget-theme-post-content table,
	.entry-content table {
		display: block !important;
		max-width: 100% !important;
		width: 100% !important;
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
	}
	.elementor-widget-text-editor table th,
	.elementor-widget-text-editor table td,
	.elementor-widget-theme-post-content table th,
	.elementor-widget-theme-post-content table td,
	.entry-content table th,
	.entry-content table td {
		white-space: normal !important;
		min-width: 140px;
		word-break: normal;
		overflow-wrap: anywhere;
	}
}

/* 2. CookieYes consent box: 394px box on a 390px phone shifted the page sideways */
@media (max-width: 480px) {
	.cky-consent-container.cky-box-bottom-right,
	.cky-consent-container.cky-box-bottom-left {
		left: 8px !important;
		right: 8px !important;
		width: auto !important;
		max-width: calc(100vw - 16px) !important;
		box-sizing: border-box !important;
	}
}

/* 3. Older iOS Safari (< 16) doesn't support overflow: clip → fall back so pages can't slide sideways */
@supports not (overflow: clip) {
	html, body { overflow-x: hidden; }
}

/* 4. Safety net: very long words in headings (e.g. "INTERNATIONALLY" at 40px on /watch/) must wrap, not overflow */
@media (max-width: 767px) {
	.elementor-heading-title {
		overflow-wrap: break-word;
		hyphens: auto;
	}
}

/* 5. (v3, 2026-11-17, Air agent, approved by Terry) Accessibility button (ea11y-widget, z-index 2147483645) sat on top of the CookieYes "Reject All" button on phones. Keep the consent box above it on phones so the buttons are tappable. Accessibility button returns once the box is answered. */
@media (max-width: 767px) {
	.cky-consent-container {
		z-index: 2147483646 !important;
	}
}

/* 6. Newsletter form layout. Elementor Kit 22844's auto-width submit/Turnstile group collapsed the email field and overflowed its footer column. Stack the email, Turnstile, and submit controls from 481px up; keep the phone layout at 480px and below. */
@media (min-width: 481px) {
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-form-fields-wrapper {
		flex-direction: column !important;
		align-items: stretch !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-group-email {
		flex: 0 1 auto !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-group-email .elementor-field {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-type-submit {
		flex: 0 1 auto !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-type-submit .cf-turnstile {
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
	.elementor-kit-22844 .tmc-newsletter-form .elementor-form .elementor-field-type-submit .elementor-button {
		flex: 0 1 100% !important;
		min-width: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		box-sizing: border-box !important;
	}
}

/* At tablet widths, the four-column footer gives the newsletter/Turnstile too little room. Move its existing inner column to a full row. */
@media (min-width: 768px) and (max-width: 1024px) {
	.elementor-kit-22844 .elementor-element-1e2661ff {
		flex: 0 0 100% !important;
		width: 100% !important;
		max-width: 100% !important;
	}
}

/* 7. (v5, 2026-11-30, Muse — mobile audit) Tap targets: WooCommerce buttons and the
   events Read-more toggle get thumb-sized minimums on phones/tablets. */
@media (max-width: 1024px) {
	.woocommerce a.button,
	.woocommerce button.button,
	.woocommerce input.button {
		min-height: 48px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
	.woocommerce ul.products li.product a.button {
		display: flex;
		width: 100%;
		box-sizing: border-box;
	}
	.single-product .single_add_to_cart_button {
		width: 100%;
		min-height: 52px;
	}
	.tmc-ev-more {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		padding: 0.5rem 0.9rem;
	}
}

/* 8. (v5) Sticky buy bar on single-product pages; the bar element is added by
   tmc-mobile-fixes-v1.js and only appears while the real buy button is off-screen. */
#tmc-buybar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	display: none;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 0.9rem calc(0.6rem + env(safe-area-inset-bottom));
	background: #0D1B2A;
	border-top: 2px solid #C9A84C;
	box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.35);
}
@media (max-width: 1024px) {
	#tmc-buybar.tmc-buybar-on { display: flex; }
	body.single-product { padding-bottom: 76px; }
	body.single-product .cky-btn-revisit { bottom: 88px !important; }
}
#tmc-buybar .tmc-buybar-price {
	color: #D4AF37;
	font-weight: 700;
	font-size: 1.05rem;
	white-space: nowrap;
}
#tmc-buybar .tmc-buybar-btn {
	flex: 1 1 auto;
	min-height: 50px;
	background: #D4AF37;
	color: #041C2C;
	border: 1px solid #C9A84C;
	border-radius: 6px;
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
}

/* 9. (v5) CookieYes revisit button: shrink it so it stops crowding phone corners. */
@media (max-width: 767px) {
	.cky-btn-revisit {
		transform: scale(0.82);
		transform-origin: bottom left;
	}
}

/* 10. (v5) Readability floors for dense small-text zones on phones. */
@media (max-width: 767px) {
	.tmc-ev-desc-inner,
	.woocommerce-Tabs-panel {
		font-size: 1rem;
		line-height: 1.6;
	}
}

/* 11. (v5) Google Maps embeds: do not trap page scroll on touch devices.
   The fixes JS adds .tmc-map-on to the widget when it is tapped. */
.elementor-widget-google_maps iframe { pointer-events: none; }
.elementor-widget-google_maps.tmc-map-on iframe { pointer-events: auto; }

/* 12. H1 scales on mobile (Terry, Nov 30, 2026 — "All h1 should scale on mobile"): fluid size under the mobile breakpoint so every H1 (Elementor, theme, block) scales with the screen instead of rendering at the 56px desktop size. The kit theme style also steps H1 down (42px tablet / 34px mobile). */
@media (max-width: 767px) {
    h1 { font-size: clamp(30px, 8.5vw, 40px) !important; line-height: 1.15 !important; }
}
