/**
 * CF7 Mate – Phone Number Field Styles
 *
 * @package CF7_Mate\Pro\PhoneNumber
 * @since   3.0.0
 */

/* ── Field wrapper ────────────────────────────────────────────── */

.cf7m-phone-field {
	display: block;
	width: 100%;
	margin-bottom: 1.25rem;
	box-sizing: border-box;
}

.cf7m-phone-field:last-child {
	margin-bottom: 0;
}

/* ── Label ────────────────────────────────────────────────────── */

.cf7m-phone-label {
	display: block;
	margin: 0 0 0.375rem 0;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	color: #1d2327;
	cursor: pointer;
	-webkit-font-smoothing: antialiased;
}

.cf7m-phone-required {
	color: #d63638;
	font-weight: 700;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
}

.cf7m-phone-description {
	display: block;
	margin: 0 0 0.5rem 0;
	padding: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: #646970;
	max-width: 100%;
}

/* ── Input wrap (trigger + text input) ────────────────────────── */

.cf7m-phone-wrap {
	display: flex;
	align-items: stretch;
	flex-wrap: nowrap;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cf7m-phone-wrap:focus-within {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

.cf7m-phone-wrap:focus-within .cf7m-phone-input {
	box-shadow: none;
}

/* ── Country trigger button ───────────────────────────────────── */

.cf7m-phone-trigger {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 10px 10px 12px;
	min-width: 100px;
	background: #f6f7f7;
	border: none;
	border-right: 1px solid #c3c4c7;
	border-radius: 5px 0 0 5px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.4;
	color: #1d2327;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.cf7m-phone-trigger:hover {
	background: #f0f0f1;
}

.cf7m-phone-trigger:focus {
	outline: none;
}

.cf7m-phone-trigger[aria-expanded="true"] .cf7m-phone-caret {
	transform: rotate(180deg);
}

.cf7m-phone-flag {
	font-size: 1.25em;
	line-height: 1;
	flex-shrink: 0;
}

.cf7m-phone-dial {
	flex-shrink: 0;
}

.cf7m-phone-caret {
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 4px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid #646970;
	vertical-align: middle;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.cf7m-phone-trigger:hover .cf7m-phone-caret {
	border-top-color: #1d2327;
}

/* ── Phone text input ─────────────────────────────────────────── */

.cf7m-phone-input {
	flex: 1;
	min-width: 0;
	padding: 10px 14px;
	border: none;
	border-radius: 0 5px 5px 0;
	font-size: 16px;
	line-height: 1.4;
	color: #1d2327;
	background: transparent;
	transition: box-shadow 0.2s ease;
}

.cf7m-phone-input::placeholder {
	color: #a7aaad;
}

.cf7m-phone-input:focus {
	outline: none;
	box-shadow: none;
}

/* ── Dropdown ─────────────────────────────────────────────────── */

.cf7m-phone-dropdown {
	position: absolute;
	z-index: 1000;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 6px;
	max-height: 280px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
}

.cf7m-phone-dropdown.cf7m-phone-dropdown--hidden {
	display: none;
}

/* ── Dropdown search ──────────────────────────────────────────── */

.cf7m-phone-search-wrap {
	padding: 8px;
	border-bottom: 1px solid #dcdcde;
	flex-shrink: 0;
}

.cf7m-phone-search {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
}

.cf7m-phone-search:focus {
	border-color: #2271b1;
	outline: none;
}

/* ── Dropdown list & options ──────────────────────────────────── */

.cf7m-phone-list {
	flex: 1;
	overflow-y: auto;
	padding: 4px 0;
}

.cf7m-phone-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.4;
	color: #1d2327;
	background: transparent;
	border: none;
	width: 100%;
	text-align: left;
	box-sizing: border-box;
}

.cf7m-phone-option:hover,
.cf7m-phone-option.cf7m-phone-option--selected {
	background: #f0f6fc;
}

.cf7m-phone-option.cf7m-phone-option--selected {
	color: #2271b1;
}

.cf7m-phone-option-flag {
	font-size: 1.2em;
	line-height: 1;
	flex-shrink: 0;
}

.cf7m-phone-option-label {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cf7m-phone-option-dial {
	flex-shrink: 0;
	color: #646970;
	font-size: 13px;
}

.cf7m-phone-option--selected .cf7m-phone-option-dial {
	color: #2271b1;
}

/* ── Combo wrapper (relative for dropdown positioning) ────────── */

.cf7m-phone-combo {
	position: relative;
	width: 100%;
}

/* ── CF7 integration ──────────────────────────────────────────── */

.wpcf7-form-control-wrap .cf7m-phone-field {
	width: 100%;
}

.wpcf7-form-control-wrap .cf7m-phone-wrap {
	width: 100%;
}
