/*
  =================================================================================
  GEO ADDRESS: «Usar mi ubicación» en los campos de dirección (js/geo_address.js)

  Mismo aspecto que .alert-modal (css/common_v2.css), con clases propias para no
  heredar los handlers que mallorca_js.js engancha a .alert-modal.
  z-index 2000: por encima de .overlay / .alert-modal (1000-1001) y de .pac-container.
  Plan: DOCS/geo_address/PLAN.md
  =================================================================================
*/

/* Enlace junto al campo */
.geo-address-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 6px 0 2px 0;
	min-height: 32px;
	font-size: 13px;
	font-weight: 600;
	color: #ce2c21;
	text-decoration: none;
	cursor: pointer;
}
	.geo-address-link:hover,
	.geo-address-link:focus {
		color: #ce2c21;
		text-decoration: underline;
	}
	.geo-address-link .geo-address-icon {
		flex: 0 0 auto;
	}

/* Asistente de selección (fondo rojo, css/selection.css): enlace en blanco y alineado con el campo */
#address-selection-modal .geo-address-link,
#address-selection-modal .geo-address-link:hover,
#address-selection-modal .geo-address-link:focus {
	color: #fff;
}
	/* Formulario 7 (sin sesión): el campo tiene margin 0 15px 15px (selection.css:294) */
	#address-selection-modal #autocomplete + .geo-address-link {
		margin: -9px 15px 10px 15px;
	}
	/* Formulario 8 (con sesión, .new-address): el campo ocupa todo el ancho */
	#address-selection-modal .new-address #autocomplete + .geo-address-link {
		margin: 2px 0 6px 0;
	}

/* El enlace va justo detrás del campo: se oculta si el campo no es editable */
input:disabled + .geo-address-link,
input[readonly] + .geo-address-link {
	display: none;
}

/* Bloqueo del scroll de la página con el modal abierto */
html.geo-address-open,
html.geo-address-open body {
	overflow: hidden;
}

/* Modal */
.geo-address-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(255, 255, 255, 0.7);
	z-index: 2000;
	text-align: center;
	-webkit-tap-highlight-color: transparent;
}

.geo-address-box {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	box-sizing: border-box;
	width: calc(100% - 30px);
	max-width: 480px;
	max-height: calc(100% - 30px);
	background-color: white;
	padding: 15px;
	border: 1px solid black;
	text-align: center;
}

.geo-address-title {
	margin: 5px 0 0 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: #ce2c21;
}

.geo-address-text {
	font-size: 14px;
	line-height: 1.45;
	margin: 15px auto 0 auto;
	max-width: calc(100% - 30px);
}

/* Botones (aspecto de .alert-modal button) */
.geo-address-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 10px;
	margin-top: 10px;
}

.geo-address-btn {
	display: inline-block;
	min-height: 44px;
	border: 1px solid black;
	padding: 6px 14px;
	background: none;
	font-weight: 600;
	color: black;
	font-size: 13px;
	margin: 10px 0 0 0;
	cursor: pointer;
	border-radius: 0;
	-webkit-appearance: none;
}
	.geo-address-btn:hover,
	.geo-address-btn:focus {
		text-decoration: underline;
	}
	.geo-address-btn-primary {
		background: black;
		color: white;
	}

/* Spinner */
.geo-address-spinner {
	width: 36px;
	height: 36px;
	margin: 20px auto 10px auto;
	border: 3px solid #e5e5e5;
	border-top-color: #ce2c21;
	border-radius: 50%;
	animation: geo-address-spin 0.8s linear infinite;
}

@keyframes geo-address-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.geo-address-spinner {
		animation-duration: 2.4s;
	}
}

/* Lista de candidatas */
.geo-address-list {
	list-style: none;
	margin: 15px 0 0 0;
	padding: 0;
	text-align: left;
}
	.geo-address-list li {
		margin: 0;
		padding: 0;
		border-top: 1px solid #e5e5e5;
	}
	.geo-address-list li:last-child {
		border-bottom: 1px solid #e5e5e5;
	}

.geo-address-item {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: 9px 6px;
	background: none;
	border: 0;
	text-align: left;
	color: black;
	cursor: pointer;
	-webkit-appearance: none;
}
	.geo-address-item:hover,
	.geo-address-item:focus {
		background: #f6f6f6;
	}

.geo-address-item-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.geo-address-item-hint {
	font-weight: 400;
	color: #ce2c21;
}

.geo-address-item-meta {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: #666;
}

/* Atribución obligatoria de Google (resultados mostrados sin mapa) */
.geo-address-attribution {
	margin: 6px 0 0 0;
	font-size: 11px;
	color: #666;
	text-align: right;
}

/* Número de portal */
.geo-address-number-label {
	display: block;
	margin: 15px 0 5px 0;
	font-size: 13px;
	font-weight: 600;
}

.geo-address-number {
	display: block;
	box-sizing: border-box;
	width: 140px;
	max-width: 100%;
	height: 44px;
	margin: 0 auto;
	padding: 6px 10px;
	border: 1px solid black;
	border-radius: 0;
	font-size: 16px; /* 16px: evita el zoom automático de iOS al enfocar */
	text-align: center;
}
