/*
 * "Magazin" mega menu (desktop header only, ≥1000px).
 * Menu item classes: .gr-mega-shop (Magazin), .gr-mega-col (column showing the content block).
 */

/* ---------- Blocksy dropdown shell ---------- */
/* Floating card a little below the header */
[data-id="menu"] .gr-mega-shop > .sub-menu {
	margin-top: 14px !important;
	padding: 0 !important;
	background: #fff !important;
	border: 1px solid rgba(12, 102, 65, 0.1) !important;
	border-radius: 24px !important;
	box-shadow: 0 30px 70px -24px rgba(4, 61, 37, 0.35), 0 6px 18px -8px rgba(4, 61, 37, 0.12) !important;
}

/* Blocksy paints the dropdown colour on ::after – reuse it as an invisible
   hover bridge across the gap, so the menu stays open while moving the mouse. */
[data-id="menu"] .gr-mega-shop > .sub-menu::after {
	content: '' !important;
	display: block !important;
	position: absolute !important;
	top: -16px !important;
	right: 0 !important;
	bottom: auto !important;
	left: 0 !important;
	height: 16px !important;
	background: transparent !important;
	box-shadow: none !important;
	opacity: 1 !important;
}

[data-id="menu"] .gr-mega-shop > .sub-menu > li {
	padding: 0 !important;
	border: 0 !important;
}

/* The column item only carries the content block: hide its own link and sub-items. */
[data-id="menu"] .gr-mega-col > a,
[data-id="menu"] .gr-mega-col > .ct-menu-link,
[data-id="menu"] .gr-mega-col > .sub-menu {
	display: none !important;
}

[data-id="menu"] .gr-mega-col .entry-content,
[data-id="menu"] .gr-mega-col .ct-mega-menu-custom-content {
	margin: 0;
	padding: 0;
}

