/* ==========================================================================
   ITCM Header Navigation — itcm-header-nav.css
   ========================================================================== */

/* ── Custom properties ────────────────────────────────────────────────────── */
.itcm-hn {
	/* UI interaction timing (hover, dropdown, hamburger) */
	--itcm-hn-z:            100;
	--itcm-hn-dur:          0.25s;
	--itcm-hn-ease:         cubic-bezier(0.4, 0, 0.2, 1);

	/* Shrink/compact transition — overridden by shrink_duration/easing controls */
	--itcm-hn-shrink-dur:   0.3s;
	--itcm-hn-shrink-ease:  ease-in-out;

	/* Bar/logo sizing — set by bar_min_height, outer_padding, logo controls */
	--itcm-hn-bar-min-h:    72px;
	--itcm-hn-pad-t:        0px;
	--itcm-hn-pad-b:        0px;
	--itcm-hn-logo-h:       48px;
	--itcm-hn-logo-w:       140px;

	/* Compact overrides — Elementor rules replace these when the user sets them.
	   Until then, compact is visibly smaller than the normal bar. */
	--itcm-hn-compact-bar-h: max(56px, calc(var(--itcm-hn-bar-min-h) * 0.72));
	--itcm-hn-compact-pad-t: calc(var(--itcm-hn-pad-t) * 0.5);
	--itcm-hn-compact-pad-b: calc(var(--itcm-hn-pad-b) * 0.5);
}

/* Raw logo height, kept on the widget so the compact override cannot cycle. */
.elementor-widget-itcm-header-navigation {
	--itcm-hn-logo-h-base: 48px;
}

/* ── Widget wrapper must fill parent regardless of Elementor flex alignment ─ */
.elementor-element.elementor-widget-itcm-header-navigation {
	width:      100%;
	max-width:  100%;
	min-width:  0;
	align-self: stretch;
}

.elementor-widget-itcm-header-navigation > .elementor-widget-container {
	width:     100%;
	max-width: 100%;
	min-width: 0;
}

/* ── Root container ──────────────────────────────────────────────────────── */
.itcm-hn {
	position:   relative;
	width:      100%;
	max-width:  100%;
	min-width:  0;
	box-sizing: border-box;
}

/* ── Outer — full-width header surface ───────────────────────────────────── */
.itcm-hn__outer {
	position:   relative;
	width:      100%;
	box-sizing: border-box;
}

/* Sticky behavior */
.elementor-widget-itcm-header-navigation.itcm-hn-behavior-sticky .itcm-hn__outer {
	position: sticky;
	top:      var(--itcm-hn-sticky-top, 0px);
	z-index:  var(--itcm-hn-z, 100);
}

/* Fixed behavior — spacer is inserted by JS */
.elementor-widget-itcm-header-navigation.itcm-hn-behavior-fixed .itcm-hn__outer {
	position: fixed;
	top:      var(--itcm-hn-sticky-top, 0px);
	left:     0;
	right:    0;
	z-index:  var(--itcm-hn-z, 100);
}

/* In Elementor editor, disable fixed so layout is usable */
.elementor-editor-active .elementor-widget-itcm-header-navigation.itcm-hn-behavior-fixed .itcm-hn__outer,
.elementor-editor-active .elementor-widget-itcm-header-navigation.itcm-hn-behavior-sticky .itcm-hn__outer {
	position: relative;
	top:      auto;
}

/* ── Inner — content-width shell (follows Hero Slider pattern) ───────────── */
.itcm-hn__inner {
	display:    flex;
	flex-direction: column;
	width:      100%;
	min-width:  0;
	margin-inline: auto;
	box-sizing: border-box;
}

