/* Головне меню на ПК: класичне випадаюче меню з бічним підменю (inc/mega-menu.php, js/mega-menu.js).
   Мобільне меню не змінюється. */

@media (min-width: 992px) {
	/* Старі випадаючі списки теми — замість них .yx-mega */
	#menu-primary-1 > li > ul.sub-menu,
	#access .child-menu-open,
	#access .child-menu-close {
		display: none !important;
	}

	#menu-primary-1 > li {
		position: relative;
	}

	/* Не переносити шеврон на другий рядок (шапка ставала вищою) */
	#menu-primary-1 > li > a {
		white-space: nowrap;
	}

	/* Шеврон біля пунктів із підменю (span у посиланні; ::after посилання — зелене підкреслення теми) */
	#access .yx-mega-chev {
		display: inline-block;
		width: 6px;
		height: 6px;
		margin-left: 7px;
		border-right: 1.5px solid currentColor;
		border-bottom: 1.5px solid currentColor;
		vertical-align: 4px;
		opacity: .7;
		transform: rotate(45deg);
		transition: transform .2s ease, vertical-align .2s ease;
	}

	#menu-primary-1 > li.yx-mega-on .yx-mega-chev {
		vertical-align: 1px;
		transform: rotate(225deg);
	}

	/* ---- Картка під пунктом ---- */
	#access .yx-mega {
		display: flex !important; /* у розмітці інлайн display:none — щоб меню не з'являлось до завантаження цього CSS */
		align-items: stretch;
		position: absolute;
		top: calc(100% + var(--yx-mega-gap, 16px));
		left: 0;
		z-index: 990;
		color: #1F2427;
		font-family: 'Roboto Condensed', sans-serif;
		text-align: left;
		text-transform: none;
		letter-spacing: normal;
		background: #fff;
		box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-6px);
		/* закриття: невелика затримка, щоб не зникало при випадковому виході курсора */
		transition: opacity .16s ease .1s, transform .16s ease .1s, visibility 0s linear .26s;
	}

	/* «Місток» між пунктом меню і карткою — курсор не втрачає наведення */
	#access .yx-mega::before {
		content: "";
		position: absolute;
		right: 0;
		bottom: 100%;
		left: 0;
		height: var(--yx-mega-gap, 16px);
	}

	#access li.yx-mega-on > .yx-mega {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity .16s ease, transform .16s ease, visibility 0s;
	}

	/* Без JS — за наведенням / фокусом */
	html:not(.yx-mega-js) #access li:hover > .yx-mega,
	html:not(.yx-mega-js) #access li:focus-within > .yx-mega {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity .16s ease .12s, transform .16s ease .12s, visibility 0s linear .12s;
	}

	#access .yx-mega ul {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	#access .yx-mega li {
		display: block;
		margin: 0 !important;
		padding: 0;
	}

	/* Посилання (перебиваємо `.menu .col-1 a` теми: білий 18px капсом; `a::after` — підкреслення теми) */
	#access .yx-mega a {
		color: inherit;
		font-size: 16px;
		font-weight: 400 !important;
		letter-spacing: normal;
		text-decoration: none;
		text-transform: none;
	}

	#access .yx-mega a::after {
		content: none;
	}

	#access .yx-mega__drop {
		width: 270px;
		padding: 10px 0;
	}

	#access .yx-mega .yx-mega__cat {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 9px 22px;
		color: #1F2427;
		line-height: 1.3;
		transition: background-color .12s ease, color .12s ease;
	}

	#access .yx-mega .yx-mega__cat:hover,
	#access .yx-mega .yx-mega__item.is-active > .yx-mega__cat,
	#access .yx-mega .yx-mega__cat:focus-visible {
		color: #009A3E;
		background: #F4F4F4;
	}

	#access .yx-mega .yx-mega__cat[aria-current="page"] {
		color: #009A3E;
	}

	#access .yx-mega__arrow {
		flex: none;
		width: 6px;
		height: 6px;
		border-top: 1.5px solid currentColor;
		border-right: 1.5px solid currentColor;
		opacity: .6;
		transform: rotate(45deg);
	}

	#access .yx-mega__extra {
		margin-top: 8px !important;
		padding-top: 8px !important;
		border-top: 1px solid #E8E8E8;
	}

	#access .yx-mega .yx-mega__cat--extra {
		color: #5A6063;
		font-size: 15px;
	}

	#access .yx-mega a.is-accent {
		color: #D62D2D;
		font-weight: 700 !important;
	}

	/* ---- Бічне підменю (серії ракеток тощо) ---- */
	#access .yx-mega__flys {
		display: none;
		width: 250px;
		padding: 10px 0;
		background: #FAFAFA;
		border-left: 1px solid #ECECEC;
	}

	#access .yx-mega__flys:has(.yx-mega__fly.is-active) {
		display: block;
	}

	#access .yx-mega__fly {
		display: none;
	}

	#access .yx-mega__fly.is-active {
		display: block;
		animation: yx-mega-fly .16s ease;
	}

	@keyframes yx-mega-fly {
		from { opacity: 0; transform: translateX(-4px); }
		to { opacity: 1; transform: none; }
	}

	#access .yx-mega__fly-title {
		display: block;
		padding: 8px 22px 6px;
		color: #8A8F92;
		font-size: 13px;
		font-weight: 700;
		letter-spacing: .06em;
		text-transform: uppercase;
	}

	#access .yx-mega__fly .yx-mega__cat:hover {
		background: #EFEFEF;
	}

	#access .yx-mega .yx-mega__all {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		margin: 8px 22px 4px;
		color: #1F2427;
		font-size: 15px;
		font-weight: 500 !important;
		transition: color .15s ease;
	}

	#access .yx-mega .yx-mega__all:hover {
		color: #009A3E;
	}

	/* Стрілка — іконкою: у Roboto Condensed немає «→», запасний шрифт садить її нижче рядка */
	#access .yx-mega .yx-mega__all::after {
		content: "";
		display: inline-block;
		position: static;
		width: 14px !important;
		height: 10px !important;
		background: currentColor !important;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M9 1l4 4-4 4M13 5H1' fill='none' stroke='%23000' stroke-width='1.5'/%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 14 10'%3E%3Cpath d='M9 1l4 4-4 4M13 5H1' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
		transition: transform .15s ease;
	}

	#access .yx-mega .yx-mega__all:hover::after {
		transform: translateX(3px);
	}
}

@media (prefers-reduced-motion: reduce) {
	#access .yx-mega,
	#access li.yx-mega-on > .yx-mega {
		transition: none !important;
	}

	#access .yx-mega__fly.is-active {
		animation: none !important;
	}
}
