/* Global site header: logo, primary nav, "לפי סוג אירוע" mega menu, mobile panel.
   Mobile-first: unprefixed rules are the mobile baseline; @media (min-width: 1024px)
   layers on the inline desktop nav + dropdown/mega-menu behavior. */

.site-header {
	position: sticky;
	top: 0;
	z-index: var(--header-z);
	height: var(--header-height-mobile);
	background: var(--color-bg);
	border-bottom: 1px solid var(--color-border);
	transition: height .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.site-header.is-sticky {
	border-bottom-color: transparent;
	box-shadow: var(--shadow-floating);
}

.site-header .container {
	width: calc(100% - (var(--gutter) * 2));
	max-width: none;
}

.site-header__row {
	position: relative;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-lg);
}

.site-header__logo {
	flex: 0 0 auto;
}

.site-header__logo img {
	max-height: 44px;
	width: auto;
	display: block;
}

.site-header__menu-toggle,
.primary-nav__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	background: none;
	border: 0;
	padding: 8px;
	color: var(--color-ink);
	cursor: pointer;
}

.primary-nav__close {
	align-self: flex-end;
	margin-bottom: var(--space-sm);
}

.site-header__menu-toggle svg {
	transition: transform .2s ease;
}

.site-header__menu-toggle:hover svg {
	transform: scale(1.1) rotate(-4deg);
	color: var(--color-coral);
}

.site-header__menu-toggle:active svg {
	transform: scale(.92);
}

.site-header__menu-toggle[aria-expanded="true"] svg {
	animation: basarela-burger-bounce .45s ease;
}

@keyframes basarela-burger-bounce {
	0% {
		transform: scale(1) rotate(0deg);
	}
	35% {
		transform: scale(1.3) rotate(-10deg);
	}
	65% {
		transform: scale(.88) rotate(6deg);
	}
	100% {
		transform: scale(1) rotate(0deg);
	}
}

.site-header__menu-toggle svg,
.primary-nav__close svg {
	width: 26px;
	height: 26px;
}

.site-header__cta-wrap {
	display: none;
}

/* Primary nav: full-screen mobile panel by default, becomes the inline desktop row at 1024px+. */

.primary-nav {
	position: fixed;
	inset: var(--header-height-mobile) 0 0 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	background: var(--color-bg);
	padding: var(--space-md) var(--gutter) var(--space-xl);
	overflow-y: auto;
	transform: translateX(-100%);
	transition: transform .18s ease;
	z-index: var(--header-z);
}

.primary-nav.is-open {
	transform: translateX(0);
}

.primary-nav__list {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-nav__item {
	position: relative;
	border-bottom: 1px solid var(--color-border);
}

.primary-nav__link,
.primary-nav__mega-trigger {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	width: 100%;
	background: none;
	border: 0;
	padding: 16px 4px;
	font: inherit;
	font-weight: 600;
	color: var(--color-ink);
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}

.primary-nav__chevron {
	width: 14px;
	height: 14px;
	transition: transform .15s ease;
}

.primary-nav__mega-trigger[aria-expanded="true"] .primary-nav__chevron {
	transform: rotate(180deg);
}

.primary-nav__mobile-cta {
	display: block;
	margin-top: var(--space-lg);
}

.primary-nav__mobile-cta .site-header__cta {
	display: flex;
	width: 100%;
}

/* Mega menu: stacked flat sections inside the mobile panel by default,
   becomes a floating dropdown/mega card anchored to its trigger at 1024px+. */

.mega-menu,
.mega-menu--wide {
	position: static;
	width: auto;
	min-width: 0;
	max-width: none;
	margin: 0;
	border: 0;
	box-shadow: none;
	border-radius: 0;
	padding: var(--space-sm) 0 var(--space-md) var(--space-lg);
	background: var(--color-surface);
}

.mega-menu[hidden] {
	display: none;
}

.mega-menu__columns {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-md);
}

.mega-menu__column-title {
	margin: 0 0 var(--space-sm);
	font-size: .8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--color-muted);
}

.mega-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mega-menu__list a {
	display: block;
	padding: 6px 8px;
	margin-inline: -8px;
	border-radius: var(--radius-sm);
	color: var(--color-ink);
	text-decoration: none;
	font-weight: 500;
}

.mega-menu__list a:hover,
.mega-menu__list a:focus-visible {
	background: var(--color-surface);
	color: var(--color-coral-dark);
}

.mega-menu__column--callout {
	background: var(--color-coral-soft);
	border-radius: var(--radius-md);
	padding: var(--space-md);
}

.mega-menu__callout {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	color: var(--color-ink);
	text-decoration: none;
	font-weight: 700;
}

