/* ==================================================================
 * Хедър: бяло мобилно меню, по-малко лого на телефон,
 * плавно отваряне/затваряне на падащите менюта на десктоп.
 * (Зарежда се след htp-frontend.css — затова презаписва неговите правила.)
 * ================================================================== */

/* ------------------------------------------------------------------
 * Лого — по-ниско на таблет и телефон.
 * ------------------------------------------------------------------ */
@media (max-width: 1024px) {
	.elementor-location-header .hts-nav-fade img.e-image-base {
		height: 46px !important;
		width: auto !important;
		max-height: 46px !important;
	}
}

@media (max-width: 767px) {
	.elementor-location-header .hts-nav-fade img.e-image-base {
		height: 40px !important;
		max-height: 40px !important;
	}
}

/* ------------------------------------------------------------------
 * Мобилно меню — бял фон, тъмни текстове и иконки.
 * ------------------------------------------------------------------ */
@media (max-width: 1024px) {
	.elementor-location-header .e-n-menu-wrapper {
		--n-menu-title-color-normal: #004d55;
		--n-menu-title-color-hover: #008990;
		--n-menu-title-color-active: #008990;
		--n-menu-icon-color: #004d55;
		background: #fdfdfd !important;
	}

	.elementor-location-header .e-n-menu-item {
		border-bottom-color: #e5e8f0 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title-text {
		color: #004d55 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-dropdown-icon {
		color: #004d55 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-dropdown-icon svg {
		fill: #004d55 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .hts-dd-title {
		color: #004d55 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .hts-dd-item:hover .hts-dd-title,
	.elementor-location-header .e-n-menu-wrapper .hts-dd-item:focus-visible .hts-dd-title,
	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title:hover .e-n-menu-title-text,
	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title:hover .e-n-menu-dropdown-icon {
		color: #008990 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title:hover .e-n-menu-dropdown-icon svg {
		fill: #008990 !important;
	}

	/* Подменюта в мобилното меню: без картата/сянката на десктоп падащото меню. */
	.elementor-location-header .e-n-menu-wrapper .hts-dd,
	.elementor-location-header .e-n-menu-wrapper .e-n-menu-content > .e-con,
	.elementor-location-header .e-n-menu-wrapper .e-n-menu-content > .e-con > .e-con {
		box-shadow: none !important;
		background: transparent !important;
		border: 0 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .hts-dd-item {
		border-top: 0 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .hts-dd-all {
		color: #008990 !important;
	}

	/* Отворено меню: бяла лента — тъмно лого и тъмна иконка „X“. */
	.elementor-location-header .hts-nav-fade:has(.e-n-menu-toggle[aria-expanded="true"])::before {
		opacity: 1 !important;
	}

	.elementor-location-header .hts-nav-fade:has(.e-n-menu-toggle[aria-expanded="true"]) img.e-image-base {
		content: url(../img/hts-logo.svg);
		filter: none !important;
	}

	.elementor-location-header .hts-nav-fade:has(.e-n-menu-toggle[aria-expanded="true"]) .e-n-menu-toggle {
		--n-menu-toggle-icon-color: #004d55 !important;
		--n-menu-toggle-icon-color-hover: #008990 !important;
		--n-menu-toggle-icon-color-active: #004d55 !important;
		color: #004d55 !important;
	}

	.elementor-location-header .hts-nav-fade:has(.e-n-menu-toggle[aria-expanded="true"]) .e-n-menu-toggle svg {
		fill: #004d55 !important;
	}

	/* Дъното на менюто (CTA + социални мрежи, добавят се от JS). */
	.htp-mm-footer {
		padding-top: 24px;
		border-top: 1px solid #e5e8f0;
	}

	.htp-mm-footer .htp-mm-cta {
		background: #008990 !important;
		color: #fdfdfd !important;
		transition: background-color .2s ease;
	}

	.htp-mm-footer .htp-mm-cta:hover,
	.htp-mm-footer .htp-mm-cta:focus-visible {
		background: #004d55 !important;
	}

	.htp-mm-footer .htp-mm-social a {
		color: #004d55 !important;
		transition: color .2s ease;
	}

	.htp-mm-footer .htp-mm-social svg {
		fill: currentColor !important;
	}

	.htp-mm-footer .htp-mm-social a:hover,
	.htp-mm-footer .htp-mm-social a:focus-visible {
		color: #008990 !important;
	}
}

/* ------------------------------------------------------------------
 * Десктоп: падащите менюта се отварят/затварят плавно
 * (само появяване; затварянето е мигновено — без „прескачане“ на панела).
 * ------------------------------------------------------------------ */
@media (min-width: 1025px) {
	/* Само меко появяване на място: 60ms изчакване (невидим), докато Elementor позиционира панела,
	   после fade. Без плъзгане и без задържане при затваряне — затварянето е мигновено, на място. */
	.elementor-location-header .e-n-menu-content > .e-con.e-active {
		animation: htp-dd-in .2s ease-out .06s both;
	}
}

@keyframes htp-dd-in {
	from {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.elementor-location-header .e-n-menu-content > .e-con.e-active {
		animation: none !important;
	}
}


/* Мобилно меню: без втора линия над бутона — „Блог“ вече има линия отдолу. */
.elementor-location-header .htp-mm-footer {
	border-top: 0 !important;
	padding-top: 24px !important;
}

/* 1025–1365px: 8-те пункта не се събират до бутона — бутонът се скрива (има го в hero и в мобилното меню),
   менюто е вдясно и винаги на ЕДИН ред. */
@media (min-width: 1025px) and (max-width: 1365px) {
	.elementor-location-header a.e-button-base:not(.htp-mm-cta) {
		display: none !important;
	}

	.elementor-location-header .elementor-widget-n-menu {
		flex: 1 1 auto !important;
		width: auto !important;
		max-width: none !important;
		margin-left: auto !important;
		display: flex;
		justify-content: flex-end;
	}

	.elementor-location-header .e-n-menu-heading {
		flex-wrap: nowrap !important;
		justify-content: flex-end !important;
		white-space: nowrap;
		column-gap: 0 !important;
	}

	.elementor-location-header .e-n-menu-title {
		padding-inline: clamp(8px, calc((100vw - 1025px) / 34 + 8px), 18px) !important;
	}
}

/* Мобилно меню: списъкът започва ПОД лентата с логото и се превърта там — логото никога не минава върху пунктовете.
   По-малки заглавия. */
@media (max-width: 1024px) {
	.elementor-location-header .e-n-menu-wrapper {
		inset: 88px 0 auto 0 !important;
		height: calc(100vh - 88px) !important;
		height: calc(100dvh - 88px) !important;
		padding: 8px 24px 32px !important;
		gap: 24px !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title-text {
		font-size: 24px !important;
		line-height: 1.25 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title {
		padding: 13px 0 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .hts-dd-title {
		font-size: 16px !important;
	}

	/* Лентата с логото — плътна, над списъка. */
	.elementor-location-header .hts-nav-fade:has(.e-n-menu-toggle[aria-expanded="true"]) {
		background: #fdfdfd !important;
	}
}

@media (max-width: 767px) {
	.elementor-location-header .e-n-menu-wrapper {
		inset: 76px 0 auto 0 !important;
		height: calc(100vh - 76px) !important;
		height: calc(100dvh - 76px) !important;
		padding: 4px 16px 28px !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title-text {
		font-size: 22px !important;
	}
}

/* Мобилно меню: стрелките на подменютата центрирани точно под „X“ (същата кутия, иконата в средата)
   и целият ред е линк — не само думата. */
@media (max-width: 1024px) {
	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title {
		display: flex !important;
		align-items: center !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title-container {
		flex: 1 1 auto !important;
		align-self: stretch;
		display: flex !important;
		align-items: center;
		min-height: 100%;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-dropdown-icon {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		flex: 0 0 44px !important;
		width: 44px !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	/* Височината на реда — в самия линк (цялата лента се натиска). */
	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title {
		padding: 0 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-title-container {
		padding: 13px 0 !important;
	}

	.elementor-location-header .e-n-menu-wrapper .e-n-menu-dropdown-icon {
		align-self: stretch !important;
		height: auto !important;
	}
}

/* ==================================================================
 * Мега меню „Какво“ (десктоп ≥1025px): списък с миниатюри вляво,
 * голяма карта „Всички обучения“ вдясно. Елементите се добавят от htp-header.js.
 * ================================================================== */
.hts-mega-thumb,
.hts-mega-sub,
.hts-mega-feature {
	display: none;
}

@media (min-width: 1025px) {
	.elementor-location-header .e-n-menu-content .hts-dd.hts-dd--mega {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) 330px;
		grid-auto-rows: auto;
		column-gap: 16px;
		row-gap: 2px;
		width: 780px !important;
		max-width: calc(100vw - 40px);
		padding: 16px !important;
		box-sizing: border-box;
		border-radius: 12px;
	}

	.hts-dd--mega > .htp-nav-all {
		display: none !important;
	}

	.hts-dd--mega > .hts-mega-row {
		grid-column: 1;
		display: grid !important;
		grid-template-columns: 56px minmax(0, 1fr);
		grid-template-rows: auto auto;
		gap: 3px 14px !important;
		align-items: center;
		align-content: center;
		padding: 10px 12px !important;
		border: 0 !important;
		border-radius: 8px;
	}

	.elementor .hts-dd--mega > .hts-mega-row:hover,
	.elementor .hts-dd--mega > .hts-mega-row:focus-visible {
		background-color: #f3f9f8;
	}

	.hts-dd--mega .hts-mega-thumb {
		display: block;
		grid-row: 1 / span 2;
		width: 56px;
		height: 56px;
		border-radius: 8px;
		object-fit: cover;
	}

	.hts-dd--mega > .hts-mega-row .hts-dd-title {
		align-self: end;
		font-size: 16px !important;
		font-weight: 700 !important;
		line-height: 1.25 !important;
		color: #004d55;
	}

	.hts-dd--mega .hts-mega-sub {
		display: block;
		align-self: start;
		font-size: 13px;
		line-height: 1.35;
		color: #515b70;
	}

	.hts-dd--mega .hts-mega-feature {
		grid-column: 2;
		grid-row: 1 / span 6;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		min-height: 420px;
		border-radius: 10px;
		overflow: hidden;
		background-color: #004d55;
		background-size: cover;
		background-position: 22% 20%;
		text-decoration: none;
		transition: transform .25s ease;
	}

	.hts-dd--mega .hts-mega-panel {
		margin: 12px;
		padding: 18px;
		border-radius: 10px;
		background: rgba(20, 70, 75, .62);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		display: flex;
		flex-direction: column;
		gap: 10px;
		color: #fdfdfd;
	}

	.hts-dd--mega .hts-mega-tag {
		align-self: flex-start;
		font-size: 10px;
		letter-spacing: .04em;
		text-transform: uppercase;
		background: rgba(255, 255, 255, .14);
		padding: 4px 7px;
		border-radius: 4px;
	}

	.hts-dd--mega .hts-mega-title {
		font-size: 21px;
		font-weight: 700;
		line-height: 1.2;
	}

	.hts-dd--mega .hts-mega-title em {
		font-family: "Salina Bold Italic", Georgia, serif;
		font-style: normal;
		font-weight: 400;
		font-size: 25px;
		color: #9fdfdb;
	}

	.hts-dd--mega .hts-mega-text {
		font-size: 13px;
		line-height: 1.45;
		color: #e3f4f2;
	}

	.hts-dd--mega .hts-mega-btn {
		margin-top: 4px;
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 44px;
		border-radius: 8px;
		background: #fdfdfd;
		color: #004d55;
		font-size: 14px;
		font-weight: 700;
		transition: background-color .2s ease, color .2s ease;
	}

	.hts-dd--mega .hts-mega-feature:hover .hts-mega-btn,
	.hts-dd--mega .hts-mega-feature:focus-visible .hts-mega-btn {
		background: #008990;
		color: #fdfdfd;
	}

	.hts-dd--mega .hts-mega-feature:focus-visible {
		outline: 3px solid #008990;
		outline-offset: 2px;
	}
}
