/**
 * Mobile responsive overrides — breakpoints: 375, 768, 1024, 1440
 *
 * @package MedSolutions_Academy
 */

/* Prevent horizontal scroll site-wide */
html {
	overflow-x: clip;
}

body.msa-academy {
	overflow-x: clip;
	max-width: 100vw;
}

img,
video,
iframe,
svg {
	max-width: 100%;
	height: auto;
}

/* Touch targets — minimum 44px */
.btn,
.msa-btn,
.msa-blog-filter__btn,
.msa-validity-tab,
.msa-plan-subscribe,
.mslms-button,
.mslms-exam-catalog__filters-toggle,
.mslms-free-mock-catalog__filters-toggle,
.mslms-exam-catalog__search-btn,
.nav-links a,
.msa-header__nav-link {
	min-height: 44px;
}

.msa-mobile-nav__link {
	min-height: 48px;
	display: flex;
	align-items: center;
}

/* Header — small phones */
@media (max-width: 480px) {
	nav.wrap,
	.msa-header__inner {
		height: 72px;
		gap: 8px;
	}

	.brand-name,
	.msa-header__logo-main {
		font-size: 0.88rem;
	}

	.brand-name small,
	.msa-header__logo-sub {
		font-size: 0.55rem;
		letter-spacing: 0.08em;
	}

	.nav-cta .btn-primary,
	.msa-header__actions .msa-btn--primary {
		display: none;
	}

	.msa-mobile-nav {
		top: 72px;
	}
}

@media (max-width: 375px) {
	.wrap,
	.msa-container {
		padding: 0 16px;
	}

	.brand .seal,
	.msa-header__logo .seal {
		--seal-size: 32px;
	}
}

