/* MOSHEKO Beauty Advisor - mobile first. Colours come from settings as CSS custom properties. */

.mba-root,
.mba-bubble {
	--mba-primary: #111111;
	--mba-primary-text: #ffffff;
	--mba-accent: #b08d57;
	--mba-bg: #ffffff;
	--mba-bot-bg: #f4efe9;
	--mba-bot-text: #1f1f1f;
	--mba-user-bg: #111111;
	--mba-user-text: #ffffff;
	--mba-border: rgba(0, 0, 0, 0.12);
	--mba-muted: #5c5c5c;
	--mba-radius: 16px;
	--mba-focus: 0 0 0 3px var(--mba-bg), 0 0 0 5px var(--mba-accent);
}

.mba-root *,
.mba-root *::before,
.mba-root *::after {
	box-sizing: border-box;
}

.mba-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Page layout ---------- */

.mba-root--inline {
	max-width: 760px;
	margin: 0 auto;
	padding: 0 16px;
	color: var(--mba-bot-text);
	line-height: 1.5;
}

.mba-hero {
	text-align: center;
	padding: 24px 0 8px;
}

.mba-hero__title {
	margin: 0 0 12px;
	font-size: clamp(1.5rem, 4vw + 0.5rem, 2.25rem);
	line-height: 1.2;
	color: var(--mba-primary);
}

.mba-hero__text {
	margin: 0 auto 16px;
	max-width: 600px;
	color: var(--mba-muted);
}

.mba-hero__how {
	margin: 16px 0 8px;
	font-size: 0.8rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--mba-accent);
}

.mba-steps {
	list-style: none;
	counter-reset: mba-step;
	display: grid;
	gap: 12px;
	margin: 0 0 24px;
	padding: 0;
	text-align: left;
}

.mba-steps li {
	counter-increment: mba-step;
	position: relative;
	padding: 12px 12px 12px 52px;
	background: var(--mba-bot-bg);
	border-radius: 12px;
	font-size: 0.95rem;
}

.mba-steps li::before {
	content: counter(mba-step);
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--mba-primary);
	color: var(--mba-primary-text);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 0.85rem;
}

@media (min-width: 640px) {
	.mba-steps {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ---------- Chat window ---------- */

.mba-advisor {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--mba-bg);
	border: 1px solid var(--mba-border);
	border-radius: var(--mba-radius);
	overflow: hidden;
	color: var(--mba-bot-text);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

.mba-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: var(--mba-primary);
	color: var(--mba-primary-text);
}

.mba-avatar {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--mba-accent);
	color: #ffffff;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.mba-header__title {
	flex: 1 1 auto;
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
}

.mba-advisor .mba-icon-btn {
	appearance: none;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
}

.mba-advisor .mba-icon-btn:hover {
	background: rgba(255, 255, 255, 0.15);
}

.mba-advisor .mba-icon-btn[hidden] {
	display: none;
}

/* Progress */
.mba-progress {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--mba-border);
	font-size: 0.8rem;
	color: var(--mba-muted);
}

.mba-progress[hidden] {
	display: none;
}

.mba-progress__track {
	flex: 1 1 auto;
	height: 6px;
	border-radius: 999px;
	background: var(--mba-bot-bg);
	overflow: hidden;
}

.mba-progress__fill {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--mba-accent);
	transition: width 0.3s ease;
}

.mba-progress__text {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* Log */
.mba-log {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 14px;
	min-height: 220px;
	max-height: 70vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	scroll-behavior: smooth;
}

.mba-log:focus {
	outline: none;
}

/* On the advisor page the conversation grows with the page (no nested scroll box). */
.mba-advisor--inline .mba-log {
	max-height: none;
	overflow: visible;
	min-height: 160px;
}

.mba-advisor--inline .mba-msg,
.mba-advisor--inline .mba-controls {
	scroll-margin: 24px 0 96px;
}

.mba-msg {
	display: flex;
	max-width: 100%;
	animation: mba-in 0.25s ease both;
}

.mba-msg__bubble {
	max-width: 88%;
	padding: 10px 14px;
	border-radius: 18px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.mba-msg--bot .mba-msg__bubble {
	background: var(--mba-bot-bg);
	color: var(--mba-bot-text);
	border-bottom-left-radius: 6px;
}

.mba-msg--user {
	justify-content: flex-end;
}

.mba-msg--user .mba-msg__bubble {
	background: var(--mba-user-bg);
	color: var(--mba-user-text);
	border-bottom-right-radius: 6px;
}

.mba-msg--question .mba-msg__bubble {
	font-weight: 600;
}

.mba-msg--results,
.mba-msg--email {
	display: block;
}

.mba-msg--email .mba-msg__bubble {
	max-width: 100%;
	border-radius: 14px;
}

/* Typing indicator */
.mba-typing .mba-msg__bubble {
	display: inline-flex;
	gap: 4px;
	padding: 14px 16px;
}

.mba-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--mba-bot-text);
	opacity: 0.35;
	animation: mba-dot 1s infinite ease-in-out;
}

