/* MQ Physics Landing - mobile fixes (landing pages + /trial-class/). Loaded only on those pages. */

/* Floating chat buttons fade out while they would cover a CTA / form field (class set by mq-mobile.js). */
body.mqpl-mobile #mq-chat-launch,
body.mqpl-mobile .wa__btn_popup {
	transition: opacity 0.2s ease;
}

html.mq-chat-tuck body.mqpl-mobile #mq-chat-launch,
html.mq-chat-tuck body.mqpl-mobile .wa__btn_popup {
	opacity: 0;
	pointer-events: none;
}

/* Chat panel + its close button above everything else on the page: Divi's #top-header (z-index 100000)
   otherwise covers the top of the full-screen panel and the close button. */
body.mqpl-mobile #mq-chat-panel {
	z-index: 2147483000;
}

body.mqpl-mobile #mq-chat-launch {
	z-index: 2147483001;
}

@media (max-width: 767px) {
	/* Chatbot launcher (outside working hours): round icon button, label kept for screen readers. */
	body.mqpl-mobile #mq-chat-launch {
		right: 12px;
		bottom: 16px;
		width: 52px;
		height: 52px;
		padding: 0;
		justify-content: center;
	}

	body.mqpl-mobile #mq-chat-launch svg {
		width: 24px;
		height: 24px;
	}

	body.mqpl-mobile #mq-chat-launch span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	/* Chat panel full screen: page behind it locked (mq-mobile.js), no scroll chaining / bounce. */
	html.mq-chat-lock,
	html.mq-chat-lock body {
		overflow: hidden;
		overscroll-behavior: none;
	}

	body.mqpl-mobile #mq-chat-panel {
		overscroll-behavior: contain;
		touch-action: pan-y;
	}


	/* Panel open: the launcher becomes a small round close (X) button, clear of the chat header text. */
	body.mqpl-mobile #mq-chat-panel.open ~ #mq-chat-launch {
		width: 36px;
		height: 36px;
		padding: 0;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	}

	body.mqpl-mobile #mq-chat-panel.open ~ #mq-chat-launch svg {
		display: none;
	}

	body.mqpl-mobile #mq-chat-panel.open ~ #mq-chat-launch::before,
	body.mqpl-mobile #mq-chat-panel.open ~ #mq-chat-launch::after {
		content: '';
		position: absolute;
		left: 50%;
		top: 50%;
		width: 16px;
		height: 2px;
		margin: -1px 0 0 -8px;
		background: currentColor;
		border-radius: 1px;
		transform: rotate(45deg);
	}

	body.mqpl-mobile #mq-chat-panel.open ~ #mq-chat-launch::after {
		transform: rotate(-45deg);
	}

	/* WhatsApp widget (working hours): icon only, same corner. */
	body.mqpl-mobile .wa__btn_popup {
		right: 12px !important;
		bottom: 16px !important;
	}

	body.mqpl-mobile .wa__btn_popup .wa__btn_popup_txt {
		display: none !important;
	}

	/* Justified page text (marked by mq-mobile.js) reads better left-aligned in a narrow column. */
	body.mqpl-mobile .mq-nojustify,
	body.mqpl-mobile .dica_divi_carousel .dica_divi_carouselitem.dica_divi_carouselitem .dica-item-content .content,
	body.mqpl-mobile .dica_divi_carousel .dica_divi_carouselitem.dica_divi_carouselitem .dica-item-content .content p {
		text-align: left !important;
	}

	/* Divi back-to-top arrow: one floating control is enough on mobile. */
	body.mqpl-mobile .et_pb_scroll_top {
		display: none !important;
	}

	/* Tap targets >= 44px without changing the look. */
	body.mqpl-mobile .mq-link {
		position: relative;
	}

	body.mqpl-mobile .mq-link::after {
		content: '';
		position: absolute;
		left: -6px;
		right: -6px;
		top: -10px;
		bottom: -10px;
	}

	body.mqpl-mobile .mq-reveal__btn {
		min-height: 44px;
	}

	body.mqpl-mobile .mq-dots {
		gap: 14px;
	}

	body.mqpl-mobile .mq-dots button {
		position: relative;
	}

	body.mqpl-mobile .mq-dots button::after {
		content: '';
		position: absolute;
		left: -7px;
		right: -7px;
		top: -18px;
		bottom: -18px;
	}

	/* Schedule tables: keep the time on one line. */
	body.mqpl-mobile .mq-fee td,
	body.mqpl-mobile .mq-fee th {
		padding-left: 10px;
		padding-right: 10px;
	}

	body.mqpl-mobile .mq-fee td:nth-child(2) {
		white-space: nowrap;
	}

	body.mqpl-mobile .wpdtSimpleTable td,
	body.mqpl-mobile .wpdtSimpleTable th {
		padding-left: 8px !important;
		padding-right: 8px !important;
	}

	body.mqpl-mobile .wpdtSimpleTable td:nth-child(2) {
		white-space: nowrap;
	}
}

/* Testimonial carousel on phones: cards run edge to edge with the next card peeking in (swipe hint),
   shorter cards, left-aligned text (justified text leaves wide gaps in a narrow column). */
@media (max-width: 680px) {
	body.mqpl-mobile .mq-carousel__track {
		grid-auto-columns: 84%;
		gap: 12px;
		margin: 0 calc(var(--mq-gutter) * -1);
		padding: 0 var(--mq-gutter) 4px;
		scroll-padding: 0 var(--mq-gutter);
		overscroll-behavior-x: contain;
	}

	body.mqpl-mobile .mq-tcard {
		padding: 24px 20px 26px;
	}

	body.mqpl-mobile .mq-tcard img {
		width: 80px;
		height: 80px;
		margin-bottom: 16px;
	}

	body.mqpl-mobile .mq-tcard__result {
		margin-bottom: 14px;
	}

	body.mqpl-mobile .mq-tcard p {
		line-height: 1.65;
		text-align: left;
	}

	body.mqpl-mobile .mq-dots {
		margin-top: 18px;
	}
}

/* Full-screen chat panel (<= 600px, as set by the chat snippet): follow the visible viewport on iOS. */
@media (max-width: 600px) {
	@supports (height: 100dvh) {
		body.mqpl-mobile #mq-chat-panel {
			height: 100dvh;
			max-height: 100dvh;
		}
	}
}
