/**
 * Modernes Dropdown fuer die Variationsauswahl (Ticketkategorie etc.)
 *
 * Farben orientieren sich an den Theme-Variablen; die Werte nach dem Komma
 * sind Rueckfallwerte, falls eine Variable im Theme anders heisst.
 *   --vts-accent  Hauptakzent (Rahmen, Hervorhebung)
 *   --vts-text    Textfarbe
 */

/* ---------- Layout der Variationen-Tabelle ---------- */
.variations_form table.variations {
	width: 100%;
	margin: 0 0 20px;
	border: 0;
	border-collapse: separate;
}
.variations_form table.variations tr {
	display: block;
	margin-bottom: 18px;
}
.variations_form table.variations th,
.variations_form table.variations td {
	display: block;
	padding: 0;
	border: 0;
	text-align: left;
}
.variations_form table.variations th.label label {
	display: block;
	margin-bottom: 8px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .02em;
}

/* ---------- Rueckfall: natives Select ohne JavaScript ---------- */
.variations_form .variations select:not(.vts-select__native) {
	width: 100%;
	min-height: 54px;
	padding: 12px 44px 12px 18px;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	color: var(--vts-text, #1f2430);
	background-color: #fff;
	border: 2px solid var(--vts-accent, #2563eb);
	border-radius: 14px;
	box-shadow: 0 4px 14px rgba(37, 99, 235, .15);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 18px center;
}

/* ---------- Eigenes Dropdown ---------- */
.vts-select {
	position: relative;
	width: 100%;
}
.vts-select__native {
	display: none !important;
}

.vts-select__btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 54px;
	padding: 12px 18px;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	color: var(--vts-text, #1f2430);
	background: #fff;
	border: 2px solid var(--vts-accent, #2563eb);
	border-radius: 14px;
	box-shadow: 0 4px 14px rgba(37, 99, 235, .15);
	cursor: pointer;
	transition: box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}
.vts-select__btn:hover {
	box-shadow: 0 6px 20px rgba(37, 99, 235, .25);
	transform: translateY(-1px);
}
.vts-select__btn:focus-visible {
	outline: 3px solid rgba(37, 99, 235, .35);
	outline-offset: 2px;
}
.vts-select__btn:disabled {
	opacity: .55;
	cursor: not-allowed;
	transform: none;
}

/* Platzhalter ("Bitte waehlen") faellt durch Akzentfarbe auf. */
.vts-select__value.is-placeholder {
	color: var(--vts-accent, #2563eb);
}

/* Solange nichts gewaehlt ist: sanft pulsierender Ring. */
.vts-select:not(.has-value) .vts-select__btn {
	animation: vts-select-pulse 2.6s ease-out infinite;
}
@keyframes vts-select-pulse {
	0%   { box-shadow: 0 4px 14px rgba(37, 99, 235, .15), 0 0 0 0 rgba(37, 99, 235, .35); }
	70%  { box-shadow: 0 4px 14px rgba(37, 99, 235, .15), 0 0 0 10px rgba(37, 99, 235, 0); }
	100% { box-shadow: 0 4px 14px rgba(37, 99, 235, .15), 0 0 0 0 rgba(37, 99, 235, 0); }
}
.vts-select.is-open .vts-select__btn {
	animation: none;
}

/* Sobald gewaehlt: dezent getoenter Hintergrund. */
.vts-select.has-value .vts-select__btn {
	background: rgba(37, 99, 235, .06);
}

/* Pfeil */
.vts-select__chevron {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	margin-top: -4px;
	color: var(--vts-accent, #2563eb);
	border-right: 2.5px solid currentColor;
	border-bottom: 2.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s ease, margin .2s ease;
}
.vts-select.is-open .vts-select__chevron {
	margin-top: 4px;
	transform: rotate(-135deg);
}

/* Auswahlliste */
.vts-select__list {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 50;
	max-height: 320px;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	list-style: none;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .08);
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(20, 24, 40, .18);
}
.vts-select__list[hidden] {
	display: none;
}
.vts-select.is-open .vts-select__list {
	animation: vts-select-in .16s ease-out;
}
@keyframes vts-select-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.vts-select__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 12px 14px;
	font-size: 16px;
	line-height: 1.3;
	color: var(--vts-text, #1f2430);
	border-radius: 10px;
	cursor: pointer;
}
.vts-select__option.is-active {
	background: rgba(37, 99, 235, .1);
}
.vts-select__option.is-selected {
	font-weight: 700;
	color: var(--vts-accent, #2563eb);
}
.vts-select__option.is-selected::after {
	content: "\2713";
	font-weight: 700;
}
.vts-select__option.is-disabled {
	opacity: .45;
	cursor: not-allowed;
}

/* "Auswahl zuruecksetzen" */
.variations_form .reset_variations {
	display: inline-block;
	margin-top: 10px;
	font-size: 14px;
	color: var(--vts-secondary, #6d757e);
	text-decoration: underline;
}

/* Bewegung reduzieren, wenn vom System gewuenscht */
@media (prefers-reduced-motion: reduce) {
	.vts-select__btn,
	.vts-select__chevron {
		transition: none;
	}
	.vts-select:not(.has-value) .vts-select__btn,
	.vts-select.is-open .vts-select__list {
		animation: none;
	}
}
