/* ==========================================================================
   N14 Megamenu
   Font, size, weight, spacing and colors of the menu come from the block
   settings (sidebar > Stile) or Aspetto > Editor > Stili > Blocchi.
   Smartphone < 768px · Tablet 768-1023px · Desktop >= 1024px
   ========================================================================== */

.n14-mega__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.n14-mega__item {
	margin: 0;
}
.n14-mega__row {
	display: flex;
	align-items: center;
	gap: 0.125rem;
}
.n14-mega__link {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: inherit;
	text-decoration: none;
}
:where(a.n14-mega__link:hover) {
	color: var(--wp--preset--color--rose);
}
.n14-mega__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}
.n14-mega__toggle svg {
	transition: transform 0.2s ease;
}
.n14-mega__thumb,
.n14-mega__burger,
.n14-mega__drawer-head {
	display: none;
}
.n14-mega__overlay[hidden] {
	display: none;
}

/* Panel content is made of normal blocks: it does not inherit the menu's uppercase style. */
.n14-mega__panel {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}
:where(.n14-mega__panel .wp-block-heading) {
	margin: 0 0 0.875rem;
}
:where(.n14-mega__links) {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.5rem;
}
:where(.n14-mega__links a) {
	color: inherit;
}
.n14-mega__links a {
	text-decoration: none;
}
:where(.n14-mega__links a:hover) {
	color: var(--wp--preset--color--rose);
}
:where(.n14-mega__promo) {
	padding: 2rem;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 260px;
}

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
	.n14-mega__drawer {
		display: block;
	}
	.n14-mega__list {
		display: flex;
		justify-content: center;
		flex-wrap: nowrap;
		column-gap: clamp(0.75rem, 1.6vw, 2rem);
		white-space: nowrap;
	}
	.n14-mega__link {
		padding: 0.875rem 0;
		border-bottom: 1px solid transparent;
	}
	.n14-mega__item.is-open > .n14-mega__row .n14-mega__link,
	.n14-mega__link[aria-current="page"] {
		border-bottom-color: currentColor;
	}
	.n14-mega__toggle {
		width: 24px;
		height: 44px;
	}
	.n14-mega__item.is-open .n14-mega__toggle svg {
		transform: rotate(180deg);
	}
	.n14-mega__panel {
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		z-index: 50;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-6px);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	}
	:where(.n14-mega__panel) {
		background: var(--wp--preset--color--surface);
		color: var(--wp--preset--color--ink);
		border-top: 1px solid var(--wp--preset--color--line);
		box-shadow: 0 30px 40px -30px rgba(28, 24, 24, 0.28);
	}
	.n14-mega__item.is-open > .n14-mega__panel,
	.n14-mega:not(.is-js) .n14-mega__item:hover > .n14-mega__panel,
	.n14-mega:not(.is-js) .n14-mega__item:focus-within > .n14-mega__panel {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition-delay: 0s;
	}
	.n14-mega__panel-inner {
		max-width: var(--wp--style--global--wide-size, 1440px);
		margin: 0 auto;
		padding: clamp(1.5rem, 2.5vw, 2.5rem) clamp(1rem, 4vw, 3rem);
	}
	.n14-mega__panel .wp-block-columns {
		margin: 0;
		gap: 0;
	}
	.n14-mega__panel .wp-block-columns > .wp-block-column {
		padding: 0 1.75rem;
	}
	.n14-mega__panel .wp-block-columns > .wp-block-column:first-child {
		padding-left: 0;
	}
	.n14-mega__panel .wp-block-columns > .wp-block-column:last-child {
		padding-right: 0;
	}
	:where(.n14-mega__panel .wp-block-columns > .wp-block-column + .wp-block-column:not(.n14-mega__promo-col)) {
		border-left: 1px solid var(--wp--preset--color--line);
	}
	.n14-mega__panel .wp-block-columns > .n14-mega__promo-col {
		flex: 0 0 clamp(220px, 20vw, 300px);
	}
	.n14-mega__panel .wp-block-image img {
		width: 100%;
		aspect-ratio: 4 / 3;
		object-fit: cover;
	}
}

