/**
 * Reusable e-meniu Compact Shell presentation.
 *
 * The same responsive Header and Footer trees frame focused account and
 * transactional screens. WordPress, WPML and WooCommerce retain ownership of
 * their native brand, language and Cart behavior.
 */

.e-meniu-compact-header,
.e-meniu-compact-footer {
	color: var(--wp--preset--color--text);
}

.e-meniu-compact-header {
	border-bottom: 1px solid var(--wp--preset--color--border-subtle);
	background: var(--wp--preset--color--surface);
}

.e-meniu-compact-header__layout {
	display: grid;
	min-height: 4rem;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas: "brand cart";
	align-items: center;
	gap: var(--wp--preset--spacing--sm);
}

.e-meniu-compact-header__layout > *,
.e-meniu-compact-footer__layout > * {
	min-width: 0;
	margin-block: 0;
}

.e-meniu-compact-header__brand {
	grid-area: brand;
	min-width: 0;
}

.e-meniu-compact-header__language {
	grid-area: language;
}

.e-meniu-compact-header__cart {
	grid-area: cart;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.25;
}

.e-meniu-compact-header a,
.e-meniu-compact-footer a {
	color: inherit;
}

.e-meniu-compact-header a {
	text-decoration: none;
}

.e-meniu-compact-header .wp-block-site-logo a,
.e-meniu-compact-header .wp-block-site-title a,
.e-meniu-compact-header .e-meniu-compact-language-switcher-slot a,
.e-meniu-compact-header .e-meniu-compact-header__cart a,
.e-meniu-compact-footer .wp-block-site-logo a,
.e-meniu-compact-footer .wp-block-site-title a,
.e-meniu-compact-footer .e-meniu-compact-footer__contact a {
	display: inline-flex;
	min-height: var(--wp--custom--interactive--target-min);
	align-items: center;
}

.e-meniu-compact-header .e-meniu-compact-header__cart a {
	min-width: var(--wp--custom--interactive--target-min);
	justify-content: center;
	white-space: nowrap;
}

.e-meniu-compact-header .wc-block-cart-link__text {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

body:not(.editor-styles-wrapper):not(.block-editor-page):not(.site-editor-php):not(.block-editor-iframe__body):not(.block-editor-block-list__layout):not(:has(.editor-styles-wrapper)):not(:has(.block-editor-iframe__body)):not(:has(.block-editor-block-list__layout)) .e-meniu-compact-language-switcher-slot:not(:has(> *)) {
	display: none;
}

body:not(.editor-styles-wrapper):not(.block-editor-page):not(.site-editor-php):not(.block-editor-iframe__body):not(.block-editor-block-list__layout):not(:has(.editor-styles-wrapper)):not(:has(.block-editor-iframe__body)):not(:has(.block-editor-block-list__layout)) .e-meniu-compact-header__layout:has(> .e-meniu-compact-language-switcher-slot > *) {
	grid-template-columns: minmax(0, 1fr) auto auto;
	grid-template-areas: "brand language cart";
}

body:not(.editor-styles-wrapper):not(.block-editor-page):not(.site-editor-php):not(.block-editor-iframe__body):not(.block-editor-block-list__layout):not(:has(.editor-styles-wrapper)):not(:has(.block-editor-iframe__body)):not(:has(.block-editor-block-list__layout)) .e-meniu-compact-language-switcher-slot:has(> *) {
	display: flex;
	align-items: center;
	justify-content: center;
}

:where(.editor-styles-wrapper, .block-editor-iframe__body, .block-editor-block-list__layout, body.block-editor-page, body.site-editor-php) .e-meniu-compact-header__layout {
	grid-template-columns: minmax(0, 1fr) auto auto;
	grid-template-areas: "brand language cart";
}

:where(.editor-styles-wrapper, .block-editor-iframe__body, .block-editor-block-list__layout, body.block-editor-page, body.site-editor-php) .e-meniu-compact-language-switcher-slot {
	display: flex;
	align-items: center;
	justify-content: center;
}

.editor-styles-wrapper .e-meniu-compact-language-switcher-slot:not(:has(.wpml-ls)):not(:has([data-type="wpml/language-switcher"])),
.block-editor-iframe__body .e-meniu-compact-language-switcher-slot:not(:has(.wpml-ls)):not(:has([data-type="wpml/language-switcher"])),
.block-editor-block-list__layout .e-meniu-compact-language-switcher-slot:not(:has(.wpml-ls)):not(:has([data-type="wpml/language-switcher"])),
body.block-editor-page .e-meniu-compact-language-switcher-slot:not(:has(.wpml-ls)):not(:has([data-type="wpml/language-switcher"])),
body.site-editor-php .e-meniu-compact-language-switcher-slot:not(:has(.wpml-ls)):not(:has([data-type="wpml/language-switcher"])) {
	display: flex;
	min-width: 5.5rem;
	min-height: var(--wp--custom--interactive--target-min);
	border: 1px dashed var(--wp--preset--color--border-strong);
	border-radius: var(--wp--custom--radius--medium);
	background: var(--wp--preset--color--surface-soft);
}

.e-meniu-compact-header .e-meniu-compact-language-switcher-slot .wpml-language-switcher-block ul.horizontal-list {
	display: flex !important;
	align-items: center !important;
	margin: 0 !important;
	padding: 0 !important;
}

.e-meniu-compact-header .e-meniu-compact-language-switcher-slot .wpml-language-switcher-block ul.horizontal-list > li {
	display: flex !important;
	min-height: 44px !important;
	align-items: center !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1 !important;
}

.e-meniu-compact-header .e-meniu-compact-language-switcher-slot .wpml-language-switcher-block ul.horizontal-list > li > a,
.e-meniu-compact-header .e-meniu-compact-language-switcher-slot .wpml-language-switcher-block ul.horizontal-list > li > div {
	display: flex !important;
	min-height: 44px !important;
	align-items: center !important;
	justify-content: center !important;
	margin: 0 !important;
	padding-block: 0 !important;
	line-height: 1 !important;
}

.e-meniu-compact-header .e-meniu-compact-language-switcher-slot .wpml-language-switcher-block .wp-block-navigation-item__label {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 14px !important;
	transform: translateY(-8px) !important;
}

.e-meniu-compact-footer {
	border-top: 1px solid var(--wp--preset--color--border-subtle);
	background: var(--wp--preset--color--surface-soft);
	padding-block: var(--wp--preset--spacing--lg);
}

.e-meniu-compact-footer__layout {
	display: grid;
	gap: var(--wp--preset--spacing--xs);
	align-items: center;
}

.e-meniu-compact-footer .e-meniu-compact-footer__brand {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--xs);
}

