/* Stepper ticket list (forms/bookingform/tickets-stepper.php): each ticket with its price and minus and plus buttons that drive its spaces select, which shows instead until the booking form script marks the list ready. Pixelbones styles tables and buttons with !important, so the overrides here do too. */
.em-tickets-stepper {
	display: block;
	box-sizing: border-box;
	width: 100% !important;
	margin: 0 !important;
	overflow: hidden;
	border: 1px solid var(--border-color-softer) !important;
	border-radius: 5px;
	background: var(--background-color-inputs);
	border-collapse: separate;

	> tbody {
		display: block;
	}

	// rows a ticket's actions add, such as attendee forms, span the list
	tr:not(.em-ticket) {
		display: block;
	}

	td {
		display: block;
		padding: 0 !important;
		border: 0 !important;
		text-align: start !important;
	}

	.em-ticket {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto auto;
		align-items: center;
		gap: 4px 18px;
		padding: 14px 16px;
		border-top: 1px solid var(--border-color-softer);
	}

	> .em-ticket:first-child,
	> tbody:first-child > .em-ticket:first-child {
		border-top: 0;
	}

	.em-ticket-type {
		min-width: 0;
	}

	.em-ticket-name {
		display: block;
		color: var(--text-color-richer);
		font-weight: 500;
	}

	.em-ticket-desc {
		display: block;
		color: var(--text-color-softer);
		font-size: 12px;
		line-height: 18px;

		p {
			margin: 0 !important;
			line-height: 18px !important;
		}
	}

	.em-ticket-price {
		margin: 0 !important;
		color: var(--text-color-richer);
		font-weight: 500;
		font-variant-numeric: tabular-nums;
		white-space: nowrap;
	}

	.em-ticket-spaces {
		display: flex;
		flex-direction: column;
		align-items: flex-end;
		margin: 0 !important;

		select.em-ticket-select {
			width: auto !important;
			margin: 0 !important;
		}
	}

	// anything a single ticket's actions print, such as attendee forms, takes the row's full width under its name, price and stepper
	.em-ticket > :not(.em-ticket-type):not(.em-ticket-price):not(.em-ticket-spaces) {
		grid-column: 1 / -1;
	}

	td.em-ticket-bookings {
		padding: 0 16px 16px !important;
	}

	.em-ticket > .em-ticket-bookings {
		margin: 10px 0 2px !important;
	}

	.em-ticket-spaces-fixed {
		display: block;
		min-width: 30px;
		color: var(--text-color-richer);
		font-weight: 600;
		text-align: center;
	}

	.em-ticket-unavailable {
		color: var(--text-color-softer);
		font-size: 13px;
	}

	.em-ticket-stepper {
		display: none;
		align-items: center;
		border: 1px solid var(--border-color-softer);
		border-radius: 5px;
		background: var(--background-color-inputs);
	}

	.em-ticket-stepper-button {
		display: flex !important;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		width: 38px !important;
		min-width: 0 !important;
		height: 38px !important;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		border-radius: 5px !important;
		background: none !important;
		color: var(--accent-color) !important;
		box-shadow: none !important;
		cursor: pointer;

		&:hover {
			background: var(--background-color-softer) !important;
		}

		&:disabled {
			background: none !important;
			color: var(--border-color) !important;
			cursor: default;
		}

		// the weight of the text minus and plus the buttons showed before, in the button's own color
		.em-icon {
			width: 20px;
			height: 20px;
			margin: 0;
			background: currentColor;
			-webkit-mask: no-repeat center / 20px;
			mask: no-repeat center / 20px;

			&.em-icon-minus {
				-webkit-mask-image: var(--icon-minus-bold);
				mask-image: var(--icon-minus-bold);
			}

			&.em-icon-plus {
				-webkit-mask-image: var(--icon-plus-bold);
				mask-image: var(--icon-plus-bold);
			}
		}
	}

	.em-ticket-stepper-count {
		display: block;
		min-width: 30px;
		color: var(--text-color-richer);
		font-size: 15px;
		font-weight: 600;
		line-height: 38px;
		font-variant-numeric: tabular-nums;
		text-align: center;
	}

	&.ready {
		.em-ticket-stepper {
			display: inline-flex;
		}

		.em-ticket-spaces > select.em-ticket-select {
			display: none !important;
		}
	}

	@media (max-width: 479px) {
		.em-ticket {
			grid-template-columns: minmax(0, 1fr) auto;
		}

		.em-ticket-price {
			grid-column: 1;
			grid-row: 2;
		}

		.em-ticket-spaces {
			grid-column: 2;
			grid-row: 1 / span 2;
		}
	}
}

// pixelbones gives every table a bottom margin
table.em-tickets-stepper {
	margin: 0 !important;
}

/* Attendee forms under a ticket in the stepper list, or in the Attendees section Pro can print after the tickets */
.em-tickets-stepper, .em-booking-form-attendees {
	.em-ticket-bookings {
		&.hidden {
			display: none !important;
		}

		.em-ticket-booking {
			margin: 0 0 20px;
			padding: 20px 0 0;
			border-top: 1px solid var(--border-color-softer);

			&:first-child {
				padding-top: 0;
				border-top: 0;
			}

			> strong {
				display: block;
				margin-bottom: 15px;
			}
		}
	}

	.em-ticket-bookings-title {
		margin: 0 0 12px !important;
		color: var(--text-color-richer);
		font-weight: 600;
	}
}