/* Site container: use Elementor kit content-width */
.elementor-widget-itcm-header-navigation.itcm-hn-cw-site .itcm-hn__inner,
.elementor-widget-itcm-header-navigation.itcm-hn-cw-boxed .itcm-hn__inner {
	max-width:            var(--content-width, var(--container-max-width, 1140px));
	padding-inline-start: var(--container-default-padding-left, 0px);
	padding-inline-end:   var(--container-default-padding-right, 0px);
}

/* RTL swap for site/boxed */
[dir="rtl"] .elementor-widget-itcm-header-navigation.itcm-hn-cw-site .itcm-hn__inner,
[dir="rtl"] .elementor-widget-itcm-header-navigation.itcm-hn-cw-boxed .itcm-hn__inner {
	padding-inline-start: var(--container-default-padding-right, 0px);
	padding-inline-end:   var(--container-default-padding-left, 0px);
}

/* Full width: no max-width constraint (default padding from outer_padding control) */
.elementor-widget-itcm-header-navigation.itcm-hn-cw-full .itcm-hn__inner {
	max-width:    none;
	padding-inline: var(--itcm-hn-full-pad, 24px);
}

/* ── Bar — the flex row inside inner ─────────────────────────────────────── */
.itcm-hn__bar {
	display:         flex;
	flex-direction:  row;
	align-items:     center;
	width:           100%;
	min-width:       0;
	box-sizing:      border-box;
	gap:             16px;
}

/* ── Logo ─────────────────────────────────────────────────────────────────── */
.itcm-hn__logo-wrap {
	flex-shrink: 0;
	display:     flex;
	align-items: center;
}

.itcm-hn__logo-link {
	display:     inline-flex;
	align-items: center;
	outline-offset: 4px;
}

.itcm-hn__logo {
	display:    block;
	max-width:  100%;
	object-fit: contain;
	flex-shrink: 0;
	/* Smooth transitions for compact/normal state changes */
	transition: width      var(--itcm-hn-shrink-dur) var(--itcm-hn-shrink-ease),
	            height     var(--itcm-hn-shrink-dur) var(--itcm-hn-shrink-ease),
	            max-height var(--itcm-hn-shrink-dur) var(--itcm-hn-shrink-ease);
}

/* ── Logo — width mode (default, preserves existing behavior) ─────────────── */
/* Selector includes :not(.itcm-hn-logo-height) so new installs without the
   control stored also get a sensible default. */
.elementor-widget-itcm-header-navigation:not(.itcm-hn-logo-height) .itcm-hn__logo {
	width:      var(--itcm-hn-logo-w, 140px);
	height:     auto;
	max-height: none;
}

/* ── Logo — height mode ───────────────────────────────────────────────────── */
.elementor-widget-itcm-header-navigation.itcm-hn-logo-height .itcm-hn__logo {
	height:    var(--itcm-hn-logo-h, 48px);
	width:     auto;
	max-width: none; /* natural aspect ratio; logo-link clips if needed */
}

/* ── Logo — fit within bar height (height mode + fit enabled) ─────────────── */
/* max-height = bar-min-height − top-padding − bottom-padding
   Both the preferred logo height (--itcm-hn-logo-h) and this cap are set;
   the smaller wins because height: X; max-height: Y; → renders min(X,Y).
   Only active when BOTH itcm-hn-logo-height AND itcm-hn-logo-fit-yes are present,
   so the prefix_class quirk (applied even when condition is hidden) does not
   affect width mode. */
.elementor-widget-itcm-header-navigation.itcm-hn-logo-height.itcm-hn-logo-fit-yes .itcm-hn__logo {
	max-height: calc(
		var(--itcm-hn-bar-min-h, 72px)
		- var(--itcm-hn-pad-t, 0px)
		- var(--itcm-hn-pad-b, 0px)
	);
}

/* ── Logo — compact/scrolled state in height mode ────────────────────────── */
/* scrolled_logo_height control sets --itcm-hn-logo-h on .itcm-hn.is-shrunk,
   which cascades into the height property below. */

