/**
 * LGM Tickets — front-end widget styling.
 * Inherits the shared .lgm-ae-* controls + design tokens from Core frontend.css.
 *
 * Flow:
 *   1. Selection — attribute pills + live summary + quantity + "Add ticket",
 *      with a quick cart below and a "Continue" button.
 *   2. Forms popup — a modal with a tab per attendee, stepped with Prev/Next.
 *   3. Checkout — handled by the popup's checkout button.
 * Uses logical properties for RTL.
 */
.lgm-ae-tickets {
	margin: 22px 0;
}

/* Session picker (recurring events) — full width above the card ------------- */
.lgm-ae-tk-head {
	margin-bottom: 18px;
}
.lgm-ae-tk-head .lgm-ae-field {
	margin-bottom: 0;
	max-width: 520px;
}

.lgm-ae-tk-title {
	margin: 0 0 18px;
	font-size: 1.15rem;
	color: var( --lgm-ae-green-deep );
}

/* ── Step 1 — configurator ───────────────────────────────────────────── */
.lgm-ae-tk-select {
	min-width: 0;
}
.lgm-ae-tk-config {
	min-width: 0;
}
.lgm-ae-tk-selects {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.lgm-ae-tk-attr {
	margin-bottom: 0;
}

/* Segmented option pills (progressive enhancement over the native select) --- */
.lgm-ae-segmented {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.lgm-ae-tk-attr:not( .is-enhanced ) .lgm-ae-segmented,
.lgm-ae-segmented:empty {
	display: none;
}
.lgm-ae-tk-attr.is-enhanced .lgm-ae-tk-attr__native {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	border: 0;
}
.lgm-ae-seg {
	appearance: none;
	border: 1.5px solid var( --lgm-ae-line );
	border-radius: 1000px;
	background: var( --lgm-ae-surface );
	color: var( --lgm-ae-navy );
	font-family: inherit;
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 8px 16px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.lgm-ae-seg:hover {
	border-color: var( --lgm-ae-green );
	background: rgba( 15, 93, 58, 0.06 );
}
.lgm-ae-seg:focus-visible {
	outline: none;
	border-color: var( --lgm-ae-green );
	box-shadow: 0 0 0 3px rgba( 15, 93, 58, 0.15 );
}
.lgm-ae-seg.is-selected {
	background: var( --lgm-ae-green );
	border-color: var( --lgm-ae-green );
	color: var( --lgm-fg-on-green, #fff );
}

/* Live ticket summary ------------------------------------------------------ */
.lgm-ae-tk-summary {
	min-width: 0;
}
.lgm-ae-tk-selects + .lgm-ae-tk-summary {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid var( --lgm-ae-line );
}
.lgm-ae-tk-summary__name {
	font-weight: 800;
	font-size: 1.2rem;
	line-height: 1.2;
	color: var( --lgm-ae-navy );
}
.lgm-ae-tk-summary__price {
	margin-top: 4px;
	font-weight: 800;
	color: var( --lgm-ae-green-deep );
	font-variant-numeric: tabular-nums;
}
.lgm-ae-tk-summary__meta {
	margin-top: 6px;
	font-size: 0.8rem;
	font-weight: 700;
	color: var( --lgm-ae-gold-ink );
	min-height: 1em;
}
.lgm-ae-tk-summary__meta.is-soldout {
	color: var( --lgm-ae-danger );
}
.lgm-ae-tk-summary__desc {
	margin: 10px 0 0;
	font-size: 0.9rem;
	line-height: 1.55;
	color: var( --lgm-ae-slate );
}
.lgm-ae-tk-summary__desc:empty {
	display: none;
}

/* Quantity + Add ticket ---------------------------------------------------- */
.lgm-ae-tk-add {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 14px;
	margin-top: 18px;
}
.lgm-ae-tk-add__qty {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.lgm-ae-tk-add__qty-label {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --lgm-ae-muted );
}
.lgm-ae-tk-add__btn {
	flex: 1 1 auto;
}

/* ── Quick cart ──────────────────────────────────────────────────────── */
.lgm-ae-tk-cart {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid var( --lgm-ae-line );
}
.lgm-ae-tk-cart__title {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 700;
	color: var( --lgm-ae-navy );
}
.lgm-ae-tk-cart__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.lgm-ae-tk-cart__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid var( --lgm-ae-line );
}
.lgm-ae-tk-cart__name {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
	color: var( --lgm-ae-navy );
	overflow-wrap: anywhere;
}
.lgm-ae-tk-cart__qty {
	flex: 0 0 auto;
	color: var( --lgm-ae-muted );
	font-variant-numeric: tabular-nums;
}
.lgm-ae-tk-cart__price {
	flex: 0 0 auto;
	font-weight: 700;
	color: var( --lgm-ae-green-deep );
	font-variant-numeric: tabular-nums;
}
.lgm-ae-tk-cart__remove {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var( --lgm-ae-line );
	border-radius: 8px;
	background: var( --lgm-ae-surface );
	color: var( --lgm-ae-slate );
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}
.lgm-ae-tk-cart__remove:hover {
	border-color: var( --lgm-ae-danger );
	color: var( --lgm-ae-danger );
}
.lgm-ae-tk-cart__foot {
	margin-top: 14px;
}
.lgm-ae-tk-cart__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 12px;
}
.lgm-ae-tk-cart__total-label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --lgm-ae-muted );
}
.lgm-ae-tk-cart__total-val {
	font-size: 1.4rem;
	font-weight: 800;
	color: var( --lgm-ae-green-deep );
	font-variant-numeric: tabular-nums;
}

