/* ==========================================================================
   Home · Sección 5 · Contacto (teléfono)
   --------------------------------------------------------------------------
   .ans-phone tiene la proporción de la imagen del teléfono levantado (la más
   alta); ambas imágenes se alinean por la base. El marcador y la información
   de contacto se posicionan en % de este contenedor.
   ========================================================================== */

.ans-contact {
	position: relative;
	z-index: 1;
	height: 100vh;
	min-height: 520px;
}

@supports (height: 100svh) {
	.ans-contact {
		height: 100svh;
	}
}

.ans-phone {
	/* Posición del centro del marcador dentro del contenedor (medida). */
	--dial-x: 56.1%;
	--dial-y: 61.6%;
	--dial-w: 35.5%;

	position: absolute;
	bottom: 6%;
	left: 51.5%;
	width: min(63.5vw, 112vh);
	aspect-ratio: 1600 / 1183;
	transform: translateX(-56.1%);
	container-type: inline-size;
}

@supports (height: 100svh) {
	.ans-phone {
		width: min(63.5vw, 112svh);
	}
}

.ans-phone__frame {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	pointer-events: none;
}

.ans-phone__img {
	width: 100%;
	height: auto;
}

/* La imagen "levantado" tiene la base un 1,4 % más grande, desplazada y con
   margen transparente inferior: se compensa (medido por píxeles) para que
   la base y el marcador coincidan exactamente al cambiar de imagen. */
.ans-phone__frame--open {
	left: -0.34%;
	bottom: -2.34cqw;
	width: 98.6%;
	opacity: 0;
	visibility: hidden;
}

/* Marcador circular = botón "CONTÁCTAME". */
.ans-contact .ans-phone__dial {
	position: absolute;
	left: var(--dial-x);
	top: var(--dial-y);
	z-index: 3;
	width: var(--dial-w);
	aspect-ratio: 1;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transform: translate(-50%, -50%);
	-webkit-tap-highlight-color: transparent;
}

.ans-contact .ans-phone__dial:hover,
.ans-contact .ans-phone__dial:focus {
	border-radius: 50%;
}

.ans-contact .ans-phone__dial:focus-visible {
	border-radius: 50%;
	outline: 3px solid var(--ans-black);
	outline-offset: 6px;
}

.ans-phone__dial-disc {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	transform-origin: 50% 50%;
	will-change: transform;
	transition: filter 0.3s var(--ans-ease);
}

.ans-contact .ans-phone__dial:hover .ans-phone__dial-disc {
	filter: brightness(1.05);
}

.ans-phone__dial-img {
	width: 100%;
	height: 100% !important;
	object-fit: contain;
}

/* Información de contacto: en el hueco entre la base y el auricular. */
.ans-phone__info {
	/* Centro del hueco entre auricular y base de la imagen "levantado"
	   (medido por píxeles: 19,3 %–43 % del alto del contenedor). */
	--info-x: 56.1%;
	--info-y: 31.2%;

	position: absolute;
	left: var(--info-x);
	top: var(--info-y);
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3em;
	font-family: var(--ans-font-sans);
	font-weight: 600;
	font-size: var(--ans-text);
	line-height: 1.15;
	text-align: center;
	white-space: nowrap;
	transform: translate(-50%, -50%);
	opacity: 0;
	visibility: hidden;
}

.ans-phone__link,
.ans-phone__link:visited,
.ans-phone__link:hover,
.ans-phone__link:focus {
	position: relative;
	color: var(--ans-black);
	text-decoration: none;
}

/* Subrayado negro al pasar el cursor. */
.ans-phone__link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -0.12em;
	height: 1.5px;
	background: var(--ans-black);
	transform: scaleX(0);
	transform-origin: 0 50%;
	transition: transform 0.35s var(--ans-ease);
}

.ans-phone__link:hover::after,
.ans-phone__link:focus-visible::after {
	transform: scaleX(1);
}

/* Texto inicial encima del teléfono (se oculta al abrirlo). */
.ans-contact .ans-phone__hint {
	position: absolute;
	left: 56.1%;
	bottom: calc(85% + 1.6em);
	z-index: 2;
	margin: 0;
	font-family: var(--ans-font-sans);
	font-weight: 300;
	font-size: var(--ans-text-sm);
	line-height: 1;
	letter-spacing: var(--ans-tracking);
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--ans-black);
	transform: translateX(-50%);
	pointer-events: none;
}

/* Sin JS: el contacto queda visible. */
html:not(.ans-js) .ans-phone__info {
	opacity: 1;
	visibility: visible;
}

/* --------------------------------------------------------------------------
   Vertical (móvil / tablet vertical)
   -------------------------------------------------------------------------- */

@media (max-aspect-ratio: 1/1) {
	.ans-contact {
		height: auto;
		min-height: 0;
		aspect-ratio: 375 / 520;
	}

	.ans-phone {
		left: 50%;
		bottom: 3%;
		width: 112vw;
	}
}

/* En teléfonos el texto se compacta para caber en el hueco. */
@media (max-width: 767px) {
	.ans-phone__info {
		gap: 0.15em;
		font-size: min(var(--ans-text), 3.6cqw);
		line-height: 1.1;
	}
}

@media (max-aspect-ratio: 1/1) and (min-width: 768px) {
	.ans-contact {
		aspect-ratio: 768 / 820;
	}

	.ans-phone {
		width: 90vw;
	}
}