/* Compact fit-within-bar in height mode */
.elementor-widget-itcm-header-navigation.itcm-hn-logo-height.itcm-hn-logo-fit-yes .itcm-hn.is-shrunk .itcm-hn__logo {
	max-height: calc(
		var(--itcm-hn-compact-bar-h, var(--itcm-hn-bar-min-h, 72px))
		- var(--itcm-hn-compact-pad-t, var(--itcm-hn-pad-t, 0px))
		- var(--itcm-hn-compact-pad-b, var(--itcm-hn-pad-b, 0px))
	);
}

.itcm-hn__logo-text {
	font-weight: 700;
	font-size:   1.25rem;
	white-space: nowrap;
}

/* ── Desktop Nav ─────────────────────────────────────────────────────────── */
.itcm-hn__nav {
	display:         flex;
	flex:            1 1 auto;
	min-width:       0;
	justify-content: center;
}

/* Top-level menu */
.itcm-hn__menu {
	display:     flex;
	flex-direction: row;
	align-items: center;
	list-style:  none;
	margin:      0;
	padding:     0;
	gap:         8px;
}

/* Mobile menu overrides (inside mobile panel) */
.itcm-hn__mobile .itcm-hn__menu {
	flex-direction: column;
	align-items:    stretch;
	gap:            0;
}

/* ── Menu item ───────────────────────────────────────────────────────────── */
.itcm-hn__item {
	position:   relative;
	list-style: none;
	display:    flex;
	align-items: center;
}

/* Top-level items with submenus: keep row on desktop */
.itcm-hn__nav > .itcm-hn__menu > .itcm-hn__item {
	flex-wrap: nowrap;
}

/* Mobile items: column to allow sub-toggle beside link */
.itcm-hn__mobile .itcm-hn__item {
	flex-direction: row;
	flex-wrap:      wrap;
	align-items:    center;
	border-bottom:  1px solid rgba(0,0,0,0.07);
}

.itcm-hn__mobile .itcm-hn__item:last-child {
	border-bottom: none;
}

/* ── Menu links ──────────────────────────────────────────────────────────── */
.itcm-hn__link {
	display:         inline-flex;
	align-items:     center;
	padding:         8px 12px;
	color:           inherit;
	text-decoration: none;
	white-space:     nowrap;
	cursor:          pointer;
	border-radius:   4px;
	transition:      color var(--itcm-hn-dur) var(--itcm-hn-ease),
	                 background-color var(--itcm-hn-dur) var(--itcm-hn-ease);
}

.itcm-hn__mobile .itcm-hn__link {
	flex:       1 1 auto;
	min-width:  0;
	padding:    12px 0;
	border-radius: 0;
	white-space: normal;
}

.itcm-hn__link:hover,
.itcm-hn__link:focus-visible {
	outline: none;
}

.itcm-hn__link:focus-visible {
	outline:        2px solid currentColor;
	outline-offset: 2px;
}

/* Current page */
.itcm-hn__link--current {
	font-weight: 600;
}

/* ── Submenu toggle button ───────────────────────────────────────────────── */
.itcm-hn__sub-toggle {
	display:          inline-flex;
	align-items:      center;
	justify-content:  center;
	flex-shrink:      0;
	background:       none;
	border:           none;
	padding:          6px 4px;
	cursor:           pointer;
	color:            inherit;
	border-radius:    4px;
	transition:       color var(--itcm-hn-dur) var(--itcm-hn-ease),
	                  transform var(--itcm-hn-dur) var(--itcm-hn-ease);
}

.itcm-hn__sub-toggle:hover,
.itcm-hn__sub-toggle:focus-visible {
	outline:        2px solid currentColor;
	outline-offset: 2px;
}

.itcm-hn__sub-icon {
	display: block;
	width:   12px;
	height:  8px;
	transition: transform var(--itcm-hn-dur) var(--itcm-hn-ease);
}

