/* Dovelitus kategorijų meniu — kairysis full-height drawer */
.dov-cm {
	--dov-cm-accent: #f55501;
	--dov-cm-border: rgba(17, 24, 39, 0.1);
	--dov-cm-text: #111827;
	--dov-cm-muted: #6b7280;
	--dov-cm-hover: #f3f4f6;
	--dov-cm-col-w: 300px;
	position: relative;
	display: inline-block;
	font-family: inherit;
}

/* ---------- Mygtukas ---------- */
.dov-cm {
	width: 100%;
}

.dov-cm-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 18px;
	border: 0px solid #000000;
	border-radius: 10px;
	background: #040404;
	color: #ffffff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.dov-cm-trigger:hover {
	background: #2a791e;
	border-color: #2a791e;
	color: #ffffff;
}

.dov-cm-trigger:focus-visible {
	outline: 2px solid #111827;
	outline-offset: 2px;
}

.dov-cm-trigger-icon {
	display: inline-flex;
	width: 1.15em;
	height: 1.15em;
}

.dov-cm-trigger-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* ---------- Overlay ---------- */
.dov-cm-overlay {
	position: fixed;
	inset: 0;
	z-index: 99990;
	box-sizing: border-box;
}

.dov-cm-overlay[hidden] {
	display: none;
}

.dov-cm-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 20, 0.5);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.dov-cm.is-open .dov-cm-backdrop {
	opacity: 1;
}

/* ---------- Panelė: kairys drawer per visą aukštį ---------- */
.dov-cm-panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: auto;
	max-width: 100vw;
	height: 100%;
	max-height: none;
	background: #fff;
	border-radius: 0;
	box-shadow: 10px 0 40px rgba(8, 12, 20, 0.22);
	transform: translateX(-100%);
	transition: transform 0.28s cubic-bezier(0.22, 0.8, 0.3, 1);
	overflow: hidden;
}

.dov-cm.is-open .dov-cm-panel {
	transform: translateX(0);
}

.dov-cm-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 14px 18px 22px;
	border-bottom: 1px solid var(--dov-cm-border);
	flex: 0 0 auto;
}

.dov-cm-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--dov-cm-muted);
}

.dov-cm-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--dov-cm-text);
	cursor: pointer;
	transition: background 0.15s ease;
}

.dov-cm-close svg {
	width: 19px;
	height: 19px;
}

.dov-cm-close:hover {
	background: var(--dov-cm-hover);
}

/* ---------- Stulpeliai (desktop: greta, per visą aukštį) ---------- */
.dov-cm-cols {
	position: relative;
	display: flex;
	align-items: stretch;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

.dov-cm-col {
	display: none;
	flex: 0 0 var(--dov-cm-col-w);
	width: var(--dov-cm-col-w);
	height: 100%;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 10px 10px 32px;
	box-sizing: border-box;
	border-left: 1px solid var(--dov-cm-border);
	background: #fff;
}

.dov-cm-col:first-child {
	border-left: 0;
}

.dov-cm-col.is-dov-active {
	display: block;
	animation: dov-cm-col-in 0.2s ease;
}

@keyframes dov-cm-col-in {
	from {
		opacity: 0;
		transform: translateX(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.dov-cm-col-head {
	position: sticky;
	top: 0;
	z-index: 3;
	display: none; /* Desktop: be antraštės subkategorijų bloke. Mobilu įjungiama. */
	align-items: center;
	gap: 8px;
	padding: 8px 4px 10px;
	margin: -10px -4px 6px;
	background: #fff;
	border-bottom: 1px solid var(--dov-cm-border);
}

/* Tarpas tarp subkategorijų eilučių */
.dov-cm-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dov-cm-col:not([data-level="1"]) .dov-cm-list {
	gap: 4px;
}

.dov-cm-col:not([data-level="1"]) {
	padding-top: 16px;
}

.dov-cm-col-title {
	flex: 1 1 auto;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--dov-cm-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dov-cm-back {
	display: none;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: var(--dov-cm-hover);
	color: var(--dov-cm-text);
	cursor: pointer;
}

.dov-cm-back svg {
	width: 16px;
	height: 16px;
}

.dov-cm-all {
	font-size: 12px;
	font-weight: 600;
	color: #2563eb;
	text-decoration: none;
	white-space: nowrap;
}

.dov-cm-all:hover {
	text-decoration: underline;
}

/* ---------- Eilutė ---------- */
.dov-cm-row {
	display: flex;
	align-items: stretch;
	gap: 2px;
	border-radius: 8px;
	transition: background 0.14s ease;
}

.dov-cm-row:hover,
.dov-cm-row:focus-within {
	background: var(--dov-cm-hover);
}

.dov-cm-link {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 10px;
	color: var(--dov-cm-text) !important;
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none !important;
	border-radius: 8px;
}

.dov-cm-link:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: -2px;
}

.dov-cm-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dov-cm-row--has-kids .dov-cm-name {
	font-weight: 600;
}

.dov-cm-count {
	flex: 0 0 auto;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--dov-cm-muted);
	background: rgba(17, 24, 39, 0.06);
	border-radius: 999px;
	padding: 2px 7px;
	line-height: 1.4;
}

.dov-cm-caret {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--dov-cm-muted);
	cursor: pointer;
	border-radius: 8px;
}

.dov-cm-caret svg {
	width: 16px;
	height: 16px;
}

.dov-cm-caret:hover {
	color: var(--dov-cm-text);
}

.dov-cm-caret:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: -2px;
}

/* ---------- Scrollbar ---------- */
.dov-cm-col::-webkit-scrollbar {
	width: 8px;
}

.dov-cm-col::-webkit-scrollbar-thumb {
	background: rgba(17, 24, 39, 0.18);
	border-radius: 4px;
}

html.dov-cm-lock {
	overflow: hidden;
}

/* ---------- Mobilu: tas pats drawer, tik per visą plotį ---------- */
@media (max-width: 900px) {
	.dov-cm-panel {
		right: 0;
		width: 100%;
		max-width: none;
		box-shadow: none;
	}

	.dov-cm-cols {
		display: block;
	}

	.dov-cm-col {
		position: absolute;
		inset: 0;
		display: block;
		width: 100%;
		flex: none;
		border-left: 0;
		height: 100%;
		overflow-y: auto;
		padding: 8px 12px 32px;
		transform: translateX(100%);
		visibility: hidden;
		transition: transform 0.24s cubic-bezier(0.22, 0.8, 0.3, 1), visibility 0.24s;
		animation: none;
	}

	.dov-cm-col:first-child {
		transform: translateX(0);
	}

	.dov-cm-col.is-dov-active {
		transform: translateX(0);
		visibility: visible;
		animation: none;
		z-index: 2;
	}

	.dov-cm-col.is-dov-below {
		transform: translateX(-18%);
		visibility: visible;
	}

	.dov-cm-col-head {
		display: flex;
		padding: 6px 2px 10px;
		margin: -8px -2px 6px;
	}

	.dov-cm-col:not([data-level="1"]) {
		padding-top: 8px;
	}

	.dov-cm-back {
		display: inline-flex;
	}

	.dov-cm-row {
		border-radius: 10px;
	}

	.dov-cm-link {
		padding: 14px 12px;
		font-size: 16px;
	}

	.dov-cm-caret {
		width: 46px;
		height: 46px;
	}

	.dov-cm-close {
		width: 44px;
		height: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dov-cm-panel,
	.dov-cm-backdrop,
	.dov-cm-col,
	.dov-cm-row {
		transition: none !important;
		animation: none !important;
	}
}