.mba-typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.mba-typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes mba-dot {
	0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
	40% { opacity: 0.9; transform: translateY(-3px); }
}

@keyframes mba-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

/* Controls */
.mba-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 14px 14px;
	border-top: 1px solid var(--mba-border);
}

.mba-controls:empty {
	display: none;
}

.mba-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	width: 100%;
}

/* Buttons are fully styled here so theme / page-builder button styles don't leak in. */
.mba-root .mba-option,
.mba-root .mba-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 10px 16px;
	border-radius: 999px;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mba-root .mba-option {
	flex: 1 1 calc(50% - 8px);
	border: 1.5px solid var(--mba-primary);
	background: var(--mba-bg);
	color: var(--mba-primary);
}

.mba-root .mba-option:hover,
.mba-root .mba-option[aria-pressed="true"] {
	background: var(--mba-primary);
	color: var(--mba-primary-text);
}

.mba-root .mba-btn--primary {
	border: 1.5px solid var(--mba-primary);
	background: var(--mba-primary);
	color: var(--mba-primary-text);
}

.mba-root .mba-btn--primary:hover {
	background: var(--mba-accent);
	border-color: var(--mba-accent);
	color: #ffffff;
}

.mba-root .mba-btn--secondary {
	border: 1.5px solid var(--mba-primary);
	background: transparent;
	color: var(--mba-primary);
}

.mba-root .mba-btn--secondary:hover {
	background: var(--mba-bot-bg);
}

.mba-root .mba-btn--link {
	border: 0;
	background: transparent;
	color: var(--mba-primary);
	text-decoration: underline;
	padding-left: 8px;
	padding-right: 8px;
}

.mba-root .mba-btn[disabled] {
	opacity: 0.6;
	cursor: wait;
}

.mba-root .mba-start {
	width: 100%;
}

.mba-root .mba-option:focus-visible,
.mba-root .mba-btn:focus-visible,
.mba-root .mba-icon-btn:focus-visible,
.mba-root a:focus-visible,
.mba-root input:focus-visible,
.mba-root summary:focus-visible,
.mba-launcher:focus-visible {
	outline: 2px solid transparent;
	box-shadow: var(--mba-focus);
}

@media (min-width: 560px) {
	.mba-root .mba-option {
		flex: 0 1 auto;
	}

	.mba-root .mba-start {
		width: auto;
	}
}

/* Product cards */
.mba-cards {
	list-style: none;
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin: 0;
	padding: 0;
}

@media (min-width: 520px) {
	.mba-cards {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	}
}

.mba-card {
	display: flex;
	flex-direction: row;
	gap: 12px;
	margin: 0;
	padding: 12px;
	border: 1px solid var(--mba-border);
	border-radius: 14px;
	background: var(--mba-bg);
	animation: mba-in 0.3s ease both;
}

@media (min-width: 520px) {
	.mba-card {
		flex-direction: column;
	}
}

.mba-card__media {
	flex: 0 0 96px;
}

.mba-card__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 10px;
	background: var(--mba-bot-bg);
}

.mba-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	flex: 1 1 auto;
}

.mba-card__badge {
	align-self: flex-start;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--mba-accent);
}

.mba-card--alternative .mba-card__badge {
	color: var(--mba-muted);
}

.mba-root .mba-card__name {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--mba-bot-text);
}

.mba-card__price {
	font-weight: 600;
}

.mba-card__price del {
	opacity: 0.6;
	font-weight: 400;
	margin-right: 4px;
}

.mba-card__price ins {
	text-decoration: none;
}

.mba-card__reason {
	margin: 0 0 6px;
	font-size: 0.875rem;
	color: var(--mba-muted);
}

