/**
 * Header login control (settings-driven)
 *
 * When a single login link is configured the header shows a normal button.
 * When several links are configured the button becomes a dropdown trigger:
 * the links drop down on hover (desktop) or when the button is tapped/focused
 * (mobile), mirroring the language selector interaction. The trigger keeps the
 * .btn.btn--primary styling — it is a button, never a bare link.
 *
 * Markup is produced by twiser_render_header_login() in inc/theme-settings.php.
 */

.login-switcher {
	position: relative;
	display: inline-block;
}

.login-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.login-switcher__arrow {
	transition: transform 0.2s ease;
}

/* Dropdown panel */
.login-switcher__dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 100;
	min-width: 180px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid rgba(15, 18, 43, 0.08);
	border-radius: 12px;
	box-shadow: 0 12px 30px rgba(15, 18, 43, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	pointer-events: none;
}

/* Invisible bridge so the cursor can travel from the button to the panel
   without dropping the hover state. */
.login-switcher__dropdown::before {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 0;
	right: 0;
	height: 10px;
}

.login-switcher__dropdown::after {
	background: url(../img/login-arrow.svg);
}

.login-switcher:hover .login-switcher__dropdown,
.login-switcher:focus-within .login-switcher__dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(4px);
	pointer-events: auto;
}

.login-switcher:hover .login-switcher__arrow,
.login-switcher:focus-within .login-switcher__arrow {
	transform: rotate(180deg);
}

/* Dropdown items */
.login-switcher__item {
	margin: 0;
}

.login-switcher__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 8px;
	color: #0f122b;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.login-switcher__link:hover,
.login-switcher__link:focus-visible {
	background: rgba(75, 61, 245, 0.08);
	color: #4b3df5;
}

/* Inside the mobile off-canvas footer the control is full width and the panel
   opens upward so it is never clipped at the bottom of the screen. */
.mobile-nav__footer .login-switcher {
	display: block;
}

.mobile-nav__footer .login-switcher__toggle {
	width: 100%;
	justify-content: center;
}

.mobile-nav__footer .login-switcher__dropdown {
	top: auto;
	bottom: 100%;
	left: 0;
	right: 0;
	transform: translateY(-8px);
}

.mobile-nav__footer .login-switcher:hover .login-switcher__dropdown,
.mobile-nav__footer .login-switcher:focus-within .login-switcher__dropdown {
	transform: translateY(-4px);
}

.mobile-nav__footer .login-switcher__dropdown::before {
	top: 100%;
	bottom: auto;
}