/* Rotate chevron when expanded */
.itcm-hn__sub-toggle[aria-expanded="true"] .itcm-hn__sub-icon {
	transform: rotate(180deg);
}

/* ── Desktop submenu (dropdown) ──────────────────────────────────────────── */
.itcm-hn__nav .itcm-hn__submenu {
	position:         absolute;
	top:              calc(100% + 4px);
	inset-inline-start: 0;
	min-width:        200px;
	list-style:       none;
	margin:           0;
	padding:          8px 0;
	background-color: #fff;
	border-radius:    6px;
	box-shadow:       0 4px 20px rgba(0,0,0,0.12);
	opacity:          0;
	visibility:       hidden;
	pointer-events:   none;
	transform:        translateY(-6px);
	transition:       opacity var(--itcm-hn-dur) var(--itcm-hn-ease),
	                  visibility var(--itcm-hn-dur) var(--itcm-hn-ease),
	                  transform var(--itcm-hn-dur) var(--itcm-hn-ease);
	z-index:          10;
}

/* RTL: align to right edge */
[dir="rtl"] .itcm-hn__nav .itcm-hn__submenu {
	inset-inline-start: auto;
	inset-inline-end:   0;
}

/* Open state (desktop) */
.itcm-hn__nav .itcm-hn__submenu.is-open,
.itcm-hn__nav .itcm-hn__item:hover > .itcm-hn__submenu,
.itcm-hn__nav .itcm-hn__item:focus-within > .itcm-hn__submenu {
	opacity:        1;
	visibility:     visible;
	pointer-events: auto;
	transform:      translateY(0);
}

/* Desktop submenu items are block */
.itcm-hn__nav .itcm-hn__submenu .itcm-hn__item {
	display:  block;
	width:    100%;
	border:   none;
}

.itcm-hn__nav .itcm-hn__submenu .itcm-hn__link {
	display:       block;
	padding:       10px 16px;
	border-radius: 0;
	white-space:   nowrap;
}

/* ── Mobile submenu (accordion) ──────────────────────────────────────────── */
.itcm-hn__mobile .itcm-hn__submenu {
	position:   static;
	display:    none;
	flex:       0 0 100%;
	width:      100%;
	list-style: none;
	margin:     0;
	padding:    0 0 0 16px;
	opacity:    1;
	visibility: visible;
	pointer-events: auto;
	transform:  none;
	box-shadow: none;
	border-radius: 0;
	background: transparent;
	border-left: 2px solid rgba(0,0,0,0.1);
}

.itcm-hn__mobile .itcm-hn__submenu.is-open {
	display: block;
}

/* ── Actions bar (desktop CTA + hamburger + mobile CTA) ──────────────────── */
.itcm-hn__actions {
	display:     flex;
	align-items: center;
	flex-shrink: 0;
	gap:         8px;
	margin-inline-start: auto;
}

/* ── Contact CTA ─────────────────────────────────────────────────────────── */
.itcm-hn__contact {
	display:         inline-flex;
	align-items:     center;
	gap:             8px;
	padding:         10px 24px;
	text-decoration: none;
	border-radius:   4px;
	white-space:     nowrap;
	cursor:          pointer;
	font-weight:     600;
	line-height:     1;
	transition:      color var(--itcm-hn-dur) var(--itcm-hn-ease),
	                 background-color var(--itcm-hn-dur) var(--itcm-hn-ease),
	                 border-color var(--itcm-hn-dur) var(--itcm-hn-ease);
}

.itcm-hn__contact:focus-visible {
	outline:        2px solid currentColor;
	outline-offset: 2px;
}

.itcm-hn__contact-icon {
	display:         inline-flex;
	align-items:     center;
	justify-content: center;
	flex-shrink:     0;
	line-height:     1;
}

.itcm-hn__contact-icon svg {
	display: block;
	width:   1em;
	height:  1em;
	fill:    currentColor;
}

