/*
 * Category menu (includes/theme/inc/megamenu.php, behaviour assets/js/megamenu.js).
 *
 * Bar + shared panel in .wa-header__bottom-area (from 721px, header.css): .mm-nav, .mm-bar, .mm-item,
 * .mm-link(--season, .is-active), .mm-chev, .mm-panel(.is-open), .mm-panel__in, .mm-panes,
 * .mm-pane(.is-season, .is-active), .mm-panel__hit.
 * Off-canvas accordion (phones): .mm-mobile, .mm-acc, .mm-acc__sec(.is-open, .is-season), __head,
 * __body, __inner, __title, .mm-mobile__hit.
 * Shared: group card .mm-group(--panel|--mob), __head, __img, __title, __list; "Hit týždňa" card
 * .mm-hit(--panel|--mob), __img, __pct, __txt, __tag, __name, __prices, __cta (+ catalog card parts
 * from product-card(-parts).css).
 *
 * Purple gradient panel with white text; hover = underline, white ring around the group image.
 * The seasonal item (Black Friday) takes its colours from --mm-season-* (a season may override
 * them inline on .mm-nav / .mm-mobile). The hit card is orange (--nd-c-sale), its button green.
 */

.mm-nav,
.mm-mobile {
	--mm-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--mm-bg: radial-gradient(120% 90% at 100% 0%, rgba(98, 51, 133, 0.55) 0%, transparent 60%), linear-gradient(180deg, var(--primary-dark) 0%, #2e1740 60%, var(--primary-ultra-dark) 100%);
	--mm-season-bg: linear-gradient(160deg, #26262a 0%, #111113 45%, #000 100%);
	--mm-season-link-bg: linear-gradient(180deg, #2a2a2e 0%, #0b0b0d 100%);
	--mm-season-head-bg: #1a1a1e;
	--mm-season-border: #3c3c42;
	--mm-season-border-hover: rgba(255, 255, 255, 0.5);
	--mm-season-shadow: rgba(0, 0, 0, 0.6);
}

.mm-nav *,
.mm-mobile * {
	box-sizing: border-box;
}

.mm-nav a,
.mm-mobile a {
	color: inherit;
	text-decoration: none;
}

/* Same specificity as .mm-bar (which comes later and centres the bar). */
.mm-bar,
.mm-group__list,
.mm-item,
.mm-group__list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mm-mobile button {
	margin: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.mm-mobile button:hover,
.mm-mobile button:focus {
	background: transparent;
	color: inherit;
}

/* ================================================================ Bar */
.mm-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 4px;
	max-width: var(--nd-container);
	margin: 0 auto;
	padding: 0 var(--nd-gutter-sm);
}

.mm-link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 7px;
	height: 56px;
	padding: 0 14px;
	color: var(--white) !important;
	font-size: 16.5px;
	font-weight: 600;
	white-space: nowrap;
	transition: background 0.15s, color 0.15s;
}

.mm-link:hover {
	background: rgba(255, 255, 255, 0.1);
}

.mm-link.is-active {
	background: var(--primary-dark);
}

.mm-chev {
	flex: 0 0 auto;
	opacity: 0.75;
	transition: transform 0.2s var(--mm-ease);
}

.mm-link.is-active .mm-chev {
	transform: rotate(180deg);
}

.mm-link--season {
	font-weight: 800;
}

.mm-link--season.is-active {
	background: var(--mm-season-link-bg);
}

/* ================================================================ Shared panel */
.mm-panel {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 1000;
	max-height: calc(100vh - 170px);
	overflow-y: auto;
	overscroll-behavior: contain;
	visibility: hidden;
	opacity: 0;
	background: var(--mm-bg);
	color: var(--white);
	box-shadow: 0 30px 50px -20px rgba(20, 10, 30, 0.45);
	transition: opacity 0.18s var(--mm-ease), visibility 0s linear 0.22s;
}

.mm-panel.is-open {
	visibility: visible;
	opacity: 1;
	transition: opacity 0.18s var(--mm-ease), visibility 0s;
}

.mm-panel:has(.mm-pane.is-season.is-active) {
	background: var(--mm-season-bg);
	box-shadow: 0 30px 50px -20px var(--mm-season-shadow);
}

/* Groups on the left, the hit card in a column on the right (only while there is one). */
.mm-panel__in {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 14px;
	padding-top: 24px;
	padding-bottom: 28px;
}

.mm-panel__in:has(> .mm-panel__hit:not(:empty)) {
	grid-template-columns: minmax(0, 1fr) 248px;
}

.mm-panel__hit {
	display: flex;
}

.mm-panel__hit:empty {
	display: none;
}

/* All panes in one grid cell: the panel keeps one height, contents only cross-fade. */
.mm-panes {
	display: grid;
}

.mm-pane {
	display: grid;
	grid-area: 1 / 1;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-items: stretch;
	gap: 14px;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.16s ease, visibility 0s linear 0.16s;
}

.mm-pane.is-active {
	visibility: visible;
	opacity: 1;
	transition: opacity 0.16s ease 0.04s, visibility 0s;
}

/* ================================================================ Group card */
.mm-group__head {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--white) !important;
	font-weight: 800;
	line-height: 1.2;
}

/* Category image next to the title: white tile (product photos have a white background). */
.mm-group__img {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	overflow: hidden;
	border-radius: calc(var(--nd-radius) * 1.2);
	outline: 2px solid transparent;
	outline-offset: 3px;
	background: var(--white);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
	transition: box-shadow 0.15s, outline-color 0.15s;
}

.mm-group__img img {
	display: block;
	width: 88%;
	height: 88%;
	object-fit: contain;
}

/* Hover of the card: white ring around the image, with a gap (visible on the seasonal panel too). */
.mm-group:hover .mm-group__img {
	outline-color: var(--white);
	box-shadow: 0 0 0 2px var(--white);
}

/* Hover of a link: stays white, only underlined. */
.mm-group__head:hover,
.mm-group__list a:hover {
	color: var(--white) !important;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.is-season .mm-group__img {
	box-shadow: 0 0 0 2px var(--white);
}

/* In the panel */
.mm-group--panel {
	padding: 18px 20px 14px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: calc(var(--nd-radius) * 1.2);
	background: rgba(255, 255, 255, 0.06);
	transition: background 0.15s, border-color 0.15s;
}

.mm-group--panel:hover {
	border-color: rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.09);
}

.mm-group--panel .mm-group__head {
	margin-bottom: 8px;
	padding-bottom: 14px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.14);
	font-size: 19px;
	letter-spacing: -0.01em;
}

