/*
 * Tiler Market - Mobile Category Menu
 * Visual values ported 1:1 from AzingPro MobileNavigation.module.css / SiteHeader.module.css (.allCats).
 * Everything lives under .tm-mcm (BEM tm-mcm__*). No bare tag selectors, no global resets.
 *
 * Theming: override any --tm-mcm-* variable on .tm-mcm, e.g. in child-theme CSS or wp_add_inline_style():
 *   .tm-mcm { --tm-mcm-blue: #e30613; }
 * The overlay is moved under <body> by JS; it sits inside a wrapper that also carries .tm-mcm,
 * so the variables are defined for it too (custom properties inherit from the DOM parent, not from the source position).
 *
 * Breakpoint-dependent rules (hide above the breakpoint, hide the original sidebar) are NOT here:
 * they are generated from the settings page (TM_MCM_Renderer::build_inline_css).
 */

.tm-mcm {
	--tm-mcm-ink: #24272b;
	--tm-mcm-ink-2: #3a3d42;
	--tm-mcm-bg: #fafaf8;
	--tm-mcm-surface: #fff;
	--tm-mcm-line: #e4e4df;
	--tm-mcm-line-soft: #ededea;
	--tm-mcm-blue: #38689c;
	--tm-mcm-blue-dark: #2d5682;
	--tm-mcm-chevron: #b4b7bc;
	--tm-mcm-muted: #686c72;
	--tm-mcm-trigger-fg: #fff;
	--tm-mcm-z: 100000;
	--tm-mcm-font: inherit;
	font-family: var(--tm-mcm-font);
	box-sizing: border-box;
}
.tm-mcm *,
.tm-mcm *::before,
.tm-mcm *::after {
	box-sizing: border-box;
}

/* ---- Shared control reset (beats Bricks/Woo bare button/a rules via .tm-mcm .tm-mcm__x specificity) ---- */
.tm-mcm .tm-mcm__trigger,
.tm-mcm .tm-mcm__back,
.tm-mcm .tm-mcm__close,
.tm-mcm .tm-mcm__row,
.tm-mcm .tm-mcm__link,
.tm-mcm .tm-mcm__cta {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	text-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	font-family: inherit;
	line-height: 1.3;
	font-style: normal;
	font-variant: normal;
	text-indent: 0;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}
.tm-mcm .tm-mcm__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.tm-mcm .tm-mcm__item {
	margin: 0;
	padding: 0;
	list-style: none;
}
.tm-mcm .tm-mcm__trigger:focus-visible,
.tm-mcm .tm-mcm__back:focus-visible,
.tm-mcm .tm-mcm__close:focus-visible,
.tm-mcm .tm-mcm__row:focus-visible,
.tm-mcm .tm-mcm__link:focus-visible,
.tm-mcm .tm-mcm__cta:focus-visible {
	outline: 2px solid var(--tm-mcm-blue);
	outline-offset: -2px;
}
.tm-mcm .tm-mcm__trigger:focus-visible {
	outline-color: var(--tm-mcm-trigger-fg);
}

/* ---- Without JS: plain nested list, always visible ---- */
.tm-mcm .tm-mcm__source {
	background: var(--tm-mcm-surface);
	border-bottom: 1px solid var(--tm-mcm-line);
}
.tm-mcm .tm-mcm__source .tm-mcm__sublist {
	padding-left: 16px;
}
.tm-mcm .tm-mcm__source .tm-mcm__link {
	display: flex;
	align-items: center;
	min-height: 52px;
	padding: 0 16px;
	border-bottom: 1px solid var(--tm-mcm-line-soft);
	font-size: 16px;
	font-weight: 500;
	color: var(--tm-mcm-ink);
}
.tm-mcm .tm-mcm__source .tm-mcm__heading {
	display: block;
	padding: 14px 16px 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--tm-mcm-muted);
}
/* After a successful JS init the source list is replaced by the trigger + overlay. */
.tm-mcm.is-enhanced .tm-mcm__source {
	display: none;
}