/* ── Hamburger ───────────────────────────────────────────────────────────── */
.itcm-hn__hamburger {
	display:          flex;
	align-items:      center;
	justify-content:  center;
	background:       none;
	border:           none;
	padding:          8px;
	cursor:           pointer;
	color:            inherit;
	border-radius:    4px;
	min-width:        44px;
	min-height:       44px;
	transition:       color var(--itcm-hn-dur) var(--itcm-hn-ease);
}

.itcm-hn__hamburger:focus-visible {
	outline:        2px solid currentColor;
	outline-offset: 2px;
}

.itcm-hn__ham-box {
	position:        relative;
	display:         flex;
	flex-direction:  column;
	justify-content: space-between;
	width:           28px;
	height:          18px;
	flex-shrink:     0;
}

.itcm-hn__ham-line {
	display:          block;
	width:            100%;
	height:           2px;
	background-color: currentColor;
	border-radius:    2px;
	transform-origin: center;
	transition:       transform var(--itcm-hn-dur) var(--itcm-hn-ease),
	                  opacity   var(--itcm-hn-dur) var(--itcm-hn-ease);
}

/* Hamburger → X animation when menu is open */
.itcm-hn.is-open .itcm-hn__ham-line:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}

.itcm-hn.is-open .itcm-hn__ham-line:nth-child(2) {
	opacity:   0;
	transform: scaleX(0);
}

.itcm-hn.is-open .itcm-hn__ham-line:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

/* ── Mobile panel ─────────────────────────────────────────────────────────── */
.itcm-hn__mobile {
	--itcm-hn-panel-w: 320px;
	position:          fixed;
	z-index:           calc(var(--itcm-hn-z, 100) + 1);
	overflow:          hidden;
}

/* Drawer: slides in from side */
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-drawer .itcm-hn__mobile {
	top:         0;
	bottom:      0;
	inset-inline-end: 0;
	inset-inline-start: auto;
	width:       fit-content;
	max-width:   100%;
	transform:   translateX(100%);
	transition:  transform var(--itcm-hn-dur) var(--itcm-hn-ease),
	             visibility var(--itcm-hn-dur) var(--itcm-hn-ease);
	visibility:  hidden;
}

[dir="rtl"] .elementor-widget-itcm-header-navigation.itcm-hn-mobile-drawer .itcm-hn__mobile {
	transform: translateX(-100%);
}

/* Drawer from start side */
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-drawer.itcm-hn-drawer-start .itcm-hn__mobile {
	inset-inline-start: 0;
	inset-inline-end:   auto;
	transform:          translateX(-100%);
}

[dir="rtl"] .elementor-widget-itcm-header-navigation.itcm-hn-mobile-drawer.itcm-hn-drawer-start .itcm-hn__mobile {
	transform: translateX(100%);
}

/* Dropdown: falls below the bar */
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-dropdown .itcm-hn__mobile {
	position:   absolute;
	top:        100%;
	left:       0;
	right:      0;
	width:      100%;
	max-height: 0;
	overflow:   hidden;
	transform:  none;
	transition: max-height 0.35s var(--itcm-hn-ease),
	            visibility  var(--itcm-hn-dur) var(--itcm-hn-ease);
	visibility: hidden;
}

/* Fullscreen overlay */
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-fullscreen .itcm-hn__mobile {
	top:        0;
	left:       0;
	right:      0;
	bottom:     0;
	width:      100%;
	height:     100%;
	transform:  translateY(-100%);
	transition: transform     var(--itcm-hn-dur) var(--itcm-hn-ease),
	            visibility    var(--itcm-hn-dur) var(--itcm-hn-ease);
	visibility: hidden;
}

/* Open states */
.itcm-hn.is-open.elementor-widget-itcm-header-navigation .itcm-hn__mobile,
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-drawer .itcm-hn.is-open .itcm-hn__mobile,
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-dropdown .itcm-hn.is-open .itcm-hn__mobile,
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-fullscreen .itcm-hn.is-open .itcm-hn__mobile {
	visibility: visible;
}