.mega-menu__callout-image {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--radius-sm);
	transition: opacity .12s ease;
}

.mega-menu__callout-body {
	display: block;
}

.mega-menu__callout-desc {
	display: block;
	margin-top: 6px;
	font-size: .875rem;
	font-weight: 400;
	color: var(--color-muted);
}

/* "קייטרינג" mega menu (id 2507) redesign — category cards + side CTA panel.
   Every rule below is scoped to #mega-menu-2507 specifically so the other
   wide panel ("דוכני אוכל לאירועים") and the 2 narrow dropdowns are
   provably unaffected. Mobile-first: these are the shared/base styles used
   both inside the mobile drawer and (with the desktop overrides further
   below) inside the floating desktop panel. */

#mega-menu-2507 .mega-menu__column--catering-card {
	position: relative;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

#mega-menu-2507 .mega-menu__column--catering-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-card);
	border-color: var(--color-coral);
}

/* Focus ring drawn inward (negative offset) so it isn't clipped by the
   card's own overflow: hidden (needed to crop the image's square corners
   to the card's rounded border). The default global :focus-visible outline
   on the link itself is suppressed here in favor of this inward ring. */
#mega-menu-2507 .mega-menu__column--catering-card:focus-within {
	outline: 3px solid var(--color-orange);
	outline-offset: -3px;
}

#mega-menu-2507 .mega-menu__callout:focus-visible {
	outline: none;
}

#mega-menu-2507 .mega-menu__callout {
	position: relative;
	gap: 0;
	height: 100%;
}

/* The shared .mega-menu__callout-image rule puts width:100% + aspect-ratio
   directly on the <img> — inside a CSS Grid this can't resolve the
   percentage width during the grid's row auto-sizing pass and silently
   falls back to the raw HTML height attribute, rendering portrait-tall
   (the same bug already fixed elsewhere on this project: post hero,
   blog cards, service/article cards — see CHANGELOG.md). It was never
   surfaced on the "דוכני אוכל" panel this project must leave untouched,
   so the fix here is scoped to #mega-menu-2507 only: a definite height
   instead of aspect-ratio sidesteps the interaction entirely. */
#mega-menu-2507 .mega-menu__callout-image {
	aspect-ratio: auto;
	height: 130px;
	object-fit: cover;
}

#mega-menu-2507 .mega-menu__callout-body {
	padding: 14px 16px;
	font-size: .9375rem;
}

#mega-menu-2507 .mega-menu__callout-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: var(--radius-pill);
	background: rgba(255, 255, 255, .92);
	box-shadow: 0 2px 8px rgba(16, 27, 61, .18);
	color: var(--color-coral-dark);
}

#mega-menu-2507 .mega-menu__callout-badge-icon {
	width: 18px;
	height: 18px;
}

#mega-menu-2507 .mega-menu__cta {
	margin-top: var(--space-md);
	background: var(--color-coral-soft);
	border-radius: var(--radius-md);
	padding: var(--space-md) var(--space-sm);
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

#mega-menu-2507 .mega-menu__cta-title {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 700;
	color: var(--color-ink);
}

#mega-menu-2507 .mega-menu__cta-body {
	margin: 0;
	font-size: .8125rem;
	color: var(--color-muted);
	line-height: 1.5;
}

#mega-menu-2507 .mega-menu__cta-button {
	width: 100%;
	min-height: 46px;
	padding: 0 var(--space-md);
	font-size: .9rem;
}

#mega-menu-2507 .mega-menu__cta-icon {
	width: 18px;
	height: 18px;
}

#mega-menu-2507 .mega-menu__cta-facts {
	list-style: none;
	margin: 0;
	padding: var(--space-sm) 0 0;
	border-top: 1px solid rgba(16, 27, 61, .08);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#mega-menu-2507 .mega-menu__cta-facts li {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: .8125rem;
	font-weight: 500;
	color: var(--color-ink);
}

#mega-menu-2507 .mega-menu__cta-fact-icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--color-coral-dark);
}

/* Inside the mobile drawer (below 1024px, phone AND tablet widths alike —
   this theme has no separate tablet nav mode, .primary-nav is the drawer
   at every width under the desktop breakpoint), 9 cards read better as a
   2-column grid than the shared 1-column default. No fixed pixel widths;
   percentages/fr units only, so this can never cause horizontal overflow. */
#mega-menu-2507 .mega-menu__columns {
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-sm);
}

.primary-nav__backdrop {
	display: block;
	position: fixed;
	inset: var(--header-height-mobile) 0 0 0;
	background: rgba(16, 27, 61, .45);
	z-index: calc(var(--header-z) - 1);
}

.primary-nav__backdrop[hidden] {
	display: none;
}

html.basarela-nav-open {
	overflow: hidden;
}

