/*
 * Maia base styles: layout and states only. Colours, fonts and sizes come from the theme
 * through the --maia-* variables below.
 */

:root {
	--maia-gap: 1rem;
	--maia-radius: 4px;
	--maia-border: rgba(0, 0, 0, 0.15);
	--maia-muted: rgba(0, 0, 0, 0.6);
	--maia-error: #b32d2e;
	--maia-warning: #b26200;
	--maia-warning-bg: #fff7e6;
	--maia-success: #00703c;
	--maia-accent: currentColor;
}

/* The hidden attribute must win over display rules below. */
.maia-tickets [hidden],
.maia-attendee [hidden] {
	display: none !important;
}

/* Step indicator */

.maia-steps ol {
	display: flex;
	flex-wrap: wrap;
	gap: calc(var(--maia-gap) * 0.5) var(--maia-gap);
	margin: 0 0 calc(var(--maia-gap) * 1.5);
	padding: 0;
	list-style: none;
}

.maia-step {
	color: var(--maia-muted);
}

.maia-step a {
	color: inherit;
}

.maia-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75em;
	height: 1.75em;
	border: 1px solid currentColor;
	border-radius: 50%;
	font-size: 0.85em;
}

.maia-step--current {
	color: inherit;
	font-weight: 600;
}

.maia-step--current .maia-step-number {
	background: var(--maia-accent);
	border-color: var(--maia-accent);
	color: #fff;
}

/* Step 1: ticket list */

.maia-tickets-group + .maia-tickets-group {
	margin-top: calc(var(--maia-gap) * 2);
}

.maia-ticket {
	margin: 0 0 var(--maia-gap);
	padding: var(--maia-gap);
	border: 1px solid var(--maia-border);
	border-radius: var(--maia-radius);
}

.maia-ticket-title {
	margin: 0;
}

.maia-ticket-meta {
	margin: 0.25em 0 0;
	color: var(--maia-muted);
}

.maia-ticket-options {
	margin: var(--maia-gap) 0 0;
	padding: 0;
	list-style: none;
}

.maia-ticket-option {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: var(--maia-gap);
	align-items: center;
	padding: 0.5em 0;
	border-top: 1px solid var(--maia-border);
}

.maia-ticket-option--soldout {
	color: var(--maia-muted);
}

/* "Not bookable yet": the note where price and quantity would be. */
.maia-ticket-not-bookable {
	margin: var(--maia-gap) 0 0;
	padding: 0.5em 0;
	border-top: 1px solid var(--maia-border);
	color: var(--maia-muted);
	text-align: right;
}

.maia-ticket-option-proof {
	display: block;
	color: var(--maia-muted);
}

.maia-qty {
	display: inline-flex;
	align-items: center;
	gap: 0.25em;
}

.maia-qty input {
	width: 3.5em;
	text-align: center;
}

.maia-qty-step {
	display: none;
	min-width: 2.25em;
	min-height: 2.25em;
}

.maia-js .maia-qty-step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.maia-ticket-details {
	margin-top: 0.5em;
}

.maia-ticket-details summary {
	cursor: pointer;
}

.maia-tickets-footer {
	display: flex;
	flex-wrap: wrap;
	gap: var(--maia-gap);
	align-items: center;
	justify-content: flex-end;
	margin-top: calc(var(--maia-gap) * 1.5);
}

.maia-tickets-total {
	margin: 0;
	font-weight: 600;
}

@media (max-width: 480px) {
	.maia-ticket-option {
		grid-template-columns: 1fr auto;
	}

	.maia-ticket-option .maia-qty,
	.maia-ticket-option .maia-ticket-soldout {
		grid-column: 1 / -1;
		justify-self: end;
	}
}

/* Detail page */

.maia-ticket-info p {
	margin: 0 0 0.5em;
}

.maia-ticket-info-sale--closed {
	color: var(--maia-error);
}

/* "Not bookable yet" is no error. */
.maia-ticket-info-sale--soon {
	font-weight: 600;
}

.maia-ticket-info-proof {
	color: var(--maia-muted);
}

/* Thank-you page */

.maia-transfer-deadline,
.maia-thankyou-proof {
	padding: 0.75em 1em;
	border-left: 3px solid var(--maia-warning);
	background: var(--maia-warning-bg);
}

/* Notices (ticket page) */

.maia-notice {
	margin: 0 0 var(--maia-gap);
	padding: 0.75em 1em;
	border-left: 3px solid var(--maia-border);
}

.maia-notice--success {
	border-left-color: var(--maia-success);
}

.maia-notice--error {
	border-left-color: var(--maia-error);
}

/* Ticket page: "Send my tickets again" */

.maia-ticket-resend {
	max-width: 28rem;
}

.maia-ticket-resend .maia-field {
	margin-bottom: var(--maia-gap);
}

/* "My account": create an account for an order (link from the ticket mail) */

/* "Your tickets" above the order details (My account, order confirmation). */
.maia-order-tickets {
	margin: 0 0 calc(var(--maia-gap) * 2);
}

.maia-order-tickets .maia-ticket-download {
	margin: 0 0 var(--maia-gap);
}

.maia-order-tickets .maia-ticket-for {
	display: block;
	margin-bottom: calc(var(--maia-gap) / 2);
}

