/*
 * MO-169 — shared shell fixes (header, mobile menu, footer, 404).
 * Owned by the shell workstream. Loads after components.css so it can
 * correct shared-component rules without editing them in place.
 */

/* ---------- Header: compact 3-column layout, no overflow ---------- */

.mo-header {
	position: relative;
	flex-wrap: nowrap;
}

.mo-header .wp-block-site-title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

/* the wordmark is a <p> (one h1 per page belongs to the content); keep the
   size and face it had as an h1 */
.mo-header p.wp-block-site-title {
	font-family: var(--wp--preset--font-family--display);
	font-size: 2em;
	font-weight: 700;
	line-height: 1.15;
}

.mo-header .wp-block-site-title a {
	display: flex;
	align-items: center;
	min-height: var(--wp--custom--touch-target);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mo-header__nav-toggle,
.mo-header__cart {
	flex: 0 0 auto;
}

.mo-header__cart {
	padding-inline: var(--wp--preset--spacing--2-xs);
}

.mo-header__cart-icon {
	flex: 0 0 auto;
}

@media (max-width: 767.98px) {
	.mo-header .wp-block-site-title a {
		font-size: 22px;
	}

	/* The open menu becomes a full-width dropdown below the header instead
	   of a flex sibling squeezed in next to the wordmark — that squeeze is
	   what pushed the cart offscreen at 390px. */
	.mo-header__nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		width: 100%;
		margin: 0;
		padding: var(--wp--preset--spacing--sm) var(--wp--preset--spacing--md);
		background: var(--wp--preset--color--surface-elevated);
		border-bottom: 1px solid var(--wp--custom--border-subtle);
		box-shadow: var(--wp--preset--shadow--md);
		z-index: 60;
		max-height: calc(100vh - 100%);
		overflow-y: auto;
	}

	.mo-header__nav[hidden] {
		display: none;
	}
}

/* ---------- Footer: grouped Support / Legal links ---------- */

.mo-footer__groups {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--lg);
}

.mo-footer__group {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--sm);
}

.mo-footer__group-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--text-primary);
}

.mo-footer__group a {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--touch-target);
}

.mo-footer__cookie-settings {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--touch-target);
	padding: 0;
	background: none;
	border: 0;
	font: inherit;
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--accent-cobalt-light);
	text-decoration: underline;
	cursor: pointer;
	text-align: left;
}

@media (min-width: 768px) {
	.mo-footer__groups {
		flex-direction: row;
		gap: var(--wp--preset--spacing--2-xl);
	}

	.mo-footer__group {
		gap: var(--wp--preset--spacing--xs);
	}
}

/* ---------- 404 ---------- */

.mo-404__content {
	padding-block: var(--wp--preset--spacing--2-xl);
	text-align: center;
}

.mo-404__title {
	font-size: var(--wp--preset--font-size--2-xl);
	margin: 0 0 var(--wp--preset--spacing--sm);
}

.mo-404__text {
	color: var(--wp--preset--color--text-muted);
	margin: 0 0 var(--wp--preset--spacing--lg);
}

.mo-404__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--wp--preset--spacing--sm);
}
