/* ==========================================================================
   Child Off-Canvas Mobile Menu (Elementor widget: child-offcanvas-menu)
   Nested sliding panels, premium styling.
   ========================================================================== */

.child-ocm {
	--ocm-width: 340px;
	--ocm-bg: #ffffff;
	--ocm-overlay: rgba(17, 17, 17, 0.55);
	--ocm-text: #2b2b2b;
	--ocm-title: #111111;
	--ocm-accent: #e8590c;
	--ocm-divider: #efefef;
	--ocm-toggle-size: 22px;
	--ocm-ease: cubic-bezier(0.32, 0.72, 0.18, 1);
}

/* ── Toggle button ──────────────────────────────────────────────────────── */

.child-ocm__toggle {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	background: transparent;
	border: 0;
	padding: 6px;
	cursor: pointer;
	color: inherit;
	line-height: 1;
}

.child-ocm__burger {
	display: inline-flex;
	flex-direction: column;
	justify-content: space-between;
	width: var(--ocm-toggle-size);
	height: calc(var(--ocm-toggle-size) * 0.72);
}

.child-ocm__burger span {
	display: block;
	height: 2px;
	width: 100%;
	border-radius: 2px;
	background: currentColor;
	transition: transform 0.25s var(--ocm-ease), opacity 0.2s;
}

.child-ocm__burger span:nth-child(2) {
	width: 72%;
}

.child-ocm__toggle-label {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

/* ── Overlay ────────────────────────────────────────────────────────────── */

.child-ocm__overlay {
	position: fixed;
	inset: 0;
	background: var(--ocm-overlay);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s var(--ocm-ease), visibility 0.3s;
	z-index: 99998;
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

.child-ocm.is-open .child-ocm__overlay {
	opacity: 1;
	visibility: visible;
}

/* ── Drawer ─────────────────────────────────────────────────────────────── */

.child-ocm__drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	width: var(--ocm-width);
	max-width: 88vw;
	background: var(--ocm-bg);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	transition: transform 0.34s var(--ocm-ease);
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.18);
	overscroll-behavior: contain;
}

.child-ocm--right .child-ocm__drawer {
	right: 0;
	transform: translateX(102%);
}

.child-ocm--left .child-ocm__drawer {
	left: 0;
	transform: translateX(-102%);
}

.child-ocm.is-open .child-ocm__drawer {
	transform: translateX(0);
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.child-ocm__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px 16px;
	border-bottom: 1px solid var(--ocm-divider);
	flex-shrink: 0;
	min-height: 76px;
}

.child-ocm__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--ocm-title);
	letter-spacing: 0.02em;
}

.child-ocm__logo {
	max-height: 44px;
	max-width: 160px;
	width: auto;
	object-fit: contain;
}

.child-ocm__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border: 0;
	border-radius: 50%;
	background: #f4f4f4;
	color: #444;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s, color 0.15s, transform 0.2s var(--ocm-ease);
}

.child-ocm__close:hover {
	background: var(--ocm-accent);
	color: #fff;
	transform: rotate(90deg);
}

/* ── Sliding panels ─────────────────────────────────────────────────────── */

.child-ocm__viewport {
	position: relative;
	flex: 1;
	overflow: hidden;
}

.child-ocm__panel {
	position: absolute;
	inset: 0;
	background: var(--ocm-bg);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	transform: translateX(100%);
	transition: transform 0.32s var(--ocm-ease), visibility 0.32s;
	visibility: hidden;
	padding: 8px 0 24px;
}

.child-ocm--left .child-ocm__panel {
	transform: translateX(100%);
}

.child-ocm__panel.is-active {
	transform: translateX(0);
	visibility: visible;
}

.child-ocm__panel.is-parked {
	transform: translateX(-28%);
	visibility: hidden;
}

/* ── Menu lists ─────────────────────────────────────────────────────────── */

.child-ocm__menu,
.child-ocm__panel ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Hide native nested submenus — JS clones them into panels. */
.child-ocm__panel .child-ocm__menu .sub-menu {
	display: none;
}

.child-ocm__panel li {
	margin: 0;
	border-bottom: 1px solid var(--ocm-divider);
}

.child-ocm__panel li:last-child {
	border-bottom: 0;
}

.child-ocm__panel li > a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 16px 20px;
	font-size: 17px;
	font-weight: 700;
	color: var(--ocm-text);
	text-decoration: none;
	line-height: 1.3;
	transition: color 0.15s, background 0.15s;
}

.child-ocm__panel li > a:hover,
.child-ocm__panel li > a:active {
	color: var(--ocm-accent);
	background: rgba(0, 0, 0, 0.025);
}

/* Chevron for items with children — bare arrow, no circle */
.child-ocm__chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #1a1a1a;
	transition: color 0.15s, transform 0.2s var(--ocm-ease);
}

.child-ocm__panel li > a:hover .child-ocm__chevron {
	color: var(--ocm-accent);
}

/* ── Panel sub-header (back button + panel title) ───────────────────────── */

.child-ocm__panel-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	border-bottom: 1px solid var(--ocm-divider);
	margin-bottom: 4px;
	position: sticky;
	top: 0;
	background: var(--ocm-bg);
	z-index: 2;
}

.child-ocm__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 0;
	background: transparent;
	color: var(--ocm-accent);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 6px 8px 6px 0;
	line-height: 1;
}

.child-ocm__back svg {
	flex-shrink: 0;
}

.child-ocm__panel-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--ocm-title);
	margin-left: auto;
	text-align: right;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* "View all" row */
.child-ocm__panel li.child-ocm__view-all > a {
	font-weight: 700;
	color: var(--ocm-accent);
}

/* ── Body scroll-lock ───────────────────────────────────────────────────── */

body.child-ocm-locked {
	overflow: hidden !important;
	touch-action: none;
}

/* ── Secondary menu (bottom of drawer) ─────────────────────────────────── */

.child-ocm__secondary {
	flex-shrink: 0;
	border-top: 2px solid var(--ocm-divider);
	padding: 10px 0 env(safe-area-inset-bottom, 16px);
}

.child-ocm__secondary-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.child-ocm__secondary-list li {
	margin: 0;
}

.child-ocm__secondary-list li > a {
	display: block;
	padding: 11px 20px;
	font-size: 13px;
	font-weight: 600;
	color: #666;
	text-decoration: none;
	line-height: 1.4;
	transition: color 0.15s;
}

.child-ocm__secondary-list li > a:hover {
	color: var(--ocm-accent);
}

/* Hide sub-menus in the secondary nav — it is intentionally flat */
.child-ocm__secondary-list .sub-menu {
	display: none;
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.child-ocm__drawer,
	.child-ocm__panel,
	.child-ocm__overlay {
		transition-duration: 0.01s !important;
	}
}
