.af-contacto {
	--af-c-verde: var(--verde, #79d100);
	--af-c-negro: var(--negro, #000000);
	--af-c-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--af-c-rebote: cubic-bezier(0.34, 1.56, 0.64, 1);

	display: flex;
	flex-direction: column;
	max-width: 640px;
}

/* La línea divisoria es un fondo que se "dibuja" de izquierda a derecha al
   entrar (en lugar de un borde), así acompaña la animación. */
.af-contacto__item {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 18px;
	padding: 22px 0;
	background: linear-gradient(#e5e5e5, #e5e5e5) no-repeat left bottom / 0 1px;
	opacity: 0;
	transform: translateY(14px);
	transition:
		opacity 0.5s ease,
		transform 0.6s var(--af-c-ease),
		background-size 0.8s var(--af-c-ease);
	transition-delay: calc(var(--af-c-i, 0) * 0.1s);
}

.af-contacto__item:nth-child(1) { --af-c-i: 0; }
.af-contacto__item:nth-child(2) { --af-c-i: 1; }
.af-contacto__item:nth-child(3) { --af-c-i: 2; }
.af-contacto__item:nth-child(4) { --af-c-i: 3; }
.af-contacto__item:nth-child(5) { --af-c-i: 4; }

.af-contacto.is-visible .af-contacto__item {
	opacity: 1;
	transform: none;
	background-size: 100% 1px;
}

.af-contacto__item:last-child {
	background: none;
}

.af-contacto__icon {
	position: relative;
	z-index: 1;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--af-c-verde);
	color: var(--af-c-negro);
	transform: scale(0.5);
	opacity: 0;
	transition:
		transform 0.55s var(--af-c-rebote),
		opacity 0.3s ease,
		background-color 0.3s ease,
		color 0.3s ease;
	transition-delay: calc(var(--af-c-i, 0) * 0.1s + 0.15s);
}

.af-contacto.is-visible .af-contacto__icon {
	transform: none;
	opacity: 1;
}

.af-contacto__icon svg {
	width: 20px;
	height: 20px;
}

.af-contacto__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 4px;
	min-width: 0;
}

.af-contacto__label {
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #8a8a8a;
}

.af-contacto__value {
	font-family: 'DM Sans', sans-serif;
	font-size: 16px;
	color: var(--af-c-negro);
}

.af-contacto__value--links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
}

.af-contacto__value--links a {
	position: relative;
	display: inline-block;
	color: var(--af-c-negro);
	text-decoration: none;
	padding-bottom: 2px;
}

.af-contacto__value--links a::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 2px;
	background: var(--af-c-verde);
	transition: width 0.3s var(--af-c-ease);
}

/* Teléfono, mail y dirección: se puede tocar todo el renglón, no solo el texto. */
.af-contacto__item--link a::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 2;
}

.af-contacto__item--link .af-contacto__value--links a {
	position: static;
}

.af-contacto__item--link .af-contacto__value--links {
	position: relative;
}

/* Flecha que entra por la derecha al pasar el mouse. */
.af-contacto__item--link::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 4px;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	background: var(--af-c-negro);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
	opacity: 0;
	transform: translate(-8px, 8px);
	transition: opacity 0.25s ease, transform 0.35s var(--af-c-ease);
	pointer-events: none;
}

@media (hover: hover) {
	.af-contacto__item--link:hover .af-contacto__icon {
		background: var(--af-c-negro);
		color: var(--af-c-verde);
		transform: scale(1.06);
		transition-delay: 0s;
	}

	.af-contacto__item--link:hover .af-contacto__value--links a::after {
		width: 100%;
	}

	.af-contacto__item--link:hover::after {
		opacity: 1;
		transform: none;
	}

	/* El teléfono "suena" al pasar el mouse. */
	.af-contacto__item--link:first-child:hover .af-contacto__icon svg {
		animation: af-contacto-ring 0.6s ease;
	}
}

@keyframes af-contacto-ring {
	0%, 100% { transform: rotate(0); }
	20% { transform: rotate(-14deg); }
	40% { transform: rotate(12deg); }
	60% { transform: rotate(-8deg); }
	80% { transform: rotate(5deg); }
}

.af-contacto__item--link:focus-within {
	outline: 2px solid var(--af-c-verde);
	outline-offset: 4px;
	border-radius: 6px;
}

.af-contacto__item--link a:focus-visible {
	outline: none;
}

.af-contacto__horario {
	margin: 0;
	line-height: 1.5;
}

.af-contacto__horario strong {
	font-weight: 400;
}

/* "Abierto ahora / Cerrado", calculado con la hora de Córdoba (contacto-info.js). */
.af-contacto__estado {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	margin-top: 8px;
	padding: 5px 12px 5px 10px;
	border-radius: 999px;
	font-family: 'Montserrat', sans-serif;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.2;
}

.af-contacto__estado i {
	position: relative;
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

.af-contacto__estado.is-abierto {
	background: rgba(121, 209, 0, 0.15);
	color: #3f7000;
}

/* Punto que late cuando está abierto. */
.af-contacto__estado.is-abierto i::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: currentColor;
	animation: af-contacto-pulso 1.8s ease-out infinite;
}

.af-contacto__estado.is-cerrado {
	background: #efefec;
	color: #6b6b66;
}

@keyframes af-contacto-pulso {
	from { transform: scale(1); opacity: 0.6; }
	to { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.af-contacto__item,
	.af-contacto__icon {
		transition-duration: 0.01ms;
		transition-delay: 0s;
	}

	.af-contacto__estado.is-abierto i::after,
	.af-contacto__item--link:hover .af-contacto__icon svg {
		animation: none;
	}
}

/* Laptops (hasta 1366px). Va antes del bloque móvil a propósito: en pantallas
   chicas el de abajo gana. Tiene piso en 721px para no tocar el móvil. */
@media (min-width: 721px) and (max-width: 1366px) {
	.af-contacto__item {
		gap: 16px;
		padding: 10px 0;
	}

	.af-contacto__value {
		font-size: 14px;
	}
}

@media (max-width: 720px) {
	/* Una sola columna dejaba una lista larguísima. Los cuatro datos cortos
	   van de a dos, y la dirección sola abajo porque es la más larga. */
	.af-contacto {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 16px;
		padding: 10px;
	}

	/* Con un solo mail quedan teléfono + mail en la primera fila; los horarios,
	   que son largos, van solos a lo ancho como la dirección. */
	.af-contacto__item--direccion,
	.af-contacto__item--horarios {
		grid-column: 1 / -1;
	}

	/* El mail más largo mide 199px y la media columna 157: sin esto se sale
	   y se mete en la columna de al lado. */
	.af-contacto__value {
		overflow-wrap: anywhere;
	}

	.af-contacto__value--links a {
		max-width: 100%;
		color: #6b6b6b;
	}

	.af-contacto__item {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 10px;
		padding: 10px;
		margin-top: 20px;
	}

	.af-contacto__body {
		align-items: center;
		padding-top: 0;
	}

	.af-contacto__value--links {
		flex-direction: column;
		align-items: center;
		gap: 4px;
	}

	.af-contacto__icon {
		width: 38px;
		height: 38px;
	}

	.af-contacto__icon svg {
		width: 17px;
		height: 17px;
	}

	.af-contacto__label {
		font-size: 12px;
		letter-spacing: 0;
		color: #000000;
	}

	.af-contacto__value {
		font-size: 14px;
		color: #6b6b6b;
	}

	.af-contacto__estado {
		align-self: center;
	}

	/* En el móvil no hay mouse: sin flecha. */
	.af-contacto__item--link::after {
		display: none;
	}
}