.mm-group--panel .mm-group__list a {
	display: inline-block;
	padding: 7px 0;
	color: rgba(255, 255, 255, 0.86);
	font-size: 16.5px;
	line-height: 1.4;
	transition: color 0.15s;
}

.mm-pane.is-season .mm-group--panel {
	border-color: var(--mm-season-border);
	background: rgba(255, 255, 255, 0.04);
}

.mm-pane.is-season .mm-group--panel:hover {
	border-color: var(--mm-season-border-hover);
	background: rgba(255, 255, 255, 0.07);
}

.mm-pane.is-season .mm-group--panel .mm-group__head {
	border-bottom-color: var(--mm-season-border);
}

/* In the accordion */
.mm-group--mob {
	margin: 10px 14px;
	padding: 12px 14px 8px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: var(--nd-radius);
	background: rgba(255, 255, 255, 0.05);
}

.mm-group--mob:last-child {
	margin-bottom: 16px;
}

.mm-group--mob .mm-group__head {
	margin-bottom: 4px;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 18px;
}

.mm-group--mob .mm-group__img {
	flex-basis: 46px;
	width: 46px;
	height: 46px;
}

.mm-group--mob .mm-group__list a {
	display: block;
	padding: 11px 0;
	color: var(--white);
	font-size: 17px;
	line-height: 1.35;
}

.mm-acc__sec.is-season .mm-group--mob {
	border-color: var(--mm-season-border);
	background: rgba(255, 255, 255, 0.04);
}

.mm-acc__sec.is-season .mm-group--mob .mm-group__head {
	border-bottom-color: var(--mm-season-border);
}

