/* LegendSky mobile fixes. Phone and tablet only, except where noted.
   Astra switches to its mobile header at 921px and its phone layout at 544px. */

/* ---------- Header ---------- */
@media (max-width: 921px) {
	/* Break the site name between words, never mid-word ("LegendSk / y"). */
	.ast-mobile-header-wrap .site-title,
	.ast-mobile-header-wrap .site-title a {
		overflow-wrap: normal;
		word-break: normal;
		hyphens: none;
		line-height: 1.12;
	}
	.ast-mobile-header-wrap .site-branding { min-width: 0; }

	/* Name gets whatever room is left; the button and menu icon never get squeezed. */
	.ast-mobile-header-wrap .ast-primary-header-bar .ast-builder-grid-row {
		grid-template-columns: minmax(0, 1fr) auto !important;
		column-gap: 8px;
	}
	.ast-mobile-header-wrap .site-header-primary-section-right > .ast-builder-layout-element { flex-shrink: 0; }

	/* Menu button: a full 48px tap target, icon drawn bigger. */
	.ast-mobile-header-wrap .menu-toggle.main-header-menu-toggle {
		min-width: 48px;
		min-height: 48px;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-right: -8px;
	}
	.ast-mobile-header-wrap .menu-toggle .ast-mobile-svg {
		width: 28px;
		height: 28px;
	}

	/* Menu rows and their dropdown arrows: comfortable to tap. */
	.ast-mobile-header-wrap .main-header-menu .menu-item > .menu-link {
		min-height: 48px;
		display: flex;
		align-items: center;
	}
	.ast-mobile-header-wrap .main-header-menu .ast-menu-toggle {
		min-width: 52px;
		min-height: 48px;
	}

	/* Nothing on a phone should ever make the page slide sideways. */
	html, body { overflow-x: clip; }
}

@media (max-width: 544px) {
	/* Enroll Now button: a little more compact so the name has room. */
	.ast-mobile-header-wrap .ast-custom-button {
		padding: 10px 14px !important;
		font-size: 14px;
		white-space: nowrap;
	}
}

/* ---------- Text boxes: 16px stops iPhones zooming in on every tap ---------- */
@media (max-width: 768px) {
	input[type="text"],
	input[type="email"],
	input[type="password"],
	input[type="tel"],
	input[type="number"],
	input[type="search"],
	input[type="url"],
	select,
	textarea {
		font-size: 16px !important;
	}
}

/* ---------- Course shop ("Enroll Now!" page) ---------- */
@media (max-width: 921px) {
	/* Pictures fill a square, shown whole, with no grey bars around them.
	   (Desktop keeps its 300px boxes from the Customizer CSS.) */
	body.woocommerce-page ul.products li.product img,
	body .woocommerce ul.products li.product img {
		height: auto !important;
		aspect-ratio: 1 / 1;
		object-fit: contain !important;
		background: transparent !important;
		margin-bottom: 10px !important;
	}
}
@media (max-width: 544px) {
	/* Two courses per row instead of three squeezed ones. */
	body.woocommerce-page ul.products,
	body .woocommerce ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		column-gap: 14px !important;
		row-gap: 28px !important;
	}
	ul.products li.product .woocommerce-loop-product__title { font-size: 16px !important; line-height: 1.25 !important; }
	/* Buttons in the same row line up, however long the course name is. */
	ul.products li.product { display: flex !important; flex-direction: column; }
	ul.products li.product .astra-shop-summary-wrap { display: flex; flex-direction: column; flex: 1 1 auto; }
	ul.products li.product .astra-shop-summary-wrap .button { margin-top: auto !important; }
	ul.products li.product .button {
		display: block !important;
		width: 100%;
		text-align: center;
		white-space: nowrap;
		padding: 12px 8px !important;
		font-size: 15px !important;
	}
}

/* ---------- Cart panel (Modern Cart) ---------- */
/* Full screen on phones, so it's clearly one step (it was 80% wide with the
   page peeking out behind it). */
@media (max-width: 544px) {
	html body #moderncart-slide-out { max-width: 100% !important; width: 100% !important; }
}
.moderncart-slide-out-header-close {
	min-width: 44px;
	min-height: 44px;
}
.lsmf-keep-browsing {
	display: block;
	margin: 14px 16px 6px;
	padding: 12px 16px;
	border: 1.5px solid #2285c9;
	border-radius: 6px;
	background: #fff;
	color: #2285c9;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	width: calc(100% - 32px);
}
.lsmf-keep-browsing:hover,
.lsmf-keep-browsing:focus { background: #f0f7fc; color: #1a6aa1; }

/* ---------- Cookie banner (Complianz) ---------- */
@media (max-width: 544px) {
	.cmplz-cookiebanner.cmplz-show {
		padding: 12px 14px !important;
		max-width: 100vw;
	}
	.cmplz-cookiebanner .cmplz-header .cmplz-logo { max-height: 28px; }
	.cmplz-cookiebanner .cmplz-message { font-size: 12.5px !important; line-height: 1.45 !important; }
	/* Accept and Deny side by side and equally prominent; preferences below. */
	.cmplz-cookiebanner .cmplz-buttons {
		flex-direction: row !important;
		flex-wrap: wrap !important;
		gap: 8px !important;
	}
	.cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
		margin: 0 !important;
		min-width: 0 !important;
		height: 44px !important;
	}
	.cmplz-cookiebanner .cmplz-buttons .cmplz-accept,
	.cmplz-cookiebanner .cmplz-buttons .cmplz-deny {
		flex: 1 1 calc(50% - 4px) !important;
	}
	.cmplz-cookiebanner .cmplz-buttons .cmplz-view-preferences,
	.cmplz-cookiebanner .cmplz-buttons .cmplz-save-preferences {
		flex: 1 1 100% !important;
	}
}

/* ---------- After registering: "check your email" screen ---------- */
.lsmf-registered {
	max-width: 520px;
	margin: 8px auto 24px;
	padding: 28px 24px;
	border: 1px solid #cfe5d6;
	border-radius: 12px;
	background: #f3fbf6;
	color: #1f2937;
	text-align: center;
}
.lsmf-registered .lsmf-tick {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #1e8e4e;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	margin-bottom: 12px;
}
.lsmf-registered h2 { font-size: 22px; margin: 0 0 10px; }
.lsmf-registered p { margin: 0 0 12px; font-size: 16px; line-height: 1.55; }
.lsmf-registered .lsmf-small { font-size: 14px; color: #4b5563; }
.lsmf-registered .lsmf-btn {
	display: inline-block;
	margin-top: 6px;
	padding: 12px 22px;
	border-radius: 6px;
	background: #1b4f7a;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}
.lsmf-registered .lsmf-btn:hover,
.lsmf-registered .lsmf-btn:focus { background: #163f62; color: #fff; }

/* Register button while the sign-up is being sent. */
#tutor-registration-form button[type="submit"][disabled] { opacity: .75; cursor: progress; }