/* ---------- "Magazin" top-level item: pill with tree icon (desktop) ---------- */
[data-device="desktop"] [data-id="menu"] .gr-mega-shop > .ct-menu-link {
	--gr-pill-bg: #eaf4ee;
	position: relative;
	gap: 8px;
	height: auto !important;
	margin-block: auto;
	padding: 9px 14px 9px 12px !important;
	border-radius: 999px;
	background: var(--gr-pill-bg);
	color: var(--theme-palette-color-1, #0c6641) !important;
	transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

[data-device="desktop"] [data-id="menu"] .gr-mega-shop > .ct-menu-link::before {
	content: '';
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.6 15A3.6 3.6 0 0 1 6 8.3a4.6 4.6 0 0 1 8.8-2.5 3.9 3.9 0 0 1 3.4 6.4A3 3 0 0 1 16 15Z'/%3E%3Cpath d='M12 21v-8M12 15.5l-2.4-2.2M12 14.2l2.6-2.4M8.5 21h7'/%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='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.6 15A3.6 3.6 0 0 1 6 8.3a4.6 4.6 0 0 1 8.8-2.5 3.9 3.9 0 0 1 3.4 6.4A3 3 0 0 1 16 15Z'/%3E%3Cpath d='M12 21v-8M12 15.5l-2.4-2.2M12 14.2l2.6-2.4M8.5 21h7'/%3E%3C/svg%3E") center / contain no-repeat;
	transform-origin: 50% 100%;
	/* Blocksy uses ::before for its hover indicator – reset it into an inline icon */
	position: static !important;
	inset: auto !important;
	display: block !important;
	opacity: 1 !important;
	visibility: visible !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

[data-device="desktop"] [data-id="menu"] .gr-mega-shop:is(:hover, :focus-within, .ct-active) > .ct-menu-link {
	background: var(--theme-palette-color-1, #0c6641);
	color: #fff !important;
	box-shadow: 0 8px 20px -8px rgba(4, 61, 37, 0.55);
}

[data-device="desktop"] [data-id="menu"] .gr-mega-shop:is(:hover, :focus-within) > .ct-menu-link::before {
	animation: gr-sway 1.4s ease-in-out infinite;
}

[data-device="desktop"] [data-id="menu"] .gr-mega-shop > .ct-menu-link .ct-toggle-dropdown-desktop {
	margin-left: 2px;
	color: inherit;
	transition: transform 0.25s ease;
}

[data-device="desktop"] [data-id="menu"] .gr-mega-shop > .ct-menu-link .ct-toggle-dropdown-desktop svg {
	fill: currentColor;
}

[data-device="desktop"] [data-id="menu"] .gr-mega-shop:is(:hover, :focus-within) > .ct-menu-link .ct-toggle-dropdown-desktop {
	transform: rotate(180deg);
}

/* ---------- Panel ---------- */
.gr-mega {
	--gr-green: var(--theme-palette-color-1, #0c6641);
	--gr-dark: var(--theme-palette-color-2, #043d25);
	--gr-mint: #eaf4ee;
	--gr-ink: #10231a;
	--gr-muted: #5d6e66;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 380px;
	gap: 36px;
	width: min(var(--theme-container-width, 1290px), 100%);
	margin: 0 auto;
	padding: 28px 32px 32px;
	color: var(--gr-ink);
	font-size: 15px;
	line-height: 1.35;
	text-align: left;
	white-space: normal;
}

.gr-mega a {
	color: inherit !important;
	text-decoration: none !important;
}

/* Head */
.gr-mega__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.gr-mega__title {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 20px;
	font-weight: 700;
	color: var(--gr-ink) !important;
}

.gr-mega__title:hover {
	color: var(--gr-green) !important;
}

.gr-mega__badge {
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--gr-mint);
	color: var(--gr-green);
	font-size: 12px;
	font-weight: 700;
}

.gr-mega__all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 700;
	color: var(--gr-green) !important;
}

.gr-mega__all:hover .gr-mega__arrow {
	transform: translateX(4px);
}

/* Grid of categories */
.gr-mega__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gr-mega__grid > li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gr-mega__tile,
.gr-mega__gift {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-radius: 16px;
	transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.gr-mega__tile:hover,
.gr-mega__tile:focus-visible,
.gr-mega__tile.is-active {
	background: var(--gr-mint);
	border-color: rgba(12, 102, 65, 0.14);
}

.gr-mega__tile:focus-visible,
.gr-mega__gift:focus-visible {
	outline: 3px solid rgba(135, 189, 166, 0.9);
	outline-offset: 2px;
}

.gr-mega__icon {
	display: flex;
	flex: 0 0 48px;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--gr-mint);
	color: var(--gr-green);
	transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.gr-mega__tile:hover .gr-mega__icon,
.gr-mega__tile:focus-visible .gr-mega__icon,
.gr-mega__tile.is-active .gr-mega__icon {
	background: var(--gr-green);
	color: #fff;
}

.gr-mega__txt {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.gr-mega__name {
	font-size: 15px;
	font-weight: 700;
	color: var(--gr-ink);
}

.gr-mega__count {
	margin-top: 2px;
	font-size: 12.5px;
	color: var(--gr-muted);
}

.gr-mega__arrow {
	flex: 0 0 auto;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.gr-mega__tile .gr-mega__arrow,
.gr-mega__gift .gr-mega__arrow {
	margin-left: auto;
	color: var(--gr-green);
	opacity: 0;
	transform: translateX(-6px);
}

.gr-mega__tile:hover .gr-mega__arrow,
.gr-mega__tile:focus-visible .gr-mega__arrow,
.gr-mega__tile.is-active .gr-mega__arrow,
.gr-mega__gift:hover .gr-mega__arrow {
	opacity: 1;
	transform: none;
}

/* Gift card strip */
.gr-mega__gift {
	margin-top: 16px;
	padding: 12px 16px;
	border: 1px dashed rgba(12, 102, 65, 0.35);
	background: linear-gradient(90deg, #f3f9f5 0%, #fff 100%);
}

.gr-mega__gift:hover {
	border-style: solid;
	background: var(--gr-mint);
}

/* ---------- Preview (right) ---------- */
.gr-mega__preview {
	position: relative;
	min-height: 430px;
}

.gr-mega__card {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.gr-mega__card.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* Framed photo: thin green border + white mat */
.gr-mega__media {
	position: relative;
	flex: 1 1 0;
	min-height: 220px;
	overflow: hidden;
	border: 1px solid rgba(12, 102, 65, 0.22);
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 12px 28px -18px rgba(4, 61, 37, 0.45);
}

.gr-mega__media img {
	position: absolute;
	inset: 6px;
	width: calc(100% - 12px);
	height: calc(100% - 12px);
	max-width: none;
	border-radius: 15px;
}

/* Product count badge on the photo */
.gr-mega__chip {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
	padding: 5px 11px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--gr-green);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	box-shadow: 0 4px 12px -4px rgba(4, 61, 37, 0.35);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

/* Soft blurred fill behind the photo */
.gr-mega__media .gr-mega__bg {
	object-fit: cover;
	filter: blur(18px) saturate(1.1);
	opacity: 0.55;
	transform: scale(1.25);
}

/* The whole photo, never cropped */
.gr-mega__media .gr-mega__fg {
	padding: 10px;
	object-fit: contain;
	transform: scale(0.97);
	transition: transform 1.2s ease;
	filter: drop-shadow(0 10px 18px rgba(4, 61, 37, 0.18));
}

.gr-mega__card.is-active .gr-mega__media .gr-mega__fg {
	transform: scale(1);
}

.gr-mega__body {
	padding: 16px 4px 0;
}

.gr-mega__pname {
	display: block;
	margin-top: 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--gr-ink);
}

.gr-mega__pdesc {
	margin: 6px 0 14px;
	color: var(--gr-muted);
	font-size: 14px;
	line-height: 1.5;
}

.gr-mega .gr-mega__btn,
.gr-mega .gr-mega__btn:hover {
	color: #fff !important;
}

.gr-mega__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--gr-green);
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	transition: background 0.25s ease;
}

.gr-mega__btn:hover {
	background: var(--gr-dark);
}

.gr-mega__btn:hover .gr-mega__arrow {
	transform: translateX(4px);
}

/* ---------- Entrance: tiles rise in when the dropdown opens ---------- */
@keyframes gr-mega-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

[data-id="menu"] .gr-mega-shop:hover .gr-mega__grid > li,
[data-id="menu"] .gr-mega-shop:focus-within .gr-mega__grid > li {
	animation: gr-mega-rise 0.4s ease both;
	animation-delay: calc(var(--i, 0) * 35ms);
}

/* ---------- Icon animations (on hover / keyboard focus) ---------- */
.gr-mega__icon svg * {
	transform-box: fill-box;
}

.gr-a-sway, .gr-a-wave { transform-origin: 50% 100%; }
.gr-a-pop, .gr-a-bloom, .gr-a-spin, .gr-a-pulse, .gr-a-twinkle { transform-origin: 50% 50%; }
.gr-a-lift { transform-origin: 0% 100%; }
.gr-a-draw { stroke-dasharray: 26; }

@keyframes gr-sway { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@keyframes gr-pop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes gr-bloom { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(36deg) scale(1.12); } 100% { transform: rotate(72deg) scale(1); } }
@keyframes gr-spin { to { transform: rotate(360deg); } }
@keyframes gr-wave { 0%, 100% { transform: skewX(0); } 30% { transform: skewX(-9deg); } 70% { transform: skewX(9deg); } }
@keyframes gr-draw { from { stroke-dashoffset: 26; } to { stroke-dashoffset: 0; } }
@keyframes gr-twinkle { 0%, 100% { opacity: 1; transform: scale(1) rotate(0); } 50% { opacity: 0.3; transform: scale(0.6) rotate(45deg); } }
@keyframes gr-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes gr-lift { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2.5px) rotate(-7deg); } }

:is(.gr-mega__tile, .gr-mega__gift):is(:hover, :focus-visible) .gr-a-sway { animation: gr-sway 1.4s ease-in-out infinite; }
:is(.gr-mega__tile, .gr-mega__gift):is(:hover, :focus-visible) .gr-a-pop { animation: gr-pop 1.1s ease-in-out infinite; }
:is(.gr-mega__tile, .gr-mega__gift):is(:hover, :focus-visible) .gr-a-bloom { animation: gr-bloom 1.6s ease-in-out infinite; }
:is(.gr-mega__tile, .gr-mega__gift):is(:hover, :focus-visible) .gr-a-spin { animation: gr-spin 2.4s linear infinite; }
:is(.gr-mega__tile, .gr-mega__gift):is(:hover, :focus-visible) .gr-a-wave { animation: gr-wave 1.3s ease-in-out infinite; }
:is(.gr-mega__tile, .gr-mega__gift):is(:hover, :focus-visible) .gr-a-draw { animation: gr-draw 1.2s ease-out both; }
:is(.gr-mega__tile, .gr-mega__gift):is(:hover, :focus-visible) .gr-a-twinkle { animation: gr-twinkle 1s ease-in-out infinite; }
:is(.gr-mega__tile, .gr-mega__gift):is(:hover, :focus-visible) .gr-a-pulse { animation: gr-pulse 1.2s ease-in-out infinite; }
:is(.gr-mega__tile, .gr-mega__gift):is(:hover, :focus-visible) .gr-a-lift { animation: gr-lift 1.1s ease-in-out infinite; }

/* ---------- Smaller desktops ---------- */
@media (max-width: 1199.98px) {
	.gr-mega {
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 24px;
		padding: 22px 24px 26px;
	}

	.gr-mega__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.gr-mega *,
	[data-id="menu"] .gr-mega-shop .gr-mega__grid > li {
		animation: none !important;
		transition: none !important;
	}
}

/* Left column fills the card height: Gift Card strip aligns with the bottom of the preview */
.gr-mega__main {
	display: flex;
	flex-direction: column;
}

.gr-mega__grid {
	flex: 1 1 auto;
	align-content: space-evenly;
	margin-bottom: 16px;
}

.gr-mega__main > .gr-mega__gift {
	margin-top: auto;
}