.elementor-widget-itcm-header-navigation.itcm-hn-mobile-drawer .itcm-hn.is-open .itcm-hn__mobile {
	transform: translateX(0);
}

.elementor-widget-itcm-header-navigation.itcm-hn-mobile-dropdown .itcm-hn.is-open .itcm-hn__mobile {
	max-height: 80vh;
	overflow-y: auto;
}

.elementor-widget-itcm-header-navigation.itcm-hn-mobile-fullscreen .itcm-hn.is-open .itcm-hn__mobile {
	transform: translateY(0);
}

/* ── Mobile panel inner ──────────────────────────────────────────────────── */
.itcm-hn__mobile-wrap {
	display:        flex;
	flex-direction: column;
	height:         100%;
	max-height:     100vh;
	overflow-y:     auto;
	background-color: #fff;
	padding:        24px;
	box-sizing:     border-box;
	width:          320px;
	max-width:      100vw;
}

/* Fullscreen takes full width */
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-fullscreen .itcm-hn__mobile-wrap {
	width:  100%;
}

/* Dropdown takes full width */
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-dropdown .itcm-hn__mobile-wrap {
	width:  100%;
}

/* ── Mobile panel header ─────────────────────────────────────────────────── */
.itcm-hn__mobile-head {
	display:         flex;
	align-items:     center;
	justify-content: flex-end;
	margin-bottom:   16px;
	gap:             12px;
}

.itcm-hn__mobile-logo {
	flex:        1 1 auto;
	min-width:   0;
}

.itcm-hn__mobile-logo .itcm-hn__logo {
	max-height: 48px;
}

/* ── Close button ────────────────────────────────────────────────────────── */
.itcm-hn__close {
	display:          flex;
	align-items:      center;
	justify-content:  center;
	background:       none;
	border:           none;
	padding:          8px;
	cursor:           pointer;
	color:            inherit;
	border-radius:    4px;
	min-width:        44px;
	min-height:       44px;
	flex-shrink:      0;
}

.itcm-hn__close svg {
	width:  20px;
	height: 20px;
	display: block;
}

.itcm-hn__close:focus-visible {
	outline:        2px solid currentColor;
	outline-offset: 2px;
}

/* ── Mobile nav ──────────────────────────────────────────────────────────── */
.itcm-hn__mobile-nav {
	flex: 1 1 auto;
}

.itcm-hn__mobile-footer {
	margin-top:  24px;
	padding-top: 20px;
	border-top:  1px solid rgba(0,0,0,0.1);
}

.itcm-hn__mobile-footer .itcm-hn__contact {
	width:           100%;
	justify-content: center;
}

/* ── Backdrop ────────────────────────────────────────────────────────────── */
.itcm-hn__backdrop {
	position:         fixed;
	inset:            0;
	background-color: rgba(0, 0, 0, 0.5);
	z-index:          calc(var(--itcm-hn-z, 100));
	opacity:          0;
	visibility:       hidden;
	pointer-events:   none;
	transition:       opacity   var(--itcm-hn-dur) var(--itcm-hn-ease),
	                  visibility var(--itcm-hn-dur) var(--itcm-hn-ease);
}

.itcm-hn.is-open .itcm-hn__backdrop {
	opacity:        1;
	visibility:     visible;
	pointer-events: auto;
}

/* No backdrop for dropdown style */
.elementor-widget-itcm-header-navigation.itcm-hn-mobile-dropdown .itcm-hn.is-open .itcm-hn__backdrop {
	display: none;
}

/* ── Spacer (injected by JS for fixed mode) ──────────────────────────────── */
.itcm-hn__spacer {
	display:    block;
	width:      100%;
	flex-shrink: 0;
}

