/* Allow dropdown to extend past Elementor columns/sections (common clipping issue). */
.elementor-widget-luxury_jewelry_mega_menu,
.elementor-widget-luxury_jewelry_mega_menu .elementor-widget-container,
.elementor-column:has( .luxury-mega-menu ),
.elementor-column:has( .luxury-mega-menu-root ),
.elementor-section:has( .luxury-mega-menu ),
.elementor-section:has( .luxury-mega-menu-root ) {
	overflow: visible !important;
}

.luxury-mega-menu-root {
	position: relative;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	overflow: visible;
	z-index: 1;
}

/*
 * Three-column grid: [ slot / cart ][ menu ][ empty balance ].
 * direction:ltr on the bar so column 1 is always physical left (works on RTL Hebrew sites).
 * Explicit grid-column on slot + nav works for both DOM orders (slot before/after in PHP).
 */
.luxury-mega-menu__bar {
	direction: ltr;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	gap: 24px;
}

.luxury-mega-menu__header-slot {
	grid-column: 1;
	grid-row: 1;
	justify-self: start;
	min-width: 0;
	max-width: min(520px, 42vw);
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
}

.luxury-mega-menu__bar > .luxury-mega-menu {
	grid-column: 2;
	grid-row: 1;
	justify-self: center;
	min-width: 0;
	max-width: 100%;
	width: auto;
	z-index: 1;
}

/* Stack for Elementor nested drop target + hint text (does not cover the drop zone). */
.luxury-mega-menu__builder-slot-stack {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	max-width: 100%;
}

/* Where Nested Elements attaches the child container in the editor (see get_default_children_placeholder_selector). */
.luxury-mega-menu__nested-children {
	flex: 0 1 auto;
	min-width: 0;
	min-height: 36px;
	max-width: 100%;
}

/* Elementor nested container defaults to full row width; clamp it to the slot so it stays beside the menu. */
.luxury-mega-menu__nested-children > .e-con,
.luxury-mega-menu__header-slot .e-con {
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
}

.elementor-editor-active .luxury-mega-menu__nested-children:empty {
	min-height: 56px;
	min-width: 120px;
	border: 1px dashed #c5c5c5;
	border-radius: 4px;
	background: #fafafa;
	box-sizing: border-box;
}

.luxury-mega-menu__slot-hint {
	margin: 0;
	font-size: 11px;
	line-height: 1.35;
	color: #888;
	max-width: 280px;
}

.luxury-mega-menu__header-slot > .elementor,
.luxury-mega-menu__header-slot .elementor-element {
	max-width: 100%;
}

/* Built-in custom cart beside mega menu (see luxury_custom_cart slot source). */
.luxury-mega-menu__embedded-cart {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	flex: 0 0 auto;
	min-width: 0;
	max-width: 100%;
}

.luxury-mega-menu__embedded-cart .luxury-custom-cart {
	flex-shrink: 0;
}

.luxury-mega-menu__slot-placeholder {
	padding: 8px 12px;
	font-size: 12px;
	line-height: 1.4;
	color: #666;
	border: 1px dashed #c5c5c5;
	border-radius: 4px;
	max-width: 240px;
	background: #fafafa;
}

.luxury-mega-menu {
	position: relative;
	width: 100%;
	direction: ltr;
	overflow: visible;
	z-index: 1;
}

