/*
 * TicketCo for WordPress — frontend styles.
 *
 * Layout-only. No colors, fonts, or borders that fight the active theme.
 * Block Themes / Full Site Editing themes will paint headings, buttons,
 * inputs and links with their own design tokens — we only handle the
 * structural concerns (grid, spacing, alignment).
 */

.tcfw-root {
	display: block;
	width: 100%;
}

.tcfw-event-detail {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.tcfw-event-detail__header h2 {
	margin: 0 0 0.25rem;
}

.tcfw-event-single__inner {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.tcfw-event-header {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.tcfw-event-header__title {
	margin: 0;
}

.tcfw-event-header__ingress {
	margin: 0;
	opacity: 0.85;
}

.tcfw-event-header__location,
.tcfw-event-header__description,
.tcfw-event-header__restrictions,
.tcfw-event-header__waiver {
	margin: 0;
}

.tcfw-event-header__restrictions,
.tcfw-event-header__waiver {
	opacity: 0.85;
	font-size: 0.9em;
}

.tcfw-event-list {
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
	display: flex;
	gap: 0.5rem;
}

.tcfw-event-list__item {
	margin: 0;
	width: min(100%, 250px);
}

.tcfw-event-list__button {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	width: 100%;
	text-align: left;
	padding: 1.25rem;
	border: 2px solid var(--tcfw-border-color, #ddd);
	border-radius: 0;
	background: transparent;
	cursor: pointer;
	height: 100%;
	gap: 1rem;
}

.tcfw-event-list__title {
	font-weight: 500;
}

.tcfw-event-list__meta {
	opacity: 0.85;
	font-size: 0.9em;
	font-weight: 400;
	margin-top: auto;
}

.tcfw-checkout-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	align-items: start;
	position: relative;
}

@media (max-width: 960px) {
	.tcfw-checkout-layout {
		grid-template-columns: 1fr;
	}
}

/* While the basket sync request is actually in flight the whole layout fades
   out and a spinner is shown in the middle. Interaction is blocked so nothing
   can be changed mid-update. */
.tcfw-checkout-layout.is-busy {
	pointer-events: none;
	user-select: none;
}

/* Dim the layout content but keep the spinner fully visible. */
.tcfw-checkout-layout.is-busy > *:not(.tcfw-checkout-layout__spinner) {
	opacity: 0.25;
}

/* On mobile the order total is fixed to the bottom of the screen, so it must
   stay fully visible while busy. An ancestor's opacity can't be undone on a
   descendant, so instead of dimming the total's ancestors (summary →
   cart-summary) we leave that chain at full opacity and dim only its
   siblings. */
@media (max-width: 640px) {
	.tcfw-checkout-layout.is-busy > .tcfw-checkout__summary,
	.tcfw-checkout-layout.is-busy .tcfw-checkout__summary > .tcfw-cart-summary {
		opacity: 1;
	}

	.tcfw-checkout-layout.is-busy .tcfw-checkout__summary > *:not(.tcfw-cart-summary),
	.tcfw-checkout-layout.is-busy .tcfw-cart-summary > *:not(.tcfw-cart-summary__total) {
		opacity: 0.25;
	}
}

.tcfw-checkout-layout__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 5;
	width: 2.5rem;
	height: 2.5rem;
	font-size: 0;
	color: transparent;
	border: 3px solid rgba(170, 170, 170, 0.35);
	border-top-color: #aaa;
	border-radius: 50%;
	animation: tcfw-spin 0.8s linear infinite;
}

@keyframes tcfw-spin {
	to {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

.tcfw-checkout__heading {
	margin: 0 0 1rem;
}

.tcfw-checkout__heading,
.tcfw-cart-summary__title,
.tcfw-buyer-form__title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.tcfw-icon {
	flex: 0 0 auto;
	width: 1.25rem;
	height: 1.25rem;
}

.tcfw-cart-summary__empty {
	margin: 0 0 0.75rem;
	opacity: 0.7;
}

.tcfw-basket__total--calculating {
	opacity: 0.7;
}

.tcfw-stepper {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: tcfw-step;
}

.tcfw-stepper__step {
	flex: 1 1 0;
	min-width: 8rem;
	padding: 0.5rem 0.75rem;
	border-bottom: 2px solid currentColor;
	opacity: 0.4;
}

.tcfw-stepper__step.is-current {
	opacity: 1;
	font-weight: 600;
}

.tcfw-stepper__step.is-complete {
	opacity: 0.85;
}

.tcfw-stepper__label {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: default;
}

.tcfw-stepper__step.is-complete .tcfw-stepper__label {
	cursor: pointer;
	text-decoration: underline;
}

.tcfw-stepper__index {
	opacity: 0.7;
}

.tcfw-payment {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	padding: 2rem 0;
}

.tcfw-payment__hint {
	margin: 0;
}

.tcfw-cart-summary {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	border-radius: 4px;
	margin-bottom: 2rem;
	opacity: 0.95;
}

.tcfw-cart-summary__title {
	margin: 0;
}

.tcfw-cart-summary__items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.tcfw-cart-summary__item {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding: 1rem 0;
}

.tcfw-cart-summary__line {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	align-items: baseline;
}

.tcfw-cart-summary__line-label {
	opacity: 0.75;
}

.tcfw-cart-summary__qty {
	opacity: 0.75;
}

.tcfw-cart-summary__price {
	font-variant-numeric: tabular-nums;
}

.tcfw-cart-summary__total {
	margin: 0;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.5rem;
}

.tcfw-event-detail__meta {
	margin: 0;
	opacity: 0.85;
}

.tcfw-event-detail__description {
	line-height: 1.6;
}

.tcfw-tickets {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.tcfw-event-detail__group {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.tcfw-event-detail__group-head {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.tcfw-event-detail__group-head h3 {
	margin: 0;
}

.tcfw-ticket {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.5rem 0;
}

.tcfw-ticket__product-name {
	font-weight: 700;
}

.tcfw-ticket__name-row,
.tcfw-ticket__desc-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
}

.tcfw-ticket__name-row .tcfw-ticket__price {
	margin-left: auto;
}

.tcfw-ticket__qty {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
}

.tcfw-ticket__qty button {
	min-width: 1.5rem;
}

.tcfw-ticket__count {
	min-width: 1.5rem;
	text-align: center;
}

.tcfw-ticket__buy-link {
	margin-left: auto;
	white-space: nowrap;
}

.tcfw-ticket__product-desc {
	opacity: 0.85;
}

.tcfw-ticket__access {
	margin-top: 0.25rem;
}

.tcfw-basket__hint {
	margin: 0;
	opacity: 0.85;
}

.tcfw-basket {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.tcfw-basket__items {
	list-style: disc inside;
	margin: 0;
	padding: 0;
}

.tcfw-basket__discount {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.tcfw-basket__discount.is-busy {
	opacity: 0.5;
	pointer-events: none;
}

.tcfw-basket__discount-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
}

.tcfw-basket__discount-applied {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.tcfw-basket__discount-code {
	font-weight: 600;
}

.tcfw-basket__discount-amount {
	color: #157347;
}

.tcfw-basket__discount-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	line-height: 1;
	background: none;
	border: 0;
	cursor: pointer;
	font-size: 1.1rem;
}

.tcfw-basket__discount-verify[disabled],
.tcfw-basket__discount-verify:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.tcfw-basket__discount-feedback {
	margin: 0;
	font-size: 0.9em;
}

.tcfw-basket__discount-feedback.is-valid {
	color: #157347;
}

.tcfw-basket__discount-feedback.is-invalid,
.tcfw-basket__discount-feedback.is-error {
	color: #b02a37;
}

.tcfw-basket__total {
	margin: 0;
}

.tcfw-basket__total-status {
	font-weight: normal;
	opacity: 0.7;
	font-size: 0.9em;
}

.tcfw-buyer-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.tcfw-buyer-form__field-desc {
	font-size: 0.8em;
	color: #6c757d;
}

.tcfw-checkout {
	align-self: flex-start;
}

.tcfw-checkout[disabled],
.tcfw-checkout:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.tcfw-loading,
.tcfw-empty,
.tcfw-error {
	padding: 0.5rem 0;
}

.tcfw-editor-placeholder .tcfw-editor-card {
	padding: 1rem;
	border: 1px dashed currentColor;
	opacity: 0.7;
}

/* ------------------------------------------------------------------ *
 * Keyboard / focus accessibility
 *
 * Make every interactive element inside the event-single block show a
 * clearly visible focus ring when reached via Tab so keyboard users can
 * always tell where they are. Uses :focus-visible so mouse clicks don't
 * leave a lingering outline.
 * ------------------------------------------------------------------ */

.wp-block-tcfw-event-single :focus-visible,
.tcfw-event-single :focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	border-radius: 2px;
}

/* ------------------------------------------------------------------ *
 * Booking status / order confirmation
 * ------------------------------------------------------------------ */

.tcfw-booking-status__inner {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	max-width: 40rem;
}

.tcfw-booking-status__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.tcfw-booking-status__title {
	margin: 0;
}

.tcfw-booking-status__badge {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	background: #e9ecef;
	color: #495057;
}

.tcfw-booking-status__badge.is-paid {
	background: #d1e7dd;
	color: #157347;
}

.tcfw-booking-status__event {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.tcfw-booking-status__event-name {
	margin: 0;
}

.tcfw-booking-status__event-date {
	margin: 0;
	opacity: 0.75;
}

.tcfw-booking-status__reference {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
	margin: 0;
	padding: 0.75rem 1rem;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.03);
}

.tcfw-booking-status__reference-label {
	opacity: 0.75;
}

.tcfw-booking-status__reference-value {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-weight: 600;
	word-break: break-all;
}

.tcfw-booking-status__items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.tcfw-booking-status__item {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 1rem 0;
	border-top: 1px solid var(--tcfw-border-color, #ddd);
}

.tcfw-booking-status__item:first-child {
	border-top: 0;
}

.tcfw-booking-status__item-main {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.tcfw-booking-status__item-qty {
	opacity: 0.75;
	font-variant-numeric: tabular-nums;
}

.tcfw-booking-status__item-name {
	flex: 1 1 auto;
	font-weight: 600;
}

.tcfw-booking-status__item-price {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.tcfw-booking-status__item-unit {
	font-size: 0.85rem;
	opacity: 0.7;
}

.tcfw-booking-status__item-desc {
	margin: 0;
	font-size: 0.9rem;
	opacity: 0.75;
}

.tcfw-booking-status__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	margin: 0;
	padding-top: 1rem;
	border-top: 2px solid var(--tcfw-border-color, #ddd);
	font-size: 1.15rem;
}

.tcfw-booking-status__total-amount {
	font-variant-numeric: tabular-nums;
}

.tcfw-booking-status__empty {
	padding: 0.5rem 0;
}