/* ── Compact defaults when the user has not set compact controls ───────────
   Specificity stays below the Elementor rules that target
   {{WRAPPER}} .itcm-hn.is-shrunk …, and those rules load later, so an
   explicit compact height, padding or logo size still wins.
   ────────────────────────────────────────────────────────────────────────── */
/* Elementor prints normal bar/logo rules as
   .elementor-{id} .elementor-element.elementor-element-{widget} .itcm-hn__bar
   (4 classes) after this file. Compact defaults need 5 classes to win.
   An explicit compact control is 6 classes in that same file and still wins. */
.elementor-widget.elementor-widget-itcm-header-navigation.itcm-hn-behavior-sticky .itcm-hn.is-shrunk .itcm-hn__bar,
.elementor-widget.elementor-widget-itcm-header-navigation.itcm-hn-behavior-fixed .itcm-hn.is-shrunk .itcm-hn__bar {
	min-height: var(--itcm-hn-compact-bar-h);
}

.elementor-widget.elementor-widget-itcm-header-navigation.itcm-hn-behavior-sticky .itcm-hn.is-shrunk .itcm-hn__outer,
.elementor-widget.elementor-widget-itcm-header-navigation.itcm-hn-behavior-fixed .itcm-hn.is-shrunk .itcm-hn__outer {
	padding-block-start: var(--itcm-hn-compact-pad-t);
	padding-block-end: var(--itcm-hn-compact-pad-b);
}

.elementor-widget.elementor-widget-itcm-header-navigation.itcm-hn-behavior-sticky .itcm-hn.is-shrunk .itcm-hn__logo,
.elementor-widget.elementor-widget-itcm-header-navigation.itcm-hn-behavior-fixed .itcm-hn.is-shrunk .itcm-hn__logo {
	width: calc(var(--itcm-hn-logo-w, 140px) * 0.75);
}

.elementor-widget-itcm-header-navigation.itcm-hn-logo-height .itcm-hn.is-shrunk {
	--itcm-hn-logo-h: calc(var(--itcm-hn-logo-h-base, 48px) * 0.75);
}

.elementor-widget.elementor-widget-itcm-header-navigation.itcm-hn-logo-height.itcm-hn-behavior-sticky .itcm-hn.is-shrunk .itcm-hn__logo,
.elementor-widget.elementor-widget-itcm-header-navigation.itcm-hn-logo-height.itcm-hn-behavior-fixed .itcm-hn.is-shrunk .itcm-hn__logo {
	width: auto;
	height: var(--itcm-hn-logo-h);
	max-height: none;
}

.elementor-widget-itcm-header-navigation.itcm-hn-logo-height.itcm-hn-logo-fit-yes .itcm-hn.is-shrunk .itcm-hn__logo {
	max-height: calc(
		var(--itcm-hn-compact-bar-h)
		- var(--itcm-hn-compact-pad-t)
		- var(--itcm-hn-compact-pad-b)
	);
}

/* ── Scroll shrink / scrolled state transitions ──────────────────────────── */

/* Outer: smoothly animate background, shadow and block padding on shrink */
.itcm-hn .itcm-hn__outer {
	transition: background-color var(--itcm-hn-shrink-dur) var(--itcm-hn-shrink-ease),
	            box-shadow        var(--itcm-hn-shrink-dur) var(--itcm-hn-shrink-ease),
	            padding-block     var(--itcm-hn-shrink-dur) var(--itcm-hn-shrink-ease),
	            padding-block-start var(--itcm-hn-shrink-dur) var(--itcm-hn-shrink-ease),
	            padding-block-end   var(--itcm-hn-shrink-dur) var(--itcm-hn-shrink-ease);
}

/* Bar: animate min-height on shrink */
.itcm-hn__bar {
	transition: min-height var(--itcm-hn-shrink-dur) var(--itcm-hn-shrink-ease);
}

/* Note: .itcm-hn__logo transition is defined in the logo block above */

