/**
 * Enhanced phone field (Esmira VX Enhanced Phone)
 */

.iti {
	width: 100% !important;
	display: block !important;
}

.ts-input-icon .iti,
.flexify .iti,
.ts-form-group .iti {
	flex: 1 1 100% !important;
	min-width: 0 !important;
	width: 100% !important;
}

.iti input[type="tel"],
.iti .iti__tel-input {
	width: 100% !important;
}

/* Hide native intl-tel-input list — replaced by searchable Esmira picker. */
.esmira-ep-phone .iti__country-list {
	display: none !important;
}

/* Desktop: anchored searchable popup (no Voxel bottom-sheet / blur side effects). */
@media (min-width: 1024px) {
	.esmira-ep-country-sheet-root--desktop {
		position: fixed;
		inset: 0;
		z-index: 100070;
		pointer-events: none;
		display: block;
	}

	.esmira-ep-country-sheet-root--desktop[hidden] {
		display: none !important;
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-sheet-root__backdrop {
		display: none;
	}

	.esmira-ep-country-sheet-root--desktop .ts-field-popup-container {
		position: fixed;
		z-index: 2;
		margin: 0;
		pointer-events: auto;
		width: min(360px, calc(100vw - 24px));
		max-height: min(420px, 60vh);
	}

	.esmira-ep-country-sheet-root--desktop .ts-field-popup {
		display: flex;
		flex-direction: column;
		min-height: 0;
		max-height: inherit;
		border-radius: var(--ts-radius, 10px);
		box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
		overflow: hidden;
		opacity: 1 !important;
		visibility: visible !important;
		animation: none !important;
		transform: none !important;
		transition: none !important;
	}

	.esmira-ep-country-sheet-root--desktop .ts-popup-controller {
		display: none;
	}

	.esmira-ep-country-sheet-root--desktop .ts-popup-content-wrapper {
		flex: 1 1 auto;
		min-height: 0;
		overflow: auto;
		display: flex;
		flex-direction: column;
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-sheet-root__body {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		min-height: 0;
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-sheet-root__head {
		flex-shrink: 0;
		padding: 0.75rem 0.75rem 0.5rem;
		background: #fff;
		position: sticky;
		top: 0;
		z-index: 2;
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-sheet-root__title {
		margin: 0 0 0.5rem;
		font-size: 0.9375rem;
		font-weight: 600;
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-sheet-root__search-input {
		width: 100%;
		box-sizing: border-box;
		min-height: 40px;
		font-size: 14px;
		padding: 0.5rem 0.75rem;
		border-radius: var(--ts-radius, 10px);
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-sheet-root__list-wrap {
		flex: 1 1 auto;
		min-height: 0;
		overflow: auto;
		max-height: min(320px, 50vh);
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-sheet-root__list {
		margin: 0;
		padding: 0 0 0.5rem;
		list-style: none;
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-sheet-root__list > li[hidden] {
		display: none !important;
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-option {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		cursor: pointer;
		text-decoration: none;
		color: inherit;
		gap: 0.75rem;
		padding: 0.625rem 0.75rem;
		min-height: 40px;
		box-sizing: border-box;
		width: 100%;
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-option__label {
		flex: 1 1 auto;
		min-width: 0;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		line-height: 1.35;
	}

	.esmira-ep-country-sheet-root--desktop .esmira-ep-country-option .iti__flag {
		flex-shrink: 0;
	}

	.esmira-ep-country-sheet-root--desktop li.ts-selected .esmira-ep-country-option {
		font-weight: 600;
	}
}

/* Legacy ITI dropdown styling (unused while native list hidden). */
@media (min-width: 1024px) {
	.iti__country-list {
		max-height: min(280px, 40vh);
		border-radius: var(--ts-radius, 10px);
		box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
	}
}

/* Tablet / mobile: bottom sheet. */
@media (max-width: 1023px) {
	html.esmira-ep-country-sheet-open {
		overflow: hidden;
	}

	.esmira-ep-country-sheet-root {
		position: fixed;
		inset: 0;
		z-index: 100070;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		pointer-events: auto;
	}

	.esmira-ep-country-sheet-root--mobile {
		position: fixed;
		inset: 0;
		z-index: 100070;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		pointer-events: auto;
	}

	.esmira-ep-country-sheet-root[hidden] {
		display: none !important;
	}

	.esmira-ep-country-sheet-root__backdrop {
		position: absolute;
		inset: 0;
		background: rgba(15, 23, 42, 0.45);
		backdrop-filter: blur(4px);
		-webkit-backdrop-filter: blur(4px);
		cursor: pointer;
	}

	.esmira-ep-country-sheet-root .ts-popup-controller .ts-icon-btn {
		cursor: pointer;
		pointer-events: auto;
	}

	.esmira-ep-country-sheet-root .ts-field-popup-container {
		position: relative;
		z-index: 1;
		width: 100%;
		margin: 0;
		flex: 0 0 auto;
		max-height: 100dvh;
	}

	.esmira-ep-country-sheet-root--mobile .ts-field-popup {
		display: flex;
		flex-direction: column;
		min-height: var(--vx-popup-height, 85dvh);
		max-height: 100dvh;
	}

	.esmira-ep-country-sheet-root .ts-popup-controller {
		flex-shrink: 0;
	}

	.esmira-ep-country-sheet-root .ts-popup-content-wrapper {
		flex: 1 1 auto;
		min-height: 0;
		overflow: auto;
		display: flex;
		flex-direction: column;
	}

	.esmira-ep-country-sheet-root__body {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		min-height: 0;
	}

	.esmira-ep-country-sheet-root__head {
		flex-shrink: 0;
		padding: 1rem 1rem 0.5rem;
		background: #fff;
		position: sticky;
		top: 0;
		z-index: 2;
	}

	.esmira-ep-country-sheet-root__title {
		margin: 0 0 0.75rem;
		font-size: 1.125rem;
		font-weight: 600;
		line-height: 1.3;
	}

	.esmira-ep-country-sheet-root__search {
		margin: 0;
		width: 100%;
	}

	.esmira-ep-country-sheet-root__search-input {
		width: 100%;
		box-sizing: border-box;
		min-height: 48px;
		font-size: 16px;
		padding: 0.75rem 1rem;
		border-radius: var(--ts-radius, 10px);
	}

	.esmira-ep-country-sheet-root__list-wrap {
		flex: 1 1 auto;
		min-height: 0;
		overflow: auto;
		-webkit-overflow-scrolling: touch;
	}

	.esmira-ep-country-sheet-root__list {
		margin: 0;
		padding: 0 0 1rem;
		list-style: none;
	}

	.esmira-ep-country-sheet-root__list > li[hidden] {
		display: none !important;
	}

	.esmira-ep-country-sheet-root__body .esmira-ep-country-option {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		cursor: pointer;
		text-decoration: none;
		color: inherit;
		gap: 0.75rem;
		padding: 0.875rem 1rem;
		min-height: 44px;
		box-sizing: border-box;
		width: 100%;
	}

	.esmira-ep-country-sheet-root__body .esmira-ep-country-option__label {
		flex: 1 1 auto;
		min-width: 0;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		line-height: 1.35;
	}

	.esmira-ep-country-sheet-root__empty {
		margin: 0;
		padding: 1rem 1rem 1.5rem;
		color: #64748b;
	}

	.esmira-ep-country-sheet-root__body .esmira-ep-country-option .iti__flag {
		flex-shrink: 0;
	}

	.esmira-ep-country-sheet-root__body li.ts-selected .esmira-ep-country-option {
		font-weight: 600;
	}
}
