/**
 * Responsive fixes for the Elementor header (Theme Builder template 111).
 * Logo | main menu | search, always on one row, with equal space left and right.
 *  - 1366px and up : full menu, every size scales fluidly with the window width (no cropping).
 *  - 1365px & below: hamburger menu (+ search), so the header can never run out of room.
 * !important is used on purpose: Elementor prints its own per-element CSS with high specificity.
 */

body .elementor-location-header .elementor-nav-menu--main .elementor-nav-menu { flex-wrap: nowrap; }
body .elementor-location-header .elementor-nav-menu--main .elementor-item { white-space: nowrap; }
body .elementor-location-header .elementor-widget-image img { max-width: 100%; height: auto; }

/* ---------- Desktop: 1366px and up (fluid) ---------- */
@media (min-width: 1366px) {
	body .elementor-location-header .elementor-element.elementor-element-1db5888d {
		--padding-left: clamp(20px, 4.5vw, 110px) !important;
		--padding-right: clamp(20px, 4.5vw, 110px) !important;
		padding-left: clamp(20px, 4.5vw, 110px) !important;
		padding-right: clamp(20px, 4.5vw, 110px) !important;
		justify-content: space-between !important;
		gap: clamp(8px, 1vw, 24px) !important;
	}
	body .elementor-location-header .elementor-element.elementor-element-5e1aa96a { flex: 0 0 auto; }
	body .elementor-location-header .elementor-element.elementor-element-5e1aa96a img {
		width: clamp(150px, 15vw, 300px) !important;
	}
	body .elementor-location-header .elementor-element.elementor-element-54183820 {
		flex: 0 1 auto !important;
		min-width: 0;
		margin: 0 !important;
	}
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--main .elementor-item {
		font-size: clamp(13.5px, 1vw, 16px) !important;
	}
	/* gap between menu items, set directly on the items (Elementor's variable is ignored for some of them) */
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--main .elementor-nav-menu > li {
		margin-inline-end: 0 !important;
		margin-inline-start: 0 !important;
	}
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--main .elementor-nav-menu > li:not(:last-child) {
		margin-inline-end: clamp(8px, 1.1vw, 26px) !important;
	}
	body .elementor-location-header .elementor-element.elementor-element-3dc754 {
		--container-widget-width: clamp(150px, 15vw, 300px) !important;
		width: clamp(150px, 15vw, 300px) !important;
		max-width: clamp(150px, 15vw, 300px) !important;
		flex: 0 1 auto !important;
		min-width: 0;
		margin: 0 !important;
	}
}

/* ---------- Below 1366px: hamburger ---------- */
@media (max-width: 1365px) {
	body .elementor-location-header .elementor-element.elementor-element-1db5888d {
		--padding-left: 20px !important;
		--padding-right: 20px !important;
		padding-left: 20px !important;
		padding-right: 20px !important;
		--min-height: 80px !important;
		min-height: 80px;
		gap: 12px !important;
	}
	body .elementor-location-header .elementor-element.elementor-element-5e1aa96a img { width: 170px !important; }
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--main { display: none !important; }
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-menu-toggle {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		cursor: pointer;
	}
	/* Dropdown panel: Elementor hides it above 1024px, so show it again (still collapsed until the toggle is active). */
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--dropdown.elementor-nav-menu__container {
		display: block !important;
		position: absolute;
		top: 100% !important;
		left: 0 !important;
		right: 0;
		width: 100vw !important;
		z-index: 9999;
	}
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--dropdown .elementor-item,
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--dropdown .elementor-sub-item { white-space: normal; }
}

/* 1025-1365px: desktop search stays visible, hamburger goes to the far right. */
@media (min-width: 1025px) and (max-width: 1365px) {
	body .elementor-location-header .elementor-element.elementor-element-1db5888d { justify-content: flex-start; }
	body .elementor-location-header .elementor-element.elementor-element-54183820 { order: 3; margin-left: 0; }
	body .elementor-location-header .elementor-element.elementor-element-3dc754 {
		--container-widget-width: 220px !important;
		width: 220px !important;
		max-width: 220px !important;
		flex-shrink: 1;
		min-width: 0;
		order: 2;
		margin-left: auto;
	}
	/* Let the dropdown anchor to the header wrapper, not to the small hamburger widget. */
	body .elementor-location-header .elementor-element.elementor-element-54183820,
	body .elementor-location-header .elementor-element.elementor-element-54183820 > .elementor-widget-container { position: static; }
}

/* Tablet / phone: logo left, search icon + hamburger together on the right. */
@media (max-width: 1024px) {
	body .elementor-location-header .elementor-element.elementor-element-fdd5a02 { margin-left: auto !important; }
	body .elementor-location-header .elementor-element.elementor-element-54183820 { margin-left: 0 !important; }
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-menu-toggle { margin-left: 0 !important; }
	body .elementor-location-header .elementor-element.elementor-element-1db5888d { gap: 8px !important; }
}

/* Phones */
@media (max-width: 767px) {
	body .elementor-location-header .elementor-element.elementor-element-1db5888d {
		--padding-left: 16px !important;
		--padding-right: 16px !important;
		padding-left: 16px !important;
		padding-right: 16px !important;
		--min-height: 68px !important;
		min-height: 68px;
	}
	body .elementor-location-header .elementor-element.elementor-element-5e1aa96a img { width: 150px !important; }
	body .elementor-location-header .elementor-element.elementor-element-2dc92bab { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 400px) {
	body .elementor-location-header .elementor-element.elementor-element-5e1aa96a img { width: 135px !important; }
}

/* ---------- Desktop menu spacing (overrides the Customizer CSS: gap 19px + 14px padding = 47px between items) ---------- */
@media (min-width: 1366px) {
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--main > .elementor-nav-menu {
		gap: clamp(0px, 0.3vw, 8px) !important;
	}
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--main > .elementor-nav-menu > li > a.elementor-item {
		padding: 9px clamp(6px, 0.8vw, 15px) !important;
		font-size: clamp(14px, 1.05vw, 18px) !important;
	}
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--main > .elementor-nav-menu > li:not(:last-child) {
		margin-inline-end: 0 !important;
	}
	body .elementor-location-header .fe-header__search--desktop,
	body .elementor-location-header .elementor-element.elementor-element-3dc754 {
		margin-left: 0 !important;
	}
}

/* ---------- Mobile / tablet menu: anchor the dropdown to the whole header, not to the small hamburger widget ---------- */
@media (max-width: 1365px) {
	body .elementor-location-header .elementor-element.elementor-element-1db5888d { position: relative; }
	body .elementor-location-header .elementor-element.elementor-element-54183820,
	body .elementor-location-header .elementor-element.elementor-element-54183820 > .elementor-widget-container { position: static !important; }
	body .elementor-location-header .elementor-element.elementor-element-54183820 .elementor-nav-menu--dropdown.elementor-nav-menu__container {
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		max-width: 100vw;
		transform-origin: top;
	}
}
