/* MedSkill – mega menu categorii (doar text, pentru arbori mari) */

/* Butonul din header */
.ms-mega-btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 11px 20px;
	border-radius: 999px;
	background: #e5232e;
	color: #fff !important;
	font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none !important;
	box-shadow: 0 8px 20px rgba(229, 35, 46, .28);
	transition: background .2s, transform .2s;
}
.ms-mega-btn:hover,
.ms-mega-btn[aria-expanded="true"] {
	background: #c4141f;
}
.ms-mega-btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
}
.ms-mega-btn:focus-visible {
	outline: 2px solid #0b1f6e;
	outline-offset: 3px;
}

/* Strat */
.ms-mega {
	position: fixed;
	inset: 0;
	z-index: 100050;
	pointer-events: none;
	font-family: 'DM Sans', system-ui, sans-serif;
}
.ms-mega[hidden] { display: none; }
/* The full-screen wrapper never takes the mouse (it would cover the header
   button and make hover open / close in a loop): only the overlay under
   the header and the panel do. */
.ms-mega.is-open { pointer-events: none; }
.ms-mega.is-open .ms-mega__backdrop,
.ms-mega.is-open .ms-mega__box { pointer-events: auto; }
.ms-mega__backdrop {
	position: absolute;
	inset: var(--ms-mega-top, 0px) 0 0 0; /* starts under the header */
	background: rgba(14, 27, 77, .35);
	opacity: 0;
	transition: opacity .2s;
}
.ms-mega.is-open .ms-mega__backdrop { opacity: 1; }

/* ---- desktop: dropdown ---- */
.ms-mega__box {
	position: fixed;
	display: flex;
	flex-direction: column;
	max-height: min(620px, calc(100vh - 120px));
	overflow: hidden;
	border: 1px solid #e4e9f5;
	border-top: 3px solid #e5232e;
	border-radius: 0 0 20px 20px;
	background: #fff;
	box-shadow: 0 30px 70px rgba(14, 27, 77, .22);
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity .2s, transform .2s;
}
.ms-mega.is-open .ms-mega__box { opacity: 1; transform: none; }
.ms-mega__top,
.ms-mega__tree { display: none; }