/* Hero visual scaling */
@media (max-width: 768px) {
	.hero-visual,
	.msa-hero__visual {
		height: 340px;
	}

	.license-card.back {
		width: 85%;
		height: 260px;
	}

	.license-card.front {
		width: 90%;
		height: 240px;
	}

	.floating-chip {
		font-size: 0.7rem;
		padding: 8px 12px;
		right: 12px;
	}

	.dm-cards {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 375px) {
	.hero h1,
	.msa-hero__title {
		font-size: 2rem;
	}

	.hero-visual,
	.msa-hero__visual {
		height: 300px;
	}
}

/* Inner pages shared padding */
@media (max-width: 768px) {
	.msa-page .pagehead,
	.msa-page .section {
		padding: 48px 0;
	}

	.msa-page--contact .form-card {
		padding: 24px 20px;
	}

	.msa-inner-hero {
		padding: 48px 0 36px;
	}

	.msa-inner-hero__stats {
		gap: 0.75rem;
	}

	.msa-inner-hero__stat {
		min-width: 0;
		flex: 1 1 calc(50% - 0.75rem);
		padding: 0.75rem 1rem;
	}
}

/* Footer */
@media (max-width: 768px) {
	footer,
	.msa-footer {
		padding: 48px 0 24px;
	}

	.footer-bottom,
	.msa-footer__bottom {
		flex-direction: column;
		text-align: center;
	}

	.footer-social a {
		width: 44px;
		height: 44px;
	}
}

/* Sticky CTA bar */
@media (max-width: 768px) {
	.msa-sticky-cta__inner {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.msa-sticky-cta .msa-btn {
		width: 100%;
		justify-content: center;
	}
}

/* Prometric exam pages */
@media (max-width: 768px) {
	.msa-prometric-page .exam-hero-grid,
	.msa-page--exam .exam-hero-grid {
		gap: 28px;
	}

	.msa-prometric-page .cta-actions,
	.msa-page--exam .cta-actions {
		flex-direction: column;
		width: 100%;
	}

	.msa-prometric-page .cta-actions .btn,
	.msa-page--exam .cta-actions .btn {
		width: 100%;
	}
}

/* Blog filter chips */
@media (max-width: 768px) {
	.msa-blog-filter__btn {
		padding: 0.5rem 1rem;
		font-size: 0.8125rem;
	}
}

/* WhatsApp float — safe area on mobile */
@media (max-width: 768px) {
	.wa-float,
	.msa-whatsapp-float {
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		right: 16px;
		width: 52px;
		height: 52px;
	}

	.msa-whatsapp-float__label {
		display: none;
	}
}

/* Exam catalog — plugin */
@media (max-width: 768px) {
	.mslms-exam-catalog {
		padding: 0 0 32px;
	}

	.mslms-exam-catalog__search-bar {
		flex-direction: column;
		border-radius: var(--msa-radius-md, 18px);
	}

	.mslms-exam-catalog__search-input {
		padding: 14px 18px;
		font-size: 16px;
	}

	.mslms-exam-catalog__search-btn {
		justify-content: center;
		padding: 14px 20px;
		min-height: 48px;
	}

	.mslms-exam-catalog__grid {
		grid-template-columns: 1fr;
	}

	.mslms-exam-catalog__filters-toggle {
		min-height: 48px;
	}

	.mslms-exam-catalog__select {
		font-size: 16px;
		min-height: 48px;
	}
}

@media (max-width: 1024px) and (min-width: 769px) {
	.mslms-exam-catalog__filters {
		grid-template-columns: repeat(2, 1fr);
	}

	.mslms-exam-catalog__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Free mock test */
@media (max-width: 768px) {
	.mslms-free-mock-catalog__filters-toggle {
		min-height: 48px;
	}

	.mslms-free-mock-take__header,
	.mslms-free-mock-results {
		padding: 20px 16px;
	}

	.mslms-free-mock-take__nav {
		flex-direction: column;
		gap: 12px;
	}

	.mslms-free-mock-take__nav .mslms-button {
		width: 100%;
		justify-content: center;
	}
}

/* Subscription plans */
@media (max-width: 768px) {
	.msa-validity-tab {
		padding: 0.75rem 1rem;
		font-size: 0.875rem;
	}

	.msa-plan-card {
		padding: 24px 20px;
	}

	.msa-plan-subscribe {
		min-height: 48px;
		padding: 0.875rem 1.25rem;
	}
}

/* Student dashboard */
@media (max-width: 768px) {
	.mslms-sd-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.mslms-sd-tabs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		flex-wrap: nowrap;
		padding-bottom: 4px;
	}

	.mslms-sd-tab {
		flex-shrink: 0;
		min-height: 44px;
	}
}

@media (max-width: 375px) {
	.mslms-dashboard {
		padding: 0 12px;
	}
}

/* Contact & auth forms — prevent iOS zoom, full-width inputs */
@media (max-width: 768px) {
	.msa-form__input,
	.msa-form__select,
	.msa-form__textarea,
	.msa-contact-form input,
	.msa-contact-form select,
	.msa-contact-form textarea,
	.mslms-reg__field .input,
	.mslms-reg__country-select {
		font-size: 16px;
		min-height: 48px;
	}

	.msa-form__submit,
	.msa-contact-form .btn-primary,
	.mslms-reg__btn {
		min-height: 48px;
		width: 100%;
	}

	.msa-page--contact .form-card {
		padding: 24px 16px;
	}

	.msa-page--contact .side-card,
	.msa-page--contact .hours-card {
		padding: 24px 20px;
	}

	.msa-auth-section {
		padding-left: 16px;
		padding-right: 16px;
	}

	.footer-col a,
	.msa-footer__branch-contacts a {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		padding-block: 4px;
	}

	.msa-footer__branches {
		gap: 16px;
		margin-bottom: 32px;
	}

	.msa-footer__branch {
		padding: 20px 16px;
	}
}

@media (max-width: 375px) {
	.msa-auth-panel {
		padding: 0 4px;
	}

	.mslms-reg {
		padding-left: 12px;
		padding-right: 12px;
	}

	.msa-blog-filter__inner {
		flex-direction: column;
		align-items: stretch;
	}

	.msa-blog-filter__tags {
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
	}

	.msa-blog-filter__btn {
		flex-shrink: 0;
	}
}

/* Elementor full-width content */
body.msa-academy .elementor-section.elementor-section-boxed > .elementor-container {
	max-width: 1240px;
}

/* Success stories slider — touch-friendly controls */
@media (max-width: 768px) {
	.msa-stories-slider__viewport {
		margin: 0 48px;
		overflow: hidden;
	}

	.msa-stories-slider__arrow {
		width: 44px;
		height: 44px;
		min-width: 44px;
		min-height: 44px;
	}

	.msa-stories-slider__dots {
		gap: 4px;
	}

	.msa-stories-slider__dot {
		width: 44px;
		height: 44px;
		border-radius: 50%;
		background: transparent;
		position: relative;
	}

	.msa-stories-slider__dot.is-active {
		background: transparent;
		transform: none;
	}

	.msa-stories-slider__dot::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 8px;
		height: 8px;
		margin: -4px 0 0 -4px;
		border-radius: 50%;
		background: rgba(11, 79, 135, 0.25);
		transition: background 0.2s, transform 0.2s;
	}

	.msa-stories-slider__dot.is-active::after {
		background: var(--green, #0C9A46);
		transform: scale(1.25);
	}

	.msa-stories-slider__dot:hover::after {
		background: var(--blue-deep, #0B4F87);
	}
}

@media (max-width: 1024px) {
	.msa-footer__branches {
		grid-template-columns: 1fr;
	}

	.msa-footer__branch {
		max-width: none;
	}
}

body.msa-academy {
	overflow-x: hidden;
}
