/*
 * WebsiteAdmin Orders: only what Tailwind utilities don't cover.
 * Layout and colours come from the theme's Tailwind build, which scans the
 * plugin's PHP templates (run `npm run build` in the theme after changes).
 */

/* Honeypot field: off-screen for people, still in the form for bots. */
.wa-orders-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wa-orders [hidden] {
	display: none !important;
}

.wa-orders .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Selected radio and tick-box cards. */
.wa-orders .wa-card:has(input:checked) {
	border-color: #002046;
	background-color: rgba(214, 227, 255, 0.4);
}

.wa-orders .wa-card:has(input:focus-visible) {
	outline: 2px solid #002046;
	outline-offset: 2px;
}

/* Expandable sections on the access step. */
.wa-orders details > summary {
	list-style: none;
	position: relative;
	padding-right: 2rem;
}

.wa-orders details > summary::-webkit-details-marker {
	display: none;
}

.wa-orders details > summary::after {
	content: 'expand_more';
	font-family: 'Material Symbols Outlined';
	font-size: 24px;
	line-height: 1;
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	transition: transform 0.2s ease-in-out;
}

.wa-orders details[open] > summary::after {
	transform: translateY(-50%) rotate(180deg);
}

.wa-orders button[disabled] {
	opacity: 0.6;
	cursor: wait;
}

/*
 * The [wa_availability] badge. assets/availability.js sets data-state to
 * green, orange or grey; until then the dot is neutral grey.
 */
.wa-availability {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.875rem;
	border: 1px solid #c4c6cf;
	border-radius: 9999px;
	background-color: #ffffff;
	color: #1b1c19;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
}

.wa-availability [data-wa-availability-dot] {
	flex: none;
	width: 0.625rem;
	height: 0.625rem;
	border-radius: 9999px;
	background-color: #74777f;
}

.wa-availability[data-state="green"] [data-wa-availability-dot] {
	background-color: #2e7d32;
	box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.wa-availability[data-state="orange"] [data-wa-availability-dot] {
	background-color: #d97706;
	box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.wa-availability[data-state="grey"] [data-wa-availability-dot] {
	background-color: #74777f;
}

@media (prefers-reduced-motion: no-preference) {
	.wa-availability[data-state="green"] [data-wa-availability-dot] {
		animation: wa-availability-pulse 2s ease-in-out infinite;
	}
}

@keyframes wa-availability-pulse {
	50% {
		box-shadow: 0 0 0 6px rgba(46, 125, 50, 0.05);
	}
}
