/* Checkout time pickers, "Like the menu page" display style. Colors follow the checkout page theme. */
.fdoe-checkout-menu-picker {
	--fdoe-cmp-accent: var(--fdoe-checkout-picker-accent, var(--wp--preset--color--contrast, #1e1e1e));
	--fdoe-cmp-accent-text: var(--fdoe-checkout-picker-accent-text, var(--wp--preset--color--base, #fff));
	display: grid;
	gap: 16px;
	margin-top: 8px;
}

.fdoe-checkout-menu-picker__field,
.fdoe-checkout-menu-picker__group {
	display: grid;
	gap: 8px;
	min-width: 0;
}

.fdoe-checkout-menu-picker__label,
.fdoe-checkout-menu-picker__sublabel {
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.75;
}

.fdoe-checkout-menu-picker__sublabel {
	letter-spacing: 0.04em;
	opacity: 0.65;
}

.fdoe-checkout-menu-picker__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fdoe-checkout-menu-picker .fdoe-checkout-chip {
	min-height: 40px;
	margin: 0;
	padding: 8px 14px;
	border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
}

.fdoe-checkout-menu-picker .fdoe-checkout-chip:hover:not(:disabled) {
	border-color: currentColor;
}

.fdoe-checkout-menu-picker .fdoe-checkout-chip:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.fdoe-checkout-menu-picker .fdoe-checkout-chip.is-active {
	border-color: var(--fdoe-cmp-accent);
	background: var(--fdoe-cmp-accent);
	color: var(--fdoe-cmp-accent-text);
}

.fdoe-checkout-menu-picker .fdoe-checkout-chip:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.fdoe-checkout-menu-picker__note {
	margin: 0;
	opacity: 0.8;
}

@media (max-width: 480px) {
	.fdoe-checkout-menu-picker .fdoe-checkout-chip {
		padding: 8px 12px;
	}
}

@media (forced-colors: active) {
	.fdoe-checkout-menu-picker .fdoe-checkout-chip.is-active {
		border: 2px solid Highlight;
		background: Highlight;
		color: HighlightText;
	}
}

/* Compact row that opens the chips in a panel, like the Menu Flow time field. */
.fdoe-checkout-time-field {
	--fdoe-cmp-accent: var(--fdoe-checkout-picker-accent, var(--wp--preset--color--contrast, #1e1e1e));
	--fdoe-cmp-accent-text: var(--fdoe-checkout-picker-accent-text, var(--wp--preset--color--base, #fff));
	position: relative;
	margin-top: 8px;
}

.fdoe-checkout-time-field__button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.fdoe-checkout-time-field__button:hover {
	border-color: currentColor;
}

.fdoe-checkout-time-field__button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.fdoe-checkout-time-field.has-error .fdoe-checkout-time-field__button {
	border-color: var(--wc-red, #cc1818);
}

.fdoe-checkout-time-field__icon {
	flex: 0 0 auto;
}

.fdoe-checkout-time-field__text {
	display: grid;
	flex: 1 1 auto;
	min-width: 0;
	gap: 2px;
}

.fdoe-checkout-time-field__label {
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.75;
}

.fdoe-checkout-time-field__value {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.fdoe-checkout-time-field__value.is-placeholder {
	font-weight: 400;
	opacity: 0.75;
}

.fdoe-checkout-time-field__chevron {
	flex: 0 0 auto;
	transition: transform 0.15s ease;
}

.fdoe-checkout-time-field.is-open .fdoe-checkout-time-field__chevron {
	transform: rotate(180deg);
}

.fdoe-checkout-time-field__backdrop {
	display: none;
}

.fdoe-checkout-time-field__panel {
	position: absolute;
	z-index: 1000;
	top: calc(100% + 8px);
	left: 0;
	box-sizing: border-box;
	width: min(480px, 100%);
	max-height: min(70vh, 560px);
	padding: 16px;
	overflow-y: auto;
	border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 12px;
	background: var(--wp--preset--color--base, #fff);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.fdoe-checkout-time-field__panel .fdoe-checkout-menu-picker {
	margin-top: 12px;
}

.fdoe-checkout-time-field__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.fdoe-checkout-time-field__title {
	margin: 0;
	font-size: 1.05em;
}

.fdoe-checkout-time-field__copy {
	margin: 4px 0 0;
	font-size: 0.9em;
	opacity: 0.8;
}

.fdoe-checkout-time-field__close {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 1.5em;
	line-height: 1;
	cursor: pointer;
}

.fdoe-checkout-time-field__footer {
	display: flex;
	justify-content: flex-end;
	margin-top: 16px;
}

.fdoe-checkout-time-field__done {
	min-height: 40px;
	margin: 0;
	padding: 8px 20px;
	border: 1px solid var(--fdoe-cmp-accent);
	border-radius: 999px;
	background: var(--fdoe-cmp-accent);
	color: var(--fdoe-cmp-accent-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.fdoe-checkout-time-field__close:focus-visible,
.fdoe-checkout-time-field__done:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.fdoe-checkout-time-field.is-open .fdoe-checkout-time-field__backdrop {
		display: block;
		position: fixed;
		z-index: 99998;
		inset: 0;
		background: rgba(0, 0, 0, 0.4);
	}

	.fdoe-checkout-time-field__panel {
		position: fixed;
		z-index: 99999;
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-height: 85vh;
		border-radius: 16px 16px 0 0;
		padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}
}
