/* WC Address Autocomplete - Frontend Styles */

/* --- Wrapper --- */
.wcaa-field-wrapper {
	position: relative;
}

/* --- Autocomplete enhanced input --- */
.wcaa-input-enhanced {
	padding-right: 2.4em !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234285F4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 0.6em center !important;
	background-size: 1em !important;
	transition: border-color 0.2s, box-shadow 0.2s !important;
}

.wcaa-input-enhanced:focus {
	border-color: #4285F4 !important;
	box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.12) !important;
	outline: none !important;
}

/* Loading state */
.wcaa-input-enhanced.wcaa-loading {
	background-image: none !important;
	opacity: 0.7;
	cursor: wait;
}

/* Filled highlight animation */
@keyframes wcaaFillPulse {
	0%   { background-color: rgba(66, 133, 244, 0.08); }
	100% { background-color: transparent; }
}

.wcaa-field-filled {
	animation: wcaaFillPulse 2s ease-out forwards;
}

/* --- Dropdown --- */
.wcaa-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 99999;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-top: none;
	border-radius: 0 0 8px 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
	max-height: 320px;
	overflow-y: auto;
	display: none;
	margin-top: -1px;
}

.wcaa-dropdown-visible {
	display: block;
	animation: wcaaSlideDown 0.15s ease-out;
}

@keyframes wcaaSlideDown {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* --- Dropdown items --- */
.wcaa-dropdown-item {
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
	padding: 0.75em 1em;
	cursor: pointer;
	border-bottom: 1px solid #f5f5f5;
	transition: background-color 0.1s;
	outline: none;
}

.wcaa-dropdown-item:last-of-type {
	border-bottom: none;
}

.wcaa-dropdown-item:hover,
.wcaa-dropdown-item:focus,
.wcaa-dropdown-item.wcaa-active {
	background-color: #f0f6ff;
}

.wcaa-item-icon {
	font-size: 1em;
	line-height: 1.5;
	flex-shrink: 0;
	color: #4285F4;
}

.wcaa-item-text {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	line-height: 1.4;
}

.wcaa-item-main {
	font-size: 0.92em;
	font-weight: 600;
	color: #1a1a1a;
}

.wcaa-item-secondary {
	font-size: 0.8em;
	color: #777;
}

/* --- Loading item --- */
.wcaa-loading-item {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.85em 1em;
	color: #666;
	font-size: 0.88em;
}

/* --- Spinner --- */
.wcaa-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid #e0e0e0;
	border-top-color: #4285F4;
	border-radius: 50%;
	animation: wcaaSpin 0.7s linear infinite;
	flex-shrink: 0;
}

@keyframes wcaaSpin {
	to { transform: rotate(360deg); }
}

/* --- No results --- */
.wcaa-no-results {
	padding: 0.85em 1em;
	color: #888;
	font-size: 0.88em;
	font-style: italic;
}

/* --- Footer --- */
.wcaa-dropdown-footer {
	padding: 0.5em 1em;
	background: #fafafa;
	border-top: 1px solid #ebebeb;
	font-size: 0.72em;
	color: #aaa;
	text-align: right;
	border-radius: 0 0 8px 8px;
}

/* --- Status bar --- */
.wcaa-status {
	display: none;
	align-items: center;
	gap: 0.4em;
	margin-top: 0.35em;
	padding: 0.45em 0.75em;
	border-radius: 4px;
	font-size: 0.82em;
	font-weight: 500;
	transition: opacity 0.4s ease;
	opacity: 0;
}

.wcaa-status.wcaa-status-visible {
	display: flex;
	opacity: 1;
}

.wcaa-status.wcaa-status-success {
	background-color: #f0faf4;
	color: #2d7a4f;
	border: 1px solid #c3e6d0;
}

.wcaa-status-hint {
	color: #5a9a72;
	font-weight: 400;
}

.wcaa-status-icon {
	font-style: normal;
	font-size: 1em;
}

/* --- Responsive --- */
@media ( max-width: 600px ) {
	.wcaa-dropdown {
		left: 0;
		right: 0;
	}

	.wcaa-item-main {
		font-size: 0.9em;
	}

	.wcaa-item-secondary {
		font-size: 0.77em;
	}
}