/* ── Step 2 — tabbed forms modal ─────────────────────────────────────── */
.lgm-ae-tk-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.lgm-ae-tk-modal[hidden] {
	display: none;
}
.lgm-ae-tk-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 11, 38, 60, 0.55 );
	-webkit-backdrop-filter: blur( 2px );
	backdrop-filter: blur( 2px );
	cursor: pointer;
}
.lgm-ae-tk-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	max-height: calc( 100vh - 40px );
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba( 11, 38, 60, 0.35 );
	animation: lgm-ae-modal-in 0.18s ease-out;
}
@media ( prefers-reduced-motion: reduce ) {
	.lgm-ae-tk-modal__dialog {
		animation: none;
	}
}
@keyframes lgm-ae-modal-in {
	from {
		opacity: 0;
		transform: translateY( 12px );
	}
	to {
		opacity: 1;
		transform: none;
	}
}
.lgm-ae-tk-modal__head {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 22px;
	border-bottom: 1px solid var( --lgm-ae-line );
}
.lgm-ae-tk-modal__head .lgm-ae-tk-title {
	margin: 0;
}
.lgm-ae-tk-modal__close {
	flex: none;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var( --lgm-ae-line );
	border-radius: 8px;
	background: var( --lgm-ae-surface );
	color: var( --lgm-ae-slate );
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s;
}
.lgm-ae-tk-modal__close:hover {
	border-color: var( --lgm-ae-danger );
	color: var( --lgm-ae-danger );
}