.e-meniu-compact-footer__contact,
.e-meniu-compact-footer__copyright,
.e-meniu-compact-footer__copyright > p,
.e-meniu-compact-footer__copyright .wp-block-site-title {
	margin: 0;
}

.e-meniu-compact-footer__contact a {
	max-width: 100%;
	color: var(--wp--preset--color--olive);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	overflow-wrap: anywhere;
}

.e-meniu-compact-footer__copyright {
	display: flex;
	gap: var(--wp--preset--spacing--2-xs);
	align-items: center;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
}

.e-meniu-compact-footer__copyright .wp-block-site-title {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: normal;
	line-height: inherit;
}

@media (max-width: 47.999rem) {
	.e-meniu-compact-footer {
		padding-block: 0;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__layout {
		display: grid;
		min-height: 4rem;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: center;
		column-gap: 0.75rem;
		row-gap: 0;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__brand {
		display: none;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__contact {
		display: flex;
		justify-self: start;
		align-items: center;
		margin: 0;
		transform: translateY(-2px);
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__contact a {
		min-height: 0;
		height: auto;
		font-size: 0.75rem;
		line-height: 1;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__copyright {
		display: flex;
		justify-self: end;
		align-items: center;
		margin: 0;
		font-size: 0.75rem;
		line-height: 1;
		white-space: nowrap;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__copyright > p,
	.e-meniu-compact-footer .e-meniu-compact-footer__copyright .wp-block-site-title {
		line-height: 1;
	}
}

@media (hover: hover) {
	.e-meniu-compact-header a:hover,
	.e-meniu-compact-footer a:hover {
		color: var(--wp--preset--color--accent);
	}
}

@media (min-width: 48rem) {
	.e-meniu-compact-header .e-meniu-compact-header__layout {
		width: 100%;
		max-width: 72rem;
		min-height: 4.5rem;
		gap: var(--wp--preset--spacing--md);
		margin-inline: auto;
		padding-inline: 0;
	}

	.e-meniu-compact-header .wc-block-cart-link__text {
		position: static;
		inline-size: auto;
		block-size: auto;
		overflow: visible;
		clip: auto;
		clip-path: none;
		white-space: normal;
	}

	.e-meniu-compact-footer {
		padding-block: 0;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__layout {
		display: grid;
		min-height: 4.5rem;
		grid-template-columns: 1fr;
		justify-items: center;
		align-items: center;
		gap: 0.1rem;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__brand {
		display: none;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__contact {
		justify-self: center;
		margin: 0;
		text-align: center;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__contact a {
		min-height: 0;
		height: auto;
		line-height: 1.1;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__copyright {
		justify-self: center;
		margin: 0;
		text-align: center;
		line-height: 1.1;
	}

	.e-meniu-compact-footer .e-meniu-compact-footer__copyright > p,
	.e-meniu-compact-footer .e-meniu-compact-footer__copyright .wp-block-site-title {
		line-height: 1.1;
	}
}