/* ================================================================ Hit týždňa */
.mm-hit {
	--card-pad-x: 10px;

	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: calc(var(--nd-radius) * 1.2);
	background: var(--white);
	color: var(--nd-c-head) !important;
	box-shadow: 0 0 0 2px var(--nd-c-sale, #ea7e1e);
	transition: transform 0.2s var(--mm-ease), box-shadow 0.2s;
}

.mm-hit:hover {
	transform: translateY(-2px);
	box-shadow: 0 0 0 3px var(--nd-c-sale, #ea7e1e), 0 14px 28px -12px rgba(0, 0, 0, 0.5);
}

.mm-hit__img {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	background: var(--white);
}

.mm-hit__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.mm-hit__pct {
	position: absolute;
	top: 8px;
	right: 8px;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--nd-c-sale, #ea7e1e);
	color: var(--white);
	font-size: 13px;
	font-weight: 800;
	line-height: 1.2;
}

.mm-hit__txt {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.mm-hit__tag {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 5px;
	padding: 3px 9px 3px 6px;
	border-radius: 999px;
	background: var(--nd-c-sale, #ea7e1e);
	color: var(--white);
	font-size: 12px;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.mm-hit__tag svg {
	width: 14px;
	height: 14px;
	transform: rotate(-12deg);
}

.mm-hit__name {
	display: -webkit-box;
	overflow: hidden;
	color: var(--nd-c-head);
	font-size: 15.5px;
	font-weight: 600;
	line-height: 1.3;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.mm-hit__prices b {
	color: var(--nd-c-head);
	font-size: 23px;
	font-weight: 800;
}

.mm-hit__prices del {
	margin-left: 4px;
	color: var(--nd-c-muted);
	font-size: 14px;
}

/* Parts of the catalog card, sized for the narrow column. */
.mm-hit .pcard__media {
	width: 100%;
	height: 100%;
}

.mm-hit .card-usp,
.mm-hit .card-price {
	margin: 0;
}

.mm-hit .card-usp {
	font-size: 13px;
}

.mm-hit .card-price {
	width: 100%;
}

.mm-hit .card-colors:not(:has(*)) {
	display: none;
}

/* In the panel: a column, image on top, green button at the bottom. */
.mm-hit--panel {
	flex: 1 1 auto;
}

.mm-hit--panel .mm-hit__img {
	height: 112px;
	padding: 8px 10px 0;
}

.mm-hit--panel .mm-hit__txt {
	flex: 1 1 auto;
	gap: 5px;
	padding: 8px 12px 12px;
}

.mm-hit--panel .mm-hit__name {
	font-size: 14.5px;
}

.mm-hit--panel .card-usp {
	gap: 1px;
	font-size: 12.5px;
}

.mm-hit--panel .card-price {
	padding: 6px 10px;
}

.mm-hit__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: auto;
	padding: 8px 12px;
	border-radius: var(--nd-radius);
	background: var(--nd-c-cta);
	color: var(--nd-c-on-cta);
	font-size: 15.5px;
	font-weight: 700;
}

.mm-hit__cta i {
	font-style: normal;
	transition: transform 0.2s var(--mm-ease);
}

.mm-hit--panel:hover .mm-hit__cta i {
	transform: translateX(3px);
}

/* In the off-canvas: a compact row, without USPs, badges and the shipping ribbon. */
.mm-mobile__hit {
	padding: 18px 16px 0;
}

.mm-mobile__hit:empty {
	display: none;
}

.mm-hit--mob {
	flex-direction: row;
	align-items: center;
	gap: 12px;
	padding: 10px;
}

.mm-hit--mob .mm-hit__img {
	flex: 0 0 92px;
	width: 92px;
	height: 92px;
	border-radius: var(--nd-radius);
}

.mm-hit--mob .mm-hit__pct {
	top: 2px;
	right: auto;
	left: 2px;
	padding: 2px 6px;
	font-size: 11px;
}

.mm-hit--mob .mm-hit__txt {
	flex: 1 1 auto;
	gap: 4px;
}

.mm-hit--mob .mm-hit__name {
	font-size: 14.5px;
}

.mm-hit--mob .mm-hit__prices b {
	font-size: 19px;
}

.mm-hit--mob .card-usp,
.mm-hit--mob .pcard__badges,
.mm-hit--mob .card-ribbon--ship {
	display: none;
}

.mm-hit--mob .card-ribbons {
	top: 0;
	left: 0;
}

.mm-hit--mob .card-ribbon {
	padding: 2px 6px;
	font-size: 11px;
}

/* ================================================================ Off-canvas accordion */
.mm-mobile {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	padding-bottom: 110px;
	color: var(--white);
	font-size: 15px;
	line-height: 1.35;
}

.mm-acc__sec {
	display: block;
}

.mm-acc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 17px 20px !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
	color: var(--white) !important;
	font-size: 19px !important;
	font-weight: 600 !important;
}

/* The heading of the open section sticks to the top of the off-canvas while its section is on
   screen, so it can be collapsed any time. */
.mm-acc__sec.is-open > .mm-acc__head {
	position: sticky;
	top: 0;
	z-index: 3;
	background: var(--primary);
	box-shadow: 0 8px 14px -10px rgba(0, 0, 0, 0.55);
}

.mm-acc__sec.is-season > .mm-acc__head {
	font-weight: 800 !important;
}

.mm-acc__sec.is-season.is-open > .mm-acc__head {
	background: var(--mm-season-head-bg);
}

/* Plus that turns into a minus. */
.mm-acc__head i {
	position: relative;
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
}

.mm-acc__head i::before,
.mm-acc__head i::after {
	content: "";
	position: absolute;
	top: 6px;
	left: 0;
	width: 14px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: transform 0.25s var(--mm-ease);
}

.mm-acc__head i::after {
	transform: rotate(90deg);
}

.mm-acc__sec.is-open .mm-acc__head i::after {
	transform: rotate(0deg);
}

/* Collapsed sections are hidden (not focusable, not read out) once the slide-up has finished. */
.mm-acc__body {
	display: grid;
	grid-template-rows: 0fr;
	align-items: stretch;
	visibility: hidden;
	transition: grid-template-rows 0.3s var(--mm-ease), visibility 0s linear 0.3s;
}

.mm-acc__sec.is-open .mm-acc__body {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows 0.3s var(--mm-ease), visibility 0s;
}

.mm-acc__inner {
	min-height: 0;
	overflow: hidden;
	background: var(--mm-bg);
}

.mm-acc__sec.is-season .mm-acc__inner {
	background: var(--mm-season-bg);
}

.mm-acc__title {
	display: block;
	padding: 16px 20px 4px;
	color: var(--white) !important;
	font-size: 16px;
	font-weight: 700;
}

/* ================================================================ Tablet (721–1023): bar and panel stay */
@media (min-width: 721px) and (max-width: 1023px) {
	.mm-bar {
		justify-content: flex-start;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.mm-link {
		height: 52px;
		padding: 0 9px;
		font-size: 15px;
	}

	.mm-panel {
		max-height: calc(100vh - 220px);
	}

	/* Still 4 (narrower) cards in a row, the hit on the right. */
	.mm-panel__in {
		gap: 10px;
		padding-top: 18px;
		padding-bottom: 20px;
	}

	.mm-panel__in:has(> .mm-panel__hit:not(:empty)) {
		grid-template-columns: minmax(0, 1fr) 196px;
	}

	.mm-pane {
		gap: 10px;
	}

	.mm-group--panel {
		padding: 12px 10px 8px;
	}

	/* Narrow cards: image above the title so long words (Príslušenstvo) don't break. */
	.mm-group--panel .mm-group__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
		font-size: 15.5px;
	}

	.mm-group--panel .mm-group__img {
		flex-basis: 40px;
		width: 40px;
		height: 40px;
	}

	.mm-group--panel .mm-group__list a {
		padding: 6px 0;
		font-size: 15px;
	}

	.mm-hit__name {
		font-size: 14px;
	}

	.mm-hit__prices b {
		font-size: 20px;
	}

	.mm-hit--panel .mm-hit__img {
		height: 110px;
	}
}

/* ================================================================ Narrower desktop bar (1024–1200) */
@media (min-width: 1024px) and (max-width: 1200px) {
	.mm-link {
		padding: 0 9px;
		font-size: 15.5px;
	}

	.mm-group--panel {
		padding: 16px 14px 12px;
	}

	.mm-group--panel .mm-group__head {
		font-size: 17px;
	}

	.mm-group--panel .mm-group__img {
		flex-basis: 44px;
		width: 44px;
		height: 44px;
	}

	.mm-group--panel .mm-group__list a {
		font-size: 15.5px;
	}

	.mm-panel__in:has(> .mm-panel__hit:not(:empty)) {
		grid-template-columns: minmax(0, 1fr) 220px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mm-nav *,
	.mm-mobile * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
