/* Language switcher — dropdown (desktop) + mobile grid / header chip */

.lang-switcher-mount {
	display: flex;
	align-items: center;
}

.lang-switcher {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: stretch;
}

.lang-switcher__label {
	display: none;
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(15, 23, 42, 0.55);
}

.lang-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid var(--divider-color, #E6DCC8);
	background: var(--white-color, #fff);
	color: var(--primary-color, #0C0C0C);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.lang-switcher__toggle:hover,
.lang-switcher__toggle:focus-visible {
	border-color: var(--accent-color, #C9A84C);
	outline: none;
}

.lang-switcher__flag,
.lang-switcher__option-flag {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	flex-shrink: 0;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
}

.lang-switcher__code {
	line-height: 1;
}

.lang-switcher__caret {
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	opacity: 0.6;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.lang-switcher.is-open .lang-switcher__caret {
	transform: rotate(180deg);
}

.lang-switcher__menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	min-width: 188px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: var(--white-color, #fff);
	border: 1px solid var(--divider-color, #E6DCC8);
	border-radius: 14px;
	box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
	z-index: 1050;
}

.lang-switcher.is-open .lang-switcher__menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.lang-switcher__menu > li {
	margin: 0;
	list-style: none;
}

.lang-switcher__option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 9px;
	color: var(--primary-color, #0C0C0C);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
	white-space: nowrap;
	border: 1px solid transparent;
	background: transparent;
	width: 100%;
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

.lang-switcher__option-code {
	display: none;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.04em;
	color: rgba(15, 23, 42, 0.45);
}

.lang-switcher__option-name {
	line-height: 1.2;
}

a.lang-switcher__option:hover,
a.lang-switcher__option:focus-visible {
	background: rgba(201, 168, 76, 0.16);
	outline: none;
}

.lang-switcher__option.is-active {
	background: rgba(201, 168, 76, 0.14);
	color: #A88635;
	cursor: default;
}

.lang-switcher__option.is-active .lang-switcher__option-code {
	color: #A88635;
}

/* Compact chip in mobile header bar (next to hamburger) */
.lang-switcher-mount--bar {
	display: none;
}

/* Footer varijanta — svetli tekst preko tamne gradijent pozadine */
.lang-switcher-mount--footer {
	justify-content: center;
	margin: 0 0 32px;
}

.lang-switcher-mount--footer .lang-switcher__toggle {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.35);
	color: var(--white-color, #fff);
}

.lang-switcher-mount--footer .lang-switcher__toggle:hover,
.lang-switcher-mount--footer .lang-switcher__toggle:focus-visible {
	border-color: var(--accent-color, #C9A84C);
	background: rgba(255, 255, 255, 0.16);
}

.lang-switcher-mount--footer .lang-switcher__menu {
	right: auto;
	left: 50%;
	transform: translate(-50%, -6px);
}

.lang-switcher-mount--footer .lang-switcher.is-open .lang-switcher__menu {
	transform: translate(-50%, 0);
}

/* ========== Mobile ========== */
@media (max-width: 991px) {
	/* Chip u sticky headeru pored hamburgera */
	.lang-switcher-mount--bar {
		display: flex;
		margin-left: auto;
		margin-right: 6px;
		position: relative;
		z-index: 1004;
		transition: opacity 0.2s ease, visibility 0.2s ease;
	}

	/* Dok je side meni otvoren — sakrij header chip */
	.site-header.nav-open .lang-switcher-mount--bar {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}

	.lang-switcher-mount--bar .lang-switcher__label {
		display: none;
	}

	.lang-switcher-mount--bar .lang-switcher__toggle {
		min-height: 44px;
		min-width: 44px;
		padding: 8px 12px;
		box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
		background: #fff;
	}

	.lang-switcher-mount--bar .lang-switcher__flag {
		width: 22px;
		height: 22px;
	}

	.lang-switcher-mount--bar .lang-switcher__menu {
		right: 0;
		left: auto;
		min-width: 200px;
		padding: 10px;
		border-radius: 16px;
		box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
	}

	.lang-switcher-mount--bar .lang-switcher__option {
		min-height: 44px;
		padding: 10px 12px;
		border-radius: 12px;
	}

	.lang-switcher-mount--bar .lang-switcher__option-flag {
		width: 22px;
		height: 22px;
	}

	/* U draweru: uvek vidljiva 2×2 mreža — ispod nav linkova */
	.site-nav-drawer .lang-switcher-mount {
		order: 0;
		width: 100%;
		margin: 14px 0 8px;
		padding: 16px 0 0;
		border-top: 1px solid rgba(148, 163, 184, 0.28);
		border-bottom: none;
	}

	.site-nav-drawer .lang-switcher {
		width: 100%;
	}

	.site-nav-drawer .lang-switcher__label {
		display: block;
	}

	.site-nav-drawer .lang-switcher__toggle {
		display: none;
	}

	.site-nav-drawer .lang-switcher__menu {
		position: static;
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
		width: 100%;
		min-width: 0;
		margin: 0;
		padding: 0;
		border: none;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none !important;
		max-height: none;
		overflow: visible;
	}

	.site-nav-drawer .lang-switcher__menu > li {
		display: flex;
		min-width: 0;
	}

	.site-nav-drawer .lang-switcher__option {
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: 6px;
		width: 100%;
		min-height: 78px;
		padding: 12px 8px;
		border-radius: 16px;
		border: 1px solid rgba(148, 163, 184, 0.28);
		background: #faf8f4;
		white-space: normal;
		text-align: center;
		font-size: 13px;
	}

	.site-nav-drawer .lang-switcher__option-flag {
		width: 28px;
		height: 28px;
		box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.08);
	}

	.site-nav-drawer .lang-switcher__option-code {
		display: block;
		font-size: 11px;
		letter-spacing: 0.06em;
	}

	.site-nav-drawer .lang-switcher__option-name {
		font-size: 13px;
		font-weight: 700;
	}

	a.site-nav-drawer .lang-switcher__option:hover,
	a.site-nav-drawer .lang-switcher__option:focus-visible,
	.site-nav-drawer a.lang-switcher__option:hover,
	.site-nav-drawer a.lang-switcher__option:focus-visible {
		background: rgba(201, 168, 76, 0.14);
		border-color: rgba(201, 168, 76, 0.55);
		transform: translateY(-1px);
	}

	.site-nav-drawer .lang-switcher__option.is-active {
		background: rgba(201, 168, 76, 0.18);
		border-color: #C9A84C;
		color: #8a6d28;
		box-shadow: inset 0 0 0 1px rgba(201, 168, 76, 0.35);
	}

	/* Footer na mobilnom — kompaktan red zastava */
	.lang-switcher-mount--footer .lang-switcher__toggle {
		display: none;
	}

	.lang-switcher-mount--footer .lang-switcher__label {
		display: block;
		text-align: center;
		color: rgba(255, 255, 255, 0.65);
	}

	.lang-switcher-mount--footer .lang-switcher__menu {
		position: static;
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
		width: 100%;
		max-width: 320px;
		margin: 0 auto;
		padding: 0;
		border: none;
		background: transparent;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none !important;
		left: auto;
		right: auto;
	}

	.lang-switcher-mount--footer .lang-switcher__option {
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: 5px;
		min-height: 68px;
		padding: 10px 6px;
		border-radius: 14px;
		border: 1px solid rgba(255, 255, 255, 0.22);
		background: rgba(255, 255, 255, 0.08);
		color: #fff;
		white-space: normal;
		text-align: center;
	}

	.lang-switcher-mount--footer .lang-switcher__option-code {
		display: block;
		color: rgba(255, 255, 255, 0.55);
	}

	.lang-switcher-mount--footer .lang-switcher__option.is-active {
		background: rgba(201, 168, 76, 0.28);
		border-color: #C9A84C;
		color: #fff;
	}

	.lang-switcher-mount--footer a.lang-switcher__option:hover,
	.lang-switcher-mount--footer a.lang-switcher__option:focus-visible {
		background: rgba(255, 255, 255, 0.16);
		border-color: rgba(201, 168, 76, 0.7);
	}
}

@media (min-width: 992px) {
	.lang-switcher-mount--bar {
		display: none !important;
	}
}