.mba-root .mba-card__cta {
	margin-top: auto;
	align-self: stretch;
}

/* Email capture */
.mba-email__prompt {
	margin: 0 0 8px;
	font-weight: 600;
}

.mba-email__label {
	display: block;
	margin-bottom: 4px;
	font-size: 0.85rem;
}

.mba-email__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mba-root .mba-input {
	flex: 1 1 200px;
	min-height: 44px;
	margin: 0;
	padding: 10px 14px;
	border: 1.5px solid var(--mba-border);
	border-radius: 999px;
	background: #ffffff;
	color: #1f1f1f;
	font: inherit;
	font-size: 16px; /* Prevents iOS zoom on focus. */
}

.mba-root .mba-input[aria-invalid="true"] {
	border-color: #b42318;
}

.mba-email__help {
	margin: 6px 0 0;
	font-size: 0.8rem;
	color: var(--mba-muted);
}

.mba-email__consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 10px;
	font-size: 0.85rem;
}

.mba-email__consent input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--mba-primary);
}

.mba-email__consent a {
	color: inherit;
	text-decoration: underline;
}

.mba-email__status {
	margin: 8px 0 0;
	font-size: 0.875rem;
	color: #b42318;
}

.mba-email__status:empty {
	display: none;
}

.mba-email__done {
	margin: 0;
	font-weight: 600;
}

.mba-email__done:focus {
	outline: none;
}

.mba-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Disclaimer */
.mba-disclaimer {
	margin: 0;
	padding: 10px 14px 14px;
	font-size: 0.75rem;
	line-height: 1.45;
	color: var(--mba-muted);
	border-top: 1px solid var(--mba-border);
}

.mba-noscript {
	padding: 14px;
	margin: 0;
}

/* FAQ */
.mba-faq {
	margin: 32px 0;
}

.mba-faq__title {
	margin: 0 0 12px;
	font-size: 1.25rem;
	color: var(--mba-primary);
}

.mba-faq__item {
	border-bottom: 1px solid var(--mba-border);
}

.mba-faq__item summary {
	cursor: pointer;
	padding: 14px 4px;
	font-weight: 600;
	list-style-position: outside;
}

.mba-faq__answer {
	padding: 0 4px 14px;
	color: var(--mba-muted);
}

.mba-faq__answer p {
	margin: 0 0 8px;
}

.mba-faq__privacy {
	margin: 16px 0 0;
	font-size: 0.9rem;
}

.mba-faq__privacy a {
	color: var(--mba-primary);
}

/* ---------- Floating bubble ---------- */

.mba-bubble {
	position: fixed;
	bottom: 16px;
	z-index: 99990;
	font-size: 16px;
}

.mba-bubble--right {
	right: 16px;
}

.mba-bubble--left {
	left: 16px;
}

.mba-launcher {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 52px;
	margin: 0;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--mba-primary);
	color: var(--mba-primary-text);
	font: inherit;
	font-weight: 600;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	cursor: pointer;
}

.mba-launcher:hover {
	background: var(--mba-accent);
	color: #ffffff;
}

.mba-panel {
	position: fixed;
	bottom: 80px;
	width: min(400px, calc(100vw - 32px));
	max-height: calc(100vh - 110px);
	display: flex;
	flex-direction: column;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
	border-radius: var(--mba-radius);
}

.mba-panel[hidden] {
	display: none;
}

.mba-bubble--right .mba-panel {
	right: 16px;
}

.mba-bubble--left .mba-panel {
	left: 16px;
}

.mba-panel .mba-advisor {
	flex: 1 1 auto;
	min-height: 0;
	max-height: inherit;
}

.mba-panel .mba-log {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
}

.mba-panel .mba-disclaimer {
	font-size: 0.7rem;
	padding-top: 8px;
	padding-bottom: 10px;
}

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

.mba-panel .mba-card {
	flex-direction: row;
}

@media (max-width: 479px) {
	.mba-launcher__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.mba-launcher {
		width: 56px;
		height: 56px;
		padding: 0;
		justify-content: center;
	}

	.mba-panel {
		left: 8px !important;
		right: 8px !important;
		bottom: 80px;
		width: auto;
		max-height: calc(100vh - 96px);
		max-height: calc(100dvh - 96px);
	}
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.mba-root *,
	.mba-bubble * {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
