/**
 * The country combobox (D-036).
 *
 * Loaded only where a phone field is rendered.
 */

.srs-combo {
	position: relative;
}

/*
 * Present for a screen reader, absent for everyone else. The country control's
 * name cannot be shown: its visible label belongs to the national number beside
 * it, and "+ Code" is a placeholder rather than a name.
 */
.srs-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/*
 * The select stays in the document and stays submitting — it is only taken out
 * of sight once the script has upgraded it. display:none would break nothing
 * here, but clip keeps it reachable to assistive technology that follows a
 * label, and hidden inputs cannot be focused programmatically.
 */
.srs-combo__select--upgraded {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.srs-combo__input {
	width: 100%;
	box-sizing: border-box;
}

.srs-combo__list {
	position: absolute;
	z-index: 20;
	top: 100%;
	left: 0;
	min-width: 100%;
	/* Wide enough for "+852 · Hong Kong SAR" even when the control itself is
	   30% of a 3:7 split. */
	width: max-content;
	max-width: 22rem;
	max-height: 16rem;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.12 );
}

.srs-combo__group {
	padding: 0.4rem 0.75rem 0.2rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #646970;
}

.srs-combo__option {
	padding: 0.4rem 0.75rem;
	cursor: pointer;
	white-space: nowrap;
}

.srs-combo__option.is-active,
.srs-combo__option:hover {
	background: #f0f0f1;
}

.srs-combo__empty {
	padding: 0.5rem 0.75rem;
	color: #646970;
}

/* The number sits beside the code at D-036's 3:7 split. */
.srs-phone {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
}

.srs-phone__country {
	flex: 3 1 0;
	min-width: 0;
}

.srs-phone__national {
	flex: 7 1 0;
	min-width: 0;
}

.srs-phone__preview {
	margin: 0.25rem 0 0;
	font-size: 0.875rem;
	color: #646970;
}

.srs-phone__preview .srs-phone__e164 {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: #1d2327;
}

/*
 * NO DARK BLOCK HERE ANY MORE, for the reason given at the same removal in
 * `booking-form.css`: this component is frontend-only and the frontend has one
 * palette, a light one. The block painted the open country list #1d2327 — a
 * wp-admin grey — so a customer on a dark-preference browser opened a black
 * dropdown out of a white form field.
 */
