/*
 * iShack — modern skin for the existing Max Mega Menu.
 * Every selector is scoped to the OceanWP custom header. FiboSearch, account
 * and WooCommerce cart elements are intentionally outside this stylesheet.
 */

body.ishack-new-mega-menu {
	--ishack-menu-ink: #101828;
	--ishack-menu-muted: #667085;
	--ishack-menu-border: #e7eaf0;
	--ishack-menu-surface: #ffffff;
	--ishack-menu-soft: #f6f8fb;
	--ishack-menu-accent: #f5ad00;
	--ishack-menu-accent-dark: #7a4d00;
	--ishack-menu-radius: 18px;
	--ishack-menu-shadow: 0 24px 70px rgba(16, 24, 40, 0.16);
}

body.ishack-new-mega-menu #site-header {
	position: relative;
	z-index: 1000;
}

body.ishack-new-mega-menu #site-header .elementor-widget-maxmegamenu,
body.ishack-new-mega-menu #site-header .elementor-widget-wp-widget-maxmegamenu {
	overflow: visible;
}

body.ishack-new-mega-menu #site-header .ishack-menu-enhanced {
	overflow: visible;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .ishack-menu-icon {
	display: inline-grid;
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	place-items: center;
	border-radius: 9px;
	color: #344054;
	background: #f2f4f7;
	transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .ishack-menu-icon svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

body.ishack-new-mega-menu #site-header .ishack-menu-enhanced a:focus-visible,
body.ishack-new-mega-menu #site-header .ishack-menu-enhanced button:focus-visible {
	outline: 3px solid rgba(245, 173, 0, 0.48) !important;
	outline-offset: 3px;
	border-radius: 8px;
}