/* Filtru */
.ms-mega__filter {
	padding: 14px 16px;
	border-bottom: 1px solid #e4e9f5;
	background: #f4f7fd;
}
.ms-mega__filter input {
	width: 100%;
	height: 44px;
	padding: 0 16px 0 42px !important;
	border: 1px solid #d5dcec !important;
	border-radius: 12px !important;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333d5c' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E") 14px 50% / 18px no-repeat !important;
	color: #0e1b4d !important;
	font-size: 14.5px;
}
.ms-mega__filter input::placeholder { color: #525d7d; opacity: 1; }
.ms-mega__filter input:focus { outline: 2px solid #0b1f6e; outline-offset: 0; }

.ms-mega__body {
	display: grid;
	grid-template-columns: minmax(250px, 300px) 1fr;
	min-height: 0;
	overflow: hidden;
}

/* Stânga: categoriile principale */
.ms-mega__list {
	margin: 0;
	padding: 10px !important;
	overflow-y: auto;
	list-style: none !important;
	border-right: 1px solid #e4e9f5;
	background: #f4f7fd;
}
.ms-mega__item { margin: 0; padding: 0 !important; }
.ms-mega__cat {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	color: #0e1b4d !important;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none !important;
	transition: background .15s, color .15s;
}
.ms-mega__item.is-active > .ms-mega__cat,
.ms-mega__cat:hover,
.ms-mega__cat:focus-visible {
	background: #fff;
	color: #c4141f !important;
	box-shadow: 0 6px 18px rgba(14, 27, 77, .08);
	outline: none;
}
.ms-mega__name { flex: 1 1 auto; min-width: 0; }
.ms-mega__chev {
	flex: none;
	width: 8px;
	height: 8px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(45deg);
	opacity: .7;
}
.ms-mega em {
	flex: none;
	min-width: 26px;
	padding: 1px 8px;
	border-radius: 20px;
	background: #e4e9f5;
	color: #333d5c;
	font-size: 11.5px;
	font-style: normal;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
}

/* Dreapta: subcategoriile */
.ms-mega__panes {
	min-width: 0;
	padding: 24px 28px;
	overflow-y: auto;
}
.ms-mega__pane { display: none; }
.ms-mega__pane.is-active { display: block; animation: msMegaIn .18s ease; }
@keyframes msMegaIn { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
.ms-mega__pane-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid #e4e9f5;
}
.ms-mega__pane-title {
	margin: 0 0 10px;
	padding: 0;
	color: #0e1b4d;
	font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.25;
}
.ms-mega__pane-head .ms-mega__pane-title { margin: 0; }
.ms-mega__all,
.ms-mega__go {
	color: #c4141f !important;
	font-size: 13.5px;
	font-weight: 700;
	white-space: nowrap;
	text-decoration: none !important;
}
.ms-mega__all:hover,
.ms-mega__go:hover { text-decoration: underline !important; }

.ms-mega__cols {
	columns: 3 220px;
	column-gap: 28px;
}
.ms-mega__col {
	break-inside: avoid;
	margin: 0 0 22px;
}
.ms-mega a.ms-mega__h {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
	color: #0e1b4d !important;
	font-size: 14.5px;
	font-weight: 700;
	text-decoration: none !important;
}
.ms-mega a.ms-mega__h:hover { color: #c4141f !important; }
.ms-mega__links,
.ms-mega__deep,
.ms-mega__found {
	margin: 0;
	padding: 0 !important;
	list-style: none !important;
}
.ms-mega__links li,
.ms-mega__deep li,
.ms-mega__found li { margin: 0; padding: 0 !important; }
.ms-mega__links a,
.ms-mega__deep a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 0;
	color: #333d5c !important;
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none !important;
}
.ms-mega__links a span,
.ms-mega__deep a span { flex: 0 1 auto; }
.ms-mega__links a:hover,
.ms-mega__deep a:hover { color: #c4141f !important; }
.ms-mega__links em,
.ms-mega__deep em { min-width: 0; padding: 0 6px; font-size: 10.5px; }
.ms-mega__deep {
	margin: 0 0 4px 10px;
	padding-left: 10px !important;
	border-left: 2px solid #e4e9f5;
}
.ms-mega__deep a { font-size: 13.5px; }
a.ms-mega__more {
	color: #0b1f6e !important;
	font-weight: 700;
}
.ms-mega__empty {
	margin: 0 0 14px;
	color: #333d5c;
	font-size: 14.5px;
}

/* Rezultatele filtrului */
.ms-mega__found {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 6px 20px;
}
.ms-mega__found a {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 0 10px;
	padding: 9px 12px;
	border-radius: 10px;
	color: #0e1b4d !important;
	text-decoration: none !important;
	transition: background .15s;
}
.ms-mega__found a:hover { background: #f4f7fd; }
.ms-mega__found span { font-size: 14.5px; font-weight: 600; }
.ms-mega__found small {
	grid-column: 1;
	color: #525d7d;
	font-size: 12px;
}
.ms-mega__found em { grid-row: 1 / span 2; grid-column: 2; }
.ms-mega.is-filtering .ms-mega__item.is-active > .ms-mega__cat {
	background: transparent;
	color: #0e1b4d !important;
	box-shadow: none;
}

/* Subsol */
.ms-mega__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 22px;
	border-top: 1px solid #e4e9f5;
	background: #f4f7fd;
	color: #333d5c;
	font-size: 13.5px;
}
.ms-mega__foot-links { display: flex; gap: 10px; flex-wrap: wrap; }
.ms-mega__foot-links a {
	padding: 11px 22px;
	border: 1px solid #d5dcec;
	border-radius: 999px;
	background: #fff;
	color: #0e1b4d !important;
	font-weight: 700;
	white-space: nowrap;
	text-decoration: none !important;
}
.ms-mega__foot-links a:hover { border-color: #0e1b4d; }
.ms-mega__foot-links a.is-cta {
	border-color: #e5232e;
	background: #e5232e;
	color: #fff !important;
}
.ms-mega__foot-links a.is-cta:hover { background: #c4141f; border-color: #c4141f; }

/* ---- telefon / tabletă: sertar lateral cu acordeon ---- */
@media (max-width: 980px) {
	html.ms-mega-lock { overflow: hidden; }
	.ms-mega__backdrop { inset: 0; }
	.ms-mega__box {
		top: 0 !important;
		bottom: 0;
		left: 0 !important;
		width: min(92vw, 420px) !important;
		max-height: none;
		border-top: 0;
		border-radius: 0 20px 20px 0;
		transform: translateX(-100%);
	}
	.ms-mega.is-open .ms-mega__box { transform: none; }
	.ms-mega__top {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 18px;
		background: #0b1f6e;
		color: #fff;
	}
	.ms-mega__top p {
		margin: 0;
		padding: 0;
		color: #fff;
		font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
		font-size: 17px;
		font-weight: 700;
	}
	.ms-mega__close {
		width: 36px;
		height: 36px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: rgba(255, 255, 255, .14);
		color: #fff;
		font-size: 24px;
		line-height: 36px;
		cursor: pointer;
	}
	.ms-mega__body { display: none; }
	.ms-mega.is-filtering .ms-mega__body {
		display: block;
		overflow-y: auto;
	}
	.ms-mega.is-filtering .ms-mega__list,
	.ms-mega.is-filtering .ms-mega__tree { display: none; }
	.ms-mega.is-filtering .ms-mega__panes { padding: 16px; }
	.ms-mega__tree {
		display: block;
		flex: 1 1 auto;
		margin: 0;
		padding: 8px 10px 20px !important;
		overflow-y: auto;
		list-style: none !important;
	}
	.ms-mega__tree ul {
		margin: 0 0 6px 12px;
		padding: 0 0 0 10px !important;
		border-left: 2px solid #e4e9f5;
		list-style: none !important;
	}
	.ms-mega__tree li { margin: 0; padding: 0 !important; }
	.ms-mega__tree summary,
	.ms-mega__tree a {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 12px 10px;
		border-radius: 10px;
		color: #0e1b4d !important;
		font-size: 15px;
		font-weight: 600;
		line-height: 1.3;
		text-decoration: none !important;
		cursor: pointer;
	}
	.ms-mega__tree a span { flex: 1 1 auto; }
	.ms-mega__tree summary { list-style: none; }
	.ms-mega__tree summary::-webkit-details-marker { display: none; }
	.ms-mega__tree summary::after {
		content: '';
		flex: none;
		width: 8px;
		height: 8px;
		margin-left: auto;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg);
		transition: transform .2s;
	}
	.ms-mega__tree details[open] > summary::after { transform: rotate(-135deg); }
	.ms-mega__tree details[open] > summary { color: #c4141f !important; }
	.ms-mega__tree summary em { margin-left: auto; }
	.ms-mega__tree a.is-all { color: #c4141f !important; font-weight: 700; }
	.ms-mega__tree ul a,
	.ms-mega__tree ul summary { font-size: 14.5px; font-weight: 500; }
	.ms-mega__foot {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}
	.ms-mega__foot-links { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
	.ms-mega__box,
	.ms-mega__backdrop,
	.ms-mega__pane.is-active { transition: none; animation: none; }
}

/* ---- UX / CRO ---- */
/* Comfortable targets everywhere (min 44px) */
.ms-mega__cat,
.ms-mega__links a,
.ms-mega__found a { min-height: 44px; }
.ms-mega__cat:focus-visible,
.ms-mega__links a:focus-visible,
.ms-mega__found a:focus-visible,
.ms-mega__tree a:focus-visible,
.ms-mega__tree summary:focus-visible { outline: 2px solid #e5232e; outline-offset: 2px; }
/* "Vezi tot din …" as a clear button */
.ms-mega__all,
.ms-mega__go {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border-radius: 999px;
	background: #fde8ea;
	text-decoration: none !important;
	transition: background .2s, color .2s;
}
.ms-mega__all:hover,
.ms-mega__go:hover { background: #e5232e; color: #fff !important; text-decoration: none !important; }
/* Hint under the filter */
.ms-mega__filter { position: relative; }
.ms-mega__hint { margin: 6px 2px 0; color: #333d5c; font-size: 12.5px; }
/* Phone / tablet drawer: filter and footer always visible, list scrolls */
@media (max-width: 980px) {
	.ms-mega__box { display: flex; flex-direction: column; }
	.ms-mega__top, .ms-mega__filter, .ms-mega__foot { flex: none; }
	.ms-mega__tree { flex: 1 1 auto; min-height: 0; }
	.ms-mega__tree summary, .ms-mega__tree a { min-height: 48px; }
	.ms-mega__foot { padding: 12px 16px; box-shadow: 0 -8px 20px rgba(14, 27, 77, .06); }
	.ms-mega__foot > span:first-child { display: none; }
	.ms-mega__foot-links { width: 100%; }
	.ms-mega__foot-links a { flex: 1; text-align: center; }
	.ms-mega-btn { min-height: 44px; }
}
