/**
 * MamaMentor base component styles.
 * Uses CSS logical properties throughout so LTR (EN) and RTL (AR) share one file.
 * Page-level layout lives in Elementor; this covers typography defaults,
 * buttons, cards, forms and WooCommerce/LearnPress chrome the builder can't reach.
 */

body {
	font-family: var(--mm-font-body);
	color: var(--mm-ink);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--mm-font-heading);
	font-weight: 700;
	line-height: 1.3;
	color: var(--mm-ink);
}

a {
	color: var(--mm-primary);
	transition: color var(--mm-speed) var(--mm-ease);
}

a:hover {
	color: var(--mm-secondary);
}

/* ---- Buttons (Woo + LearnPress + generic) ---- */
.button,
button[type="submit"],
input[type="submit"],
.woocommerce a.button,
.woocommerce button.button,
.woocommerce #respond input#submit,
.lp-button,
.wp-block-button__link {
	font-family: var(--mm-font-heading);
	font-weight: 700;
	border-radius: var(--mm-radius-pill);
	background: var(--mm-primary);
	color: #fff;
	border: none;
	padding-block: 0.75em;
	padding-inline: 1.9em;
	cursor: pointer;
	transition: background var(--mm-speed) var(--mm-ease),
		transform var(--mm-speed) var(--mm-ease),
		box-shadow var(--mm-speed) var(--mm-ease);
}

.button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.lp-button:hover,
.wp-block-button__link:hover {
	background: var(--mm-primary-dark);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: var(--mm-shadow);
}

/* ---- Rounded-edge sweep: widgets that ship with square corners ---- */
.elementor-slide-button {
	border-radius: var(--mm-radius-pill) !important;
	border-width: 2px !important;
	font-family: var(--mm-font-heading);
	font-weight: 700;
	transition: background var(--mm-speed) var(--mm-ease), color var(--mm-speed) var(--mm-ease);
}

.elementor-slide-button:hover {
	background: #ffffff;
	color: var(--mm-primary);
	border-color: #ffffff;
}

.elementor-menu-toggle {
	border-radius: var(--mm-radius-sm);
}

.elementor-widget-image img,
.elementor-widget-video,
.wp-block-image img,
.page-content img {
	border-radius: var(--mm-radius);
}

/* --- RTL fixes for the hero slider (Swiper forces LTR internally) --- */
[dir="rtl"] .elementor-widget-slides .swiper-slide-contents,
[dir="rtl"] .elementor-widget-slides .elementor-slide-heading,
[dir="rtl"] .elementor-widget-slides .elementor-slide-description {
	direction: rtl;
	text-align: right;
}

/* Arrows swap sides in RTL but keep LTR chevrons — mirror the icons. */
[dir="rtl"] .elementor-swiper-button svg,
[dir="rtl"] .elementor-swiper-button i {
	transform: scaleX(-1);
}

/* the MacBook screen must stay flat inside its bezel */
.mm-macbook__screen img,
.mm-macbook__screen video,
.mm-macbook__screen iframe {
	border-radius: 0 !important;
}

table,
.wp-block-table table {
	border-radius: var(--mm-radius-sm);
	overflow: hidden;
	border-collapse: separate;
	border-spacing: 0;
}

/* ---- Cards ---- */
.mm-card {
	background: var(--mm-surface);
	border: 1px solid var(--mm-border);
	border-radius: var(--mm-radius-lg);
	box-shadow: var(--mm-shadow-sm);
	overflow: hidden;
	transition: transform var(--mm-speed) var(--mm-ease),
		box-shadow var(--mm-speed) var(--mm-ease);
}

.mm-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--mm-shadow-lg);
}

/* ---- Forms ---- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
textarea,
select {
	border: 1px solid var(--mm-border);
	border-radius: var(--mm-radius-sm);
	padding-block: 0.65em;
	padding-inline: 1em;
	font-family: inherit;
	transition: border-color var(--mm-speed) var(--mm-ease),
		box-shadow var(--mm-speed) var(--mm-ease);
}

input:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--mm-primary);
	box-shadow: 0 0 0 3px var(--mm-primary-tint);
}

/* =========================================================
   Header: alignment, account button, homepage overlay
   ========================================================= */

/* Actions group: language pill + account button on one aligned row */
.mm-header-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
}

.mm-account-btn {
	display: inline-block;
	white-space: nowrap;
	background: var(--mm-primary);
	color: #fff;
	font-family: var(--mm-font-heading);
	font-weight: 700;
	font-size: 0.85rem;
	padding: 9px 20px;
	border-radius: var(--mm-radius-pill);
	transition: background var(--mm-speed) var(--mm-ease), transform var(--mm-speed) var(--mm-ease);
}