/* Desktop and tablet header. */
@media (min-width: 768px) {
	body.ishack-new-mega-menu #site-header .elementor-widget-maxmegamenu {
		position: relative;
		z-index: 20;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu {
		position: relative !important;
		display: flex !important;
		box-sizing: border-box !important;
		align-items: stretch;
		justify-content: space-between;
		width: 100% !important;
		max-width: 100% !important;
		min-height: 58px;
		gap: clamp(2px, 0.45vw, 9px);
		padding: 5px 20px !important;
		border: 1px solid var(--ishack-menu-border) !important;
		border-radius: 15px;
		background: rgba(255, 255, 255, 0.96) !important;
		box-shadow: 0 10px 34px rgba(16, 24, 40, 0.07);
		backdrop-filter: blur(14px);
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-menu-item {
		position: static !important;
		box-sizing: border-box;
		flex: 0 1 auto;
		min-width: 0;
		margin-inline: 0 !important;
		transform: none !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-menu-item:first-child {
		margin-left: 0 !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-menu-item:last-child {
		margin-right: 0 !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li > a.mega-menu-link {
		display: flex !important;
		align-items: center;
		gap: 8px;
		min-height: 46px !important;
		padding: 8px clamp(9px, 0.85vw, 15px) !important;
		border-radius: 11px !important;
		color: var(--ishack-menu-ink) !important;
		font-size: clamp(13px, 0.85vw, 15px) !important;
		font-weight: 650 !important;
		line-height: 1.2 !important;
		letter-spacing: -0.015em;
		transition: color 180ms ease, background-color 180ms ease, transform 180ms ease !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li:hover > a.mega-menu-link,
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-toggle-on > a.mega-menu-link,
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li > a.mega-menu-link:focus-visible {
		color: #151515 !important;
		background: #fff7dc !important;
		transform: translateY(-1px);
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li:hover > a .ishack-menu-icon,
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-toggle-on > a .ishack-menu-icon {
		color: var(--ishack-menu-accent-dark);
		background: #ffd96a;
		transform: scale(1.04);
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.ishack-menu-promotions > a.mega-menu-link {
		color: #3f2a00 !important;
		background: linear-gradient(135deg, #ffe28b, #f5ad00) !important;
		box-shadow: inset 0 0 0 1px rgba(122, 77, 0, 0.12);
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.ishack-menu-promotions > a .ishack-menu-icon {
		color: #3f2a00;
		background: rgba(255, 255, 255, 0.56);
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-menu-megamenu > ul.mega-sub-menu {
		box-sizing: border-box !important;
		left: 50% !important;
		right: auto !important;
		width: min(1320px, calc(100vw - 32px)) !important;
		max-height: min(680px, calc(100vh - 150px));
		padding: 30px !important;
		overflow: auto;
		border: 1px solid var(--ishack-menu-border) !important;
		border-radius: var(--ishack-menu-radius) !important;
		background: var(--ishack-menu-surface) !important;
		box-shadow: var(--ishack-menu-shadow) !important;
		transform: translate(-50%, 14px) !important;
		transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-toggle-on > ul.mega-sub-menu,
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-menu-megamenu:hover > ul.mega-sub-menu {
		transform: translate(-50%, 8px) !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-row > ul.mega-sub-menu {
		display: grid !important;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 8px 18px;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column {
		width: auto !important;
		padding: 0 8px !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column > ul.mega-sub-menu > li {
		margin: 0 0 5px !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column > ul.mega-sub-menu > li > a.mega-menu-link {
		display: flex !important;
		align-items: center;
		min-height: 36px !important;
		padding: 8px 10px !important;
		border-radius: 9px !important;
		color: #344054 !important;
		font-size: 14px !important;
		font-weight: 520 !important;
		line-height: 1.35 !important;
		transition: color 160ms ease, background-color 160ms ease, transform 160ms ease !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column > ul.mega-sub-menu > li > a.mega-menu-link:hover,
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column > ul.mega-sub-menu > li > a.mega-menu-link:focus-visible {
		color: #101828 !important;
		background: var(--ishack-menu-soft) !important;
		transform: translateX(3px);
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column > ul.mega-sub-menu > li.mega-menu-item-has-children > a.mega-menu-link {
		margin-bottom: 3px !important;
		color: var(--ishack-menu-ink) !important;
		font-size: 14px !important;
		font-weight: 720 !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column .mega-sub-menu .mega-sub-menu a.mega-menu-link {
		padding: 6px 10px !important;
		color: var(--ishack-menu-muted) !important;
		font-size: 13px !important;
		line-height: 1.35 !important;
	}

}

/*
 * The current header keeps the desktop menu active down to 768 px. Below
 * 1366 px nine labels plus icons no longer fit in the OceanWP container.
 * Give every item an equal, shrinkable slot and hide only the decorative
 * icons at these intermediate widths.
 */
@media (min-width: 768px) and (max-width: 1365px) {
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu {
		justify-content: space-between;
		gap: 0;
		padding-inline: 20px !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-menu-item {
		flex: 1 1 0;
		min-width: 0;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li > a.mega-menu-link {
		justify-content: center;
		width: 100% !important;
		min-width: 0 !important;
		padding-inline: 4px !important;
		font-size: 12px !important;
		text-align: center;
		overflow-wrap: anywhere;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li > a .ishack-menu-icon {
		display: none;
	}
}

/* Two content columns keep long category names readable on small tablets. */
@media (min-width: 768px) and (max-width: 1099px) {
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-menu-megamenu > ul.mega-sub-menu {
		padding: 22px !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-row > ul.mega-sub-menu {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

}

/* Existing Max Mega Menu mobile accordion — restyled, not replaced. */
@media (max-width: 767px) {
	body.ishack-new-mega-menu #site-header .elementor-widget-wp-widget-maxmegamenu {
		width: 100%;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced {
		border-radius: 14px;
		background: var(--ishack-menu-surface);
		box-shadow: 0 14px 38px rgba(16, 24, 40, 0.12);
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-toggle {
		min-height: 52px;
		padding: 8px 14px;
		border: 1px solid var(--ishack-menu-border);
		border-radius: 13px;
		color: #fff;
		background: #101828;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-toggle-label {
		font-size: 14px;
		font-weight: 700;
		letter-spacing: 0.01em;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu {
		padding: 8px !important;
		border: 1px solid var(--ishack-menu-border) !important;
		border-top: 0 !important;
		border-radius: 0 0 14px 14px;
		background: var(--ishack-menu-surface) !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li {
		margin: 0 0 4px !important;
		border-bottom: 1px solid #eef0f4 !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li:last-child {
		margin-bottom: 0 !important;
		border-bottom: 0 !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li > a.mega-menu-link {
		display: flex !important;
		align-items: center;
		gap: 10px;
		min-height: 54px !important;
		padding: 10px 12px !important;
		border-radius: 10px !important;
		color: var(--ishack-menu-ink) !important;
		font-size: 15px !important;
		font-weight: 680 !important;
		line-height: 1.2 !important;
		background: transparent !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li.mega-toggle-on > a.mega-menu-link {
		color: #3f2a00 !important;
		background: #fff7dc !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced > ul.mega-menu > li > ul.mega-sub-menu {
		padding: 5px 8px 12px 46px !important;
		background: #fff !important;
		box-shadow: none !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-row > ul.mega-sub-menu,
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column > ul.mega-sub-menu {
		display: block !important;
		padding: 0 !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column {
		width: 100% !important;
		padding: 0 !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column a.mega-menu-link {
		min-height: 42px !important;
		padding: 9px 10px !important;
		border-radius: 8px !important;
		color: #475467 !important;
		font-size: 14px !important;
		line-height: 1.35 !important;
	}

	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column a.mega-menu-link:hover,
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced .mega-menu-column a.mega-menu-link:focus-visible {
		color: #101828 !important;
		background: var(--ishack-menu-soft) !important;
	}

}

@media (prefers-reduced-motion: reduce) {
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced *,
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced *::before,
	body.ishack-new-mega-menu #site-header .ishack-menu-enhanced *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
