/**
 * Componente: Dropdown Menu (.vdp-dropdown)
 * Patrón inspirado en shadcn/ui Dropdown Menu (base-nova).
 * @see https://ui.shadcn.com/docs/components/base/dropdown-menu
 *
 * DropdownMenu → .vdp-dropdown
 * DropdownMenuTrigger → .vdp-dropdown__trigger
 * DropdownMenuContent → .vdp-dropdown__content
 * DropdownMenuGroup → .vdp-dropdown__group
 * DropdownMenuItem → .vdp-dropdown__item
 * DropdownMenuSeparator → .vdp-dropdown__separator
 */

.vdp-dropdown {
	position: relative;
	width: 100%;
}

.vdp-dropdown__trigger {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 10px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--vdp-ink);
	font-family: var(--vdp-font-ui);
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease;
}

.vdp-dropdown__trigger:hover,
.vdp-dropdown__trigger:focus-visible,
.vdp-dropdown.is-open .vdp-dropdown__trigger {
	background: var(--vdp-nav-toggle-active-bg);
	outline: none;
}

.vdp-dropdown__content {
	position: absolute;
	z-index: 30;
	display: none;
	min-width: 100%;
	padding: 4px;
	border: 1px solid var(--vdp-line);
	border-radius: 10px;
	background: var(--vdp-paper);
	box-shadow: 0 10px 30px rgba(23, 23, 20, 0.12);
}

.vdp-dropdown.is-open .vdp-dropdown__content {
	display: block;
}

.vdp-dropdown--up .vdp-dropdown__content {
	bottom: calc(100% + 8px);
	left: 0;
	right: 0;
}

.vdp-dropdown__group {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vdp-dropdown__item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--vdp-ink);
	font-family: var(--vdp-font-ui);
	font-size: var(--vdp-text-body-sm);
	font-weight: var(--vdp-weight-regular);
	line-height: var(--vdp-lh-body);
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.vdp-dropdown__item:hover,
.vdp-dropdown__item:focus-visible,
.vdp-dropdown__item:visited,
.vdp-dropdown__item:active,
.vdp-dropdown__item.is-active {
	background: var(--vdp-nav-toggle-active-bg);
	color: var(--vdp-ink);
	outline: none;
	text-decoration: none;
}

.vdp-dropdown__item--destructive {
	color: var(--vdp-color-error);
}

.vdp-dropdown__item--destructive:hover,
.vdp-dropdown__item--destructive:focus-visible,
.vdp-dropdown__item--destructive:visited,
.vdp-dropdown__item--destructive:active {
	background: var(--vdp-color-error-bg);
	color: var(--vdp-color-error);
	text-decoration: none;
}

.vdp-dropdown__separator {
	height: 1px;
	margin: 4px 0;
	background: var(--vdp-line);
}

.vdp-dropdown__logout-wrap {
	position: relative;
	list-style: none;
}

.vdp-dropdown__flyout {
	position: absolute;
	z-index: 40;
	left: calc(100% + 10px);
	bottom: 0;
	width: min(260px, calc(100vw - 48px));
	padding: 14px;
	border: 1px solid var(--vdp-line);
	border-radius: 10px;
	background: var(--vdp-paper);
	box-shadow: 0 10px 30px rgba(23, 23, 20, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateX(-8px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.vdp-dropdown__flyout.is-portaled {
	position: fixed;
	z-index: 10050;
	left: auto;
	bottom: auto;
	width: min(340px, calc(100vw - 32px));
	padding: 20px;
	text-align: center;
	transform: none;
}

.vdp-dropdown__flyout.is-portaled::before {
	content: '';
	position: absolute;
	left: -6px;
	top: var(--vdp-flyout-arrow-top, 50%);
	width: 12px;
	height: 12px;
	background: var(--vdp-paper);
	border-left: 1px solid var(--vdp-line);
	border-bottom: 1px solid var(--vdp-line);
	transform: translateY(-50%) rotate(45deg);
	pointer-events: none;
}

.vdp-dropdown__flyout.is-portaled.is-flipped::before {
	left: auto;
	right: -6px;
	border-left: 0;
	border-bottom: 0;
	border-right: 1px solid var(--vdp-line);
	border-top: 1px solid var(--vdp-line);
}

.vdp-dropdown__flyout.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

.vdp-dropdown__flyout.is-portaled.is-open {
	transform: none;
}

.vdp-dropdown__flyout[hidden] {
	display: block;
}

.vdp-dropdown__flyout:not(.is-open) {
	pointer-events: none;
}

.vdp-dropdown__flyout-title {
	margin: 0;
	font-family: var(--vdp-font-body);
	font-size: var(--vdp-text-h3);
	font-weight: var(--vdp-weight-semibold);
	line-height: var(--vdp-lh-h3);
	color: var(--vdp-ink);
	text-align: center;
}

.vdp-dropdown__flyout-text {
	margin: 8px 0 0;
	font-size: var(--vdp-text-body-sm);
	line-height: var(--vdp-lh-body);
	color: var(--vdp-muted);
	text-align: center;
}

.vdp-dropdown__flyout-actions {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
}

.vdp-dropdown__flyout-actions .vdp-btn {
	align-self: center;
	flex: 0 0 auto;
	margin: 0;
}

.vdp-dropdown__flyout-actions .vdp-dropdown__flyout-confirm {
	flex: 1 1 auto;
	min-width: 0;
	text-decoration: none;
	background: var(--vdp-wine);
	border-color: var(--vdp-wine);
	color: #fff;
}

.vdp-dropdown__flyout-actions .vdp-dropdown__flyout-confirm:hover,
.vdp-dropdown__flyout-actions .vdp-dropdown__flyout-confirm:focus {
	background: #6a2a28;
	border-color: #6a2a28;
	color: #fff;
	text-decoration: none;
}

.vdp-dropdown__flyout-actions .vdp-dropdown__flyout-confirm:visited {
	color: #fff;
}

/* Avatar (trigger) */
.vdp-avatar {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--vdp-olive) 18%, var(--vdp-paper));
	color: var(--vdp-olive);
	font-family: var(--vdp-font-ui);
	font-size: 12px;
	font-weight: var(--vdp-weight-semibold);
	letter-spacing: 0.02em;
	line-height: 1;
}