.mm-account-btn:hover {
	background: var(--mm-primary-dark);
	color: #fff;
	transform: translateY(-1px);
}

@media (max-width: 767px) {
	.mm-account-btn {
		font-size: 0.72rem;
		padding: 7px 12px;
	}

	.mm-header-actions {
		gap: 6px;
	}
}

/* Tiny screens: "Login / Register" shrinks to "Login" so the centered logo has room. */
@media (max-width: 480px) {
	.mm-account-btn .mm-acct-more {
		display: none;
	}

	.mm-account-btn {
		padding: 6px 10px;
	}

	.mm-header-actions {
		gap: 4px;
	}

	.mm-header .mm-logo img {
		width: 108px !important;
	}
}

/* =========================================================
   Page banner (breadcrumb + title on non-Elementor pages)
   ========================================================= */

.mm-page-banner {
	/* Set a featured image on the page to swap the banner photo per page.
	   Top padding leaves room for the transparent overlay header. */
	--mm-banner-image: url("../../../../uploads/2025/08/3-8.png");
	width: 100vw;
	margin-inline-start: calc(50% - 50vw);
	background:
		linear-gradient(180deg, rgba(58, 34, 78, 0.55) 0%, rgba(58, 34, 78, 0.65) 100%),
		var(--mm-banner-image) center / cover no-repeat;
	text-align: center;
	padding-block: 150px 52px;
	padding-inline: 20px;
	margin-block-end: 34px;
}

@media (max-width: 767px) {
	.mm-page-banner {
		padding-block-start: 120px;
	}
}

.mm-page-banner .entry-title {
	font-family: var(--mm-font-heading);
	font-weight: 800;
	font-size: 2.3rem;
	color: #ffffff;
	margin: 8px 0 0;
}

/* Subtitle under the title — fed by the page's excerpt field. */
.mm-page-banner .mm-banner-sub,
.mm-page-banner .archive-description {
	color: rgba(255, 255, 255, 0.88);
	font-size: 1.05rem;
	max-width: 640px;
	margin: 14px auto 0;
	line-height: 1.7;
}

.mm-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	font-size: 0.82rem;
	color: rgba(255, 255, 255, 0.85);
}

.mm-breadcrumb a {
	color: rgba(255, 255, 255, 0.85);
}

.mm-breadcrumb a:hover {
	color: var(--mm-primary-soft);
}

.mm-breadcrumb__sep {
	margin-inline: 8px;
	color: var(--mm-primary-soft);
}

/* Keep regular page content comfortably narrow on banner pages */
.site-main > .page-content {
	max-width: 1290px;
	margin-inline: auto;
	padding-inline: 20px;
}

/* =========================================================
   Blog cards (Elementor Pro archive-posts widget)
   ========================================================= */

.elementor-posts .elementor-post {
	background: var(--mm-surface);
	border: 1px solid var(--mm-border);
	border-radius: var(--mm-radius-lg);
	box-shadow: var(--mm-shadow-sm);
	overflow: hidden;
	transition: transform var(--mm-speed) var(--mm-ease), box-shadow var(--mm-speed) var(--mm-ease);
}

.elementor-posts .elementor-post:hover {
	transform: translateY(-5px);
	box-shadow: var(--mm-shadow-lg);
}

.elementor-posts .elementor-post__thumbnail {
	aspect-ratio: 16 / 10;
}

.elementor-posts .elementor-post__thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.4s var(--mm-ease);
}

.elementor-posts .elementor-post:hover .elementor-post__thumbnail img {
	transform: scale(1.05);
}

.elementor-posts .elementor-post__text {
	padding: 22px 24px 26px;
}

.elementor-posts .elementor-post__title,
.elementor-posts .elementor-post__title a {
	font-family: var(--mm-font-heading);
	font-weight: 700;
	font-size: 1.15rem;
	line-height: 1.4;
	color: var(--mm-ink);
}

.elementor-posts .elementor-post__title a:hover {
	color: var(--mm-primary);
}

.elementor-posts .elementor-post__meta-data {
	font-size: 0.8rem;
	color: var(--mm-muted);
	margin-block-end: 10px;
}

.elementor-posts .elementor-post__excerpt p {
	font-size: 0.92rem;
	color: var(--mm-muted);
	line-height: 1.7;
}

.elementor-posts .elementor-post__read-more {
	display: inline-block;
	background: var(--mm-primary-tint);
	color: var(--mm-primary);
	font-family: var(--mm-font-heading);
	font-weight: 700;
	font-size: 0.85rem;
	padding: 8px 20px;
	border-radius: var(--mm-radius-pill);
	transition: background var(--mm-speed) var(--mm-ease), color var(--mm-speed) var(--mm-ease);
}

.elementor-posts .elementor-post__read-more:hover {
	background: var(--mm-primary);
	color: #ffffff;
}