/* Desktop and up: inline nav row, dropdown/mega-menu on hover-trigger, CTA button visible. */

@media (min-width: 1024px) {
	.site-header {
		height: var(--header-height-desktop);
	}

	.site-header.is-sticky {
		height: var(--header-height-sticky);
	}

	.site-header__menu-toggle {
		display: none;
	}

	.site-header__cta-wrap {
		display: block;
	}

	.primary-nav {
		position: static;
		inset: auto;
		flex: 1;
		flex-direction: row;
		align-items: center;
		background: none;
		padding: 0;
		overflow: visible;
		transform: none;
		transition: none;
	}

	.primary-nav__close {
		display: none;
	}

	.primary-nav__list {
		flex-direction: row;
		align-items: center;
		gap: var(--space-lg);
	}

	.primary-nav__item {
		border-bottom: 0;
	}

	.primary-nav__link,
	.primary-nav__mega-trigger {
		width: auto;
		padding: 8px 2px;
	}

	.primary-nav__link::after,
	.primary-nav__mega-trigger::after {
		content: "";
		position: absolute;
		inset-inline: 0;
		bottom: -4px;
		height: 2px;
		background: var(--color-coral);
		transform: scaleX(0);
		transition: transform .15s ease;
	}

	.primary-nav__link:hover::after,
	.primary-nav__mega-trigger:hover::after,
	.primary-nav__item--current > .primary-nav__link::after,
	.primary-nav__mega-trigger[aria-expanded="true"]::after {
		transform: scaleX(1);
	}

	.primary-nav__mobile-cta {
		display: none;
	}

	.mega-menu,
	.mega-menu--wide {
		position: absolute;
		top: 100%;
		right: 0;
		margin-top: 12px;
		border: 1px solid var(--color-border);
		border-radius: var(--radius-lg);
		box-shadow: var(--shadow-floating);
		background: var(--color-bg);
		z-index: calc(var(--header-z) + 1);
	}

	.mega-menu {
		min-width: 220px;
		max-width: min(92vw, 320px);
		padding: var(--space-sm);
	}

	.mega-menu--wide {
		min-width: auto;
		width: min(92vw, var(--mega-menu-max-width));
		max-width: min(92vw, var(--mega-menu-max-width));
		padding: var(--space-lg);
		max-height: calc(100vh - var(--header-height-sticky) - 24px);
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.mega-menu__columns {
		grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
		gap: var(--space-lg);
	}

	/* "קייטרינג" mega menu (id 2507) — desktop-only overrides. Detached
	   from the trigger-anchored positioning every other panel uses
	   (position: fixed, centered on the viewport under the header) so it
	   reads as a single wide panel centered under the header row, per the
	   approved brief, instead of hugging the trigger button's own edge.
	   Nothing here touches the shared .mega-menu--wide/.mega-menu__columns
	   rules above, which the other wide panel ("דוכני אוכל לאירועים")
	   still uses untouched. */
	#mega-menu-2507.mega-menu--wide {
		position: fixed;
		top: calc(var(--header-height-desktop) + 16px);
		left: 50%;
		right: auto;
		margin-top: 0;
		transform: translateX(-50%);
		width: min(96vw, var(--container-max));
		max-width: min(96vw, var(--container-max));
		padding: 26px;
		max-height: calc(100vh - var(--header-height-desktop) - 32px);
	}

	.site-header.is-sticky #mega-menu-2507.mega-menu--wide {
		top: calc(var(--header-height-sticky) + 12px);
		max-height: calc(100vh - var(--header-height-sticky) - 24px);
	}

	#mega-menu-2507 .mega-menu__inner {
		display: flex;
		align-items: stretch;
		gap: var(--space-lg);
		width: 100%;
		max-width: none;
		margin-inline: 0;
	}

	#mega-menu-2507 .mega-menu__columns {
		flex: 1 1 auto;
		grid-template-columns: repeat(3, 1fr);
		gap: var(--space-md);
		align-content: start;
	}

	#mega-menu-2507 .mega-menu__cta {
		flex: 0 0 280px;
		width: 280px;
		margin-top: 0;
	}

	#mega-menu-2507 .mega-menu__callout-image {
		aspect-ratio: auto;
		height: 156px;
		border-radius: 0;
	}

	.primary-nav__backdrop {
		display: none;
	}

	html.basarela-nav-open {
		overflow: visible;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header,
	.primary-nav,
	.primary-nav__chevron,
	.primary-nav__link::after,
	.primary-nav__mega-trigger::after,
	.site-header__menu-toggle svg {
		transition: none !important;
	}

	.site-header__menu-toggle[aria-expanded="true"] svg {
		animation: none !important;
	}
}
