.servicios-container {
    background-color: #ffffff;
    padding: 60px 8% 80px 8%;
    font-family: 'Poppins', sans-serif;
}

/* Título de la página */
.servicios-header {
    text-align: center;
    margin-bottom: 60px;
}

.servicios-main-title {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    color: #161d3a;
    font-weight: 700;
    letter-spacing: 1px;
}

.servicios-main-title .texto-azul {
    color: #5b7bb0;
}

/* 💻 Configuración de la Rejilla en 2 Columnas */
.servicios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Crea dos columnas de igual tamaño */
    gap: 40px 50px; /* Espaciado entre tarjetas (40px arriba/abajo, 50px lados) */
    max-width: 1000px;
    margin: 0 auto;
}

/* Tarjetas Blancas Comunes */
.servicio-card {
    background: #ffffff;
    border: 1px solid #c8c8c8;
    border-radius: 12px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06); /* Sombra suave como tu Figma */
    transition: transform 0.3s ease;
}

.servicio-card:hover {
    transform: translateY(-5px); /* Efecto sutil al pasar el mouse */
}

.servicio-icon {
    width: 60px;
    height: auto;
    margin-bottom: 20px;
}

.servicio-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: #161d3a;
    font-weight: 700;
}

/* 🌙 Tarjeta Azul Oscuro Especial (Número 8) */
.card-dark {
    background-color: #161d3a;
    border: none;
    align-items: center;
    justify-content: center;
}

.arrow-circle {
    width: 40px;
    height: 40px;
    border: 1px solid #ffffff;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 18px;
}

.servicio-title-dark {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.servicio-desc-dark {
    color: #a0aec0;
    font-size: 13px;
}

/* Contenedor del Botón Final */
.action-container {
    text-align: center;
    margin-top: 60px;
}

.btn-iniciar-consulta {
    display: inline-block;
    background-color: #161d3a;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 15px 45px;
    transition: background-color 0.3s;
}

.btn-iniciar-consulta:hover {
    background-color: #232d54;
}

/* 📱 Responsive automático para celulares */
@media (max-width: 768px) {
    .servicios-grid {
        grid-template-columns: 1fr; /* Pasa a 1 sola columna si la pantalla es chica */
        gap: 25px;
    }
}

.servicio-card-link {
    text-decoration: none; /* Elimina el subrayado */
    color: inherit;        /* Mantiene tus colores originales */
    display: block;
}

/* Base de la tarjeta */
.servicio-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    height: 250px;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Contenido inicial */
.servicio-icon, 
.servicio-title {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
}

/* Capa oculta por defecto */
.servicio-hover-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px 25px; /* Ajustamos padding para dar espacio a la flecha */
    box-sizing: border-box;
    
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

/* Párrafo descriptivo perfectamente centrado */
.servicio-desc {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #555555;
    text-align: center;
    line-height: 1.5;
    margin: 0; /* Sin márgenes inferiores ya que la flecha ya no ocupa espacio aquí */
}

/* 🌟 ESTADO INICIAL DE LA FLECHA (Sin rotación, oculta por defecto) */
.servicio-hover-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 22px;
    color: #161d3a;
    font-weight: bold;
    
    opacity: 0;
    transform: translateX(10px); /* Empujada un poco a la derecha en reposo */
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   DISPARADORES HOVER Y ANIMACIÓN EN BUCLE
   ========================================================================== */

.servicio-card:not(.card-dark):hover .servicio-icon,
.servicio-card:not(.card-dark):hover .servicio-title {
    opacity: 0;
    transform: translateY(-10px);
}

.servicio-card:not(.card-dark):hover .servicio-hover-layer {
    opacity: 1;
    transform: translateY(0);
}

/* 🌟 ACTIVA LA ANIMACIÓN CONSTANTE AL HACER HOVER */
.servicio-card:not(.card-dark):hover .servicio-hover-arrow {
    opacity: 1;
    /* Ejecuta la animación de entrada de forma infinita */
    animation: flechaEntrandoConstante 1s ease-in-out infinite;
}
.servicio-card.card-dark {
    background-color: #161d3a !important; /* Fuerza tu color azul oscuro original */
}

.servicio-card.card-dark:hover .servicio-title-dark,
.servicio-card.card-dark:hover .servicio-desc-dark,
.servicio-card.card-dark:hover .arrow-circle {
    opacity: 1 !important;
    transform: none !important;
    color: #ffffff !important;
}


@keyframes flechaEntrandoConstante {
    0% {
        opacity: 0;
        transform: translateX(-10px); /* Aparece viniendo desde atrás */
    }
    30% {
        opacity: 1;
        transform: translateX(0);    /* Llega a su posición original */
    }
    70% {
        opacity: 1;
        transform: translateX(0);    /* Se mantiene un momento quieta */
    }
    100% {
        opacity: 0;
        transform: translateX(10px);  /* Sale sutilmente hacia la derecha */
    }
}