/* ---------- Tablet + smartphone: drawer ---------- */
@media (max-width: 1023.98px) {
	.n14-mega__burger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		background: none;
		color: inherit;
		cursor: pointer;
	}
	.n14-mega__drawer {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 1000;
		width: min(420px, 88vw);
		display: flex;
		flex-direction: column;
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform 0.3s ease, visibility 0s linear 0.3s;
	}
	:where(.n14-mega__drawer) {
		background: var(--wp--preset--color--surface);
		color: var(--wp--preset--color--ink);
	}
	.is-drawer-open .n14-mega__drawer {
		transform: none;
		visibility: visible;
		transition-delay: 0s;
	}
	.n14-mega__overlay {
		position: fixed;
		inset: 0;
		z-index: 999;
		background: rgba(28, 24, 24, 0.4);
	}
	.n14-mega__drawer-head {
		display: flex;
		align-items: center;
		gap: 0.25rem;
		min-height: 60px;
		padding: 0.5rem;
	}
	:where(.n14-mega__drawer-head) {
		border-bottom: 1px solid var(--wp--preset--color--line);
	}
	.n14-mega__drawer-title {
		flex: 1;
		margin: 0;
		padding-left: 0.5rem;
		font-size: 1.5em;
	}
	:where(.n14-mega__drawer-title) {
		font-family: var(--wp--preset--font-family--display);
		font-weight: 400;
	}
	.n14-mega__back,
	.n14-mega__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		background: none;
		color: inherit;
		cursor: pointer;
	}
	.n14-mega__back[hidden] {
		display: none;
	}
	.n14-mega__nav {
		flex: 1;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}
	:where(.n14-mega__item) {
		border-bottom: 1px solid var(--wp--preset--color--line);
	}
	.n14-mega__row {
		justify-content: space-between;
		padding: 0 0.25rem 0 1rem;
	}
	.n14-mega__link {
		flex: 1;
		min-height: 56px;
		font-size: 1.3em;
	}
	:where(.n14-mega__link) {
		font-family: var(--wp--preset--font-family--display);
	}
	.n14-mega__thumb {
		display: block;
		width: 52px;
		height: 44px;
		object-fit: cover;
	}
	.n14-mega__toggle {
		width: 44px;
		height: 44px;
	}
	.n14-mega__toggle svg {
		transform: rotate(-90deg);
	}
	.n14-mega__panel {
		display: none;
	}
	.has-sub .n14-mega__item:not(.is-open) {
		display: none;
	}
	.has-sub .n14-mega__item.is-open {
		border-bottom: 0;
	}
	.has-sub .n14-mega__item.is-open > .n14-mega__row {
		display: none;
	}
	.has-sub .n14-mega__item.is-open > .n14-mega__panel {
		display: block;
		animation: n14-drawer-in 0.25s ease;
	}
	.n14-mega__panel-inner {
		padding: 1.25rem 1rem 2rem;
	}
	.n14-mega__panel .wp-block-columns {
		gap: 1.5rem;
	}
	.n14-mega__links a {
		display: block;
		padding: 0.375rem 0;
	}
}

@media (min-width: 768px) and (max-width: 1023.98px) {
	.n14-mega__drawer {
		width: min(760px, 92vw);
	}
	.n14-mega__panel .wp-block-columns {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2rem 1.5rem;
	}
	.n14-mega__panel .wp-block-columns > .n14-mega__promo-col {
		grid-column: 1 / -1;
	}
	.n14-mega__promo {
		min-height: 0;
	}
}