.luxury-mega-menu__top-list {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.luxury-mega-menu__top-item {
	position: relative;
	overflow: visible;
}

/*
 * Invisible full-width hover bridge (desktop, while .is-open only).
 * A permanent 100vw-wide absolute strip overflows the page horizontally; we use fixed + inset 0
 * and --luxury-mega-bridge-top from JS so the strip matches the viewport width without vw scroll.
 */
.luxury-mega-menu__top-item:has( .luxury-mega-menu__panel )::before {
	content: '';
	display: none;
}

.luxury-mega-menu__top-item.is-open:has( .luxury-mega-menu__panel )::before {
	display: block;
	position: fixed;
	left: 0;
	right: 0;
	width: auto;
	height: 24px;
	top: var(--luxury-mega-bridge-top, 0px);
	z-index: 999998;
	pointer-events: auto;
}

.luxury-mega-menu__top-link {
	display: inline-block;
	padding: 12px 0;
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #111111;
	text-decoration: none;
}

/*
 * Fixed to the viewport so the mega panel is always full window width (absolute+100vw gets clipped
 * or mis-centered when the menu lives in a narrow column or transformed header).
 * Vertical `top` is set from JS to the bottom of the nav bar.
 */
.luxury-mega-menu__panel {
	position: fixed;
	left: 0;
	right: 0;
	width: auto;
	max-width: none;
	top: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 38px 24px 26px;
	background: #ffffff;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform-origin: 50% 0;
	/* Duration overridden by Elementor control "Effect duration". */
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
	z-index: 999999;
}

.luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* --- Open effects (selected via data-panel-effect on nav) --- */

.luxury-mega-menu:not([data-panel-effect]) .luxury-mega-menu__panel,
.luxury-mega-menu[data-panel-effect="fade_slide"] .luxury-mega-menu__panel {
	transform: translateY(12px);
}

.luxury-mega-menu:not([data-panel-effect]) .luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel,
.luxury-mega-menu[data-panel-effect="fade_slide"] .luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel {
	transform: translateY(0);
}

.luxury-mega-menu[data-panel-effect="fade"] .luxury-mega-menu__panel {
	transform: translateY(0);
}

.luxury-mega-menu[data-panel-effect="fade"] .luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel {
	transform: translateY(0);
}

.luxury-mega-menu[data-panel-effect="slide_down"] .luxury-mega-menu__panel {
	transform: translateY(36px);
}

.luxury-mega-menu[data-panel-effect="slide_down"] .luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel {
	transform: translateY(0);
}

.luxury-mega-menu[data-panel-effect="slide_up"] .luxury-mega-menu__panel {
	transform: translateY(-24px);
}

.luxury-mega-menu[data-panel-effect="slide_up"] .luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel {
	transform: translateY(0);
}

/* Horizontal motion (no viewport centering — panel is full-bleed fixed). */
.luxury-mega-menu[data-panel-effect="slide_from_right"] .luxury-mega-menu__panel {
	transform: translateX(48px) translateY(0);
}

.luxury-mega-menu[data-panel-effect="slide_from_right"] .luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel {
	transform: translateX(0) translateY(0);
}

.luxury-mega-menu[data-panel-effect="slide_from_left"] .luxury-mega-menu__panel {
	transform: translateX(-48px) translateY(0);
}

.luxury-mega-menu[data-panel-effect="slide_from_left"] .luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel {
	transform: translateX(0) translateY(0);
}

.luxury-mega-menu[data-panel-effect="zoom_in"] .luxury-mega-menu__panel {
	transform: translateY(10px) scale(0.94);
}

.luxury-mega-menu[data-panel-effect="zoom_in"] .luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel {
	transform: translateY(0) scale(1);
}

.luxury-mega-menu[data-panel-effect="none"] .luxury-mega-menu__panel {
	transition: none !important;
	transform: translateY(0);
}

.luxury-mega-menu[data-panel-effect="none"] .luxury-mega-menu__top-item.is-open .luxury-mega-menu__panel {
	transform: translateY(0);
}

.luxury-mega-menu__panel-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 26px;
	align-items: start;
}

.luxury-mega-menu__columns {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 28px;
	align-items: flex-start;
	align-self: start;
	min-width: 0;
	width: 100%;
}

.luxury-mega-menu__columns--flat {
	flex: 1;
	min-width: 0;
}

.luxury-mega-menu__column--flat {
	flex: 1 1 220px;
	min-width: 160px;
	max-width: 100%;
}

.luxury-mega-menu__column--flat .luxury-mega-menu__sub-list {
	column-count: 2;
	column-gap: 32px;
}

.luxury-mega-menu__column--flat .luxury-mega-menu__sub-list li {
	break-inside: avoid;
}

@media (max-width: 1200px) {
	.luxury-mega-menu__column--flat .luxury-mega-menu__sub-list {
		column-count: 1;
	}
}

.luxury-mega-menu__column {
	min-width: 140px;
}

.luxury-mega-menu__column-title,
.luxury-mega-menu__sub-link {
	display: inline-block;
	font-size: 12px;
	line-height: 1.6;
	color: #111111;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.luxury-mega-menu__column-title {
	margin-bottom: 9px;
	font-weight: 500;
}

.luxury-mega-menu__sub-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.luxury-mega-menu__sub-list li {
	margin: 0 0 5px;
}

.luxury-mega-menu__column-title:hover {
	text-decoration: underline;
}

.luxury-mega-menu__sub-link:hover,
.luxury-mega-menu__sub-link.is-active,
.luxury-mega-menu__sub-link.is-current {
	border-bottom-color: #111111;
}

/* Sidebar image: fixed viewport so tall/large assets never stretch the panel row */
.luxury-mega-menu__media {
	display: flex;
	flex-direction: column;
	align-self: start;
	width: 100%;
	min-width: 0;
	gap: 8px;
}

.luxury-mega-menu__media-link {
	display: block;
	flex: 0 0 auto;
	height: 240px;
	overflow: hidden;
	line-height: 0;
}

.luxury-mega-menu__media > .luxury-mega-menu__media-image {
	flex: 0 0 auto;
	display: block;
	width: 100%;
	height: 240px;
	object-fit: cover;
	object-position: center;
}

.luxury-mega-menu__media-link .luxury-mega-menu__media-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}