/* Only one logo variant shows at a time (white is for the overlay state). */
.mm-logo-white {
	display: none;
}

/* --- Homepage: header overlays the hero slider --- */
.elementor-location-header {
	position: absolute;
	inset-block-start: 0;
	inset-inline: 0;
	z-index: 99;
}

/* Overlay state = on home, before the sticky "effects" threshold */
.elementor-location-header .mm-header:not(.elementor-sticky--effects) {
	background-color: transparent !important;
	box-shadow: none !important;
}

.elementor-location-header .mm-header:not(.elementor-sticky--effects) .mm-logo-color { display: none; }
.elementor-location-header .mm-header:not(.elementor-sticky--effects) .mm-logo-white { display: block; }

.elementor-location-header .mm-header:not(.elementor-sticky--effects) .elementor-nav-menu--main .elementor-item {
	color: #fff !important;
}

.elementor-location-header .mm-header:not(.elementor-sticky--effects) .elementor-nav-menu--main .elementor-item:hover,
.elementor-location-header .mm-header:not(.elementor-sticky--effects) .elementor-nav-menu--main .elementor-item.elementor-item-active {
	color: var(--mm-primary-soft) !important;
}

.elementor-location-header .mm-header:not(.elementor-sticky--effects) .elementor-menu-toggle {
	color: #fff;
	background: rgba(255, 255, 255, 0.15);
}

.elementor-location-header .mm-header:not(.elementor-sticky--effects) .trp-shortcode-switcher__wrapper {
	--text: #ffffff !important;
	--text-hover: var(--mm-primary-soft) !important;
	--border-color: rgba(255, 255, 255, 0.5) !important;
	--border: 1px solid rgba(255, 255, 255, 0.5) !important;
	--bg-hover: rgba(255, 255, 255, 0.15) !important;
}

/* Scrolled (sticky effects) state: white bar, colored logo — applies via the
   section's own white background + default logo rules, nothing extra needed.
   Smooth the change: */
.elementor-location-header .mm-header {
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* ---- TranslatePress language switcher (3.2+ markup) ----
   The shortcode wrapper carries its design as inline CSS custom properties;
   !important lets these theme values win over that inline style. */
.mm-header-actions .trp-shortcode-switcher__wrapper {
	--bg: transparent !important;
	--bg-hover: rgba(219, 76, 119, 0.08) !important;
	--text: var(--mm-ink) !important;
	--text-hover: var(--mm-primary) !important;
	--border: 1px solid var(--mm-border) !important;
	--border-color: var(--mm-border) !important;
	--border-radius: 999px !important;
	--font-size: 13px !important;
	--flag-size: 16px !important;
}

/* TRP's default inner paddings make the pill bulky — tighten them. */
.mm-header-actions .trp-language-item {
	padding: 3px 8px !important;
	gap: 4px !important;
}

.mm-header-actions .trp-current-language-item__wrapper {
	padding: 0 4px 0 0 !important;
}

/* Phones: flag-only pill so the switcher never crowds the burger or button. */
@media (max-width: 767px) {
	.mm-header-actions .trp-shortcode-switcher__wrapper {
		--font-size: 0px !important; /* hides the language name, keeps the flag */
		--flag-size: 16px !important;
	}
}

/* --- Small screens: burger left, logo truly centered, actions right --- */
@media (max-width: 1024px) {
	.mm-header > .elementor-container {
		justify-content: space-between;
	}

	/* The logo column leaves the flow and centers on the header itself,
	   so it is exactly mid-viewport regardless of the sides' widths. */
	.mm-header > .elementor-container > .elementor-column:nth-child(1) {
		position: absolute !important;
		inset-inline-start: 50%;
		inset-block-start: 50%;
		transform: translate(-50%, -50%);
		width: auto !important;
		z-index: 1;
	}

	[dir="rtl"] .mm-header > .elementor-container > .elementor-column:nth-child(1) {
		transform: translate(50%, -50%);
	}

	.mm-header > .elementor-container > .elementor-column:nth-child(2) {
		order: 1;
		width: auto !important;
	}

	.mm-header > .elementor-container > .elementor-column:nth-child(3) {
		order: 3;
		width: auto !important;
	}

	.mm-header .mm-logo .elementor-widget-container {
		text-align: center;
	}

	.mm-header .mm-logo img {
		margin-inline: auto;
	}

	/* The dropdown otherwise opens inside the tiny burger column — make it a
	   full-width panel under the header instead. Every ancestor between the
	   dropdown and the header section must be static so absolute positioning
	   resolves against the section itself. */
	.mm-header .elementor-widget-nav-menu,
	.mm-header .elementor-widget-nav-menu .elementor-widget-container,
	.mm-header .elementor-column:has(.elementor-widget-nav-menu),
	.mm-header .elementor-column:has(.elementor-widget-nav-menu) > .elementor-widget-wrap {
		position: static !important;
	}

	.mm-header .elementor-nav-menu--dropdown.elementor-nav-menu__container {
		position: absolute !important;
		inset-inline: 0 !important;
		top: 100% !important;
		width: 100% !important;
		margin: 0 !important;
		background: #ffffff;
		box-shadow: var(--mm-shadow-lg);
		border-radius: 0 0 var(--mm-radius) var(--mm-radius);
		padding-block: 8px;
		overflow: hidden;
	}

	.mm-header .elementor-nav-menu--dropdown a {
		display: block;
		padding: 14px 28px !important;
		font-family: var(--mm-font-heading);
		font-weight: 700;
		font-size: 1rem !important;
		color: var(--mm-ink) !important;
		text-align: start;
		border-block-end: 1px solid var(--mm-border);
		background: transparent !important;
	}

	.mm-header .elementor-nav-menu--dropdown li:last-child a {
		border-block-end: none;
	}

	.mm-header .elementor-nav-menu--dropdown a:hover,
	.mm-header .elementor-nav-menu--dropdown a.elementor-item-active {
		color: var(--mm-primary) !important;
		background: var(--mm-primary-tint) !important;
	}
}

/* =========================================================
   Welcome promo popup
   ========================================================= */

.mm-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.25s var(--mm-ease);
}