@keyframes n14-drawer-in {
	from {
		opacity: 0;
		transform: translateX(24px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- Editor ---------- */
.n14-me {
	position: relative;
}
.n14-me__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.5rem 1.5rem;
}
.n14-me__label {
	display: inline-block;
	padding: 0.75rem 0;
}
.n14-me__item.is-open .n14-me__label {
	border-bottom: 1px solid currentColor;
}
.n14-me__panel {
	position: absolute;
	top: 100%;
	left: 50%;
	z-index: 30;
	width: min(1280px, 94vw);
	transform: translateX(-50%);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: 0 30px 40px -30px rgba(28, 24, 24, 0.28);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}
.n14-me__panel.is-collapsed {
	display: none;
}
.n14-me__panel-inner {
	padding: 2rem;
}

/* ---------- Panels generated from Aspetto > Menu ---------- */
.n14-mega__grid {
	display: flex;
	gap: 0;
}
.n14-mega__col {
	flex: 1 1 0;
	min-width: 0;
	max-width: 300px;
	padding: 0 1.75rem;
}
.n14-mega__col:first-child {
	padding-left: 0;
}
.n14-mega__col:last-child {
	padding-right: 0;
}
:where(.n14-mega__col + .n14-mega__col:not(.n14-mega__promo-col)) {
	border-left: 1px solid var(--wp--preset--color--line);
}
.n14-mega__grid > .n14-mega__promo-col {
	flex: 0 0 clamp(220px, 22vw, 320px);
	max-width: none;
	margin-left: auto;
}
.n14-mega__col-media {
	display: block;
	margin-bottom: 1rem;
	overflow: hidden;
}
.n14-mega__col-img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.6s ease;
}
.n14-mega__col-media:hover .n14-mega__col-img {
	transform: scale(1.04);
}
.n14-mega__heading {
	margin: 0 0 0.875rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.375rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.n14-mega__heading a {
	color: inherit;
	text-decoration: none;
}
@media (max-width: 1023.98px) {
	.n14-mega__grid {
		flex-direction: column;
		gap: 1.5rem;
	}
	.n14-mega__col {
		padding: 0;
		border: 0 !important;
	}
	.n14-mega__col-media,
	.n14-mega__grid > .n14-mega__promo-col {
		display: none;
	}
	.n14-mega__heading {
		margin-bottom: 0.5rem;
		font-size: 1.125rem;
	}
}
@media (min-width: 768px) and (max-width: 1023.98px) {
	.n14-mega__grid {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- Banner card in the mega panel ---------- */
.n14-mega__promo-card {
	padding: 0 !important;
	border: 0 !important;
}
.n14-mpromo {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	background: var(--wp--preset--color--blush);
	color: #fff;
	text-decoration: none;
}
.n14-mpromo__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	transition: transform 0.9s ease;
}
.n14-mpromo:hover .n14-mpromo__img {
	transform: scale(1.04);
}
.n14-mpromo__text {
	position: absolute;
	inset: auto 0 0 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.375rem;
	padding: 3rem 1.25rem 1.25rem;
	background: linear-gradient(0deg, rgba(28, 24, 24, 0.62), rgba(28, 24, 24, 0));
}
.n14-mpromo__kicker {
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}
.n14-mpromo__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.625rem;
	line-height: 1.1;
}
.n14-mpromo__btn {
	margin-top: 0.25rem;
	padding-bottom: 2px;
	border-bottom: 1px solid currentColor;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* ---------- Highlighted item ("Crea la tua box") ---------- */
.n14-mega__item.is-highlight > .n14-mega__row > .n14-mega__link {
	color: var(--wp--preset--color--rose);
}
@media (min-width: 1024px) {
	.n14-mega__item.is-highlight > .n14-mega__row > .n14-mega__link span::before {
		content: "";
		display: inline-block;
		width: 6px;
		height: 6px;
		margin-right: 0.5rem;
		border-radius: 50%;
		background: currentColor;
		vertical-align: middle;
		transform: translateY(-1px);
	}
	.n14-mega__item.n14-only-mobile {
		display: none !important;
	}
	.n14-mega__item.is-highlight .n14-mega__thumb {
		display: none;
	}
}

/* ---------- Phone and tablet drawer ---------- */
@media (max-width: 1023.98px) {
	/* the banner is shown first in the submenu, as a horizontal card */
	.n14-mega__grid > .n14-mega__promo-card {
		display: block !important;
		order: -1;
		flex: none !important;
		width: 100%;
		max-width: none;
		margin: 0 0 0.5rem !important;
	}
	.n14-mpromo {
		display: grid;
		grid-template-columns: 96px 1fr;
		aspect-ratio: auto;
		min-height: 120px;
		background: var(--wp--preset--color--blush);
		color: var(--wp--preset--color--ink);
	}
	.n14-mpromo__img {
		position: static;
		height: 100% !important;
		min-height: 120px;
	}
	.n14-mpromo__text {
		position: static;
		justify-content: center;
		padding: 0.875rem 1rem;
		background: none;
	}
	.n14-mpromo__kicker {
		color: var(--wp--preset--color--rose);
	}
	.n14-mpromo__title {
		font-size: 1.25rem;
	}
	/* highlighted item: a bigger card with its picture */
	.n14-mega__item.is-highlight {
		margin: 0.75rem 1rem;
		border: 0 !important;
		background: var(--wp--preset--color--blush);
	}
	.n14-mega__item.is-highlight .n14-mega__row {
		padding: 0.5rem 0.75rem;
	}
	.n14-mega__item.is-highlight .n14-mega__thumb {
		width: 64px;
		height: 80px;
	}
	.n14-mega__item.n14-only-mobile .n14-mega__link,
	.n14-mega__item.n14-menu-secondary .n14-mega__link {
		font-family: var(--wp--preset--font-family--body);
		font-size: 0.9375rem;
		min-height: 48px;
	}
}

/* Chi siamo / Contatti: same row, lighter than the shop sections */
@media (min-width: 1024px) {
	.n14-mega__item.n14-menu-secondary > .n14-mega__row > .n14-mega__link {
		font-weight: 400;
		color: var(--wp--preset--color--muted);
	}
	.n14-mega__item.n14-menu-secondary > .n14-mega__row > .n14-mega__link:hover {
		color: var(--wp--preset--color--ink);
	}
}
/* Narrower computers: tighter spacing so all the items stay on one line */
@media (min-width: 1024px) and (max-width: 1379.98px) {
	.n14-mega__list {
		column-gap: 0.75rem !important;
	}
	.n14-mega__link {
		font-size: 0.6875rem !important;
		letter-spacing: 0.08em !important;
	}
	.n14-mega__toggle {
		width: 16px !important;
	}
	.n14-mega__item.is-highlight > .n14-mega__row > .n14-mega__link span::before {
		margin-right: 0.3rem;
	}
}
@media (min-width: 1024px) and (max-width: 1199.98px) {
	.n14-mega__list {
		column-gap: 0.5rem !important;
	}
	.n14-mega__link {
		font-size: 0.65rem !important;
		letter-spacing: 0.05em !important;
	}
	.n14-mega__toggle {
		width: 12px !important;
	}
}

/* "Crea la tua box" as a special button, Chi siamo / Contatti set apart (computer) */
@media (min-width: 1024px) {
	.n14-mega__item.is-highlight > .n14-mega__row > .n14-mega__link {
		align-self: center;
		padding: 0.5rem 0.875rem !important;
		border: 0 !important;
		border-radius: 999px;
		background: var(--wp--preset--color--rose);
		color: #fff !important;
		transition: background-color 0.2s ease, transform 0.2s ease;
	}
	.n14-mega__item.is-highlight > .n14-mega__row > .n14-mega__link:hover {
		background: var(--wp--preset--color--ink);
		transform: translateY(-1px);
	}
	.n14-mega__item.is-highlight > .n14-mega__row > .n14-mega__link span::before {
		display: none !important;
	}
	.n14-mega__item.is-highlight > .n14-mega__row > .n14-mega__link span::after {
		content: "";
		display: inline-block;
		width: 12px;
		height: 12px;
		margin-left: 0.5rem;
		vertical-align: -1px;
		background: currentColor;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12v9H4v-9M2 7h20v5H2zM12 21V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z'/%3E%3C/svg%3E") center / contain no-repeat;
		mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12v9H4v-9M2 7h20v5H2zM12 21V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z'/%3E%3C/svg%3E") center / contain no-repeat;
	}
	/* a thin divider and more space before the first secondary item */
	.n14-mega__item.is-highlight + .n14-mega__item.n14-menu-secondary,
	.n14-mega__item:not(.n14-menu-secondary) + .n14-mega__item.n14-menu-secondary {
		position: relative;
		margin-left: clamp(0.5rem, 1.4vw, 1.75rem);
		padding-left: clamp(0.75rem, 1.6vw, 2rem);
	}
	.n14-mega__item:not(.n14-menu-secondary) + .n14-mega__item.n14-menu-secondary::before {
		content: "";
		position: absolute;
		left: 0;
		top: 50%;
		width: 1px;
		height: 18px;
		background: var(--wp--preset--color--line);
		transform: translateY(-50%);
	}
	.n14-mega__item.n14-menu-secondary + .n14-mega__item.n14-menu-secondary {
		margin-left: clamp(0.5rem, 1vw, 1rem);
	}
}

@media (min-width: 1024px) and (max-width: 1199.98px) {
	.n14-mega__item.is-highlight > .n14-mega__row > .n14-mega__link {
		padding: 0.4rem 0.7rem !important;
	}
	.n14-mega__item.is-highlight > .n14-mega__row > .n14-mega__link span::after {
		display: none;
	}
	.n14-mega__item:not(.n14-menu-secondary) + .n14-mega__item.n14-menu-secondary {
		margin-left: 0.25rem;
		padding-left: 0.6rem;
	}
	.n14-mega__item.n14-menu-secondary + .n14-mega__item.n14-menu-secondary {
		margin-left: 0.5rem;
	}
}
@media (min-width: 1380px) and (max-width: 1599.98px) {
	.n14-mega__list {
		column-gap: 1.25rem !important;
	}
}

/* "Crea la tua box" always first, also in menus built by hand */
.n14-mega__item.is-highlight {
	order: -1;
}
@media (max-width: 1023.98px) {
	.n14-mega__drawer .n14-mega__list {
		display: flex;
		flex-direction: column;
	}
}

/* ---------- Panel layout: columns (choose how many) + banners (up to 3, left or right) ---------- */
@media (min-width: 1024px) {
	.n14-mega__grid {
		display: flex;
		align-items: flex-start;
		gap: clamp(1.5rem, 3vw, 3rem);
	}
	.n14-mega__grid.is-left {
		flex-direction: row-reverse;
	}
	.n14-mega__cols {
		flex: 1 1 auto;
		min-width: 0;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(170px, 280px));
		row-gap: 2rem;
	}
	.n14-mega__cols[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.n14-mega__cols[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.n14-mega__cols[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.n14-mega__cols[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.n14-mega__cols > .n14-mega__col {
		max-width: none;
		padding: 0 1.75rem;
		border-left: 1px solid var(--wp--preset--color--line);
	}
	/* first column of every row: no divider */
	.n14-mega__cols > .n14-mega__col:first-child,
	.n14-mega__cols[data-cols="2"] > .n14-mega__col:nth-child(2n+1),
	.n14-mega__cols[data-cols="3"] > .n14-mega__col:nth-child(3n+1),
	.n14-mega__cols[data-cols="4"] > .n14-mega__col:nth-child(4n+1),
	.n14-mega__cols[data-cols="5"] > .n14-mega__col:nth-child(5n+1) {
		padding-left: 0;
		border-left: 0;
	}
	.n14-mega__banners {
		display: flex;
		flex: 0 0 auto;
		gap: 1rem;
	}
	.n14-mega__banners .n14-mpromo {
		width: clamp(200px, 17vw, 280px);
	}
	.n14-mega__banners.is-narrow .n14-mpromo {
		width: clamp(160px, 12vw, 210px);
	}
	.n14-mega__banners.is-wide .n14-mpromo {
		width: clamp(260px, 24vw, 380px);
	}
	.n14-mega__pattern {
		width: clamp(220px, 22vw, 320px);
	}
}
@media (max-width: 1023.98px) {
	.n14-mega__grid,
	.n14-mega__grid.is-left {
		display: flex;
		flex-direction: column;
		gap: 1.5rem;
	}
	.n14-mega__banners {
		order: -1;
		display: flex;
		flex-direction: column;
		gap: 0.5rem;
	}
	.n14-mega__banners .n14-mpromo {
		width: 100%;
	}
	.n14-mega__pattern {
		display: none;
	}
	.n14-mega__cols {
		display: flex;
		flex-direction: column;
		gap: 1.5rem;
	}
	.n14-mega__cols > .n14-mega__col {
		max-width: none;
	}
}
@media (min-width: 768px) and (max-width: 1023.98px) {
	.n14-mega__cols {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