.luxury-mega-menu__media-caption {
	flex: 0 0 auto;
	margin: 0;
	font-size: 13px;
	line-height: 1.35;
	color: #111111;
}

.luxury-mega-menu__image-map {
	display: none;
}

.luxury-mega-menu__empty {
	padding: 12px;
	background: #fafafa;
	border: 1px dashed #d8d8d8;
}

/* —— Mobile: hamburger + vertical list + accordion (WordPress-style) —— */

.luxury-mega-menu__mobile-bar {
	display: none;
}

.luxury-mega-menu__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.luxury-mega-menu__toggle {
	box-sizing: border-box;
	font: inherit;
	color: inherit;
}

.luxury-mega-menu__toggle-bars,
.luxury-mega-menu__toggle-bars::before,
.luxury-mega-menu__toggle-bars::after {
	display: block;
	background: currentColor;
	border-radius: 1px;
}

body.luxury-mega-menu--scroll-lock {
	overflow: hidden;
}

@media (max-width: 767px) {
	.luxury-mega-menu-root .luxury-mega-menu__bar {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.luxury-mega-menu-root .luxury-mega-menu__bar > .luxury-mega-menu {
		width: 100%;
		min-width: 0;
		order: 2;
	}

	.luxury-mega-menu {
		flex-direction: column;
		align-items: stretch;
	}

	.luxury-mega-menu__mobile-bar {
		display: flex;
		justify-content: flex-end;
		width: 100%;
	}

	.luxury-mega-menu__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: 1px solid rgba(17, 17, 17, 0.2);
		border-radius: 4px;
		background: #ffffff;
		color: #111111;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.luxury-mega-menu__toggle-bars {
		position: relative;
		width: 22px;
		height: 2px;
	}

	.luxury-mega-menu__toggle-bars::before,
	.luxury-mega-menu__toggle-bars::after {
		content: '';
		position: absolute;
		left: 0;
		width: 22px;
		height: 2px;
	}

	.luxury-mega-menu__toggle-bars::before {
		top: -7px;
	}

	.luxury-mega-menu__toggle-bars::after {
		top: 7px;
	}

	.luxury-mega-menu.is-mobile-open .luxury-mega-menu__toggle-bars {
		background: transparent;
	}

	.luxury-mega-menu.is-mobile-open .luxury-mega-menu__toggle-bars::before {
		top: 0;
		transform: rotate(45deg);
	}

	.luxury-mega-menu.is-mobile-open .luxury-mega-menu__toggle-bars::after {
		top: 0;
		transform: rotate(-45deg);
	}

	.luxury-mega-menu__top-list {
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
		padding: 4px 0 0;
		margin: 0;
	}

	.luxury-mega-menu.is-mobile-open .luxury-mega-menu__top-list {
		display: flex;
	}

	.luxury-mega-menu__top-item {
		width: 100%;
		border-bottom: 1px solid rgba(17, 17, 17, 0.1);
	}

	.luxury-mega-menu__top-link {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 14px 6px 14px 2px;
		box-sizing: border-box;
		gap: 10px;
		text-align: start;
	}

	.luxury-mega-menu__top-item:has(.luxury-mega-menu__panel) .luxury-mega-menu__top-link::after {
		content: '';
		width: 0.45em;
		height: 0.45em;
		flex-shrink: 0;
		border-inline-end: 2px solid currentColor;
		border-block-end: 2px solid currentColor;
		transform: rotate(-45deg);
		margin-inline-end: 6px;
		opacity: 0.65;
		transition: transform 0.2s ease;
	}

	.luxury-mega-menu__top-item.is-sub-open .luxury-mega-menu__top-link::after {
		transform: rotate(45deg);
	}

	.luxury-mega-menu__top-item:has(.luxury-mega-menu__panel)::before {
		display: none !important;
	}

	.luxury-mega-menu__panel {
		position: static !important;
		top: auto !important;
		left: auto !important;
		right: auto !important;
		width: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 0 16px 12px !important;
		opacity: 1 !important;
		visibility: visible !important;
		transform: none !important;
		transition: none !important;
		box-shadow: none !important;
		background: rgba(255, 255, 255, 0.96) !important;
		display: none !important;
		pointer-events: auto !important;
		z-index: auto !important;
	}

	.luxury-mega-menu__top-item.is-sub-open .luxury-mega-menu__panel {
		display: block !important;
	}

	.luxury-mega-menu__panel-inner {
		display: block !important;
		grid-template-columns: 1fr !important;
		gap: 12px !important;
	}

	.luxury-mega-menu__media {
		display: none !important;
	}

	.luxury-mega-menu__columns {
		flex-direction: column;
		gap: 16px;
	}

	.luxury-mega-menu__column--flat .luxury-mega-menu__sub-list {
		column-count: 1 !important;
	}

	.luxury-mega-menu__sub-link,
	.luxury-mega-menu__column-title {
		padding: 6px 0;
	}
}