/* ── Hide on scroll state ────────────────────────────────────────────────── */
.itcm-hn.is-hidden .itcm-hn__outer {
	transform:  translateY(-110%);
	transition: transform 0.35s var(--itcm-hn-ease);
}

.elementor-widget-itcm-header-navigation.itcm-hn-behavior-sticky .itcm-hn.is-hidden .itcm-hn__outer,
.elementor-widget-itcm-header-navigation.itcm-hn-behavior-fixed .itcm-hn.is-hidden .itcm-hn__outer {
	transform:  translateY(-110%);
}

/* ── Mobile/Desktop visibility switches ─────────────────────────────────── */

/* Default breakpoint: 1024px */
.itcm-hn__hamburger,
.itcm-hn__contact--mobile {
	display: none;
}

.itcm-hn__contact--desktop {
	display: inline-flex;
}

@media (max-width: 1024px) {
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-1024 .itcm-hn__nav,
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-1024 .itcm-hn__contact--desktop {
		display: none;
	}

	.elementor-widget-itcm-header-navigation.itcm-hn-mb-1024 .itcm-hn__hamburger,
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-1024 .itcm-hn__contact--mobile {
		display: flex;
	}
}

@media (max-width: 1280px) {
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-1280 .itcm-hn__nav,
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-1280 .itcm-hn__contact--desktop {
		display: none;
	}

	.elementor-widget-itcm-header-navigation.itcm-hn-mb-1280 .itcm-hn__hamburger,
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-1280 .itcm-hn__contact--mobile {
		display: flex;
	}
}

@media (max-width: 880px) {
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-880 .itcm-hn__nav,
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-880 .itcm-hn__contact--desktop {
		display: none;
	}

	.elementor-widget-itcm-header-navigation.itcm-hn-mb-880 .itcm-hn__hamburger,
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-880 .itcm-hn__contact--mobile {
		display: flex;
	}
}

@media (max-width: 768px) {
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-768 .itcm-hn__nav,
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-768 .itcm-hn__contact--desktop {
		display: none;
	}

	.elementor-widget-itcm-header-navigation.itcm-hn-mb-768 .itcm-hn__hamburger,
	.elementor-widget-itcm-header-navigation.itcm-hn-mb-768 .itcm-hn__contact--mobile {
		display: flex;
	}
}

/* Mobile contact icon: icon only, no label */
.itcm-hn__contact--mobile .itcm-hn__contact-label {
	display: none;
}

.itcm-hn__contact--mobile {
	box-sizing:      border-box;
	padding:         8px;
	min-width:       44px;
	min-height:      44px;
	justify-content: center;
	align-items:     center;
	gap:             0;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.itcm-hn *,
	.itcm-hn *::before,
	.itcm-hn *::after {
		transition-duration: 0.01ms !important;
		animation-duration:  0.01ms !important;
	}
	/* Shrink state changes immediately instead of animating */
	.itcm-hn {
		--itcm-hn-shrink-dur: 0.01ms;
	}
}

/* ── Editor-only: preview_state=compact via JS class on .itcm-hn ─────────── */
/* JS adds is-shrunk to .itcm-hn when cfg.preview_state === 'compact' and
   cfg.is_edit === true. Transitions are suppressed during editor re-renders
   because the widget re-mounts, not via scroll. */
.elementor-editor-active .itcm-hn.is-shrunk .itcm-hn__outer {
	/* Allow immediate visual feedback in editor without transition delay */
	transition-duration: 0.01ms !important;
}

/* Closed panel stays out of flow and out of the tab order before JS runs.
   Opening adds .is-open, which is more specific. A <noscript> block in the
   widget restores an in-flow menu only when JavaScript is disabled. */
.itcm-hn:not(.is-open) .itcm-hn__mobile,
.itcm-hn:not(.is-open) .itcm-hn__backdrop {
	visibility: hidden;
	pointer-events: none;
}