/* ---- Trigger: full-width "Kategórie →" (AzingPro .allCats, mobile values) ---- */
.tm-mcm .tm-mcm__trigger {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-width: 0;
	height: 46px;
	min-height: 44px;
	padding: 0 16px;
	background: var(--tm-mcm-blue);
	color: var(--tm-mcm-trigger-fg);
	font-size: 15px;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}
.tm-mcm .tm-mcm__trigger:hover,
.tm-mcm .tm-mcm__trigger:focus {
	background: var(--tm-mcm-blue-dark);
	color: var(--tm-mcm-trigger-fg);
}
.tm-mcm .tm-mcm__burger {
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.tm-mcm .tm-mcm__burger i {
	display: block;
	width: 16px;
	height: 2px;
	background: var(--tm-mcm-trigger-fg);
}
.tm-mcm .tm-mcm__trigger-arrow {
	margin-left: auto;
}

/* ---- Overlay (AzingPro .overlay / .bar / .body) ---- */
.tm-mcm .tm-mcm__overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: var(--tm-mcm-z);
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	background: var(--tm-mcm-bg);
	color: var(--tm-mcm-ink);
	font-size: 16px;
	text-align: left;
}
.tm-mcm .tm-mcm__overlay[hidden] {
	display: none;
}
.tm-mcm .tm-mcm__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	height: 56px;
	padding: 0 16px;
	background: var(--tm-mcm-surface);
	border-bottom: 1px solid var(--tm-mcm-line);
}
.tm-mcm .tm-mcm__heading-text {
	font-size: 17px;
	font-weight: 700;
	color: var(--tm-mcm-ink);
}
.tm-mcm .tm-mcm__back,
.tm-mcm .tm-mcm__close {
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	background: none;
	color: var(--tm-mcm-ink);
	font-size: 15px;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}
.tm-mcm .tm-mcm__close {
	font-size: 18px;
	text-align: right;
}
.tm-mcm .tm-mcm__body {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding-bottom: 32px;
}
.tm-mcm .tm-mcm__overlay .tm-mcm__list {
	background: var(--tm-mcm-surface);
	border-bottom: 1px solid var(--tm-mcm-line);
}
.tm-mcm .tm-mcm__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	padding: 0 16px;
	background: transparent;
	border-bottom: 1px solid var(--tm-mcm-line-soft);
	font-size: 16px;
	font-weight: 500;
	color: var(--tm-mcm-ink);
	text-align: left;
	cursor: pointer;
}
.tm-mcm .tm-mcm__row:hover,
.tm-mcm .tm-mcm__row:focus {
	background: transparent;
	color: var(--tm-mcm-ink);
}
.tm-mcm .tm-mcm__chevron {
	color: var(--tm-mcm-chevron);
}
.tm-mcm .tm-mcm__title {
	padding: 18px 16px 12px;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.015em;
	color: var(--tm-mcm-ink);
}
/* Programmatic focus targets (not interactive): no ring, screen readers still land here. */
.tm-mcm .tm-mcm__title:focus,
.tm-mcm .tm-mcm__heading-text:focus {
	outline: none;
}
.tm-mcm .tm-mcm__cta {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0 16px;
	background: var(--tm-mcm-surface);
	border-top: 1px solid var(--tm-mcm-line);
	border-bottom: 1px solid var(--tm-mcm-line-soft);
	font-size: 16px;
	font-weight: 600;
	color: var(--tm-mcm-blue);
}
.tm-mcm .tm-mcm__cta:hover,
.tm-mcm .tm-mcm__cta:focus {
	color: var(--tm-mcm-blue);
}
/* Group heading from a custom "#" menu item: not clickable, no AzingPro reference, deliberately minimal. */
.tm-mcm .tm-mcm__overlay .tm-mcm__heading {
	display: block;
	padding: 14px 16px 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--tm-mcm-muted);
	border-bottom: 1px solid var(--tm-mcm-line-soft);
}

/* Screen-reader-only live region */
.tm-mcm .tm-mcm__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Scroll lock: class + counter (see tm-mcm.js), never body.style.overflow. */
html.tm-mcm-lock,
html.tm-mcm-lock body {
	overflow: hidden !important;
}