/* Tab strip (one per attendee) — scrolls horizontally when it overflows */
.lgm-ae-tk-modal__tabs {
	flex: none;
	display: flex;
	gap: 8px;
	padding: 12px 22px;
	overflow-x: auto;
	border-bottom: 1px solid var( --lgm-ae-line );
	background: var( --lgm-ae-surface-alt );
	/* Scrolls when the tabs overflow, but without a visible scrollbar. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.lgm-ae-tk-modal__tabs::-webkit-scrollbar {
	width: 0;
	height: 0;
	display: none;
}
.lgm-ae-tk-tab {
	flex: 0 0 auto;
	appearance: none;
	border: 1.5px solid var( --lgm-ae-line );
	border-radius: 1000px;
	background: var( --lgm-ae-surface );
	color: var( --lgm-ae-navy );
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.2;
	padding: 7px 14px;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.lgm-ae-tk-tab:hover {
	border-color: var( --lgm-ae-green );
}
.lgm-ae-tk-tab:focus-visible {
	outline: none;
	border-color: var( --lgm-ae-green );
	box-shadow: 0 0 0 3px rgba( 15, 93, 58, 0.15 );
}
.lgm-ae-tk-tab.is-active {
	background: var( --lgm-ae-green );
	border-color: var( --lgm-ae-green );
	color: var( --lgm-fg-on-green, #fff );
}

.lgm-ae-tk-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 20px 22px;
}
.lgm-ae-tk-panel[hidden] {
	display: none;
}

.lgm-ae-tk-modal__foot {
	flex: none;
	padding: 16px 22px;
	border-top: 1px solid var( --lgm-ae-line );
	background: var( --lgm-ae-surface );
}
.lgm-ae-tk-modal__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 12px;
}
.lgm-ae-tk-modal__total-label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --lgm-ae-muted );
}
.lgm-ae-tk-modal__total-val {
	font-weight: 800;
	font-size: 1.5rem;
	line-height: 1;
	color: var( --lgm-ae-green-deep );
	font-variant-numeric: tabular-nums;
}
.lgm-ae-tk-modal__nav {
	display: flex;
	align-items: center;
	gap: 12px;
}
.lgm-ae-tk-modal__nav .lgm-ae-btn {
	flex: 0 0 auto;
}
/* `.lgm-ae-btn` sets display, which beats the UA [hidden] rule — restore it so
   toggling the Next / checkout buttons via the hidden attribute actually hides. */
.lgm-ae-btn[hidden] {
	display: none;
}
.lgm-ae-tk-modal__nav [data-tk-next],
.lgm-ae-tk-modal__nav [data-tk-checkout] {
	margin-inline-start: auto;
}
.lgm-ae-tk-modal__step {
	font-size: 0.8rem;
	font-weight: 700;
	color: var( --lgm-ae-muted );
	font-variant-numeric: tabular-nums;
}

/* Phones: the primary action gets its own full-width row so the long
   "Continue to payment" label never overflows the dialog. */
@media ( max-width: 480px ) {
	.lgm-ae-tk-modal {
		padding: 12px;
	}
	.lgm-ae-tk-modal__nav {
		flex-wrap: wrap;
	}
	.lgm-ae-tk-modal__step {
		margin-inline-start: auto;
	}
	.lgm-ae-tk-modal__nav .lgm-ae-btn[data-tk-next],
	.lgm-ae-tk-modal__nav .lgm-ae-btn[data-tk-checkout] {
		order: 3;
		flex: 1 1 100%;
		margin-inline-start: 0;
		justify-content: center;
	}
}

/* Per-attendee form inside a panel */
.lgm-ae-tk-modal .lgm-ae-tk-form {
	max-width: none;
	margin: 0;
}
.lgm-ae-tk-form__head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
}
.lgm-ae-tk-form__name {
	font-weight: 800;
	font-size: 1.1rem;
	color: var( --lgm-ae-navy );
}
.lgm-ae-tk-form__price {
	margin-inline-start: auto;
	font-weight: 800;
	color: var( --lgm-ae-green-deep );
	font-variant-numeric: tabular-nums;
}
.lgm-ae-tk-form__remove {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	border: 1px solid var( --lgm-ae-line );
	border-radius: 8px;
	background: var( --lgm-ae-surface );
	color: var( --lgm-ae-slate );
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1;
	padding: 6px 10px;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.lgm-ae-tk-form__remove span {
	font-size: 1.05rem;
}
.lgm-ae-tk-form__remove:hover {
	border-color: var( --lgm-ae-danger );
	color: var( --lgm-ae-danger );
	background: rgba( 255, 56, 60, 0.06 );
}

body.lgm-ae-modal-open {
	overflow: hidden;
}

/* Anti-spam honeypot -------------------------------------------------------- */
.lgm-ae-hp {
	position: absolute;
	left: -9999px;
	top: -9999px;
	height: 0;
	overflow: hidden;
}

/* Success + closed states -------------------------------------------------- */
.lgm-ae-tk-success {
	text-align: center;
	margin-top: 16px;
}
.lgm-ae-tk-success__tick {
	width: 46px;
	height: 46px;
	margin: 0 auto 10px;
	border-radius: 50%;
	background: var( --lgm-ae-green );
	color: var( --lgm-fg-on-green, #fff );
	font-size: 24px;
	line-height: 46px;
}
.lgm-ae-tk-closed {
	color: var( --lgm-ae-slate );
}
