.woocommerce-address-suggestions {
	position: absolute;
	z-index: 1000;
	width: 100%;
	max-width: 100%;
	margin-top: 4px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	box-sizing: border-box;
	display: none;

	.suggestions-list {
		list-style: none;
		margin: 0;
		padding: 0;
		max-height: 200px;
		overflow-y: auto;

		li {
			padding: 8px 12px;
			font-size: 14px;
			cursor: pointer;
			text-overflow: ellipsis;
			overflow: hidden;
			white-space: nowrap;

			&:last-child {
				border-bottom: none;
			}

			&:hover,
			&.active {
				background-color: #0073aa;
				color: #fff;
			}

			&:focus {
				outline: none;
				background-color: #0073aa;
				color: #fff;
			}
		}
	}
}

// Ensure the input container has relative positioning
.woocommerce-input-wrapper:has(#billing_address_1, #shipping_address_1) {
	position: relative;
	display: block;

	// Default to showing nothing if autocomplete is not available.
	.address-search-icon {
		display: none;
	}

	// Search icon styles
	&.autocomplete-available {
		input#billing_address_1,
		input#shipping_address_1 {
			padding-right: calc(1.1rem + 16px); // Adjust padding for icon
		}

		.address-search-icon {
			display: block;
			position: absolute;
			inset-inline-end: 16px;
			top: 50%;
			transform: translateY(-50%);
			pointer-events: none;
			width: 16px;
			height: 16px;
			line-height: 16px;
			z-index: 1;

			// Mask needed to ensure the SVG has the correct color.
			background-color: var(--wc-form-color-text, #444);
			mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNCAxNCIgZm9jdXNhYmxlPSJmYWxzZSIgYXJpYS1oaWRkZW49InRydWUiPgogIDxjaXJjbGUgY3g9IjYiIGN5PSI2IiByPSI0IiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjEuNSI+PC9jaXJjbGU+CiAgPHBhdGggc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjEuNSIgZD0ibTkuMjUgOS4yNSAyLjUgMi41Ij48L3BhdGg+Cjwvc3ZnPg==")
				no-repeat center;
			mask-size: contain;

			// Safari support.
			-webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNCAxNCIgZm9jdXNhYmxlPSJmYWxzZSIgYXJpYS1oaWRkZW49InRydWUiPgogIDxjaXJjbGUgY3g9IjYiIGN5PSI2IiByPSI0IiBmaWxsPSJub25lIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjEuNSI+PC9jaXJjbGU+CiAgPHBhdGggc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjEuNSIgZD0ibTkuMjUgOS4yNSAyLjUgMi41Ij48L3BhdGg+Cjwvc3ZnPg==")
				no-repeat center;
			-webkit-mask-size: contain;
		}
	}
}