.maia-account-offer {
	margin: 0 0 calc(var(--maia-gap) * 1.5);
	padding: 0.75em 1em;
	border-left: 3px solid var(--maia-border);
}

/* Checkout: address only with "I need an invoice", account hint only with "Create an account?"
   (assets/js/invoice.js). !important, because WooCommerce's address script shows the rows
   with an inline style. */

.maia-invoice-off .maia-invoice-field,
.maia-account-off .maia-account-hint {
	display: none !important;
}

/* WooCommerce shows field descriptions as a bubble only while the field has focus, which a
   checkbox hardly ever has: plain text below the tick instead. "(optional)" is pointless on a
   checkbox. */
.woocommerce-checkout .form-row.maia-invoice-toggle .woocommerce-input-wrapper .description {
	display: block !important;
	position: static;
	margin: 0.25em 0 0;
	padding: 0;
	border-radius: 0;
	background: none;
	color: var(--maia-muted);
	font-size: 0.9em;
}

.woocommerce-checkout .form-row.maia-invoice-toggle .woocommerce-input-wrapper .description::before {
	display: none;
}

.maia-invoice-toggle .optional {
	display: none;
}

/* Hidden field for bots; out of sight, not display:none (some bots skip those). */
.maia-hp {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Step 2: attendees (inside the WooCommerce cart table) */

.maia-attendee {
	margin-top: 0.75em;
}

.maia-attendee-days,
.maia-attendee-hint {
	margin: 0.25em 0;
	color: var(--maia-muted);
	font-size: 0.9em;
}

.maia-attendee-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 0.5em var(--maia-gap);
}

.maia-field {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
	margin: 0;
}

.maia-field input {
	width: 100%;
	box-sizing: border-box;
}

.maia-field--invalid input {
	border-color: var(--maia-error);
}

.maia-field-error {
	color: var(--maia-error);
	font-size: 0.9em;
}

.maia-field-error:empty {
	display: none;
}

.maia-field-hint {
	color: var(--maia-muted);
	font-size: 0.9em;
}

.maia-field-progress {
	width: 100%;
	height: 0.5em;
}

/* Member number check and upload. "Review" stays neutral: it must not sound like an error,
   and looks the same for "not found" and "already used" (security concept S5). */

.maia-field-notice {
	font-size: 0.9em;
}

.maia-field-notice:empty {
	display: none;
}

.maia-field-notice--verified,
.maia-field-notice--uploaded {
	color: var(--maia-success);
}

.maia-field-notice--verified::before,
.maia-field-notice--uploaded::before {
	content: "✓ ";
}

.maia-field-notice--review {
	color: var(--maia-muted);
}

.maia-attendee-warning {
	margin: 0.5em 0 0;
	padding: 0.5em 0.75em;
	border-left: 3px solid var(--maia-warning);
	background: var(--maia-warning-bg);
}

.maia-attendee-warning:empty {
	display: none;
}

.maia-attendee-copy {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	align-items: center;
	margin: 0.5em 0;
}

.maia-attendee-status {
	min-height: 1.4em;
	margin: 0.25em 0 0;
	color: var(--maia-muted);
	font-size: 0.9em;
}

.maia-attendee[data-maia-state="complete"] .maia-attendee-status {
	color: var(--maia-success);
}

.maia-attendee[data-maia-state="complete"] .maia-attendee-status::before {
	content: "✓ ";
}

.maia-attendee[data-maia-state="error"] .maia-attendee-status {
	color: var(--maia-error);
}

/* Ticket-only carts: no thumbnails, no quantity, no subtotal (always equal to the price) */

.maia-cart-tickets-only .woocommerce-cart-form .product-thumbnail,
.maia-cart-tickets-only .woocommerce-cart-form .product-quantity,
.maia-cart-tickets-only .woocommerce-cart-form .product-subtotal {
	display: none;
}

/* Ticket lines are tall (attendee fields): the price sits on the line of the ticket title,
   not in the middle. */
.maia-cart-has-tickets .woocommerce-cart-form td.product-price,
.maia-cart-has-tickets .woocommerce-cart-form td.product-subtotal {
	vertical-align: top;
}

/* WooCommerce's small-screen table right-aligns cells and prefixes "Product:"; the
   attendee fields need the full width instead. */
@media (max-width: 768px) {
	.maia-cart-has-tickets .woocommerce-cart-form td.product-name {
		text-align: left !important;
	}

	.maia-cart-has-tickets .woocommerce-cart-form td.product-name::before {
		display: none;
	}
}

/* With JavaScript, names save while typing: the save buttons are not needed.
   !important beats WooCommerce's more specific button rules. */

.maia-js .maia-cart-tickets-only button[name="update_cart"],
.maia-js .maia-proceed-nojs {
	display: none !important;
}

/* Checkout: coupon between the order summary and the payment methods. */
.maia-checkout-coupon {
	margin: calc(var(--maia-gap) * 1.5) 0;
}

.maia-checkout-coupon label {
	display: block;
	margin-bottom: calc(var(--maia-gap) / 2);
}

.maia-checkout-coupon-row {
	display: flex;
	gap: var(--maia-gap);
}

.maia-checkout-coupon-row input {
	flex: 1;
	min-width: 0;
}

.maia-checkout-coupon-message {
	margin: calc(var(--maia-gap) / 2) 0 0;
}

.maia-checkout-coupon-message:empty {
	display: none;
}
