/* ══════════════════════════════════════════════════════════════
   K360 Cases  ·  assets/menu.css  ·  dropdown med cases

   Panelet lægger sig oven i den eksisterende undermenu og laver den
   om til et gitter. Vi skriver ikke menuen om, vi klæder den på, så
   det virker sammen med hovedmenuens egne farver og animationer.
   ══════════════════════════════════════════════════════════════ */

.kc-har-mega > .sub-menu {
	--kc-mega-tekst: #F5F2EA;
	--kc-mega-dim: rgba(245, 242, 234, .6);
	--kc-mega-e: cubic-bezier(.23, 1, .32, 1);

	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px;
	width: min(660px, calc(100vw - 40px));
	min-width: 0;
	padding: 12px;
}

.kc-har-mega > .sub-menu > li { min-width: 0; }

/* Linket til hele oversigten fylder begge spalter. */
.kc-har-mega > .sub-menu > li.kc-mega-alle {
	grid-column: 1 / -1;
	margin-top: 4px;
	padding-top: 10px;
	border-top: 1px solid rgba(245, 242, 234, .14);
}

/* ── Kortet ──────────────────────────────────────────────── */
.kc-har-mega .kc-mega-kort {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 12px;
	background-color: transparent;
	color: var(--kc-mega-tekst);
	text-decoration: none;
	transition: background-color .3s var(--kc-mega-e);
}

.kc-mega-bill {
	flex: 0 0 auto;
	display: block;
	width: 84px;
	height: 63px;
	overflow: hidden;
	border-radius: 8px;
	background-color: rgba(245, 242, 234, .1);
}

.kc-mega-bill img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	transition: transform .6s var(--kc-mega-e);
}

.kc-mega-tekst {
	display: block;
	min-width: 0;
}

.kc-mega-tekst b {
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -.01em;
	color: var(--kc-mega-tekst);

	/* To linjer, og så tre prikker. Titlerne er sætninger. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.kc-mega-tekst span {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--kc-mega-dim);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Se alle ─────────────────────────────────────────────── */
.kc-har-mega .kc-mega-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 10px;
	border-radius: 10px;
	color: var(--kc-mega-tekst);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color .3s var(--kc-mega-e), color .3s var(--kc-mega-e);
}

.kc-mega-link svg {
	width: 14px;
	height: 14px;
	transform: translateX(var(--kc-px, 0px));
	transition: transform .35s var(--kc-mega-e);
}

/* ── Mus ─────────────────────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {

	.kc-har-mega .kc-mega-kort:hover { background-color: rgba(245, 242, 234, .1); }
	.kc-har-mega .kc-mega-kort:hover img { transform: scale(1.06); }
	.kc-har-mega .kc-mega-link:hover { background-color: rgba(245, 242, 234, .1); --kc-px: 4px; }
}

/* ── Tastatur ────────────────────────────────────────────── */
.kc-har-mega .kc-mega-kort:focus-visible,
.kc-har-mega .kc-mega-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ── Smalle skærme ───────────────────────────────────────── */
@media (max-width: 1100px) {

	.kc-har-mega > .sub-menu {
		grid-template-columns: minmax(0, 1fr);
		width: min(420px, calc(100vw - 40px));
	}
}

@media (max-width: 860px) {

	/* På mobil er menuen en liste, og så skal panelet også være det. */
	.kc-har-mega > .sub-menu {
		display: block;
		width: auto;
		padding-left: 16px;
	}

	.kc-har-mega .kc-mega-kort { padding: 7px 0; }
	.kc-mega-bill { width: 56px; height: 42px; }
	.kc-har-mega > .sub-menu > li.kc-mega-alle { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.kc-har-mega .sub-menu * { transition-duration: .01ms !important; }
}