/* `display: flex` above would defeat the hidden attribute — without this,
   the closed popup stays as an invisible click-blocking layer. */
.mm-popup[hidden] {
	display: none !important;
}

.mm-popup.is-open {
	opacity: 1;
}

.mm-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(45, 26, 60, 0.55);
	backdrop-filter: blur(3px);
}

.mm-popup__card {
	position: relative;
	width: min(430px, 92vw);
	background:
		linear-gradient(180deg, var(--mm-primary-tint) 0%, #ffffff 45%);
	border-radius: 24px;
	box-shadow: 0 30px 80px rgba(45, 26, 60, 0.4);
	padding: 44px 34px 36px;
	text-align: center;
	transform: translateY(24px) scale(0.96);
	transition: transform 0.3s var(--mm-ease);
}

.mm-popup.is-open .mm-popup__card {
	transform: translateY(0) scale(1);
}

.mm-popup__close {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-end: 16px;
	background: transparent;
	border: none;
	font-size: 1.8rem;
	line-height: 1;
	color: var(--mm-muted);
	cursor: pointer;
	padding: 4px 8px;
	border-radius: var(--mm-radius-pill);
}

.mm-popup__close:hover {
	color: var(--mm-primary);
}

.mm-popup__confetti {
	font-size: 2.6rem;
	margin-block-end: 6px;
}

.mm-popup__title {
	font-family: var(--mm-font-heading);
	font-weight: 800;
	font-size: 1.7rem;
	color: var(--mm-secondary);
	margin: 0 0 8px;
}

.mm-popup__text {
	color: var(--mm-muted);
	font-size: 1rem;
	line-height: 1.7;
	margin: 0 0 22px;
}

.mm-popup__code {
	display: block;
	width: 100%;
	background: #fff;
	border: 2px dashed var(--mm-primary);
	border-radius: var(--mm-radius);
	padding: 14px;
	cursor: pointer;
	margin-block-end: 16px;
	transition: background var(--mm-speed) var(--mm-ease);
}

.mm-popup__code:hover {
	background: var(--mm-primary-tint);
}

.mm-popup__code.is-copied {
	border-style: solid;
	background: var(--mm-primary-tint);
}

.mm-popup__code-value {
	display: block;
	font-family: var(--mm-font-heading);
	font-weight: 800;
	font-size: 1.6rem;
	letter-spacing: 3px;
	color: var(--mm-primary);
}

.mm-popup__code-hint {
	display: block;
	font-size: 0.78rem;
	color: var(--mm-muted);
	margin-block-start: 2px;
}

.mm-popup__cta {
	display: block;
	background: var(--mm-primary);
	color: #fff;
	font-family: var(--mm-font-heading);
	font-weight: 800;
	padding: 14px;
	border-radius: var(--mm-radius-pill);
	transition: background var(--mm-speed) var(--mm-ease), transform var(--mm-speed) var(--mm-ease);
}

.mm-popup__cta:hover {
	background: var(--mm-primary-dark);
	color: #fff;
	transform: translateY(-2px);
}

/* ---- Soft section reveal (used with .mm-reveal on Elementor sections) ---- */
@keyframes mm-fade-up {
	from { opacity: 0; transform: translateY(24px); }
	to { opacity: 1; transform: translateY(0); }
}

.mm-reveal {
	animation: mm-fade-up 0.6s var(--mm-ease) both;
}
